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

This commit is contained in:
Dax 2026-06-21 14:05:49 +02:00 committed by GitHub
commit c780d7cee7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
139 changed files with 3740 additions and 1943 deletions

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))
}),
)
}),