@bleedingdev/modern-js-plugin-bff 3.8.2-ultramodern.9 → 3.8.3-ultramodern.2
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/generator.js +45 -53
- package/dist/cjs/cli/serverGlobalVars.js +1 -1
- package/dist/cjs/cli.js +1 -0
- package/dist/cjs/loader.js +7 -18
- package/dist/cjs/runtime/data-platform/index.js +32 -94
- package/dist/cjs/runtime/effect/edge-dispatcher.js +5 -91
- package/dist/cjs/runtime/effect/edge.js +11 -45
- package/dist/cjs/runtime/effect/index.js +173 -55
- package/dist/cjs/runtime/effect-client/index.js +32 -166
- package/dist/cjs/runtime/effect-client/runtime.js +32 -70
- package/dist/cjs/runtime/hono/adapter.js +13 -54
- package/dist/cjs/server.js +2 -2
- package/dist/cjs/utils/client-generator/generate.js +11 -8
- package/dist/cjs/utils/client-generator/index.js +0 -3
- package/dist/cjs/utils/client-generator/type-facade.js +16 -10
- package/dist/cjs/utils/crossProjectApiPlugin.js +5 -1
- package/dist/cjs/utils/pluginGenerator.js +4 -4
- package/dist/cjs/utils/runtimeGenerator.js +4 -16
- package/dist/esm/cli/generator.mjs +45 -53
- package/dist/esm/cli/serverGlobalVars.mjs +1 -1
- package/dist/esm/cli.mjs +1 -0
- package/dist/esm/loader.mjs +5 -16
- package/dist/esm/runtime/data-platform/index.mjs +1 -7
- package/dist/esm/runtime/effect/edge-dispatcher.mjs +1 -38
- package/dist/esm/runtime/effect/edge.mjs +2 -2
- package/dist/esm/runtime/effect/index.mjs +16 -8
- package/dist/esm/runtime/effect-client/index.mjs +1 -98
- package/dist/esm/runtime/effect-client/runtime.mjs +1 -62
- package/dist/esm/runtime/hono/adapter.mjs +13 -54
- package/dist/esm/server.mjs +2 -2
- package/dist/esm/utils/client-generator/generate.mjs +11 -8
- package/dist/esm/utils/client-generator/index.mjs +1 -1
- package/dist/esm/utils/client-generator/type-facade.mjs +9 -6
- package/dist/esm/utils/crossProjectApiPlugin.mjs +3 -2
- package/dist/esm/utils/pluginGenerator.mjs +5 -5
- package/dist/esm/utils/runtimeGenerator.mjs +4 -16
- package/dist/esm-node/cli/generator.mjs +45 -53
- package/dist/esm-node/cli/serverGlobalVars.mjs +1 -1
- package/dist/esm-node/cli.mjs +1 -0
- package/dist/esm-node/loader.mjs +5 -16
- package/dist/esm-node/runtime/data-platform/index.mjs +1 -7
- package/dist/esm-node/runtime/effect/edge-dispatcher.mjs +1 -38
- package/dist/esm-node/runtime/effect/edge.mjs +2 -2
- package/dist/esm-node/runtime/effect/index.mjs +16 -8
- package/dist/esm-node/runtime/effect-client/index.mjs +1 -98
- package/dist/esm-node/runtime/effect-client/runtime.mjs +1 -62
- package/dist/esm-node/runtime/hono/adapter.mjs +13 -54
- package/dist/esm-node/server.mjs +2 -2
- package/dist/esm-node/utils/client-generator/generate.mjs +11 -8
- package/dist/esm-node/utils/client-generator/index.mjs +1 -1
- package/dist/esm-node/utils/client-generator/type-facade.mjs +9 -6
- package/dist/esm-node/utils/crossProjectApiPlugin.mjs +3 -2
- package/dist/esm-node/utils/pluginGenerator.mjs +5 -5
- package/dist/esm-node/utils/runtimeGenerator.mjs +4 -16
- package/dist/types/loader.d.ts +1 -0
- package/dist/types/runtime/data-platform/index.d.ts +1 -8
- package/dist/types/runtime/effect/edge-dispatcher.d.ts +1 -26
- package/dist/types/runtime/effect/edge.d.ts +2 -2
- package/dist/types/runtime/effect/index.d.ts +15 -7
- package/dist/types/runtime/effect-client/index.d.ts +1 -58
- package/dist/types/runtime/effect-client/runtime.d.ts +1 -5
- package/dist/types/runtime/hono/adapter.d.ts +1 -11
- package/dist/types/utils/client-generator/generate.d.ts +2 -1
- package/dist/types/utils/client-generator/index.d.ts +1 -1
- package/dist/types/utils/client-generator/type-facade.d.ts +2 -12
- package/dist/types/utils/crossProjectApiPlugin.d.ts +1 -0
- package/dist/types/utils/pluginGenerator.d.ts +2 -1
- package/package.json +34 -33
- package/dist/cjs/runtime/data-platform/batch/queue.js +0 -284
- package/dist/cjs/runtime/data-platform/batch/request.js +0 -98
- package/dist/cjs/runtime/data-platform/batch/response.js +0 -64
- package/dist/cjs/runtime/data-platform/batch/telemetry.js +0 -67
- package/dist/cjs/runtime/data-platform/batch/url.js +0 -69
- package/dist/cjs/runtime/data-platform/batch-transport.js +0 -59
- package/dist/cjs/runtime/data-platform/codec.js +0 -155
- package/dist/cjs/runtime/data-platform/invalidation.js +0 -61
- package/dist/cjs/runtime/data-platform/trace.js +0 -73
- package/dist/cjs/runtime/data-platform/types.js +0 -48
- package/dist/cjs/runtime/data-platform/validation.js +0 -178
- package/dist/cjs/runtime/effect/adapter/constants.js +0 -44
- package/dist/cjs/runtime/effect/adapter/cross-project-policy.js +0 -66
- package/dist/cjs/runtime/effect/adapter/entry.js +0 -100
- package/dist/cjs/runtime/effect/adapter/error-response.js +0 -81
- package/dist/cjs/runtime/effect/adapter/handler.js +0 -53
- package/dist/cjs/runtime/effect/adapter.js +0 -155
- package/dist/cjs/runtime/effect/backend-federation/entry.js +0 -99
- package/dist/cjs/runtime/effect/backend-federation/identity.js +0 -82
- package/dist/cjs/runtime/effect/backend-federation/load.js +0 -75
- package/dist/cjs/runtime/effect/backend-federation/plugin.js +0 -63
- package/dist/cjs/runtime/effect/backend-federation/remotes.js +0 -51
- package/dist/cjs/runtime/effect/backend-federation/runtime.js +0 -128
- package/dist/cjs/runtime/effect/backend-federation/types.js +0 -18
- package/dist/cjs/runtime/effect/backend-federation/utils.js +0 -48
- package/dist/cjs/runtime/effect/backend-federation-manifest/errors.js +0 -83
- package/dist/cjs/runtime/effect/backend-federation-manifest/index.js +0 -55
- package/dist/cjs/runtime/effect/backend-federation-manifest/load.js +0 -94
- package/dist/cjs/runtime/effect/backend-federation-manifest/metadata.js +0 -101
- package/dist/cjs/runtime/effect/backend-federation-manifest/reference.js +0 -120
- package/dist/cjs/runtime/effect/backend-federation-manifest/remote.js +0 -68
- package/dist/cjs/runtime/effect/backend-federation-manifest/types.js +0 -18
- package/dist/cjs/runtime/effect/backend-federation-manifest/validation.js +0 -109
- package/dist/cjs/runtime/effect/backend-federation-manifest.js +0 -62
- package/dist/cjs/runtime/effect/backend-federation.js +0 -65
- package/dist/cjs/runtime/effect/context.js +0 -60
- package/dist/cjs/runtime/effect/dispatch.js +0 -101
- package/dist/cjs/runtime/effect/edge-context.js +0 -81
- package/dist/cjs/runtime/effect/endpoint-contracts.js +0 -121
- package/dist/cjs/runtime/effect/entry-shape.js +0 -84
- package/dist/cjs/runtime/effect/handler/batch-handler.js +0 -161
- package/dist/cjs/runtime/effect/handler/batch.js +0 -159
- package/dist/cjs/runtime/effect/handler/definition.js +0 -102
- package/dist/cjs/runtime/effect/handler/envelope.js +0 -104
- package/dist/cjs/runtime/effect/handler/http.js +0 -107
- package/dist/cjs/runtime/effect/handler/openapi.js +0 -57
- package/dist/cjs/runtime/effect/handler/routing.js +0 -100
- package/dist/cjs/runtime/effect/handler/rpc.js +0 -63
- package/dist/cjs/runtime/effect/handler/types.js +0 -43
- package/dist/cjs/runtime/effect/handler.js +0 -189
- package/dist/cjs/runtime/effect/module.js +0 -113
- package/dist/cjs/runtime/effect/operation-context.js +0 -103
- package/dist/cjs/runtime/effect/rpcSerialization.js +0 -54
- package/dist/cjs/runtime/effect-client/batch.js +0 -73
- package/dist/cjs/runtime/effect-client/envelope.js +0 -145
- package/dist/cjs/runtime/effect-client/guards.js +0 -44
- package/dist/cjs/runtime/effect-client/request-context.js +0 -64
- package/dist/cjs/runtime/effect-client/request.js +0 -66
- package/dist/cjs/runtime/effect-client/types.js +0 -18
- package/dist/cjs/runtime/safe-failure.js +0 -84
- package/dist/cjs/utils/crossProjectServerPolicy.js +0 -98
- package/dist/cjs/utils/effect-client-generator/generator.js +0 -69
- package/dist/cjs/utils/effect-client-generator/index.js +0 -51
- package/dist/cjs/utils/effect-client-generator/paths.js +0 -62
- package/dist/cjs/utils/effect-client-generator/rendering.js +0 -220
- package/dist/cjs/utils/effect-client-generator/runtime.js +0 -68
- package/dist/cjs/utils/effect-client-generator/types.js +0 -18
- package/dist/cjs/utils/effectClientGenerator.js +0 -49
- package/dist/cjs/utils/effectSourceLoader.js +0 -312
- package/dist/cjs/utils/headers.js +0 -46
- package/dist/esm/runtime/data-platform/batch/queue.mjs +0 -246
- package/dist/esm/runtime/data-platform/batch/request.mjs +0 -45
- package/dist/esm/runtime/data-platform/batch/response.mjs +0 -23
- package/dist/esm/runtime/data-platform/batch/telemetry.mjs +0 -23
- package/dist/esm/runtime/data-platform/batch/url.mjs +0 -25
- package/dist/esm/runtime/data-platform/batch-transport.mjs +0 -12
- package/dist/esm/runtime/data-platform/codec.mjs +0 -90
- package/dist/esm/runtime/data-platform/invalidation.mjs +0 -20
- package/dist/esm/runtime/data-platform/trace.mjs +0 -29
- package/dist/esm/runtime/data-platform/types.mjs +0 -4
- package/dist/esm/runtime/data-platform/validation.mjs +0 -128
- package/dist/esm/runtime/effect/adapter/constants.mjs +0 -6
- package/dist/esm/runtime/effect/adapter/cross-project-policy.mjs +0 -28
- package/dist/esm/runtime/effect/adapter/entry.mjs +0 -52
- package/dist/esm/runtime/effect/adapter/error-response.mjs +0 -43
- package/dist/esm/runtime/effect/adapter/handler.mjs +0 -15
- package/dist/esm/runtime/effect/adapter.mjs +0 -107
- package/dist/esm/runtime/effect/backend-federation/entry.mjs +0 -61
- package/dist/esm/runtime/effect/backend-federation/identity.mjs +0 -41
- package/dist/esm/runtime/effect/backend-federation/load.mjs +0 -37
- package/dist/esm/runtime/effect/backend-federation/plugin.mjs +0 -25
- package/dist/esm/runtime/effect/backend-federation/remotes.mjs +0 -13
- package/dist/esm/runtime/effect/backend-federation/runtime.mjs +0 -90
- package/dist/esm/runtime/effect/backend-federation/types.mjs +0 -0
- package/dist/esm/runtime/effect/backend-federation/utils.mjs +0 -7
- package/dist/esm/runtime/effect/backend-federation-manifest/errors.mjs +0 -32
- package/dist/esm/runtime/effect/backend-federation-manifest/index.mjs +0 -4
- package/dist/esm/runtime/effect/backend-federation-manifest/load.mjs +0 -56
- package/dist/esm/runtime/effect/backend-federation-manifest/metadata.mjs +0 -42
- package/dist/esm/runtime/effect/backend-federation-manifest/reference.mjs +0 -76
- package/dist/esm/runtime/effect/backend-federation-manifest/remote.mjs +0 -30
- package/dist/esm/runtime/effect/backend-federation-manifest/types.mjs +0 -0
- package/dist/esm/runtime/effect/backend-federation-manifest/validation.mjs +0 -65
- package/dist/esm/runtime/effect/backend-federation-manifest.mjs +0 -1
- package/dist/esm/runtime/effect/backend-federation.mjs +0 -5
- package/dist/esm/runtime/effect/context.mjs +0 -13
- package/dist/esm/runtime/effect/dispatch.mjs +0 -63
- package/dist/esm/runtime/effect/edge-context.mjs +0 -34
- package/dist/esm/runtime/effect/endpoint-contracts.mjs +0 -68
- package/dist/esm/runtime/effect/entry-shape.mjs +0 -36
- package/dist/esm/runtime/effect/handler/batch-handler.mjs +0 -123
- package/dist/esm/runtime/effect/handler/batch.mjs +0 -97
- package/dist/esm/runtime/effect/handler/definition.mjs +0 -61
- package/dist/esm/runtime/effect/handler/envelope.mjs +0 -63
- package/dist/esm/runtime/effect/handler/http.mjs +0 -69
- package/dist/esm/runtime/effect/handler/openapi.mjs +0 -19
- package/dist/esm/runtime/effect/handler/routing.mjs +0 -50
- package/dist/esm/runtime/effect/handler/rpc.mjs +0 -22
- package/dist/esm/runtime/effect/handler/types.mjs +0 -5
- package/dist/esm/runtime/effect/handler.mjs +0 -14
- package/dist/esm/runtime/effect/module.mjs +0 -75
- package/dist/esm/runtime/effect/operation-context.mjs +0 -65
- package/dist/esm/runtime/effect/rpcSerialization.mjs +0 -16
- package/dist/esm/runtime/effect-client/batch.mjs +0 -35
- package/dist/esm/runtime/effect-client/envelope.mjs +0 -104
- package/dist/esm/runtime/effect-client/guards.mjs +0 -3
- package/dist/esm/runtime/effect-client/request-context.mjs +0 -23
- package/dist/esm/runtime/effect-client/request.mjs +0 -28
- package/dist/esm/runtime/effect-client/types.mjs +0 -0
- package/dist/esm/runtime/safe-failure.mjs +0 -46
- package/dist/esm/utils/crossProjectServerPolicy.mjs +0 -44
- package/dist/esm/utils/effect-client-generator/generator.mjs +0 -28
- package/dist/esm/utils/effect-client-generator/index.mjs +0 -3
- package/dist/esm/utils/effect-client-generator/paths.mjs +0 -24
- package/dist/esm/utils/effect-client-generator/rendering.mjs +0 -179
- package/dist/esm/utils/effect-client-generator/runtime.mjs +0 -27
- package/dist/esm/utils/effect-client-generator/types.mjs +0 -0
- package/dist/esm/utils/effectClientGenerator.mjs +0 -1
- package/dist/esm/utils/effectSourceLoader.mjs +0 -256
- package/dist/esm/utils/headers.mjs +0 -8
- package/dist/esm-node/runtime/data-platform/batch/queue.mjs +0 -247
- package/dist/esm-node/runtime/data-platform/batch/request.mjs +0 -46
- package/dist/esm-node/runtime/data-platform/batch/response.mjs +0 -24
- package/dist/esm-node/runtime/data-platform/batch/telemetry.mjs +0 -24
- package/dist/esm-node/runtime/data-platform/batch/url.mjs +0 -26
- package/dist/esm-node/runtime/data-platform/batch-transport.mjs +0 -13
- package/dist/esm-node/runtime/data-platform/codec.mjs +0 -91
- package/dist/esm-node/runtime/data-platform/invalidation.mjs +0 -21
- package/dist/esm-node/runtime/data-platform/trace.mjs +0 -30
- package/dist/esm-node/runtime/data-platform/types.mjs +0 -5
- package/dist/esm-node/runtime/data-platform/validation.mjs +0 -129
- package/dist/esm-node/runtime/effect/adapter/constants.mjs +0 -7
- package/dist/esm-node/runtime/effect/adapter/cross-project-policy.mjs +0 -29
- package/dist/esm-node/runtime/effect/adapter/entry.mjs +0 -53
- package/dist/esm-node/runtime/effect/adapter/error-response.mjs +0 -44
- package/dist/esm-node/runtime/effect/adapter/handler.mjs +0 -16
- package/dist/esm-node/runtime/effect/adapter.mjs +0 -108
- package/dist/esm-node/runtime/effect/backend-federation/entry.mjs +0 -62
- package/dist/esm-node/runtime/effect/backend-federation/identity.mjs +0 -42
- package/dist/esm-node/runtime/effect/backend-federation/load.mjs +0 -38
- package/dist/esm-node/runtime/effect/backend-federation/plugin.mjs +0 -26
- package/dist/esm-node/runtime/effect/backend-federation/remotes.mjs +0 -14
- package/dist/esm-node/runtime/effect/backend-federation/runtime.mjs +0 -91
- package/dist/esm-node/runtime/effect/backend-federation/types.mjs +0 -1
- package/dist/esm-node/runtime/effect/backend-federation/utils.mjs +0 -8
- package/dist/esm-node/runtime/effect/backend-federation-manifest/errors.mjs +0 -33
- package/dist/esm-node/runtime/effect/backend-federation-manifest/index.mjs +0 -5
- package/dist/esm-node/runtime/effect/backend-federation-manifest/load.mjs +0 -57
- package/dist/esm-node/runtime/effect/backend-federation-manifest/metadata.mjs +0 -43
- package/dist/esm-node/runtime/effect/backend-federation-manifest/reference.mjs +0 -77
- package/dist/esm-node/runtime/effect/backend-federation-manifest/remote.mjs +0 -31
- package/dist/esm-node/runtime/effect/backend-federation-manifest/types.mjs +0 -1
- package/dist/esm-node/runtime/effect/backend-federation-manifest/validation.mjs +0 -66
- package/dist/esm-node/runtime/effect/backend-federation-manifest.mjs +0 -2
- package/dist/esm-node/runtime/effect/backend-federation.mjs +0 -6
- package/dist/esm-node/runtime/effect/context.mjs +0 -14
- package/dist/esm-node/runtime/effect/dispatch.mjs +0 -64
- package/dist/esm-node/runtime/effect/edge-context.mjs +0 -35
- package/dist/esm-node/runtime/effect/endpoint-contracts.mjs +0 -69
- package/dist/esm-node/runtime/effect/entry-shape.mjs +0 -37
- package/dist/esm-node/runtime/effect/handler/batch-handler.mjs +0 -124
- package/dist/esm-node/runtime/effect/handler/batch.mjs +0 -98
- package/dist/esm-node/runtime/effect/handler/definition.mjs +0 -62
- package/dist/esm-node/runtime/effect/handler/envelope.mjs +0 -64
- package/dist/esm-node/runtime/effect/handler/http.mjs +0 -70
- package/dist/esm-node/runtime/effect/handler/openapi.mjs +0 -20
- package/dist/esm-node/runtime/effect/handler/routing.mjs +0 -51
- package/dist/esm-node/runtime/effect/handler/rpc.mjs +0 -23
- package/dist/esm-node/runtime/effect/handler/types.mjs +0 -6
- package/dist/esm-node/runtime/effect/handler.mjs +0 -15
- package/dist/esm-node/runtime/effect/module.mjs +0 -76
- package/dist/esm-node/runtime/effect/operation-context.mjs +0 -66
- package/dist/esm-node/runtime/effect/rpcSerialization.mjs +0 -17
- package/dist/esm-node/runtime/effect-client/batch.mjs +0 -36
- package/dist/esm-node/runtime/effect-client/envelope.mjs +0 -105
- package/dist/esm-node/runtime/effect-client/guards.mjs +0 -4
- package/dist/esm-node/runtime/effect-client/request-context.mjs +0 -24
- package/dist/esm-node/runtime/effect-client/request.mjs +0 -29
- package/dist/esm-node/runtime/effect-client/types.mjs +0 -1
- package/dist/esm-node/runtime/safe-failure.mjs +0 -47
- package/dist/esm-node/utils/crossProjectServerPolicy.mjs +0 -46
- package/dist/esm-node/utils/effect-client-generator/generator.mjs +0 -29
- package/dist/esm-node/utils/effect-client-generator/index.mjs +0 -4
- package/dist/esm-node/utils/effect-client-generator/paths.mjs +0 -25
- package/dist/esm-node/utils/effect-client-generator/rendering.mjs +0 -180
- package/dist/esm-node/utils/effect-client-generator/runtime.mjs +0 -29
- package/dist/esm-node/utils/effect-client-generator/types.mjs +0 -1
- package/dist/esm-node/utils/effectClientGenerator.mjs +0 -2
- package/dist/esm-node/utils/effectSourceLoader.mjs +0 -257
- package/dist/esm-node/utils/headers.mjs +0 -9
- package/dist/types/runtime/data-platform/batch/queue.d.ts +0 -8
- package/dist/types/runtime/data-platform/batch/request.d.ts +0 -13
- package/dist/types/runtime/data-platform/batch/response.d.ts +0 -3
- package/dist/types/runtime/data-platform/batch/telemetry.d.ts +0 -4
- package/dist/types/runtime/data-platform/batch/url.d.ts +0 -4
- package/dist/types/runtime/data-platform/batch-transport.d.ts +0 -3
- package/dist/types/runtime/data-platform/codec.d.ts +0 -17
- package/dist/types/runtime/data-platform/invalidation.d.ts +0 -8
- package/dist/types/runtime/data-platform/trace.d.ts +0 -4
- package/dist/types/runtime/data-platform/types.d.ts +0 -146
- package/dist/types/runtime/data-platform/validation.d.ts +0 -29
- package/dist/types/runtime/effect/adapter/constants.d.ts +0 -1
- package/dist/types/runtime/effect/adapter/cross-project-policy.d.ts +0 -4
- package/dist/types/runtime/effect/adapter/entry.d.ts +0 -2
- package/dist/types/runtime/effect/adapter/error-response.d.ts +0 -2
- package/dist/types/runtime/effect/adapter/handler.d.ts +0 -7
- package/dist/types/runtime/effect/adapter.d.ts +0 -22
- package/dist/types/runtime/effect/backend-federation/entry.d.ts +0 -2
- package/dist/types/runtime/effect/backend-federation/identity.d.ts +0 -30
- package/dist/types/runtime/effect/backend-federation/load.d.ts +0 -13
- package/dist/types/runtime/effect/backend-federation/plugin.d.ts +0 -3
- package/dist/types/runtime/effect/backend-federation/remotes.d.ts +0 -2
- package/dist/types/runtime/effect/backend-federation/runtime.d.ts +0 -3
- package/dist/types/runtime/effect/backend-federation/types.d.ts +0 -73
- package/dist/types/runtime/effect/backend-federation/utils.d.ts +0 -2
- package/dist/types/runtime/effect/backend-federation-manifest/errors.d.ts +0 -11
- package/dist/types/runtime/effect/backend-federation-manifest/index.d.ts +0 -6
- package/dist/types/runtime/effect/backend-federation-manifest/load.d.ts +0 -3
- package/dist/types/runtime/effect/backend-federation-manifest/metadata.d.ts +0 -18
- package/dist/types/runtime/effect/backend-federation-manifest/reference.d.ts +0 -4
- package/dist/types/runtime/effect/backend-federation-manifest/remote.d.ts +0 -3
- package/dist/types/runtime/effect/backend-federation-manifest/types.d.ts +0 -51
- package/dist/types/runtime/effect/backend-federation-manifest/validation.d.ts +0 -5
- package/dist/types/runtime/effect/backend-federation-manifest.d.ts +0 -1
- package/dist/types/runtime/effect/backend-federation.d.ts +0 -7
- package/dist/types/runtime/effect/context.d.ts +0 -5
- package/dist/types/runtime/effect/dispatch.d.ts +0 -13
- package/dist/types/runtime/effect/edge-context.d.ts +0 -5
- package/dist/types/runtime/effect/endpoint-contracts.d.ts +0 -66
- package/dist/types/runtime/effect/entry-shape.d.ts +0 -31
- package/dist/types/runtime/effect/handler/batch-handler.d.ts +0 -11
- package/dist/types/runtime/effect/handler/batch.d.ts +0 -13
- package/dist/types/runtime/effect/handler/definition.d.ts +0 -7
- package/dist/types/runtime/effect/handler/envelope.d.ts +0 -13
- package/dist/types/runtime/effect/handler/http.d.ts +0 -15
- package/dist/types/runtime/effect/handler/openapi.d.ts +0 -4
- package/dist/types/runtime/effect/handler/routing.d.ts +0 -5
- package/dist/types/runtime/effect/handler/rpc.d.ts +0 -7
- package/dist/types/runtime/effect/handler/types.d.ts +0 -153
- package/dist/types/runtime/effect/handler.d.ts +0 -14
- package/dist/types/runtime/effect/module.d.ts +0 -36
- package/dist/types/runtime/effect/operation-context.d.ts +0 -10
- package/dist/types/runtime/effect/rpcSerialization.d.ts +0 -3
- package/dist/types/runtime/effect-client/batch.d.ts +0 -2
- package/dist/types/runtime/effect-client/envelope.d.ts +0 -15
- package/dist/types/runtime/effect-client/guards.d.ts +0 -2
- package/dist/types/runtime/effect-client/request-context.d.ts +0 -3
- package/dist/types/runtime/effect-client/request.d.ts +0 -1
- package/dist/types/runtime/effect-client/types.d.ts +0 -68
- package/dist/types/runtime/safe-failure.d.ts +0 -1
- package/dist/types/utils/crossProjectServerPolicy.d.ts +0 -36
- package/dist/types/utils/effect-client-generator/generator.d.ts +0 -10
- package/dist/types/utils/effect-client-generator/index.d.ts +0 -4
- package/dist/types/utils/effect-client-generator/paths.d.ts +0 -5
- package/dist/types/utils/effect-client-generator/rendering.d.ts +0 -4
- package/dist/types/utils/effect-client-generator/runtime.d.ts +0 -12
- package/dist/types/utils/effect-client-generator/types.d.ts +0 -27
- package/dist/types/utils/effectClientGenerator.d.ts +0 -2
- package/dist/types/utils/effectSourceLoader.d.ts +0 -25
- package/dist/types/utils/headers.d.ts +0 -1
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import "node:module";
|
|
2
|
-
import { deriveOperationVersion } from "@modern-js/bff-core";
|
|
3
|
-
import { fs, upath } from "@modern-js/utils";
|
|
4
|
-
import { createEffectEndpointContractHash, ensureLeadingSlash, normalizeEffectPrefix } from "../../runtime/effect/endpoint-contracts.mjs";
|
|
5
|
-
const DEFAULT_REQUEST_CREATOR = '@modern-js/plugin-bff/client';
|
|
6
|
-
const EFFECT_CLIENT_RUNTIME_IMPORT = '@modern-js/plugin-bff/effect-client-runtime';
|
|
7
|
-
function isAbsoluteUrl(value) {
|
|
8
|
-
try {
|
|
9
|
-
new URL(value);
|
|
10
|
-
return true;
|
|
11
|
-
} catch {
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
function resolveBatchEndpoint(prefix, endpoint) {
|
|
16
|
-
const value = void 0 === endpoint || '' === endpoint ? '/_data/batch' : endpoint;
|
|
17
|
-
if (isAbsoluteUrl(value)) return value;
|
|
18
|
-
const normalizedPrefix = normalizeEffectPrefix(prefix);
|
|
19
|
-
const normalizedEndpoint = ensureLeadingSlash(value);
|
|
20
|
-
if ('' === normalizedPrefix) return normalizedEndpoint;
|
|
21
|
-
if (normalizedEndpoint === normalizedPrefix || normalizedEndpoint.startsWith(`${normalizedPrefix}/`)) return normalizedEndpoint;
|
|
22
|
-
return `${normalizedPrefix}${'/' === normalizedEndpoint ? '' : normalizedEndpoint}`;
|
|
23
|
-
}
|
|
24
|
-
function getPackageInfo(appDir) {
|
|
25
|
-
try {
|
|
26
|
-
const packageJsonPath = upath.resolve(appDir, './package.json');
|
|
27
|
-
const packageJson = fs.readJSONSync(packageJsonPath);
|
|
28
|
-
return {
|
|
29
|
-
name: packageJson.name,
|
|
30
|
-
version: packageJson.version
|
|
31
|
-
};
|
|
32
|
-
} catch {
|
|
33
|
-
return {};
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
function renderEffectClientCode(endpoints, options) {
|
|
37
|
-
const requestCreator = options.requestCreator || DEFAULT_REQUEST_CREATOR;
|
|
38
|
-
const httpMethodDecider = options.httpMethodDecider || 'functionName';
|
|
39
|
-
const packageInfo = getPackageInfo(options.appDir);
|
|
40
|
-
const packageName = packageInfo.name;
|
|
41
|
-
const dataPlatformAppNamespace = void 0 === packageName || '' === packageName ? 'unknown-app' : packageName;
|
|
42
|
-
const requestId = 'bundle' === options.target ? void 0 !== packageName && '' !== packageName ? packageName : void 0 : void 0;
|
|
43
|
-
const normalizedRequestId = void 0 === requestId || '' === requestId ? 'default' : requestId;
|
|
44
|
-
const operationVersion = deriveOperationVersion(packageInfo.version);
|
|
45
|
-
const batchConfig = options.dataPlatformBatch;
|
|
46
|
-
const batchEndpoint = resolveBatchEndpoint(options.prefix, batchConfig?.endpoint);
|
|
47
|
-
const manifest = {
|
|
48
|
-
endpoints: endpoints.map((endpoint)=>({
|
|
49
|
-
apiId: endpoint.apiId,
|
|
50
|
-
group: endpoint.groupName,
|
|
51
|
-
endpoint: endpoint.endpointName,
|
|
52
|
-
method: endpoint.method,
|
|
53
|
-
routePath: endpoint.routePath,
|
|
54
|
-
schemaHash: createEffectEndpointContractHash(endpoint, normalizedRequestId),
|
|
55
|
-
operationVersion
|
|
56
|
-
}))
|
|
57
|
-
};
|
|
58
|
-
const config = {
|
|
59
|
-
appNamespace: dataPlatformAppNamespace,
|
|
60
|
-
...void 0 !== requestId && '' !== requestId ? {
|
|
61
|
-
requestId
|
|
62
|
-
} : {},
|
|
63
|
-
port: options.port,
|
|
64
|
-
useEnvPort: 'server' === options.target,
|
|
65
|
-
defaultOrigin: `http://localhost:${String(options.port)}`,
|
|
66
|
-
httpMethodDecider,
|
|
67
|
-
batch: {
|
|
68
|
-
enabled: batchConfig?.enabled ?? true,
|
|
69
|
-
endpoint: batchEndpoint,
|
|
70
|
-
flushIntervalMs: batchConfig?.flushIntervalMs ?? 8,
|
|
71
|
-
maxBatchSize: batchConfig?.maxBatchSize ?? 16,
|
|
72
|
-
maxBatchBytes: batchConfig?.maxBatchBytes ?? 65536,
|
|
73
|
-
requestTimeoutMs: batchConfig?.requestTimeoutMs ?? 10000,
|
|
74
|
-
allowedMethods: batchConfig?.allowedMethods !== void 0 && batchConfig.allowedMethods.length > 0 ? batchConfig.allowedMethods : [
|
|
75
|
-
'GET'
|
|
76
|
-
]
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
return `import * as __requestRuntime from ${JSON.stringify(requestCreator)};
|
|
80
|
-
import { createGeneratedEffectClient } from ${JSON.stringify(EFFECT_CLIENT_RUNTIME_IMPORT)};
|
|
81
|
-
|
|
82
|
-
const __manifest = ${JSON.stringify(manifest, null, 2)};
|
|
83
|
-
|
|
84
|
-
const __config = ${JSON.stringify(config, null, 2)};
|
|
85
|
-
|
|
86
|
-
const __generated = createGeneratedEffectClient(__manifest, __config, __requestRuntime);
|
|
87
|
-
|
|
88
|
-
const client = __generated.client;
|
|
89
|
-
const operationManifest = __generated.operationManifest;
|
|
90
|
-
const createEffectRequestContext = __generated.createEffectRequestContext;
|
|
91
|
-
const apiModule = {
|
|
92
|
-
client,
|
|
93
|
-
operationManifest,
|
|
94
|
-
createEffectRequestContext,
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
export { client, createEffectRequestContext, operationManifest };
|
|
98
|
-
export default apiModule;
|
|
99
|
-
`;
|
|
100
|
-
}
|
|
101
|
-
function renderClientShape(endpoints, valueType) {
|
|
102
|
-
if (0 === endpoints.length) return `Record<string, Record<string, ${valueType}>>`;
|
|
103
|
-
const groups = new Map();
|
|
104
|
-
for (const endpoint of endpoints){
|
|
105
|
-
const group = groups.get(endpoint.groupName) || [];
|
|
106
|
-
group.push(endpoint.endpointName);
|
|
107
|
-
groups.set(endpoint.groupName, group);
|
|
108
|
-
}
|
|
109
|
-
const groupEntries = [
|
|
110
|
-
...groups.entries()
|
|
111
|
-
].map(([groupName, names])=>{
|
|
112
|
-
const endpointEntries = names.map((name)=>` ${JSON.stringify(name)}: ${valueType};`).join('\n');
|
|
113
|
-
return ` ${JSON.stringify(groupName)}: {\n${endpointEntries}\n };`;
|
|
114
|
-
});
|
|
115
|
-
return `{\n${groupEntries.join('\n')}\n}`;
|
|
116
|
-
}
|
|
117
|
-
function renderEffectClientDeclaration(endpoints = []) {
|
|
118
|
-
return `export type EffectClientOperation = (
|
|
119
|
-
request?: unknown,
|
|
120
|
-
) => Promise<unknown>;
|
|
121
|
-
export type EffectClientGroup = Record<string, EffectClientOperation>;
|
|
122
|
-
export type EffectClient = Record<string, EffectClientGroup>;
|
|
123
|
-
export type EffectOperationDescriptor = {
|
|
124
|
-
appNamespace: string;
|
|
125
|
-
apiId: string;
|
|
126
|
-
group: string;
|
|
127
|
-
endpoint: string;
|
|
128
|
-
operationId: string;
|
|
129
|
-
routePath: string;
|
|
130
|
-
method: string;
|
|
131
|
-
operationVersion: number;
|
|
132
|
-
schemaHash: string;
|
|
133
|
-
version: number;
|
|
134
|
-
};
|
|
135
|
-
export type EffectOperationManifest = Record<
|
|
136
|
-
string,
|
|
137
|
-
Record<string, EffectOperationDescriptor>
|
|
138
|
-
>;
|
|
139
|
-
export type EffectOperationContext = {
|
|
140
|
-
requestId?: string;
|
|
141
|
-
operationId?: string;
|
|
142
|
-
routePath?: string;
|
|
143
|
-
method?: string;
|
|
144
|
-
schemaHash?: string;
|
|
145
|
-
operationVersion?: number;
|
|
146
|
-
locale?: string;
|
|
147
|
-
traceparent?: string;
|
|
148
|
-
traceId?: string;
|
|
149
|
-
spanId?: string;
|
|
150
|
-
source?: string;
|
|
151
|
-
scope?: Record<string, unknown>;
|
|
152
|
-
sessionClaims?: Record<string, unknown>;
|
|
153
|
-
attributes?: Record<string, unknown>;
|
|
154
|
-
};
|
|
155
|
-
export type EffectRequestContext = {
|
|
156
|
-
headers?: Record<string, string>;
|
|
157
|
-
locale?: string;
|
|
158
|
-
operationContext?: EffectOperationContext;
|
|
159
|
-
traceparent?: string;
|
|
160
|
-
traceId?: string;
|
|
161
|
-
spanId?: string;
|
|
162
|
-
};
|
|
163
|
-
export type GeneratedEffectClient = ${renderClientShape(endpoints, 'EffectClientOperation')};
|
|
164
|
-
export type GeneratedEffectOperationManifest = ${renderClientShape(endpoints, "EffectOperationDescriptor")};
|
|
165
|
-
|
|
166
|
-
export declare const client: GeneratedEffectClient;
|
|
167
|
-
export declare const createEffectRequestContext: (
|
|
168
|
-
requestContext: Record<string, unknown>,
|
|
169
|
-
) => EffectRequestContext;
|
|
170
|
-
export declare const operationManifest: GeneratedEffectOperationManifest;
|
|
171
|
-
declare const apiModule: {
|
|
172
|
-
client: GeneratedEffectClient;
|
|
173
|
-
createEffectRequestContext: typeof createEffectRequestContext;
|
|
174
|
-
operationManifest: GeneratedEffectOperationManifest;
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
export default apiModule;
|
|
178
|
-
`;
|
|
179
|
-
}
|
|
180
|
-
export { renderEffectClientCode, renderEffectClientDeclaration };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import __rslib_shim_module__ from "node:module";
|
|
2
|
-
const require = /*#__PURE__*/ __rslib_shim_module__.createRequire(/*#__PURE__*/ (()=>import.meta.url)());
|
|
3
|
-
import { compatibleRequire, upath } from "@modern-js/utils";
|
|
4
|
-
import { extractHttpApiFromModule } from "../../runtime/effect/endpoint-contracts.mjs";
|
|
5
|
-
import { loadEffectSourceModule } from "../effectSourceLoader.mjs";
|
|
6
|
-
let httpApiRuntimePromise;
|
|
7
|
-
function isRecord(value) {
|
|
8
|
-
return 'object' == typeof value && null !== value;
|
|
9
|
-
}
|
|
10
|
-
function isHttpApiRuntime(value) {
|
|
11
|
-
return isRecord(value) && 'function' == typeof value.isHttpApi && 'function' == typeof value.reflect;
|
|
12
|
-
}
|
|
13
|
-
function getHttpApiRuntime() {
|
|
14
|
-
if (void 0 === httpApiRuntimePromise) httpApiRuntimePromise = compatibleRequire('effect/unstable/httpapi', false).catch((error)=>{
|
|
15
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
16
|
-
if (!message.includes("Cannot find module 'effect/unstable/httpapi'")) throw error;
|
|
17
|
-
const effectPackageJson = require.resolve('effect/package.json');
|
|
18
|
-
const effectHttpApiRuntimePath = upath.join(upath.dirname(effectPackageJson), 'dist', 'unstable', 'httpapi', 'index.js');
|
|
19
|
-
return compatibleRequire(effectHttpApiRuntimePath, false);
|
|
20
|
-
}).then((mod)=>{
|
|
21
|
-
if (isRecord(mod) && isHttpApiRuntime(mod.HttpApi)) return mod.HttpApi;
|
|
22
|
-
throw new Error('[BFF][Effect] Unable to resolve HttpApi runtime from effect/unstable/httpapi.');
|
|
23
|
-
});
|
|
24
|
-
return httpApiRuntimePromise;
|
|
25
|
-
}
|
|
26
|
-
function loadEffectApi(options) {
|
|
27
|
-
return getHttpApiRuntime().then((httpApiRuntime)=>loadEffectSourceModule(options).then((mod)=>extractHttpApiFromModule(mod, httpApiRuntime.isHttpApi)));
|
|
28
|
-
}
|
|
29
|
-
export { getHttpApiRuntime, loadEffectApi };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "node:module";
|
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
import "node:module";
|
|
2
|
-
import node_crypto from "node:crypto";
|
|
3
|
-
import node_fs from "node:fs";
|
|
4
|
-
import { builtinModules, createRequire } from "node:module";
|
|
5
|
-
import node_path from "node:path";
|
|
6
|
-
import { pathToFileURL } from "node:url";
|
|
7
|
-
import { build, transform } from "esbuild";
|
|
8
|
-
const dynamicImport = new Function('specifier', 'return import(specifier)');
|
|
9
|
-
const SOURCE_LOADERS = new Map([
|
|
10
|
-
[
|
|
11
|
-
'.js',
|
|
12
|
-
'js'
|
|
13
|
-
],
|
|
14
|
-
[
|
|
15
|
-
'.jsx',
|
|
16
|
-
'jsx'
|
|
17
|
-
],
|
|
18
|
-
[
|
|
19
|
-
'.mjs',
|
|
20
|
-
'js'
|
|
21
|
-
],
|
|
22
|
-
[
|
|
23
|
-
'.cjs',
|
|
24
|
-
'js'
|
|
25
|
-
],
|
|
26
|
-
[
|
|
27
|
-
'.ts',
|
|
28
|
-
'ts'
|
|
29
|
-
],
|
|
30
|
-
[
|
|
31
|
-
'.tsx',
|
|
32
|
-
'tsx'
|
|
33
|
-
],
|
|
34
|
-
[
|
|
35
|
-
'.mts',
|
|
36
|
-
'ts'
|
|
37
|
-
],
|
|
38
|
-
[
|
|
39
|
-
'.cts',
|
|
40
|
-
'ts'
|
|
41
|
-
]
|
|
42
|
-
]);
|
|
43
|
-
function sourceLoader(args) {
|
|
44
|
-
return SOURCE_LOADERS.get(node_path.extname(args.path).toLowerCase());
|
|
45
|
-
}
|
|
46
|
-
function preserveSourceModuleSemantics() {
|
|
47
|
-
return {
|
|
48
|
-
name: 'modern-js-effect-source-semantics',
|
|
49
|
-
setup (buildApi) {
|
|
50
|
-
buildApi.onLoad({
|
|
51
|
-
filter: /\.[cm]?[jt]sx?$/
|
|
52
|
-
}, async (args)=>{
|
|
53
|
-
const loader = sourceLoader(args);
|
|
54
|
-
if (!loader) return;
|
|
55
|
-
const source = await node_fs.promises.readFile(args.path, 'utf8');
|
|
56
|
-
const compiled = await transform(source, {
|
|
57
|
-
define: {
|
|
58
|
-
'import.meta.url': JSON.stringify(pathToFileURL(args.path).href)
|
|
59
|
-
},
|
|
60
|
-
jsx: 'automatic',
|
|
61
|
-
loader,
|
|
62
|
-
sourcefile: args.path,
|
|
63
|
-
target: 'node20'
|
|
64
|
-
});
|
|
65
|
-
return {
|
|
66
|
-
contents: compiled.code,
|
|
67
|
-
loader: 'js',
|
|
68
|
-
resolveDir: node_path.dirname(args.path)
|
|
69
|
-
};
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
const nodeBuiltins = new Set([
|
|
75
|
-
...builtinModules,
|
|
76
|
-
...builtinModules.map((name)=>`node:${name}`)
|
|
77
|
-
]);
|
|
78
|
-
const dependencyResolutionMarker = 'modern-js-effect-dependency-resolution';
|
|
79
|
-
async function isEsmOnlyFile(filename) {
|
|
80
|
-
const extension = node_path.extname(filename).toLowerCase();
|
|
81
|
-
if ('.mjs' === extension || '.mts' === extension) return true;
|
|
82
|
-
if ('.cjs' === extension || '.cts' === extension) return false;
|
|
83
|
-
let directory = node_path.dirname(filename);
|
|
84
|
-
while(true){
|
|
85
|
-
const packagePath = node_path.join(directory, 'package.json');
|
|
86
|
-
try {
|
|
87
|
-
const packageJson = JSON.parse(await node_fs.promises.readFile(packagePath, 'utf8'));
|
|
88
|
-
return 'module' === packageJson.type;
|
|
89
|
-
} catch (error) {
|
|
90
|
-
if (!error || 'object' != typeof error || !('code' in error) || 'ENOENT' !== error.code) throw error;
|
|
91
|
-
}
|
|
92
|
-
const parent = node_path.dirname(directory);
|
|
93
|
-
if (parent === directory) return false;
|
|
94
|
-
directory = parent;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
function isBareSpecifier(specifier) {
|
|
98
|
-
return !specifier.startsWith('.') && !specifier.startsWith('/') && !node_path.isAbsolute(specifier);
|
|
99
|
-
}
|
|
100
|
-
function externalizeInstalledDependencies(options) {
|
|
101
|
-
const runtimeRequire = createRequire(node_path.join(options.runtimeResolveDir, '__modern_effect_entry.cjs'));
|
|
102
|
-
return {
|
|
103
|
-
name: 'modern-js-effect-installed-dependencies',
|
|
104
|
-
setup (buildApi) {
|
|
105
|
-
buildApi.onResolve({
|
|
106
|
-
filter: /.*/
|
|
107
|
-
}, async (args)=>{
|
|
108
|
-
if (!isBareSpecifier(args.path) || nodeBuiltins.has(args.path) || args.pluginData?.[dependencyResolutionMarker] === true) return nodeBuiltins.has(args.path) ? {
|
|
109
|
-
external: true,
|
|
110
|
-
path: args.path
|
|
111
|
-
} : void 0;
|
|
112
|
-
const resolution = await buildApi.resolve(args.path, {
|
|
113
|
-
importer: args.importer,
|
|
114
|
-
kind: args.kind,
|
|
115
|
-
namespace: args.namespace,
|
|
116
|
-
pluginData: {
|
|
117
|
-
...args.pluginData,
|
|
118
|
-
[dependencyResolutionMarker]: true
|
|
119
|
-
},
|
|
120
|
-
resolveDir: args.resolveDir
|
|
121
|
-
});
|
|
122
|
-
if (resolution.errors.length > 0) return {
|
|
123
|
-
external: true,
|
|
124
|
-
path: args.path
|
|
125
|
-
};
|
|
126
|
-
if (resolution.external || !resolution.path) return {
|
|
127
|
-
external: true,
|
|
128
|
-
path: args.path
|
|
129
|
-
};
|
|
130
|
-
const realPath = await node_fs.promises.realpath(resolution.path).catch(()=>resolution.path);
|
|
131
|
-
if (realPath.includes(`${node_path.sep}node_modules${node_path.sep}`)) {
|
|
132
|
-
const runtimeResolution = await buildApi.resolve(args.path, {
|
|
133
|
-
importer: '',
|
|
134
|
-
kind: args.kind,
|
|
135
|
-
namespace: 'file',
|
|
136
|
-
pluginData: {
|
|
137
|
-
[dependencyResolutionMarker]: true
|
|
138
|
-
},
|
|
139
|
-
resolveDir: options.runtimeResolveDir
|
|
140
|
-
});
|
|
141
|
-
if (0 === runtimeResolution.errors.length && runtimeResolution.path) {
|
|
142
|
-
if ('cjs' === options.format) {
|
|
143
|
-
let requiredPath;
|
|
144
|
-
try {
|
|
145
|
-
requiredPath = runtimeRequire.resolve(args.path);
|
|
146
|
-
} catch {
|
|
147
|
-
requiredPath = runtimeResolution.path;
|
|
148
|
-
}
|
|
149
|
-
if (await isEsmOnlyFile(requiredPath)) return {
|
|
150
|
-
namespace: resolution.namespace,
|
|
151
|
-
path: resolution.path,
|
|
152
|
-
pluginData: resolution.pluginData,
|
|
153
|
-
sideEffects: resolution.sideEffects,
|
|
154
|
-
suffix: resolution.suffix,
|
|
155
|
-
warnings: resolution.warnings
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
return {
|
|
159
|
-
external: true,
|
|
160
|
-
path: args.path
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
return {
|
|
165
|
-
namespace: resolution.namespace,
|
|
166
|
-
path: resolution.path,
|
|
167
|
-
pluginData: resolution.pluginData,
|
|
168
|
-
sideEffects: resolution.sideEffects,
|
|
169
|
-
suffix: resolution.suffix,
|
|
170
|
-
warnings: resolution.warnings
|
|
171
|
-
};
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
async function bundleEffectEntryForNode(options) {
|
|
177
|
-
await build({
|
|
178
|
-
absWorkingDir: options.appDir,
|
|
179
|
-
allowOverwrite: true,
|
|
180
|
-
bundle: true,
|
|
181
|
-
entryPoints: [
|
|
182
|
-
options.entryPath
|
|
183
|
-
],
|
|
184
|
-
format: options.format,
|
|
185
|
-
logLevel: 'silent',
|
|
186
|
-
outfile: options.entryPath,
|
|
187
|
-
platform: 'node',
|
|
188
|
-
plugins: [
|
|
189
|
-
externalizeInstalledDependencies({
|
|
190
|
-
format: options.format,
|
|
191
|
-
runtimeResolveDir: options.appDir
|
|
192
|
-
}),
|
|
193
|
-
preserveSourceModuleSemantics()
|
|
194
|
-
],
|
|
195
|
-
target: 'node20'
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
function isWatchableInput(filename) {
|
|
199
|
-
return !filename.includes(`${node_path.sep}node_modules${node_path.sep}`) && (SOURCE_LOADERS.has(node_path.extname(filename).toLowerCase()) || '.json' === node_path.extname(filename).toLowerCase());
|
|
200
|
-
}
|
|
201
|
-
function normalizeImportedModule(module) {
|
|
202
|
-
if (!module || 'object' != typeof module) return module;
|
|
203
|
-
const namespace = module;
|
|
204
|
-
const commonJsModule = namespace.default;
|
|
205
|
-
if (1 === Object.keys(namespace).length && null !== commonJsModule && 'object' == typeof commonJsModule && true === commonJsModule.__esModule) return commonJsModule;
|
|
206
|
-
return module;
|
|
207
|
-
}
|
|
208
|
-
async function loadEffectBuiltModule(resourcePath) {
|
|
209
|
-
const canonicalPath = await node_fs.promises.realpath(node_path.resolve(resourcePath));
|
|
210
|
-
if (!await isEsmOnlyFile(canonicalPath)) return createRequire(canonicalPath)(canonicalPath);
|
|
211
|
-
return normalizeImportedModule(await dynamicImport(pathToFileURL(canonicalPath).href));
|
|
212
|
-
}
|
|
213
|
-
async function loadEffectSourceModule(options) {
|
|
214
|
-
const resourcePath = node_path.resolve(options.resourcePath);
|
|
215
|
-
const appDir = node_path.resolve(options.appDir ?? node_path.dirname(resourcePath));
|
|
216
|
-
const tsconfigPath = node_path.join(appDir, 'tsconfig.json');
|
|
217
|
-
const cacheDirectory = node_path.join(appDir, 'node_modules', '.cache', 'modern-js', 'effect-source-loader');
|
|
218
|
-
const outputName = node_crypto.createHash('sha256').update(resourcePath).digest('hex').slice(0, 24);
|
|
219
|
-
const outputPath = node_path.join(cacheDirectory, `${outputName}.mjs`);
|
|
220
|
-
await node_fs.promises.mkdir(cacheDirectory, {
|
|
221
|
-
recursive: true
|
|
222
|
-
});
|
|
223
|
-
const result = await build({
|
|
224
|
-
absWorkingDir: appDir,
|
|
225
|
-
banner: {
|
|
226
|
-
js: `import { createRequire as __modernCreateEffectRequire } from 'node:module'; const require = __modernCreateEffectRequire(${JSON.stringify(pathToFileURL(resourcePath).href)});`
|
|
227
|
-
},
|
|
228
|
-
bundle: true,
|
|
229
|
-
entryPoints: [
|
|
230
|
-
resourcePath
|
|
231
|
-
],
|
|
232
|
-
format: 'esm',
|
|
233
|
-
jsx: 'automatic',
|
|
234
|
-
logLevel: 'silent',
|
|
235
|
-
metafile: true,
|
|
236
|
-
outfile: outputPath,
|
|
237
|
-
platform: 'node',
|
|
238
|
-
plugins: [
|
|
239
|
-
externalizeInstalledDependencies({
|
|
240
|
-
format: 'esm',
|
|
241
|
-
runtimeResolveDir: appDir
|
|
242
|
-
}),
|
|
243
|
-
preserveSourceModuleSemantics()
|
|
244
|
-
],
|
|
245
|
-
sourcemap: 'inline',
|
|
246
|
-
target: 'node20',
|
|
247
|
-
tsconfig: node_fs.existsSync(tsconfigPath) ? tsconfigPath : void 0
|
|
248
|
-
});
|
|
249
|
-
for (const input of Object.keys(result.metafile.inputs)){
|
|
250
|
-
const dependency = node_path.isAbsolute(input) ? node_path.normalize(input) : node_path.resolve(appDir, input);
|
|
251
|
-
if (isWatchableInput(dependency)) options.onDependency?.(dependency);
|
|
252
|
-
}
|
|
253
|
-
const output = await node_fs.promises.readFile(outputPath);
|
|
254
|
-
const revision = node_crypto.createHash('sha256').update(output).digest('hex');
|
|
255
|
-
return normalizeImportedModule(await dynamicImport(`${pathToFileURL(outputPath).href}?v=${revision}`));
|
|
256
|
-
}
|
|
257
|
-
export { bundleEffectEntryForNode, loadEffectBuiltModule, loadEffectSourceModule };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { DataBatchTransportOptions, DataTransportRequestInfo } from '../types';
|
|
2
|
-
type DataBatchFetch = NonNullable<DataBatchTransportOptions['fetch']>;
|
|
3
|
-
type CreateBatchTransportQueueOptions = {
|
|
4
|
-
options: DataBatchTransportOptions;
|
|
5
|
-
baseFetch: DataBatchFetch;
|
|
6
|
-
};
|
|
7
|
-
export declare function createBatchTransportQueue({ options, baseFetch, }: CreateBatchTransportQueueOptions): (input: DataTransportRequestInfo, init?: RequestInit) => Promise<any>;
|
|
8
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare function toHeaderRecord(headers: HeadersInit | undefined): Record<string, string>;
|
|
2
|
-
export declare function measureTextBytes(value: string): number;
|
|
3
|
-
export declare function createBatchId(): string;
|
|
4
|
-
export declare function normalizeMethod(method: string | undefined): string;
|
|
5
|
-
export declare function toRequestBody(initBody: BodyInit | null | undefined): string | undefined;
|
|
6
|
-
export declare function shouldBatchRequest(input: {
|
|
7
|
-
method: string;
|
|
8
|
-
body: string | undefined;
|
|
9
|
-
headers: Record<string, string>;
|
|
10
|
-
allowedMethods: Set<string>;
|
|
11
|
-
batchEndpoint: string;
|
|
12
|
-
requestUrl: URL;
|
|
13
|
-
}): boolean;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { DataBatchTransportEvent, DataBatchTransportTelemetryAttributes } from '../types';
|
|
2
|
-
export declare const DATA_BATCH_TRANSPORT_OTEL_EVENT = "modernjs.data.batch";
|
|
3
|
-
export declare function createDataBatchTransportTelemetryAttributes(event: DataBatchTransportEvent): DataBatchTransportTelemetryAttributes;
|
|
4
|
-
export declare function emitDataBatchTransportEvent(onEvent: ((event: DataBatchTransportEvent) => void) | undefined, event: DataBatchTransportEvent): void;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { DataTransportRequestInfo } from '../types';
|
|
2
|
-
export declare function resolveRuntimeOrigin(): string;
|
|
3
|
-
export declare function toAbsoluteUrl(input: DataTransportRequestInfo): URL;
|
|
4
|
-
export declare function normalizeBatchEndpoint(requestUrl: URL, endpoint: string | undefined): URL;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { DataBatchTransportOptions } from './types';
|
|
2
|
-
export { createDataBatchTransportTelemetryAttributes, DATA_BATCH_TRANSPORT_OTEL_EVENT, emitDataBatchTransportEvent, } from './batch/telemetry';
|
|
3
|
-
export declare function createDataBatchTransport(options?: DataBatchTransportOptions): (input: import("./types").DataTransportRequestInfo, init?: RequestInit) => Promise<any>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { CacheScope, DataRequestMode, OperationDescriptor, RequestEnvelope, SelectionPlan } from './types';
|
|
2
|
-
export declare function isPlainObject(value: unknown): value is Record<string, unknown>;
|
|
3
|
-
export declare function stableStringify(value: unknown): string;
|
|
4
|
-
export declare function encodeRequestEnvelopeHeader(envelope: RequestEnvelope): string;
|
|
5
|
-
export declare function decodeRequestEnvelopeHeader(value: string): RequestEnvelope | null;
|
|
6
|
-
export declare function hashString(value: string): string;
|
|
7
|
-
export declare function sanitizeSegment(segment: string): string;
|
|
8
|
-
export declare function normalizeOrigin(origin: string): string;
|
|
9
|
-
export declare function createOperationId(input: OperationDescriptor): string;
|
|
10
|
-
export declare function buildScopeKey(scope: CacheScope): string;
|
|
11
|
-
export declare function buildQueryKey(input: {
|
|
12
|
-
operationId: string;
|
|
13
|
-
scopeKey: string;
|
|
14
|
-
requestMode?: DataRequestMode;
|
|
15
|
-
requestInput?: unknown;
|
|
16
|
-
selectionPlan?: SelectionPlan;
|
|
17
|
-
}): string;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { CacheScope, InvalidationEvent, InvalidationSubscriber, OperationDescriptor } from './types';
|
|
2
|
-
export declare function createInvalidationEvent(input: {
|
|
3
|
-
sourceOperation: OperationDescriptor;
|
|
4
|
-
sourceScope: CacheScope;
|
|
5
|
-
targetNamespaces?: string[];
|
|
6
|
-
targetOperations?: OperationDescriptor[];
|
|
7
|
-
}): InvalidationEvent;
|
|
8
|
-
export declare function shouldApplyInvalidation(event: InvalidationEvent, subscriber: InvalidationSubscriber): boolean;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { TraceContext } from './types';
|
|
2
|
-
export declare function parseTraceparentHeader(header: string): TraceContext | null;
|
|
3
|
-
export declare function formatTraceparentHeader(trace: TraceContext): string;
|
|
4
|
-
export declare function deriveChildTraceContext(parent: TraceContext, childSpanId: string): TraceContext;
|