feat(plugin): add v2 effect host (#33111)

This commit is contained in:
Dax
2026-06-21 08:05:49 -04:00
committed by GitHub
parent 7a9337da8a
commit c780d7cee7
139 changed files with 3749 additions and 1952 deletions
+7 -10
View File
@@ -30,16 +30,13 @@ export const ProviderHandler = HttpApiBuilder.group(Api, "server.provider", (han
const catalog = yield* Catalog.Service
const pluginBoot = yield* PluginBoot.Service
yield* pluginBoot.wait().pipe(Effect.catchDefect(() => Effect.fail(catalogUnavailable)))
return yield* response(catalog.provider.get(ctx.params.providerID)).pipe(
Effect.catchTag("CatalogV2.ProviderNotFound", (error) =>
Effect.fail(
new ProviderNotFoundError({
providerID: error.providerID,
message: `Provider not found: ${error.providerID}`,
}),
),
),
)
const provider = yield* catalog.provider.get(ctx.params.providerID)
if (!provider)
return yield* new ProviderNotFoundError({
providerID: ctx.params.providerID,
message: `Provider not found: ${ctx.params.providerID}`,
})
return yield* response(Effect.succeed(provider))
}),
)
}),