@bleedingdev/modern-js-plugin-bff 3.5.0-ultramodern.3 → 3.5.0-ultramodern.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/cli/compress.js +52 -0
- package/dist/cjs/cli/generator.js +149 -0
- package/dist/cjs/cli/prefix.js +50 -0
- package/dist/cjs/cli/watch.js +51 -0
- package/dist/cjs/cli.js +11 -130
- package/dist/cjs/runtime/data-platform/batch/queue.js +287 -0
- package/dist/cjs/runtime/data-platform/batch/request.js +98 -0
- package/dist/cjs/runtime/data-platform/batch/response.js +67 -0
- package/dist/cjs/runtime/data-platform/batch/telemetry.js +67 -0
- package/dist/cjs/runtime/data-platform/batch/url.js +69 -0
- package/dist/cjs/runtime/data-platform/batch-transport.js +59 -0
- package/dist/cjs/runtime/data-platform/codec.js +155 -0
- package/dist/cjs/runtime/data-platform/index.js +30 -633
- package/dist/cjs/runtime/data-platform/invalidation.js +61 -0
- package/dist/cjs/runtime/data-platform/trace.js +73 -0
- package/dist/cjs/runtime/data-platform/types.js +48 -0
- package/dist/cjs/runtime/data-platform/validation.js +178 -0
- package/dist/cjs/runtime/effect/adapter/constants.js +44 -0
- package/dist/cjs/runtime/effect/adapter/cross-project-policy.js +61 -0
- package/dist/cjs/runtime/effect/adapter/entry.js +77 -0
- package/dist/cjs/runtime/effect/adapter/error-response.js +79 -0
- package/dist/cjs/runtime/effect/adapter/handler.js +53 -0
- package/dist/cjs/runtime/effect/adapter.js +20 -154
- package/dist/cjs/runtime/effect/backend-federation/entry.js +99 -0
- package/dist/cjs/runtime/effect/backend-federation/load.js +57 -0
- package/dist/cjs/runtime/effect/backend-federation/plugin.js +53 -0
- package/dist/cjs/runtime/effect/backend-federation/remotes.js +50 -0
- package/dist/cjs/runtime/effect/backend-federation/runtime.js +64 -0
- package/dist/cjs/runtime/effect/backend-federation/types.js +18 -0
- package/dist/cjs/runtime/effect/backend-federation/utils.js +48 -0
- package/dist/cjs/runtime/effect/backend-federation-manifest/errors.js +83 -0
- package/dist/cjs/runtime/effect/backend-federation-manifest/index.js +55 -0
- package/dist/cjs/runtime/effect/backend-federation-manifest/load.js +74 -0
- package/dist/cjs/runtime/effect/backend-federation-manifest/metadata.js +101 -0
- package/dist/cjs/runtime/effect/backend-federation-manifest/reference.js +117 -0
- package/dist/cjs/runtime/effect/backend-federation-manifest/remote.js +68 -0
- package/dist/cjs/runtime/effect/backend-federation-manifest/types.js +18 -0
- package/dist/cjs/runtime/effect/backend-federation-manifest/validation.js +108 -0
- package/dist/cjs/runtime/effect/backend-federation-manifest.js +62 -0
- package/dist/cjs/runtime/effect/backend-federation.js +61 -0
- package/dist/cjs/runtime/effect/dispatch.js +116 -0
- package/dist/cjs/runtime/effect/edge.js +58 -69
- package/dist/cjs/runtime/effect/endpoint-contracts.js +7 -12
- package/dist/cjs/runtime/effect/entry-shape.js +87 -0
- package/dist/cjs/runtime/effect/handler/batch-handler.js +161 -0
- package/dist/cjs/runtime/effect/handler/batch.js +195 -0
- package/dist/cjs/runtime/effect/handler/definition.js +101 -0
- package/dist/cjs/runtime/effect/handler/envelope.js +104 -0
- package/dist/cjs/runtime/effect/handler/http.js +96 -0
- package/dist/cjs/runtime/effect/handler/openapi.js +57 -0
- package/dist/cjs/runtime/effect/handler/routing.js +100 -0
- package/dist/cjs/runtime/effect/handler/rpc.js +63 -0
- package/dist/cjs/runtime/effect/handler/types.js +43 -0
- package/dist/cjs/runtime/effect/handler.js +37 -529
- package/dist/cjs/runtime/effect/index.js +91 -15
- package/dist/cjs/runtime/effect/module.js +23 -80
- package/dist/cjs/runtime/effect/rpcSerialization.js +54 -0
- package/dist/cjs/runtime/effect-client/batch.js +73 -0
- package/dist/cjs/runtime/effect-client/envelope.js +145 -0
- package/dist/cjs/runtime/effect-client/guards.js +44 -0
- package/dist/cjs/runtime/effect-client/index.js +6 -16
- package/dist/cjs/runtime/effect-client/request-context.js +64 -0
- package/dist/cjs/runtime/effect-client/request.js +66 -0
- package/dist/cjs/runtime/effect-client/runtime.js +12 -178
- package/dist/cjs/runtime/effect-client/types.js +18 -0
- package/dist/cjs/runtime/safe-failure.js +2 -1
- package/dist/cjs/utils/client-generator/files.js +152 -0
- package/dist/cjs/utils/client-generator/generate.js +138 -0
- package/dist/cjs/utils/client-generator/index.js +83 -0
- package/dist/cjs/utils/client-generator/package-json.js +132 -0
- package/dist/cjs/utils/client-generator/write-package.js +125 -0
- package/dist/cjs/utils/clientGenerator.js +26 -303
- package/dist/cjs/utils/effect-client-generator/generator.js +64 -0
- package/dist/cjs/utils/effect-client-generator/index.js +51 -0
- package/dist/cjs/utils/effect-client-generator/paths.js +73 -0
- package/dist/cjs/utils/effect-client-generator/rendering.js +231 -0
- package/dist/cjs/utils/effect-client-generator/runtime.js +84 -0
- package/dist/cjs/utils/effect-client-generator/types.js +18 -0
- package/dist/cjs/utils/effectClientGenerator.js +5 -262
- package/dist/esm/cli/compress.mjs +14 -0
- package/dist/esm/cli/generator.mjs +98 -0
- package/dist/esm/cli/prefix.mjs +9 -0
- package/dist/esm/cli/watch.mjs +13 -0
- package/dist/esm/cli.mjs +7 -121
- package/dist/esm/runtime/data-platform/batch/queue.mjs +246 -0
- package/dist/esm/runtime/data-platform/batch/request.mjs +45 -0
- package/dist/esm/runtime/data-platform/batch/response.mjs +23 -0
- package/dist/esm/runtime/data-platform/batch/telemetry.mjs +23 -0
- package/dist/esm/runtime/data-platform/batch/url.mjs +25 -0
- package/dist/esm/runtime/data-platform/batch-transport.mjs +12 -0
- package/dist/esm/runtime/data-platform/codec.mjs +90 -0
- package/dist/esm/runtime/data-platform/index.mjs +6 -610
- package/dist/esm/runtime/data-platform/invalidation.mjs +20 -0
- package/dist/esm/runtime/data-platform/trace.mjs +29 -0
- package/dist/esm/runtime/data-platform/types.mjs +4 -0
- package/dist/esm/runtime/data-platform/validation.mjs +128 -0
- package/dist/esm/runtime/effect/adapter/constants.mjs +6 -0
- package/dist/esm/runtime/effect/adapter/cross-project-policy.mjs +23 -0
- package/dist/esm/runtime/effect/adapter/entry.mjs +29 -0
- package/dist/esm/runtime/effect/adapter/error-response.mjs +41 -0
- package/dist/esm/runtime/effect/adapter/handler.mjs +15 -0
- package/dist/esm/runtime/effect/adapter.mjs +21 -145
- package/dist/esm/runtime/effect/backend-federation/entry.mjs +61 -0
- package/dist/esm/runtime/effect/backend-federation/load.mjs +19 -0
- package/dist/esm/runtime/effect/backend-federation/plugin.mjs +15 -0
- package/dist/esm/runtime/effect/backend-federation/remotes.mjs +12 -0
- package/dist/esm/runtime/effect/backend-federation/runtime.mjs +26 -0
- package/dist/esm/runtime/effect/backend-federation/types.mjs +0 -0
- package/dist/esm/runtime/effect/backend-federation/utils.mjs +7 -0
- package/dist/esm/runtime/effect/backend-federation-manifest/errors.mjs +32 -0
- package/dist/esm/runtime/effect/backend-federation-manifest/index.mjs +4 -0
- package/dist/esm/runtime/effect/backend-federation-manifest/load.mjs +36 -0
- package/dist/esm/runtime/effect/backend-federation-manifest/metadata.mjs +42 -0
- package/dist/esm/runtime/effect/backend-federation-manifest/reference.mjs +76 -0
- package/dist/esm/runtime/effect/backend-federation-manifest/remote.mjs +30 -0
- package/dist/esm/runtime/effect/backend-federation-manifest/types.mjs +0 -0
- package/dist/esm/runtime/effect/backend-federation-manifest/validation.mjs +64 -0
- package/dist/esm/runtime/effect/backend-federation-manifest.mjs +1 -0
- package/dist/esm/runtime/effect/backend-federation.mjs +4 -0
- package/dist/esm/runtime/effect/dispatch.mjs +63 -0
- package/dist/esm/runtime/effect/edge.mjs +17 -63
- package/dist/esm/runtime/effect/endpoint-contracts.mjs +7 -12
- package/dist/esm/runtime/effect/entry-shape.mjs +36 -0
- package/dist/esm/runtime/effect/handler/batch-handler.mjs +123 -0
- package/dist/esm/runtime/effect/handler/batch.mjs +124 -0
- package/dist/esm/runtime/effect/handler/definition.mjs +60 -0
- package/dist/esm/runtime/effect/handler/envelope.mjs +63 -0
- package/dist/esm/runtime/effect/handler/http.mjs +58 -0
- package/dist/esm/runtime/effect/handler/openapi.mjs +19 -0
- package/dist/esm/runtime/effect/handler/routing.mjs +50 -0
- package/dist/esm/runtime/effect/handler/rpc.mjs +22 -0
- package/dist/esm/runtime/effect/handler/types.mjs +5 -0
- package/dist/esm/runtime/effect/handler.mjs +7 -502
- package/dist/esm/runtime/effect/index.mjs +3 -0
- package/dist/esm/runtime/effect/module.mjs +23 -80
- package/dist/esm/runtime/effect/rpcSerialization.mjs +16 -0
- package/dist/esm/runtime/effect-client/batch.mjs +35 -0
- package/dist/esm/runtime/effect-client/envelope.mjs +104 -0
- package/dist/esm/runtime/effect-client/guards.mjs +3 -0
- package/dist/esm/runtime/effect-client/index.mjs +5 -15
- package/dist/esm/runtime/effect-client/request-context.mjs +23 -0
- package/dist/esm/runtime/effect-client/request.mjs +28 -0
- package/dist/esm/runtime/effect-client/runtime.mjs +12 -178
- package/dist/esm/runtime/effect-client/types.mjs +0 -0
- package/dist/esm/runtime/safe-failure.mjs +2 -1
- package/dist/esm/utils/client-generator/files.mjs +68 -0
- package/dist/esm/utils/client-generator/generate.mjs +88 -0
- package/dist/esm/utils/client-generator/index.mjs +4 -0
- package/dist/esm/utils/client-generator/package-json.mjs +78 -0
- package/dist/esm/utils/client-generator/write-package.mjs +74 -0
- package/dist/esm/utils/clientGenerator.mjs +2 -293
- package/dist/esm/utils/effect-client-generator/generator.mjs +23 -0
- package/dist/esm/utils/effect-client-generator/index.mjs +3 -0
- package/dist/esm/utils/effect-client-generator/paths.mjs +25 -0
- package/dist/esm/utils/effect-client-generator/rendering.mjs +180 -0
- package/dist/esm/utils/effect-client-generator/runtime.mjs +33 -0
- package/dist/esm/utils/effect-client-generator/types.mjs +0 -0
- package/dist/esm/utils/effectClientGenerator.mjs +1 -249
- package/dist/esm-node/cli/compress.mjs +15 -0
- package/dist/esm-node/cli/generator.mjs +99 -0
- package/dist/esm-node/cli/prefix.mjs +10 -0
- package/dist/esm-node/cli/watch.mjs +14 -0
- package/dist/esm-node/cli.mjs +7 -121
- package/dist/esm-node/runtime/data-platform/batch/queue.mjs +247 -0
- package/dist/esm-node/runtime/data-platform/batch/request.mjs +46 -0
- package/dist/esm-node/runtime/data-platform/batch/response.mjs +24 -0
- package/dist/esm-node/runtime/data-platform/batch/telemetry.mjs +24 -0
- package/dist/esm-node/runtime/data-platform/batch/url.mjs +26 -0
- package/dist/esm-node/runtime/data-platform/batch-transport.mjs +13 -0
- package/dist/esm-node/runtime/data-platform/codec.mjs +91 -0
- package/dist/esm-node/runtime/data-platform/index.mjs +6 -610
- package/dist/esm-node/runtime/data-platform/invalidation.mjs +21 -0
- package/dist/esm-node/runtime/data-platform/trace.mjs +30 -0
- package/dist/esm-node/runtime/data-platform/types.mjs +5 -0
- package/dist/esm-node/runtime/data-platform/validation.mjs +129 -0
- package/dist/esm-node/runtime/effect/adapter/constants.mjs +7 -0
- package/dist/esm-node/runtime/effect/adapter/cross-project-policy.mjs +24 -0
- package/dist/esm-node/runtime/effect/adapter/entry.mjs +30 -0
- package/dist/esm-node/runtime/effect/adapter/error-response.mjs +42 -0
- package/dist/esm-node/runtime/effect/adapter/handler.mjs +16 -0
- package/dist/esm-node/runtime/effect/adapter.mjs +21 -145
- package/dist/esm-node/runtime/effect/backend-federation/entry.mjs +62 -0
- package/dist/esm-node/runtime/effect/backend-federation/load.mjs +20 -0
- package/dist/esm-node/runtime/effect/backend-federation/plugin.mjs +16 -0
- package/dist/esm-node/runtime/effect/backend-federation/remotes.mjs +13 -0
- package/dist/esm-node/runtime/effect/backend-federation/runtime.mjs +27 -0
- package/dist/esm-node/runtime/effect/backend-federation/types.mjs +1 -0
- package/dist/esm-node/runtime/effect/backend-federation/utils.mjs +8 -0
- package/dist/esm-node/runtime/effect/backend-federation-manifest/errors.mjs +33 -0
- package/dist/esm-node/runtime/effect/backend-federation-manifest/index.mjs +5 -0
- package/dist/esm-node/runtime/effect/backend-federation-manifest/load.mjs +37 -0
- package/dist/esm-node/runtime/effect/backend-federation-manifest/metadata.mjs +43 -0
- package/dist/esm-node/runtime/effect/backend-federation-manifest/reference.mjs +77 -0
- package/dist/esm-node/runtime/effect/backend-federation-manifest/remote.mjs +31 -0
- package/dist/esm-node/runtime/effect/backend-federation-manifest/types.mjs +1 -0
- package/dist/esm-node/runtime/effect/backend-federation-manifest/validation.mjs +65 -0
- package/dist/esm-node/runtime/effect/backend-federation-manifest.mjs +2 -0
- package/dist/esm-node/runtime/effect/backend-federation.mjs +5 -0
- package/dist/esm-node/runtime/effect/dispatch.mjs +64 -0
- package/dist/esm-node/runtime/effect/edge.mjs +17 -63
- package/dist/esm-node/runtime/effect/endpoint-contracts.mjs +7 -12
- package/dist/esm-node/runtime/effect/entry-shape.mjs +37 -0
- package/dist/esm-node/runtime/effect/handler/batch-handler.mjs +124 -0
- package/dist/esm-node/runtime/effect/handler/batch.mjs +125 -0
- package/dist/esm-node/runtime/effect/handler/definition.mjs +61 -0
- package/dist/esm-node/runtime/effect/handler/envelope.mjs +64 -0
- package/dist/esm-node/runtime/effect/handler/http.mjs +59 -0
- package/dist/esm-node/runtime/effect/handler/openapi.mjs +20 -0
- package/dist/esm-node/runtime/effect/handler/routing.mjs +51 -0
- package/dist/esm-node/runtime/effect/handler/rpc.mjs +23 -0
- package/dist/esm-node/runtime/effect/handler/types.mjs +6 -0
- package/dist/esm-node/runtime/effect/handler.mjs +7 -502
- package/dist/esm-node/runtime/effect/index.mjs +3 -0
- package/dist/esm-node/runtime/effect/module.mjs +23 -80
- package/dist/esm-node/runtime/effect/rpcSerialization.mjs +17 -0
- package/dist/esm-node/runtime/effect-client/batch.mjs +36 -0
- package/dist/esm-node/runtime/effect-client/envelope.mjs +105 -0
- package/dist/esm-node/runtime/effect-client/guards.mjs +4 -0
- package/dist/esm-node/runtime/effect-client/index.mjs +5 -15
- package/dist/esm-node/runtime/effect-client/request-context.mjs +24 -0
- package/dist/esm-node/runtime/effect-client/request.mjs +29 -0
- package/dist/esm-node/runtime/effect-client/runtime.mjs +12 -178
- package/dist/esm-node/runtime/effect-client/types.mjs +1 -0
- package/dist/esm-node/runtime/safe-failure.mjs +2 -1
- package/dist/esm-node/utils/client-generator/files.mjs +69 -0
- package/dist/esm-node/utils/client-generator/generate.mjs +89 -0
- package/dist/esm-node/utils/client-generator/index.mjs +5 -0
- package/dist/esm-node/utils/client-generator/package-json.mjs +79 -0
- package/dist/esm-node/utils/client-generator/write-package.mjs +75 -0
- package/dist/esm-node/utils/clientGenerator.mjs +2 -293
- package/dist/esm-node/utils/effect-client-generator/generator.mjs +24 -0
- package/dist/esm-node/utils/effect-client-generator/index.mjs +4 -0
- package/dist/esm-node/utils/effect-client-generator/paths.mjs +26 -0
- package/dist/esm-node/utils/effect-client-generator/rendering.mjs +181 -0
- package/dist/esm-node/utils/effect-client-generator/runtime.mjs +35 -0
- package/dist/esm-node/utils/effect-client-generator/types.mjs +1 -0
- package/dist/esm-node/utils/effectClientGenerator.mjs +2 -251
- package/dist/types/cli/compress.d.ts +2 -0
- package/dist/types/cli/generator.d.ts +7 -0
- package/dist/types/cli/prefix.d.ts +2 -0
- package/dist/types/cli/watch.d.ts +1 -0
- package/dist/types/cli.d.ts +0 -1
- package/dist/types/runtime/data-platform/batch/queue.d.ts +25 -0
- package/dist/types/runtime/data-platform/batch/request.d.ts +13 -0
- package/dist/types/runtime/data-platform/batch/response.d.ts +4 -0
- package/dist/types/runtime/data-platform/batch/telemetry.d.ts +4 -0
- package/dist/types/runtime/data-platform/batch/url.d.ts +4 -0
- package/dist/types/runtime/data-platform/batch-transport.d.ts +3 -0
- package/dist/types/runtime/data-platform/codec.d.ts +17 -0
- package/dist/types/runtime/data-platform/index.d.ts +7 -191
- package/dist/types/runtime/data-platform/invalidation.d.ts +8 -0
- package/dist/types/runtime/data-platform/trace.d.ts +4 -0
- package/dist/types/runtime/data-platform/types.d.ts +146 -0
- package/dist/types/runtime/data-platform/validation.d.ts +29 -0
- package/dist/types/runtime/effect/adapter/constants.d.ts +1 -0
- package/dist/types/runtime/effect/adapter/cross-project-policy.d.ts +4 -0
- package/dist/types/runtime/effect/adapter/entry.d.ts +2 -0
- package/dist/types/runtime/effect/adapter/error-response.d.ts +2 -0
- package/dist/types/runtime/effect/adapter/handler.d.ts +4 -0
- package/dist/types/runtime/effect/adapter.d.ts +4 -13
- package/dist/types/runtime/effect/backend-federation/entry.d.ts +2 -0
- package/dist/types/runtime/effect/backend-federation/load.d.ts +2 -0
- package/dist/types/runtime/effect/backend-federation/plugin.d.ts +3 -0
- package/dist/types/runtime/effect/backend-federation/remotes.d.ts +2 -0
- package/dist/types/runtime/effect/backend-federation/runtime.d.ts +3 -0
- package/dist/types/runtime/effect/backend-federation/types.d.ts +58 -0
- package/dist/types/runtime/effect/backend-federation/utils.d.ts +2 -0
- package/dist/types/runtime/effect/backend-federation-manifest/errors.d.ts +11 -0
- package/dist/types/runtime/effect/backend-federation-manifest/index.d.ts +6 -0
- package/dist/types/runtime/effect/backend-federation-manifest/load.d.ts +3 -0
- package/dist/types/runtime/effect/backend-federation-manifest/metadata.d.ts +18 -0
- package/dist/types/runtime/effect/backend-federation-manifest/reference.d.ts +3 -0
- package/dist/types/runtime/effect/backend-federation-manifest/remote.d.ts +3 -0
- package/dist/types/runtime/effect/backend-federation-manifest/types.d.ts +51 -0
- package/dist/types/runtime/effect/backend-federation-manifest/validation.d.ts +5 -0
- package/dist/types/runtime/effect/backend-federation-manifest.d.ts +1 -0
- package/dist/types/runtime/effect/backend-federation.d.ts +6 -0
- package/dist/types/runtime/effect/dispatch.d.ts +17 -0
- package/dist/types/runtime/effect/edge.d.ts +9 -8
- package/dist/types/runtime/effect/endpoint-contracts.d.ts +2 -2
- package/dist/types/runtime/effect/entry-shape.d.ts +31 -0
- package/dist/types/runtime/effect/handler/batch-handler.d.ts +11 -0
- package/dist/types/runtime/effect/handler/batch.d.ts +17 -0
- package/dist/types/runtime/effect/handler/definition.d.ts +17 -0
- package/dist/types/runtime/effect/handler/envelope.d.ts +13 -0
- package/dist/types/runtime/effect/handler/http.d.ts +14 -0
- package/dist/types/runtime/effect/handler/openapi.d.ts +4 -0
- package/dist/types/runtime/effect/handler/routing.d.ts +5 -0
- package/dist/types/runtime/effect/handler/rpc.d.ts +7 -0
- package/dist/types/runtime/effect/handler/types.d.ts +148 -0
- package/dist/types/runtime/effect/handler.d.ts +4 -190
- package/dist/types/runtime/effect/index.d.ts +3 -0
- package/dist/types/runtime/effect/rpcSerialization.d.ts +3 -0
- package/dist/types/runtime/effect-client/batch.d.ts +2 -0
- package/dist/types/runtime/effect-client/envelope.d.ts +15 -0
- package/dist/types/runtime/effect-client/guards.d.ts +2 -0
- package/dist/types/runtime/effect-client/index.d.ts +1 -1
- package/dist/types/runtime/effect-client/request-context.d.ts +3 -0
- package/dist/types/runtime/effect-client/request.d.ts +1 -0
- package/dist/types/runtime/effect-client/runtime.d.ts +2 -68
- package/dist/types/runtime/effect-client/types.d.ts +68 -0
- package/dist/types/utils/client-generator/files.d.ts +28 -0
- package/dist/types/utils/client-generator/generate.d.ts +26 -0
- package/dist/types/utils/client-generator/index.d.ts +7 -0
- package/dist/types/utils/client-generator/package-json.d.ts +16 -0
- package/dist/types/utils/client-generator/write-package.d.ts +6 -0
- package/dist/types/utils/clientGenerator.d.ts +2 -37
- package/dist/types/utils/crossProjectServerPolicy.d.ts +3 -2
- package/dist/types/utils/effect-client-generator/generator.d.ts +10 -0
- package/dist/types/utils/effect-client-generator/index.d.ts +4 -0
- package/dist/types/utils/effect-client-generator/paths.d.ts +5 -0
- package/dist/types/utils/effect-client-generator/rendering.d.ts +4 -0
- package/dist/types/utils/effect-client-generator/runtime.d.ts +8 -0
- package/dist/types/utils/effect-client-generator/types.d.ts +26 -0
- package/dist/types/utils/effectClientGenerator.d.ts +2 -41
- package/package.json +26 -14
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BACKEND_FEDERATION_CONTRACT_VERSION, BACKEND_FEDERATION_EFFECT_EXPOSE, BACKEND_FEDERATION_MANIFEST_FILE, BACKEND_FEDERATION_NODE_ADAPTER_VERSION } from '@modern-js/utils/universal';
|
|
2
|
+
export { loadBackendFederatedEffectApi } from './backend-federation/load';
|
|
3
|
+
export { createBackendFederationLoadEntryPlugin } from './backend-federation/plugin';
|
|
4
|
+
export { createBackendFederationRuntime } from './backend-federation/runtime';
|
|
5
|
+
export type { BackendFederatedEffectApiModule, BackendFederationEntryExports, BackendFederationLoadEntryPluginOptions, BackendFederationRemote, BackendFederationRuntimeOptions, } from './backend-federation/types';
|
|
6
|
+
export { BACKEND_FEDERATION_CONTRACT_VERSION, BACKEND_FEDERATION_EFFECT_EXPOSE, BACKEND_FEDERATION_MANIFEST_FILE, BACKEND_FEDERATION_NODE_ADAPTER_VERSION, };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { EffectBffRequestHandler } from './module';
|
|
2
|
+
import { type EffectContext } from './operation-context';
|
|
3
|
+
export type EffectDispatchContextRunner = <T>(context: EffectContext, cb: () => T) => T;
|
|
4
|
+
export type DispatchEffectBffRequestOptions = {
|
|
5
|
+
prefix?: string;
|
|
6
|
+
env?: Record<string, unknown>;
|
|
7
|
+
path?: string;
|
|
8
|
+
method?: string;
|
|
9
|
+
runWithEffectContext: EffectDispatchContextRunner;
|
|
10
|
+
onError?: (error: unknown, context: EffectContext) => Promise<Response> | Response;
|
|
11
|
+
};
|
|
12
|
+
export declare function normalizeEffectBffPrefix(prefix: string | undefined): string;
|
|
13
|
+
export declare function removeEffectBffPrefixFromPath(pathname: string, prefix: string | undefined): string;
|
|
14
|
+
export declare function matchesEffectBffPrefix(pathname: string, prefix: string | undefined): boolean;
|
|
15
|
+
export declare function createEffectBffMountedRequest(req: Request, prefix: string | undefined): Request;
|
|
16
|
+
export declare function createEffectBffDispatchContext(originalRequest: Request, mountedRequest: Request, options: Omit<DispatchEffectBffRequestOptions, 'runWithEffectContext'>): EffectContext;
|
|
17
|
+
export declare function dispatchEffectBffRequestWithContext(handler: EffectBffRequestHandler, request: Request, options: DispatchEffectBffRequestOptions): Promise<Response>;
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
+
import { type DispatchEffectBffRequestOptions } from './dispatch';
|
|
1
2
|
import type { EffectBffOpenApiConfig, EffectDataPlatformValidationOptions } from './handler';
|
|
2
3
|
import { type EffectApiModule, type EffectBffRequestHandler } from './module';
|
|
3
|
-
import {
|
|
4
|
+
import type { EffectContext } from './operation-context';
|
|
5
|
+
export { BACKEND_FEDERATION_CONTRACT_VERSION, BACKEND_FEDERATION_EFFECT_EXPOSE, BACKEND_FEDERATION_MANIFEST_FILE, BACKEND_FEDERATION_NODE_ADAPTER_VERSION, type BackendFederatedEffectApiModule, type BackendFederationEntryExports, type BackendFederationLoadEntryPluginOptions, type BackendFederationRemote, type BackendFederationRuntimeOptions, createBackendFederationLoadEntryPlugin, createBackendFederationRuntime, loadBackendFederatedEffectApi, } from './backend-federation';
|
|
4
6
|
export { runWithEffectContext, useEffectContext, useOperationContext, } from './edge-context';
|
|
5
7
|
export * from './handler';
|
|
6
8
|
export { type CreateEffectOperationContextOptions, createEffectOperationContext, type EffectContext, } from './operation-context';
|
|
7
|
-
export type EffectBffEdgeDispatchOptions =
|
|
8
|
-
prefix?: string;
|
|
9
|
-
env?: Record<string, unknown>;
|
|
10
|
-
path?: string;
|
|
11
|
-
method?: string;
|
|
12
|
-
onError?: (error: unknown, context: EffectContext) => Promise<Response> | Response;
|
|
13
|
-
};
|
|
9
|
+
export type EffectBffEdgeDispatchOptions = Omit<DispatchEffectBffRequestOptions, 'runWithEffectContext'>;
|
|
14
10
|
export type EffectBffEdgeHandlerOptions = {
|
|
15
11
|
module: EffectApiModule;
|
|
16
12
|
prefix?: string;
|
|
@@ -19,7 +15,12 @@ export type EffectBffEdgeHandlerOptions = {
|
|
|
19
15
|
onError?: (error: unknown, context: EffectContext) => Promise<Response> | Response;
|
|
20
16
|
onWarning?: (message: string) => void;
|
|
21
17
|
};
|
|
18
|
+
export type EffectBffEdgeRequestDispatcher = (request: Request, dispatchOptions?: Omit<EffectBffEdgeDispatchOptions, 'prefix' | 'onError'>) => Promise<Response>;
|
|
22
19
|
export declare function dispatchEffectBffRequest(handler: EffectBffRequestHandler, request: Request, options?: EffectBffEdgeDispatchOptions): Promise<Response>;
|
|
20
|
+
export declare function createEffectBffEdgeDispatcher(options: EffectBffEdgeHandlerOptions): Promise<{
|
|
21
|
+
dispatch: (request: Request, dispatchOptions?: Omit<EffectBffEdgeDispatchOptions, 'prefix' | 'onError'>) => Promise<Response>;
|
|
22
|
+
dispose: () => Promise<void>;
|
|
23
|
+
}>;
|
|
23
24
|
export declare const createEffectBffTestHandler: typeof createEffectBffEdgeHandler;
|
|
24
25
|
export declare function createEffectBffEdgeHandler(options: EffectBffEdgeHandlerOptions): Promise<{
|
|
25
26
|
handler: (request: Request, dispatchOptions?: Omit<EffectBffEdgeDispatchOptions, 'prefix' | 'onError'>) => Promise<Response>;
|
|
@@ -51,8 +51,8 @@ export declare function toOperationContractSources(endpoints: EffectEndpointMeta
|
|
|
51
51
|
export declare function createEffectOperationContractSource(endpoint: EffectEndpointMeta): OperationContractSource;
|
|
52
52
|
/**
|
|
53
53
|
* Extracts the HttpApi instance from a loaded effect entry module. Mirrors
|
|
54
|
-
* the
|
|
55
|
-
*
|
|
54
|
+
* the shared entry-shape policy accepted by `resolveEffectBffModuleHandler`,
|
|
55
|
+
* without executing factories during contract extraction.
|
|
56
56
|
*/
|
|
57
57
|
export declare function extractHttpApiFromModule(mod: unknown, isHttpApi: (value: unknown) => boolean): Promise<HttpApiLike | null>;
|
|
58
58
|
/**
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type EffectBffEntryModule = {
|
|
2
|
+
api?: unknown;
|
|
3
|
+
layer?: unknown;
|
|
4
|
+
handler?: unknown;
|
|
5
|
+
createHandler?: unknown;
|
|
6
|
+
default?: unknown;
|
|
7
|
+
};
|
|
8
|
+
export type LegacyEffectBffEntryShape = '`handler` export' | 'default request handler';
|
|
9
|
+
export type EffectBffEntryShapeFacts = {
|
|
10
|
+
module: EffectBffEntryModule;
|
|
11
|
+
legacyShape?: LegacyEffectBffEntryShape;
|
|
12
|
+
createHandler?: unknown;
|
|
13
|
+
createHandlerValidatorAware: boolean;
|
|
14
|
+
api?: unknown;
|
|
15
|
+
layer?: unknown;
|
|
16
|
+
hasRuntimeLayer: boolean;
|
|
17
|
+
};
|
|
18
|
+
export type EffectBffEntryShapePredicates = {
|
|
19
|
+
isRequestHandler: (value: unknown) => boolean;
|
|
20
|
+
isValidatorAwareHandlerFactory: (value: unknown) => boolean;
|
|
21
|
+
isHttpApi: (value: unknown) => boolean;
|
|
22
|
+
};
|
|
23
|
+
export declare const EFFECT_VALIDATOR_AWARE_FACTORY: symbol;
|
|
24
|
+
/**
|
|
25
|
+
* True when a custom createHandler factory is produced by defineEffectBff and
|
|
26
|
+
* therefore forwards strict cross-project validation into createHttpApiHandler.
|
|
27
|
+
*/
|
|
28
|
+
export declare function isValidatorAwareHandlerFactory(factory: unknown): boolean;
|
|
29
|
+
export declare const strictEffectApproachMessage = "[BFF][Effect] strictEffectApproach is enforced: Effect API entries export defineEffectBff(...) or { api, layer } HttpApi module. Raw handler exports, default request handlers, unbranded custom createHandler factories not valid Effect API entries.";
|
|
30
|
+
export declare function isEffectEntryRecord(value: unknown): value is Record<string, unknown>;
|
|
31
|
+
export declare function classifyEffectBffEntryModule(value: unknown, predicates: EffectBffEntryShapePredicates): EffectBffEntryShapeFacts | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { EffectDataPlatformValidationOptions } from './types';
|
|
2
|
+
type DataPlatformBatchItemHandler<TContext> = (request: Request, context?: TContext) => Promise<unknown>;
|
|
3
|
+
export declare function createDataPlatformBatchRequestHandler<TContext>(options: {
|
|
4
|
+
dataPlatform?: EffectDataPlatformValidationOptions;
|
|
5
|
+
handleItem: DataPlatformBatchItemHandler<TContext>;
|
|
6
|
+
}): {
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
path: `/${string}`;
|
|
9
|
+
handle: (request: Request, context?: TContext) => Promise<Response>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type DataBatchRequestPayload, type DataBatchResponseItem } from '../../data-platform';
|
|
2
|
+
export declare function normalizeBatchPath(pathname: string | undefined): `/${string}`;
|
|
3
|
+
export declare function isPlainObject(value: unknown): value is Record<string, unknown>;
|
|
4
|
+
export declare function toTextLength(value: string): number;
|
|
5
|
+
export declare function toHeaderRecord(headers: Headers): Record<string, string>;
|
|
6
|
+
export declare function normalizeItemMethod(method: string | undefined): string;
|
|
7
|
+
export declare function normalizeBatchAllowedMethods(allowedMethods: string[] | undefined): Set<string>;
|
|
8
|
+
type ParsedBatchRequestPayload = Omit<DataBatchRequestPayload, 'items'> & {
|
|
9
|
+
items: unknown[];
|
|
10
|
+
};
|
|
11
|
+
export declare function isBatchRequestPayload(value: unknown): value is ParsedBatchRequestPayload;
|
|
12
|
+
export declare function createBatchValidationResponse(message: string, status?: number): Response;
|
|
13
|
+
export declare function prepareJsonRequestBody(request: Request): Promise<Request | Response>;
|
|
14
|
+
export declare function toBatchItemError(id: string, status: number, message: string): DataBatchResponseItem;
|
|
15
|
+
export declare function promiseWithTimeout<T>(effect: Promise<T>, timeoutMs: number): Promise<T>;
|
|
16
|
+
export declare function mapWithConcurrency<TItem, TResult>(items: readonly TItem[], concurrency: number, mapper: (item: TItem, index: number) => Promise<TResult>): Promise<TResult[]>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { HttpApi } from 'effect/unstable/httpapi';
|
|
2
|
+
import type { Rpc } from 'effect/unstable/rpc';
|
|
3
|
+
import type { EffectBffRuntime, EffectDataPlatformValidationOptions, EffectRpcBffDefinition, EffectRpcBffHandlerFactory, EffectRpcRuntimeLayer, EffectRuntimeLayer } from './types';
|
|
4
|
+
export declare function defineEffectBff<TApi extends HttpApi.AnyWithProps, TLayer extends EffectRuntimeLayer, TRpcs extends Rpc.Any = Rpc.Any>(definition: {
|
|
5
|
+
api: TApi;
|
|
6
|
+
layer: TLayer;
|
|
7
|
+
rpc?: EffectRpcBffDefinition<TRpcs>;
|
|
8
|
+
dataPlatform?: EffectDataPlatformValidationOptions;
|
|
9
|
+
}): {
|
|
10
|
+
api: TApi;
|
|
11
|
+
layer: TLayer;
|
|
12
|
+
rpc?: EffectRpcBffDefinition<TRpcs>;
|
|
13
|
+
dataPlatform?: EffectDataPlatformValidationOptions;
|
|
14
|
+
} & EffectBffRuntime<TApi, TLayer>;
|
|
15
|
+
export declare function defineEffectRpcBff<TRpcs extends Rpc.Any = Rpc.Any, TLayer extends EffectRpcRuntimeLayer<TRpcs> = EffectRpcRuntimeLayer<TRpcs>>(definition: EffectRpcBffDefinition<TRpcs, TLayer>): EffectRpcBffDefinition<TRpcs, TLayer> & {
|
|
16
|
+
createHandler: EffectRpcBffHandlerFactory<TRpcs>;
|
|
17
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { EffectDataPlatformValidationOptions } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Validates the `x-modernjs-data-envelope` header (the data-platform
|
|
4
|
+
* transport/cache contract: protocol version, scope, selection plan).
|
|
5
|
+
*
|
|
6
|
+
* This is NOT a security boundary: the envelope is client-constructed cache
|
|
7
|
+
* metadata used for batching, scope keys and hydration. Cross-project
|
|
8
|
+
* authorization runs through the bff-core policy evaluator wired in via
|
|
9
|
+
* `validateRequest` (see `EffectRequestValidator`), which both the direct
|
|
10
|
+
* and batched request paths hit before this check.
|
|
11
|
+
*/
|
|
12
|
+
export declare function validateDataPlatformRequestEnvelope(request: Request, options: EffectDataPlatformValidationOptions | undefined): Response | null;
|
|
13
|
+
export declare function mergeDataPlatformOptions(base: EffectDataPlatformValidationOptions | undefined, override: Partial<EffectDataPlatformValidationOptions> | undefined): EffectDataPlatformValidationOptions | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { HttpApi } from 'effect/unstable/httpapi';
|
|
2
|
+
import type { Rpc } from 'effect/unstable/rpc';
|
|
3
|
+
import type { EffectBffOpenApiConfig, EffectDataPlatformValidationOptions, EffectRequestValidator, EffectRpcBffDefinition, EffectRuntimeLayer } from './types';
|
|
4
|
+
export declare function createHttpApiHandler<TApi extends HttpApi.AnyWithProps = HttpApi.AnyWithProps, TRpcs extends Rpc.Any = Rpc.Any>(options: {
|
|
5
|
+
api: TApi;
|
|
6
|
+
layer: EffectRuntimeLayer;
|
|
7
|
+
openapi?: EffectBffOpenApiConfig;
|
|
8
|
+
rpc?: EffectRpcBffDefinition<TRpcs>;
|
|
9
|
+
dataPlatform?: EffectDataPlatformValidationOptions;
|
|
10
|
+
validateRequest?: EffectRequestValidator;
|
|
11
|
+
}): {
|
|
12
|
+
handler: (request: Request, context?: Parameters<(request: globalThis.Request, context: import("effect/Context").Context<unknown>) => Promise<Response>>[1]) => Promise<Response>;
|
|
13
|
+
dispose: () => Promise<void>;
|
|
14
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { HttpRouter } from 'effect/unstable/http';
|
|
2
|
+
import { type HttpApi } from 'effect/unstable/httpapi';
|
|
3
|
+
import type { EffectBffOpenApiConfig } from './types';
|
|
4
|
+
export declare function createOpenApiLayer(api: HttpApi.AnyWithProps, openapi: EffectBffOpenApiConfig | undefined): import("effect/Layer").Layer<never, never, HttpRouter.HttpRouter> | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function getRequestPathname(request: Request): string;
|
|
2
|
+
export declare function getMountedPrefixFromContext(request: Request, context: unknown): string;
|
|
3
|
+
export declare function removeMountedPrefixFromBatchPath(pathWithQuery: string, prefix: string): string;
|
|
4
|
+
export declare function getExpectedEnvelopeOrigin(request: Request): string;
|
|
5
|
+
export declare function isRpcRequest(request: Request, rpcPath: `/${string}`): boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Rpc } from 'effect/unstable/rpc';
|
|
2
|
+
import type { EffectRpcBffDefinition } from './types';
|
|
3
|
+
export declare function normalizeRpcPath(pathname: string | undefined): `/${string}`;
|
|
4
|
+
export declare function createRpcApiHandler<TRpcs extends Rpc.Any = Rpc.Any>(options: EffectRpcBffDefinition<TRpcs>): {
|
|
5
|
+
readonly handler: (request: globalThis.Request, context?: import("effect/Context").Context<never> | undefined) => Promise<Response>;
|
|
6
|
+
readonly dispose: () => Promise<void>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import type { FileSystem, Path } from 'effect';
|
|
2
|
+
import * as Context from 'effect/Context';
|
|
3
|
+
import type * as EffectType from 'effect/Effect';
|
|
4
|
+
import type * as Layer from 'effect/Layer';
|
|
5
|
+
import type { Etag, HttpPlatform, HttpRouter } from 'effect/unstable/http';
|
|
6
|
+
import type { HttpApi, HttpApiClient, HttpApiGroup } from 'effect/unstable/httpapi';
|
|
7
|
+
import type { Rpc, RpcGroup } from 'effect/unstable/rpc';
|
|
8
|
+
import type { createHttpApiHandler } from './http';
|
|
9
|
+
import type { createRpcApiHandler } from './rpc';
|
|
10
|
+
export type EffectRuntimeRequirements = Etag.Generator | FileSystem.FileSystem | HttpPlatform.HttpPlatform | HttpRouter.HttpRouter | HttpRouter.Request<'Error', unknown> | HttpRouter.Request<'GlobalError', unknown> | HttpRouter.Request<'GlobalRequires', unknown> | HttpRouter.Request<'Requires', unknown> | Path.Path;
|
|
11
|
+
export type EffectRuntimeLayer = Layer.Layer<never, never, EffectRuntimeRequirements>;
|
|
12
|
+
export declare const toEffectServiceContext: (context: unknown) => Context.Context<any>;
|
|
13
|
+
export type EffectRpcSerialization = 'json' | 'ndjson' | 'jsonRpc' | 'ndJsonRpc' | 'msgPack';
|
|
14
|
+
export type EffectRpcRuntimeLayer<TRpcs extends Rpc.Any = Rpc.Any> = Layer.Layer<Rpc.ToHandler<TRpcs> | Rpc.Middleware<TRpcs> | Rpc.ServicesServer<TRpcs>, unknown, never>;
|
|
15
|
+
export type EffectRpcBffDefinition<TRpcs extends Rpc.Any = Rpc.Any, TRpcLayer extends EffectRpcRuntimeLayer<TRpcs> = EffectRpcRuntimeLayer<TRpcs>> = {
|
|
16
|
+
group: RpcGroup.RpcGroup<TRpcs>;
|
|
17
|
+
layer: TRpcLayer;
|
|
18
|
+
path?: `/${string}`;
|
|
19
|
+
serialization?: EffectRpcSerialization;
|
|
20
|
+
disableTracing?: boolean;
|
|
21
|
+
spanPrefix?: string;
|
|
22
|
+
spanAttributes?: Record<string, unknown>;
|
|
23
|
+
disableFatalDefects?: boolean;
|
|
24
|
+
};
|
|
25
|
+
export type EffectRpcBffHandlerOptions = Pick<EffectRpcBffDefinition, 'path' | 'serialization' | 'disableTracing' | 'spanPrefix' | 'spanAttributes' | 'disableFatalDefects'>;
|
|
26
|
+
type EffectApiPromiseClient<TClient> = {
|
|
27
|
+
[GroupName in keyof TClient]: {
|
|
28
|
+
[EndpointName in keyof TClient[GroupName]]: TClient[GroupName][EndpointName] extends (...args: infer TArgs) => infer TResult ? TResult extends EffectType.Effect<unknown, unknown, unknown> ? (...args: TArgs) => Promise<Exclude<EffectType.Success<TResult>, readonly [unknown, unknown]>> : never : never;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export type EffectApiClientFromApi<TApi extends HttpApi.AnyWithProps = HttpApi.AnyWithProps> = TApi extends HttpApi.HttpApi<infer _ApiId, infer Groups> ? HttpApiClient.Client<Extract<Groups, HttpApiGroup.Any>, never, never> : never;
|
|
32
|
+
export type EffectApiPromiseClientFromApi<TApi extends HttpApi.AnyWithProps = HttpApi.AnyWithProps> = EffectApiPromiseClient<EffectApiClientFromApi<TApi>>;
|
|
33
|
+
export type EffectBffDefinition<TApi extends HttpApi.AnyWithProps = HttpApi.AnyWithProps, TLayer extends EffectRuntimeLayer = EffectRuntimeLayer, TRpcs extends Rpc.Any = Rpc.Any> = {
|
|
34
|
+
api: TApi;
|
|
35
|
+
layer: TLayer;
|
|
36
|
+
rpc?: EffectRpcBffDefinition<TRpcs>;
|
|
37
|
+
dataPlatform?: EffectDataPlatformValidationOptions;
|
|
38
|
+
};
|
|
39
|
+
export type EffectDataPlatformSelectionValidationOptions = {
|
|
40
|
+
maxDepth?: number;
|
|
41
|
+
maxFields?: number;
|
|
42
|
+
allowedLeafPaths?: string[];
|
|
43
|
+
};
|
|
44
|
+
export type EffectDataPlatformBatchOptions = {
|
|
45
|
+
/**
|
|
46
|
+
* Enable network batching endpoint for Effect HttpApi requests.
|
|
47
|
+
* Defaults to `true`.
|
|
48
|
+
*/
|
|
49
|
+
enabled?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Batch endpoint path mounted under BFF prefix.
|
|
52
|
+
* Defaults to `/_data/batch`.
|
|
53
|
+
*/
|
|
54
|
+
endpoint?: `/${string}`;
|
|
55
|
+
/**
|
|
56
|
+
* Maximum request items accepted per batch call.
|
|
57
|
+
* Defaults to `16`.
|
|
58
|
+
*/
|
|
59
|
+
maxBatchSize?: number;
|
|
60
|
+
/**
|
|
61
|
+
* Maximum serialized request payload size in bytes.
|
|
62
|
+
* Defaults to `65536` (64KiB).
|
|
63
|
+
*/
|
|
64
|
+
maxBatchBytes?: number;
|
|
65
|
+
/**
|
|
66
|
+
* Client-side micro-batch flush window in milliseconds.
|
|
67
|
+
* Server runtime ignores this value and passes it through for codegen.
|
|
68
|
+
* Defaults to `8`.
|
|
69
|
+
*/
|
|
70
|
+
flushIntervalMs?: number;
|
|
71
|
+
/**
|
|
72
|
+
* Maximum per-batch internal request concurrency.
|
|
73
|
+
* Defaults to `4`.
|
|
74
|
+
*/
|
|
75
|
+
maxConcurrency?: number;
|
|
76
|
+
/**
|
|
77
|
+
* Optional timeout per internal request in milliseconds.
|
|
78
|
+
* Defaults to `10000`.
|
|
79
|
+
*/
|
|
80
|
+
requestTimeoutMs?: number;
|
|
81
|
+
/**
|
|
82
|
+
* Allowed HTTP methods for internal batched dispatch.
|
|
83
|
+
* Defaults to `['GET']`.
|
|
84
|
+
*/
|
|
85
|
+
allowedMethods?: string[];
|
|
86
|
+
};
|
|
87
|
+
export type EffectDataPlatformValidationOptions = {
|
|
88
|
+
/**
|
|
89
|
+
* Enable envelope validation for HttpApi requests.
|
|
90
|
+
* Defaults to `true`.
|
|
91
|
+
*/
|
|
92
|
+
enabled?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Require every HttpApi request to include an envelope header.
|
|
95
|
+
* Defaults to `false`.
|
|
96
|
+
*/
|
|
97
|
+
requireEnvelope?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Header name used by client/server for the serialized request envelope.
|
|
100
|
+
* Defaults to `x-modernjs-data-envelope`.
|
|
101
|
+
*/
|
|
102
|
+
envelopeHeader?: string;
|
|
103
|
+
/**
|
|
104
|
+
* Optional namespace assertion for envelope validation.
|
|
105
|
+
*/
|
|
106
|
+
expectedNamespace?: string;
|
|
107
|
+
/**
|
|
108
|
+
* Validate envelope origin against incoming request origin.
|
|
109
|
+
* Defaults to `true`.
|
|
110
|
+
*/
|
|
111
|
+
validateOrigin?: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Require trace context inside request envelope.
|
|
114
|
+
* Defaults to `false`.
|
|
115
|
+
*/
|
|
116
|
+
requireTraceContext?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Selection plan guardrails for server-side validation.
|
|
119
|
+
*/
|
|
120
|
+
selection?: EffectDataPlatformSelectionValidationOptions;
|
|
121
|
+
/**
|
|
122
|
+
* Network batching gateway configuration.
|
|
123
|
+
*/
|
|
124
|
+
batch?: EffectDataPlatformBatchOptions;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Server-seam request validator applied to every HttpApi request — direct,
|
|
128
|
+
* batched (per item) and rpc. Returning a Response short-circuits the
|
|
129
|
+
* request; returning `null`/`undefined` lets it through. Used by the effect
|
|
130
|
+
* adapter to enforce the cross-project policy at one seam so batched items
|
|
131
|
+
* cannot bypass it.
|
|
132
|
+
*/
|
|
133
|
+
export type EffectRequestValidator = (request: Request) => Response | null | undefined;
|
|
134
|
+
export type EffectBffHandlerFactory<TApi extends HttpApi.AnyWithProps = HttpApi.AnyWithProps, TLayer extends EffectRuntimeLayer = EffectRuntimeLayer> = (options?: {
|
|
135
|
+
openapi?: EffectBffOpenApiConfig;
|
|
136
|
+
rpc?: Partial<EffectRpcBffHandlerOptions>;
|
|
137
|
+
dataPlatform?: Partial<EffectDataPlatformValidationOptions>;
|
|
138
|
+
validateRequest?: EffectRequestValidator;
|
|
139
|
+
}) => ReturnType<typeof createHttpApiHandler>;
|
|
140
|
+
export type EffectBffRuntime<TApi extends HttpApi.AnyWithProps = HttpApi.AnyWithProps, TLayer extends EffectRuntimeLayer = EffectRuntimeLayer> = {
|
|
141
|
+
createHandler: EffectBffHandlerFactory<TApi, TLayer>;
|
|
142
|
+
client: EffectApiPromiseClientFromApi<TApi>;
|
|
143
|
+
};
|
|
144
|
+
export type EffectBffOpenApiConfig = boolean | {
|
|
145
|
+
path?: string;
|
|
146
|
+
};
|
|
147
|
+
export type EffectRpcBffHandlerFactory<TRpcs extends Rpc.Any = Rpc.Any> = (options?: Partial<EffectRpcBffHandlerOptions>) => ReturnType<typeof createRpcApiHandler<TRpcs>>;
|
|
148
|
+
export {};
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import type { FileSystem, Path } from 'effect';
|
|
2
|
-
import * as Context from 'effect/Context';
|
|
3
|
-
import type * as EffectType from 'effect/Effect';
|
|
4
|
-
import * as Layer from 'effect/Layer';
|
|
5
|
-
import { Etag, HttpPlatform, HttpRouter } from 'effect/unstable/http';
|
|
6
|
-
import { type HttpApi, type HttpApiClient, type HttpApiGroup } from 'effect/unstable/httpapi';
|
|
7
|
-
import { type Rpc, type RpcGroup } from 'effect/unstable/rpc';
|
|
8
1
|
export * as Config from 'effect/Config';
|
|
9
2
|
export * as Effect from 'effect/Effect';
|
|
10
3
|
export * as Layer from 'effect/Layer';
|
|
@@ -15,186 +8,7 @@ export { HttpTraceContext } from 'effect/unstable/http';
|
|
|
15
8
|
export * from 'effect/unstable/httpapi';
|
|
16
9
|
export { HttpApiBuilder } from 'effect/unstable/httpapi';
|
|
17
10
|
export * from 'effect/unstable/rpc';
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
export type
|
|
22
|
-
export type EffectRpcBffDefinition<TRpcs extends Rpc.Any = Rpc.Any, TRpcLayer extends EffectRpcRuntimeLayer<TRpcs> = EffectRpcRuntimeLayer<TRpcs>> = {
|
|
23
|
-
group: RpcGroup.RpcGroup<TRpcs>;
|
|
24
|
-
layer: TRpcLayer;
|
|
25
|
-
path?: `/${string}`;
|
|
26
|
-
serialization?: EffectRpcSerialization;
|
|
27
|
-
disableTracing?: boolean;
|
|
28
|
-
spanPrefix?: string;
|
|
29
|
-
spanAttributes?: Record<string, unknown>;
|
|
30
|
-
disableFatalDefects?: boolean;
|
|
31
|
-
};
|
|
32
|
-
export type EffectRpcBffHandlerOptions = Pick<EffectRpcBffDefinition, 'path' | 'serialization' | 'disableTracing' | 'spanPrefix' | 'spanAttributes' | 'disableFatalDefects'>;
|
|
33
|
-
type EffectApiPromiseClient<TClient> = {
|
|
34
|
-
[GroupName in keyof TClient]: {
|
|
35
|
-
[EndpointName in keyof TClient[GroupName]]: TClient[GroupName][EndpointName] extends (...args: infer TArgs) => infer TResult ? TResult extends EffectType.Effect<unknown, unknown, unknown> ? (...args: TArgs) => Promise<Exclude<EffectType.Success<TResult>, readonly [unknown, unknown]>> : never : never;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
export type EffectApiClientFromApi<TApi extends HttpApi.AnyWithProps = HttpApi.AnyWithProps> = TApi extends HttpApi.HttpApi<infer _ApiId, infer Groups> ? HttpApiClient.Client<Extract<Groups, HttpApiGroup.Any>, unknown, never> : never;
|
|
39
|
-
export type EffectApiPromiseClientFromApi<TApi extends HttpApi.AnyWithProps = HttpApi.AnyWithProps> = EffectApiPromiseClient<EffectApiClientFromApi<TApi>>;
|
|
40
|
-
export type EffectBffDefinition<TApi extends HttpApi.AnyWithProps = HttpApi.AnyWithProps, TLayer extends EffectRuntimeLayer = EffectRuntimeLayer, TRpcs extends Rpc.Any = Rpc.Any> = {
|
|
41
|
-
api: TApi;
|
|
42
|
-
layer: TLayer;
|
|
43
|
-
rpc?: EffectRpcBffDefinition<TRpcs>;
|
|
44
|
-
dataPlatform?: EffectDataPlatformValidationOptions;
|
|
45
|
-
};
|
|
46
|
-
export type EffectDataPlatformSelectionValidationOptions = {
|
|
47
|
-
maxDepth?: number;
|
|
48
|
-
maxFields?: number;
|
|
49
|
-
allowedLeafPaths?: string[];
|
|
50
|
-
};
|
|
51
|
-
export type EffectDataPlatformBatchOptions = {
|
|
52
|
-
/**
|
|
53
|
-
* Enable network batching endpoint for Effect HttpApi requests.
|
|
54
|
-
* Defaults to `true`.
|
|
55
|
-
*/
|
|
56
|
-
enabled?: boolean;
|
|
57
|
-
/**
|
|
58
|
-
* Batch endpoint path mounted under BFF prefix.
|
|
59
|
-
* Defaults to `/_data/batch`.
|
|
60
|
-
*/
|
|
61
|
-
endpoint?: `/${string}`;
|
|
62
|
-
/**
|
|
63
|
-
* Maximum request items accepted per batch call.
|
|
64
|
-
* Defaults to `16`.
|
|
65
|
-
*/
|
|
66
|
-
maxBatchSize?: number;
|
|
67
|
-
/**
|
|
68
|
-
* Maximum serialized request payload size in bytes.
|
|
69
|
-
* Defaults to `65536` (64KiB).
|
|
70
|
-
*/
|
|
71
|
-
maxBatchBytes?: number;
|
|
72
|
-
/**
|
|
73
|
-
* Client-side micro-batch flush window in milliseconds.
|
|
74
|
-
* Server runtime ignores this value and passes it through for codegen.
|
|
75
|
-
* Defaults to `8`.
|
|
76
|
-
*/
|
|
77
|
-
flushIntervalMs?: number;
|
|
78
|
-
/**
|
|
79
|
-
* Maximum per-batch internal request concurrency.
|
|
80
|
-
* Defaults to `4`.
|
|
81
|
-
*/
|
|
82
|
-
maxConcurrency?: number;
|
|
83
|
-
/**
|
|
84
|
-
* Optional timeout per internal request in milliseconds.
|
|
85
|
-
* Defaults to `10000`.
|
|
86
|
-
*/
|
|
87
|
-
requestTimeoutMs?: number;
|
|
88
|
-
/**
|
|
89
|
-
* Allowed HTTP methods for internal batched dispatch.
|
|
90
|
-
* Defaults to `['GET']`.
|
|
91
|
-
*/
|
|
92
|
-
allowedMethods?: string[];
|
|
93
|
-
};
|
|
94
|
-
export type EffectDataPlatformValidationOptions = {
|
|
95
|
-
/**
|
|
96
|
-
* Enable envelope validation for HttpApi requests.
|
|
97
|
-
* Defaults to `true`.
|
|
98
|
-
*/
|
|
99
|
-
enabled?: boolean;
|
|
100
|
-
/**
|
|
101
|
-
* Require every HttpApi request to include an envelope header.
|
|
102
|
-
* Defaults to `false`.
|
|
103
|
-
*/
|
|
104
|
-
requireEnvelope?: boolean;
|
|
105
|
-
/**
|
|
106
|
-
* Header name used by client/server for the serialized request envelope.
|
|
107
|
-
* Defaults to `x-modernjs-data-envelope`.
|
|
108
|
-
*/
|
|
109
|
-
envelopeHeader?: string;
|
|
110
|
-
/**
|
|
111
|
-
* Optional namespace assertion for envelope validation.
|
|
112
|
-
*/
|
|
113
|
-
expectedNamespace?: string;
|
|
114
|
-
/**
|
|
115
|
-
* Validate envelope origin against incoming request origin.
|
|
116
|
-
* Defaults to `true`.
|
|
117
|
-
*/
|
|
118
|
-
validateOrigin?: boolean;
|
|
119
|
-
/**
|
|
120
|
-
* Require trace context inside request envelope.
|
|
121
|
-
* Defaults to `false`.
|
|
122
|
-
*/
|
|
123
|
-
requireTraceContext?: boolean;
|
|
124
|
-
/**
|
|
125
|
-
* Selection plan guardrails for server-side validation.
|
|
126
|
-
*/
|
|
127
|
-
selection?: EffectDataPlatformSelectionValidationOptions;
|
|
128
|
-
/**
|
|
129
|
-
* Network batching gateway configuration.
|
|
130
|
-
*/
|
|
131
|
-
batch?: EffectDataPlatformBatchOptions;
|
|
132
|
-
};
|
|
133
|
-
/**
|
|
134
|
-
* Server-seam request validator applied to every HttpApi request — direct,
|
|
135
|
-
* batched (per item) and rpc. Returning a Response short-circuits the
|
|
136
|
-
* request; returning `null`/`undefined` lets it through. Used by the effect
|
|
137
|
-
* adapter to enforce the cross-project policy at one seam so batched items
|
|
138
|
-
* cannot bypass it.
|
|
139
|
-
*/
|
|
140
|
-
export type EffectRequestValidator = (request: Request) => Response | null | undefined;
|
|
141
|
-
/**
|
|
142
|
-
* Brand stamped on `createHandler` factories that are guaranteed to forward
|
|
143
|
-
* `options.validateRequest` into `createHttpApiHandler` — i.e. the policy
|
|
144
|
-
* seam runs inside the produced handler, including per batched item.
|
|
145
|
-
*
|
|
146
|
-
* `defineEffectBff` brands its factory automatically. Hand-written factories
|
|
147
|
-
* are NOT assumed to honor `validateRequest`, so strict module resolution
|
|
148
|
-
* rejects unbranded factories instead of silently skipping the policy.
|
|
149
|
-
*
|
|
150
|
-
* Registered via `Symbol.for` so independently loaded runtime copies agree.
|
|
151
|
-
*/
|
|
152
|
-
export declare const EFFECT_VALIDATOR_AWARE_FACTORY: symbol;
|
|
153
|
-
/**
|
|
154
|
-
* True when `factory` is branded as validator-aware (see
|
|
155
|
-
* {@link EFFECT_VALIDATOR_AWARE_FACTORY}).
|
|
156
|
-
*/
|
|
157
|
-
export declare function isValidatorAwareHandlerFactory(factory: unknown): boolean;
|
|
158
|
-
export type EffectBffHandlerFactory<TApi extends HttpApi.AnyWithProps = HttpApi.AnyWithProps, TLayer extends EffectRuntimeLayer = EffectRuntimeLayer> = (options?: {
|
|
159
|
-
openapi?: EffectBffOpenApiConfig;
|
|
160
|
-
rpc?: Partial<EffectRpcBffHandlerOptions>;
|
|
161
|
-
dataPlatform?: Partial<EffectDataPlatformValidationOptions>;
|
|
162
|
-
validateRequest?: EffectRequestValidator;
|
|
163
|
-
}) => ReturnType<typeof createHttpApiHandler>;
|
|
164
|
-
export type EffectBffRuntime<TApi extends HttpApi.AnyWithProps = HttpApi.AnyWithProps, TLayer extends EffectRuntimeLayer = EffectRuntimeLayer> = {
|
|
165
|
-
createHandler: EffectBffHandlerFactory<TApi, TLayer>;
|
|
166
|
-
client: EffectApiPromiseClientFromApi<TApi>;
|
|
167
|
-
};
|
|
168
|
-
export type EffectBffOpenApiConfig = boolean | {
|
|
169
|
-
path?: string;
|
|
170
|
-
};
|
|
171
|
-
export type EffectRpcBffHandlerFactory<TRpcs extends Rpc.Any = Rpc.Any> = (options?: Partial<EffectRpcBffHandlerOptions>) => ReturnType<typeof createRpcApiHandler<TRpcs>>;
|
|
172
|
-
declare function createRpcApiHandler<TRpcs extends Rpc.Any = Rpc.Any>(options: EffectRpcBffDefinition<TRpcs>): {
|
|
173
|
-
readonly handler: (request: globalThis.Request, context?: Context.Context<never> | undefined) => Promise<Response>;
|
|
174
|
-
readonly dispose: () => Promise<void>;
|
|
175
|
-
};
|
|
176
|
-
export declare function defineEffectBff<TApi extends HttpApi.AnyWithProps, TLayer extends EffectRuntimeLayer, TRpcs extends Rpc.Any = Rpc.Any>(definition: {
|
|
177
|
-
api: TApi;
|
|
178
|
-
layer: TLayer;
|
|
179
|
-
rpc?: EffectRpcBffDefinition<TRpcs>;
|
|
180
|
-
dataPlatform?: EffectDataPlatformValidationOptions;
|
|
181
|
-
}): {
|
|
182
|
-
api: TApi;
|
|
183
|
-
layer: TLayer;
|
|
184
|
-
rpc?: EffectRpcBffDefinition<TRpcs>;
|
|
185
|
-
dataPlatform?: EffectDataPlatformValidationOptions;
|
|
186
|
-
} & EffectBffRuntime<TApi, TLayer>;
|
|
187
|
-
export declare function defineEffectRpcBff<TRpcs extends Rpc.Any = Rpc.Any, TLayer extends EffectRpcRuntimeLayer<TRpcs> = EffectRpcRuntimeLayer<TRpcs>>(definition: EffectRpcBffDefinition<TRpcs, TLayer>): EffectRpcBffDefinition<TRpcs, TLayer> & {
|
|
188
|
-
createHandler: EffectRpcBffHandlerFactory<TRpcs>;
|
|
189
|
-
};
|
|
190
|
-
export declare function createHttpApiHandler<TApi extends HttpApi.AnyWithProps = HttpApi.AnyWithProps, TRpcs extends Rpc.Any = Rpc.Any>(options: {
|
|
191
|
-
api: TApi;
|
|
192
|
-
layer: EffectRuntimeLayer;
|
|
193
|
-
openapi?: EffectBffOpenApiConfig;
|
|
194
|
-
rpc?: EffectRpcBffDefinition<TRpcs>;
|
|
195
|
-
dataPlatform?: EffectDataPlatformValidationOptions;
|
|
196
|
-
validateRequest?: EffectRequestValidator;
|
|
197
|
-
}): {
|
|
198
|
-
handler: (request: Request, context?: Parameters<(request: globalThis.Request, context: Context.Context<any>) => Promise<Response>>[1]) => Promise<Response>;
|
|
199
|
-
dispose: () => Promise<void>;
|
|
200
|
-
};
|
|
11
|
+
export { EFFECT_VALIDATOR_AWARE_FACTORY, isValidatorAwareHandlerFactory, } from './entry-shape';
|
|
12
|
+
export { defineEffectBff, defineEffectRpcBff } from './handler/definition';
|
|
13
|
+
export { createHttpApiHandler } from './handler/http';
|
|
14
|
+
export type { EffectApiClientFromApi, EffectApiPromiseClientFromApi, EffectBffDefinition, EffectBffHandlerFactory, EffectBffOpenApiConfig, EffectBffRuntime, EffectDataPlatformBatchOptions, EffectDataPlatformSelectionValidationOptions, EffectDataPlatformValidationOptions, EffectRequestValidator, EffectRpcBffDefinition, EffectRpcBffHandlerFactory, EffectRpcBffHandlerOptions, EffectRpcRuntimeLayer, EffectRpcSerialization, EffectRuntimeLayer, EffectRuntimeRequirements, } from './handler/types';
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export * as OpenTelemetry from '@effect/opentelemetry';
|
|
2
|
+
export * from './backend-federation';
|
|
3
|
+
export { BACKEND_FEDERATION_CONTRACT_VERSION, BACKEND_FEDERATION_EFFECT_EXPOSE, BACKEND_FEDERATION_MANIFEST_FILE, BACKEND_FEDERATION_NODE_ADAPTER_VERSION, type BackendFederatedEffectApiModule, type BackendFederationEntryExports, type BackendFederationLoadEntryPluginOptions, type BackendFederationRemote, type BackendFederationRuntimeOptions, createBackendFederationLoadEntryPlugin, createBackendFederationRuntime, loadBackendFederatedEffectApi, } from './backend-federation';
|
|
4
|
+
export { type BackendFederationManifest, BackendFederationManifestAdapterError, type BackendFederationManifestAdapterErrorCode, type BackendFederationManifestAdapterFallback, type BackendFederationManifestAdapterOptions, type BackendFederationManifestFetchResponse, type BackendFederationVersionBoundaryExpectation, loadBackendFederatedEffectApiFromManifest, loadBackendFederationManifest, resolveBackendFederationRemoteFromManifest, } from './backend-federation-manifest';
|
|
2
5
|
export { type CreateEffectOperationContextOptions, createEffectOperationContext, type EffectContext, runWithEffectContext, useEffectContext, useOperationContext, } from './context';
|
|
3
6
|
export { createEffectBffEdgeHandler, createEffectBffTestHandler, dispatchEffectBffRequest, } from './edge';
|
|
4
7
|
export * from './handler';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { RpcSerialization } from 'effect/unstable/rpc';
|
|
2
|
+
import type { EffectRpcSerialization } from './handler/types';
|
|
3
|
+
export declare function getRpcSerializationLayer(serialization: EffectRpcSerialization | undefined): import("effect/Layer").Layer<RpcSerialization.RpcSerialization, never, never>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { EffectOperationDescriptor, EffectRequestContext, EffectRequestContextInput, GeneratedEffectClientConfig, GeneratedEffectEndpoint } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves the current page origin with a configurable fallback. Single
|
|
4
|
+
* implementation shared by the configure() bootstrap and the data envelope
|
|
5
|
+
* (the generated template previously duplicated data-platform's
|
|
6
|
+
* `resolveRuntimeOrigin` with a different fallback).
|
|
7
|
+
*/
|
|
8
|
+
export declare const resolveOrigin: (defaultOrigin: string) => string;
|
|
9
|
+
export declare const prepareEffectRequest: (options: {
|
|
10
|
+
endpoint: GeneratedEffectEndpoint;
|
|
11
|
+
operation: EffectOperationDescriptor;
|
|
12
|
+
request: unknown;
|
|
13
|
+
config: GeneratedEffectClientConfig;
|
|
14
|
+
createEffectRequestContext: (requestContext: EffectRequestContextInput) => EffectRequestContext;
|
|
15
|
+
}) => Record<string, unknown>;
|
|
@@ -53,6 +53,6 @@ export type EffectRpcClientHandle<Rpcs extends Rpc.Any, Flatten extends boolean
|
|
|
53
53
|
export declare function view<T>(): <const Selection extends EffectViewSelection<T>>(selection: Selection) => Selection;
|
|
54
54
|
export declare function mask<T, const Selection extends EffectViewSelection<T>>(value: T, selection: Selection): EffectViewData<T, Selection>;
|
|
55
55
|
export declare function runEffectView<T, const Selection extends EffectViewSelection<T>>(request: PromiseLike<T>, selection: Selection): Promise<EffectViewData<T, Selection>>;
|
|
56
|
-
export declare function makeEffectHttpApiClient<ApiId extends string, Groups extends HttpApiGroup.Any>(api: HttpApi.HttpApi<ApiId, Groups>, options?: EffectHttpApiClientOptions): Effect.Effect<HttpApiClient.Client<Groups>, never, HttpApiGroup.MiddlewareClient<Groups>>;
|
|
56
|
+
export declare function makeEffectHttpApiClient<ApiId extends string, Groups extends HttpApiGroup.Any>(api: HttpApi.HttpApi<ApiId, Groups>, options?: EffectHttpApiClientOptions): Effect.Effect<HttpApiClient.Client<Groups, never, never>, never, HttpApiGroup.MiddlewareClient<Groups>>;
|
|
57
57
|
export declare function makeEffectRpcClient<Rpcs extends Rpc.Any, const Flatten extends boolean = false>(group: RpcGroup.RpcGroup<Rpcs>, options: EffectRpcClientOptions<Rpcs, Flatten>): Effect.Effect<EffectRpcClientHandle<Rpcs, Flatten>, EffectRpcClientError, never>;
|
|
58
58
|
export declare const runEffectRequest: <A, E>(effect: Effect.Effect<A, E>, options?: Effect.RunOptions | undefined) => Promise<A>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { EffectRequestContext, EffectRequestContextInput, EffectRequestRuntime } from './types';
|
|
2
|
+
export declare const createEffectRequestContext: (createRequestContextHeaders: EffectRequestRuntime['createRequestContextHeaders'], requestContext: EffectRequestContextInput) => EffectRequestContext;
|
|
3
|
+
export declare const applyRequestContext: (normalizedRequest: Record<string, unknown>, request: unknown, createRequestContext: (requestContext: EffectRequestContextInput) => EffectRequestContext) => Record<string, unknown>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const normalizeRequest: (method: string, request: unknown) => Record<string, unknown>;
|