@bleedingdev/modern-js-plugin-bff 3.5.0-ultramodern.35 → 3.5.0-ultramodern.37
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/runtime/data-platform/batch/queue.js +2 -5
- package/dist/cjs/runtime/data-platform/batch/response.js +0 -3
- package/dist/cjs/runtime/effect/dispatch.js +2 -17
- package/dist/cjs/runtime/effect/endpoint-contracts.js +0 -9
- package/dist/cjs/runtime/effect/entry-shape.js +0 -3
- package/dist/esm/runtime/data-platform/batch/queue.mjs +1 -1
- package/dist/esm/runtime/data-platform/batch/response.mjs +1 -1
- package/dist/esm/runtime/effect/dispatch.mjs +1 -1
- package/dist/esm/runtime/effect/endpoint-contracts.mjs +1 -1
- package/dist/esm/runtime/effect/entry-shape.mjs +1 -1
- package/dist/esm/runtime/effect/handler/http.mjs +3 -3
- package/dist/esm/runtime/effect/handler/rpc.mjs +3 -3
- package/dist/esm/runtime/effect/handler/types.mjs +2 -2
- package/dist/esm/runtime/effect/handler.mjs +6 -6
- package/dist/esm/runtime/effect/index.mjs +2 -2
- package/dist/esm/runtime/effect/module.mjs +2 -2
- package/dist/esm/runtime/effect-client/index.mjs +22 -22
- package/dist/esm-node/runtime/data-platform/batch/queue.mjs +1 -1
- package/dist/esm-node/runtime/data-platform/batch/response.mjs +1 -1
- package/dist/esm-node/runtime/effect/dispatch.mjs +1 -1
- package/dist/esm-node/runtime/effect/endpoint-contracts.mjs +1 -1
- package/dist/esm-node/runtime/effect/entry-shape.mjs +1 -1
- package/dist/esm-node/runtime/effect/handler/http.mjs +3 -3
- package/dist/esm-node/runtime/effect/handler/rpc.mjs +3 -3
- package/dist/esm-node/runtime/effect/handler/types.mjs +2 -2
- package/dist/esm-node/runtime/effect/handler.mjs +6 -6
- package/dist/esm-node/runtime/effect/index.mjs +2 -2
- package/dist/esm-node/runtime/effect/module.mjs +2 -2
- package/dist/esm-node/runtime/effect-client/index.mjs +22 -22
- package/dist/types/runtime/data-platform/batch/queue.d.ts +1 -18
- package/dist/types/runtime/data-platform/batch/response.d.ts +1 -2
- package/dist/types/runtime/effect/adapter/handler.d.ts +4 -1
- package/dist/types/runtime/effect/dispatch.d.ts +2 -6
- package/dist/types/runtime/effect/edge.d.ts +0 -1
- package/dist/types/runtime/effect/endpoint-contracts.d.ts +3 -5
- package/dist/types/runtime/effect/entry-shape.d.ts +4 -4
- package/dist/types/runtime/effect/module.d.ts +3 -2
- package/package.json +23 -29
|
@@ -28,8 +28,7 @@ var __webpack_require__ = {};
|
|
|
28
28
|
var __webpack_exports__ = {};
|
|
29
29
|
__webpack_require__.r(__webpack_exports__);
|
|
30
30
|
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
-
createBatchTransportQueue: ()=>createBatchTransportQueue
|
|
32
|
-
ensureBucket: ()=>ensureBucket
|
|
31
|
+
createBatchTransportQueue: ()=>createBatchTransportQueue
|
|
33
32
|
});
|
|
34
33
|
const external_codec_js_namespaceObject = require("../codec.js");
|
|
35
34
|
const external_types_js_namespaceObject = require("../types.js");
|
|
@@ -277,10 +276,8 @@ function createBatchTransportQueue({ options, baseFetch }) {
|
|
|
277
276
|
};
|
|
278
277
|
}
|
|
279
278
|
exports.createBatchTransportQueue = __webpack_exports__.createBatchTransportQueue;
|
|
280
|
-
exports.ensureBucket = __webpack_exports__.ensureBucket;
|
|
281
279
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
282
|
-
"createBatchTransportQueue"
|
|
283
|
-
"ensureBucket"
|
|
280
|
+
"createBatchTransportQueue"
|
|
284
281
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
285
282
|
Object.defineProperty(exports, '__esModule', {
|
|
286
283
|
value: true
|
|
@@ -28,7 +28,6 @@ var __webpack_require__ = {};
|
|
|
28
28
|
var __webpack_exports__ = {};
|
|
29
29
|
__webpack_require__.r(__webpack_exports__);
|
|
30
30
|
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
-
isBatchResponseItem: ()=>isBatchResponseItem,
|
|
32
31
|
isBatchResponsePayload: ()=>isBatchResponsePayload,
|
|
33
32
|
parseResponseLikeCreateRequest: ()=>parseResponseLikeCreateRequest
|
|
34
33
|
});
|
|
@@ -54,11 +53,9 @@ async function parseResponseLikeCreateRequest(response) {
|
|
|
54
53
|
if (contentType.includes('image/png')) return response;
|
|
55
54
|
return response.text();
|
|
56
55
|
}
|
|
57
|
-
exports.isBatchResponseItem = __webpack_exports__.isBatchResponseItem;
|
|
58
56
|
exports.isBatchResponsePayload = __webpack_exports__.isBatchResponsePayload;
|
|
59
57
|
exports.parseResponseLikeCreateRequest = __webpack_exports__.parseResponseLikeCreateRequest;
|
|
60
58
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
61
|
-
"isBatchResponseItem",
|
|
62
59
|
"isBatchResponsePayload",
|
|
63
60
|
"parseResponseLikeCreateRequest"
|
|
64
61
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
@@ -28,12 +28,7 @@ var __webpack_require__ = {};
|
|
|
28
28
|
var __webpack_exports__ = {};
|
|
29
29
|
__webpack_require__.r(__webpack_exports__);
|
|
30
30
|
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
-
|
|
32
|
-
createEffectBffMountedRequest: ()=>createEffectBffMountedRequest,
|
|
33
|
-
dispatchEffectBffRequestWithContext: ()=>dispatchEffectBffRequestWithContext,
|
|
34
|
-
matchesEffectBffPrefix: ()=>matchesEffectBffPrefix,
|
|
35
|
-
normalizeEffectBffPrefix: ()=>normalizeEffectBffPrefix,
|
|
36
|
-
removeEffectBffPrefixFromPath: ()=>removeEffectBffPrefixFromPath
|
|
31
|
+
dispatchEffectBffRequestWithContext: ()=>dispatchEffectBffRequestWithContext
|
|
37
32
|
});
|
|
38
33
|
const external_safe_failure_js_namespaceObject = require("../safe-failure.js");
|
|
39
34
|
const external_operation_context_js_namespaceObject = require("./operation-context.js");
|
|
@@ -97,19 +92,9 @@ async function dispatchEffectBffRequestWithContext(handler, request, options) {
|
|
|
97
92
|
return (0, external_safe_failure_js_namespaceObject.createSafeFailureResponse)(error);
|
|
98
93
|
}
|
|
99
94
|
}
|
|
100
|
-
exports.createEffectBffDispatchContext = __webpack_exports__.createEffectBffDispatchContext;
|
|
101
|
-
exports.createEffectBffMountedRequest = __webpack_exports__.createEffectBffMountedRequest;
|
|
102
95
|
exports.dispatchEffectBffRequestWithContext = __webpack_exports__.dispatchEffectBffRequestWithContext;
|
|
103
|
-
exports.matchesEffectBffPrefix = __webpack_exports__.matchesEffectBffPrefix;
|
|
104
|
-
exports.normalizeEffectBffPrefix = __webpack_exports__.normalizeEffectBffPrefix;
|
|
105
|
-
exports.removeEffectBffPrefixFromPath = __webpack_exports__.removeEffectBffPrefixFromPath;
|
|
106
96
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
107
|
-
"
|
|
108
|
-
"createEffectBffMountedRequest",
|
|
109
|
-
"dispatchEffectBffRequestWithContext",
|
|
110
|
-
"matchesEffectBffPrefix",
|
|
111
|
-
"normalizeEffectBffPrefix",
|
|
112
|
-
"removeEffectBffPrefixFromPath"
|
|
97
|
+
"dispatchEffectBffRequestWithContext"
|
|
113
98
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
114
99
|
Object.defineProperty(exports, '__esModule', {
|
|
115
100
|
value: true
|
|
@@ -30,12 +30,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
30
30
|
__webpack_require__.d(__webpack_exports__, {
|
|
31
31
|
collectEffectEndpoints: ()=>collectEffectEndpoints,
|
|
32
32
|
createEffectEndpointContractHash: ()=>createEffectEndpointContractHash,
|
|
33
|
-
createEffectOperationContractSource: ()=>createEffectOperationContractSource,
|
|
34
33
|
ensureLeadingSlash: ()=>ensureLeadingSlash,
|
|
35
34
|
extractHttpApiFromModule: ()=>extractHttpApiFromModule,
|
|
36
|
-
getEffectRoutePath: ()=>getEffectRoutePath,
|
|
37
35
|
normalizeEffectPrefix: ()=>normalizeEffectPrefix,
|
|
38
|
-
resolveEffectApiId: ()=>resolveEffectApiId,
|
|
39
36
|
toOperationContractSources: ()=>toOperationContractSources
|
|
40
37
|
});
|
|
41
38
|
const bff_core_namespaceObject = require("@modern-js/bff-core");
|
|
@@ -102,22 +99,16 @@ function createEffectEndpointContractHash(endpoint, requestId) {
|
|
|
102
99
|
}
|
|
103
100
|
exports.collectEffectEndpoints = __webpack_exports__.collectEffectEndpoints;
|
|
104
101
|
exports.createEffectEndpointContractHash = __webpack_exports__.createEffectEndpointContractHash;
|
|
105
|
-
exports.createEffectOperationContractSource = __webpack_exports__.createEffectOperationContractSource;
|
|
106
102
|
exports.ensureLeadingSlash = __webpack_exports__.ensureLeadingSlash;
|
|
107
103
|
exports.extractHttpApiFromModule = __webpack_exports__.extractHttpApiFromModule;
|
|
108
|
-
exports.getEffectRoutePath = __webpack_exports__.getEffectRoutePath;
|
|
109
104
|
exports.normalizeEffectPrefix = __webpack_exports__.normalizeEffectPrefix;
|
|
110
|
-
exports.resolveEffectApiId = __webpack_exports__.resolveEffectApiId;
|
|
111
105
|
exports.toOperationContractSources = __webpack_exports__.toOperationContractSources;
|
|
112
106
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
113
107
|
"collectEffectEndpoints",
|
|
114
108
|
"createEffectEndpointContractHash",
|
|
115
|
-
"createEffectOperationContractSource",
|
|
116
109
|
"ensureLeadingSlash",
|
|
117
110
|
"extractHttpApiFromModule",
|
|
118
|
-
"getEffectRoutePath",
|
|
119
111
|
"normalizeEffectPrefix",
|
|
120
|
-
"resolveEffectApiId",
|
|
121
112
|
"toOperationContractSources"
|
|
122
113
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
123
114
|
Object.defineProperty(exports, '__esModule', {
|
|
@@ -64,7 +64,6 @@ function createEntryShapeFacts(module, predicates, legacyShape) {
|
|
|
64
64
|
}
|
|
65
65
|
__webpack_require__.d(__webpack_exports__, {
|
|
66
66
|
classifyEffectBffEntryModule: ()=>classifyEffectBffEntryModule,
|
|
67
|
-
isEffectEntryRecord: ()=>isEffectEntryRecord,
|
|
68
67
|
isValidatorAwareHandlerFactory: ()=>isValidatorAwareHandlerFactory
|
|
69
68
|
}, {
|
|
70
69
|
EFFECT_VALIDATOR_AWARE_FACTORY: EFFECT_VALIDATOR_AWARE_FACTORY,
|
|
@@ -72,13 +71,11 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
72
71
|
});
|
|
73
72
|
exports.EFFECT_VALIDATOR_AWARE_FACTORY = __webpack_exports__.EFFECT_VALIDATOR_AWARE_FACTORY;
|
|
74
73
|
exports.classifyEffectBffEntryModule = __webpack_exports__.classifyEffectBffEntryModule;
|
|
75
|
-
exports.isEffectEntryRecord = __webpack_exports__.isEffectEntryRecord;
|
|
76
74
|
exports.isValidatorAwareHandlerFactory = __webpack_exports__.isValidatorAwareHandlerFactory;
|
|
77
75
|
exports.strictEffectApproachMessage = __webpack_exports__.strictEffectApproachMessage;
|
|
78
76
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
79
77
|
"EFFECT_VALIDATOR_AWARE_FACTORY",
|
|
80
78
|
"classifyEffectBffEntryModule",
|
|
81
|
-
"isEffectEntryRecord",
|
|
82
79
|
"isValidatorAwareHandlerFactory",
|
|
83
80
|
"strictEffectApproachMessage"
|
|
84
81
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
@@ -20,4 +20,4 @@ async function parseResponseLikeCreateRequest(response) {
|
|
|
20
20
|
if (contentType.includes('image/png')) return response;
|
|
21
21
|
return response.text();
|
|
22
22
|
}
|
|
23
|
-
export {
|
|
23
|
+
export { isBatchResponsePayload, parseResponseLikeCreateRequest };
|
|
@@ -60,4 +60,4 @@ async function dispatchEffectBffRequestWithContext(handler, request, options) {
|
|
|
60
60
|
return createSafeFailureResponse(error);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
export {
|
|
63
|
+
export { dispatchEffectBffRequestWithContext };
|
|
@@ -60,4 +60,4 @@ async function extractHttpApiFromModule(mod, isHttpApi) {
|
|
|
60
60
|
function createEffectEndpointContractHash(endpoint, requestId) {
|
|
61
61
|
return createOperationContractHash(createEffectOperationContractSource(endpoint), requestId);
|
|
62
62
|
}
|
|
63
|
-
export { collectEffectEndpoints, createEffectEndpointContractHash,
|
|
63
|
+
export { collectEffectEndpoints, createEffectEndpointContractHash, ensureLeadingSlash, extractHttpApiFromModule, normalizeEffectPrefix, toOperationContractSources };
|
|
@@ -33,4 +33,4 @@ function createEntryShapeFacts(module, predicates, legacyShape) {
|
|
|
33
33
|
hasRuntimeLayer
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
export { EFFECT_VALIDATOR_AWARE_FACTORY, classifyEffectBffEntryModule,
|
|
36
|
+
export { EFFECT_VALIDATOR_AWARE_FACTORY, classifyEffectBffEntryModule, isValidatorAwareHandlerFactory, strictEffectApproachMessage };
|
|
@@ -6,11 +6,11 @@ import { createOpenApiLayer } from "./openapi.mjs";
|
|
|
6
6
|
import { getRequestPathname, isRpcRequest } from "./routing.mjs";
|
|
7
7
|
import { createRpcApiHandler, normalizeRpcPath } from "./rpc.mjs";
|
|
8
8
|
import { toEffectServiceContext } from "./types.mjs";
|
|
9
|
-
import * as
|
|
9
|
+
import * as __rspack_external_effect_Layer_69c46453 from "effect/Layer";
|
|
10
10
|
function createHttpApiHandler(options) {
|
|
11
|
-
const apiLayer = options.layer.pipe(
|
|
11
|
+
const apiLayer = options.layer.pipe(__rspack_external_effect_Layer_69c46453.provide(HttpServer.layerServices));
|
|
12
12
|
const openApiLayer = createOpenApiLayer(options.api, options.openapi);
|
|
13
|
-
const mergedLayer = openApiLayer ?
|
|
13
|
+
const mergedLayer = openApiLayer ? __rspack_external_effect_Layer_69c46453.mergeAll(apiLayer, openApiLayer) : apiLayer;
|
|
14
14
|
const httpApiHandler = HttpRouter.toWebHandler(mergedLayer);
|
|
15
15
|
const withDataPlatformValidation = async (request, context)=>{
|
|
16
16
|
const policyDenial = options.validateRequest?.(request);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HttpRouter } from "effect/unstable/http";
|
|
2
2
|
import { RpcServer } from "effect/unstable/rpc";
|
|
3
3
|
import { getRpcSerializationLayer } from "../rpcSerialization.mjs";
|
|
4
|
-
import * as
|
|
4
|
+
import * as __rspack_external_effect_Layer_69c46453 from "effect/Layer";
|
|
5
5
|
function normalizeRpcPath(pathname) {
|
|
6
6
|
if (!pathname || '/' === pathname) return '/rpc';
|
|
7
7
|
if (!pathname.startsWith('/')) return `/${pathname}`;
|
|
@@ -9,14 +9,14 @@ function normalizeRpcPath(pathname) {
|
|
|
9
9
|
}
|
|
10
10
|
function createRpcApiHandler(options) {
|
|
11
11
|
const rpcPath = normalizeRpcPath(options.path);
|
|
12
|
-
const rpcLayer =
|
|
12
|
+
const rpcLayer = __rspack_external_effect_Layer_69c46453.provide(RpcServer.layerHttp({
|
|
13
13
|
group: options.group,
|
|
14
14
|
path: rpcPath,
|
|
15
15
|
protocol: 'http',
|
|
16
16
|
disableTracing: options.disableTracing,
|
|
17
17
|
spanPrefix: options.spanPrefix,
|
|
18
18
|
spanAttributes: options.spanAttributes
|
|
19
|
-
}),
|
|
19
|
+
}), __rspack_external_effect_Layer_69c46453.mergeAll(options.layer, getRpcSerializationLayer(options.serialization)));
|
|
20
20
|
return HttpRouter.toWebHandler(rpcLayer);
|
|
21
21
|
}
|
|
22
22
|
export { createRpcApiHandler, normalizeRpcPath };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
const emptyEffectServiceContext =
|
|
1
|
+
import * as __rspack_external_effect_Context_b3520bd3 from "effect/Context";
|
|
2
|
+
const emptyEffectServiceContext = __rspack_external_effect_Context_b3520bd3.empty();
|
|
3
3
|
const isEffectServiceContext = (context)=>'object' == typeof context && null !== context && 'mapUnsafe' in context;
|
|
4
4
|
const toEffectServiceContext = (context)=>isEffectServiceContext(context) ? context : emptyEffectServiceContext;
|
|
5
5
|
export { toEffectServiceContext };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
1
|
+
import * as __rspack_external_effect_Config_76cfa59d from "effect/Config";
|
|
2
|
+
import * as __rspack_external_effect_Effect_41060786 from "effect/Effect";
|
|
3
|
+
import * as __rspack_external_effect_Layer_69c46453 from "effect/Layer";
|
|
4
|
+
import * as __rspack_external_effect_Option_0498e63a from "effect/Option";
|
|
5
|
+
import * as __rspack_external_effect_Schema_6065f72d from "effect/Schema";
|
|
6
6
|
export * from "effect/unstable/http";
|
|
7
7
|
export * from "effect/unstable/httpapi";
|
|
8
8
|
export * from "effect/unstable/rpc";
|
|
@@ -11,4 +11,4 @@ export { HttpApiBuilder } from "effect/unstable/httpapi";
|
|
|
11
11
|
export { EFFECT_VALIDATOR_AWARE_FACTORY, isValidatorAwareHandlerFactory } from "./entry-shape.mjs";
|
|
12
12
|
export { defineEffectBff, defineEffectRpcBff } from "./handler/definition.mjs";
|
|
13
13
|
export { createHttpApiHandler } from "./handler/http.mjs";
|
|
14
|
-
export {
|
|
14
|
+
export { __rspack_external_effect_Config_76cfa59d as Config, __rspack_external_effect_Effect_41060786 as Effect, __rspack_external_effect_Layer_69c46453 as Layer, __rspack_external_effect_Option_0498e63a as Option, __rspack_external_effect_Schema_6065f72d as Schema };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as __rspack_external__effect_opentelemetry_66324c75 from "@effect/opentelemetry";
|
|
2
2
|
export * from "./backend-federation.mjs";
|
|
3
3
|
export * from "./handler.mjs";
|
|
4
4
|
export { BACKEND_FEDERATION_CONTRACT_VERSION, BACKEND_FEDERATION_EFFECT_EXPOSE, BACKEND_FEDERATION_MANIFEST_FILE, BACKEND_FEDERATION_NODE_ADAPTER_VERSION, createBackendFederationLoadEntryPlugin, createBackendFederationRuntime, loadBackendFederatedEffectApi } from "./backend-federation.mjs";
|
|
5
5
|
export { BackendFederationManifestAdapterError, loadBackendFederatedEffectApiFromManifest, loadBackendFederationManifest, resolveBackendFederationRemoteFromManifest } from "./backend-federation-manifest.mjs";
|
|
6
6
|
export { createEffectOperationContext, runWithEffectContext, useEffectContext, useOperationContext } from "./context.mjs";
|
|
7
7
|
export { createEffectBffEdgeHandler, createEffectBffTestHandler, dispatchEffectBffRequest } from "./edge.mjs";
|
|
8
|
-
export {
|
|
8
|
+
export { __rspack_external__effect_opentelemetry_66324c75 as OpenTelemetry };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { HttpApi } from "effect/unstable/httpapi";
|
|
2
2
|
import { classifyEffectBffEntryModule, isValidatorAwareHandlerFactory, strictEffectApproachMessage } from "./entry-shape.mjs";
|
|
3
3
|
import { createHttpApiHandler } from "./handler.mjs";
|
|
4
|
-
import * as
|
|
4
|
+
import * as __rspack_external_effect_Context_b3520bd3 from "effect/Context";
|
|
5
5
|
function isRequestHandler(value) {
|
|
6
6
|
return 'function' == typeof value;
|
|
7
7
|
}
|
|
8
8
|
function isEffectServiceContext(context) {
|
|
9
9
|
return 'object' == typeof context && null !== context && 'mapUnsafe' in context;
|
|
10
10
|
}
|
|
11
|
-
const emptyEffectServiceContext =
|
|
11
|
+
const emptyEffectServiceContext = __rspack_external_effect_Context_b3520bd3.empty();
|
|
12
12
|
function rejectLegacyEffectModuleShape(options, shape) {
|
|
13
13
|
options.onWarning?.(`${strictEffectApproachMessage} Rejected ${shape}.`);
|
|
14
14
|
return true;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { createRequestContextHeaders } from "@modern-js/create-request";
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
2
|
+
import * as __rspack_external_effect_Effect_41060786 from "effect/Effect";
|
|
3
|
+
import * as __rspack_external_effect_Layer_69c46453 from "effect/Layer";
|
|
4
4
|
import { FetchHttpClient, HttpClient, HttpClientRequest } from "effect/unstable/http";
|
|
5
5
|
import { HttpApi, HttpApiClient, HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/unstable/httpapi";
|
|
6
6
|
import { Rpc, RpcClient, RpcGroup, RpcSchema, RpcSerialization } from "effect/unstable/rpc";
|
|
7
7
|
import { getRpcSerializationLayer } from "../effect/rpcSerialization.mjs";
|
|
8
|
-
import * as
|
|
9
|
-
import * as
|
|
10
|
-
import * as
|
|
11
|
-
import * as
|
|
12
|
-
import * as
|
|
13
|
-
import * as
|
|
14
|
-
class EffectRpcClientError extends
|
|
8
|
+
import * as __rspack_external_effect_Schema_6065f72d from "effect/Schema";
|
|
9
|
+
import * as __rspack_external_effect_unstable_http_HttpClientError_4b9eaee6 from "effect/unstable/http/HttpClientError";
|
|
10
|
+
import * as __rspack_external_effect_Data_2b3f4efb from "effect/Data";
|
|
11
|
+
import * as __rspack_external_effect_Exit_1ca64b33 from "effect/Exit";
|
|
12
|
+
import * as __rspack_external_effect_ManagedRuntime_bfe218e3 from "effect/ManagedRuntime";
|
|
13
|
+
import * as __rspack_external_effect_Scope_f87b0bd6 from "effect/Scope";
|
|
14
|
+
class EffectRpcClientError extends __rspack_external_effect_Data_2b3f4efb.TaggedError('EffectRpcClientError') {
|
|
15
15
|
}
|
|
16
16
|
function isRecord(value) {
|
|
17
17
|
return 'object' == typeof value && null !== value && !Array.isArray(value);
|
|
@@ -52,28 +52,28 @@ function makeEffectHttpApiClient(api, options) {
|
|
|
52
52
|
baseUrl: options?.baseUrl,
|
|
53
53
|
transformClient,
|
|
54
54
|
transformResponse: options?.transformResponse
|
|
55
|
-
}).pipe(
|
|
55
|
+
}).pipe(__rspack_external_effect_Effect_41060786.provide(FetchHttpClient.layer));
|
|
56
56
|
}
|
|
57
57
|
function makeEffectRpcClient(group, options) {
|
|
58
|
-
const protocolLayer =
|
|
58
|
+
const protocolLayer = __rspack_external_effect_Layer_69c46453.provide(RpcClient.layerProtocolHttp({
|
|
59
59
|
url: options.url
|
|
60
|
-
}),
|
|
61
|
-
const middlewareLayer = options.middlewareLayer ??
|
|
62
|
-
const runtimeLayer =
|
|
63
|
-
return
|
|
60
|
+
}), __rspack_external_effect_Layer_69c46453.mergeAll(getRpcSerializationLayer(options.serialization), FetchHttpClient.layer));
|
|
61
|
+
const middlewareLayer = options.middlewareLayer ?? __rspack_external_effect_Layer_69c46453.empty;
|
|
62
|
+
const runtimeLayer = __rspack_external_effect_Layer_69c46453.mergeAll(protocolLayer, middlewareLayer);
|
|
63
|
+
return __rspack_external_effect_Effect_41060786.tryPromise({
|
|
64
64
|
try: async ()=>{
|
|
65
|
-
const runtime =
|
|
66
|
-
const scope = await runtime.runPromise(
|
|
65
|
+
const runtime = __rspack_external_effect_ManagedRuntime_bfe218e3.make(runtimeLayer);
|
|
66
|
+
const scope = await runtime.runPromise(__rspack_external_effect_Scope_f87b0bd6.make());
|
|
67
67
|
try {
|
|
68
68
|
const client = await runtime.runPromise(RpcClient.make(group, {
|
|
69
69
|
flatten: options.flatten
|
|
70
|
-
}).pipe(
|
|
70
|
+
}).pipe(__rspack_external_effect_Effect_41060786.provideService(__rspack_external_effect_Scope_f87b0bd6.Scope, scope)));
|
|
71
71
|
let disposed = false;
|
|
72
72
|
const clientWithDispose = Object.assign(client, {
|
|
73
73
|
dispose: async ()=>{
|
|
74
74
|
if (!disposed) {
|
|
75
75
|
disposed = true;
|
|
76
|
-
await runtime.runPromise(
|
|
76
|
+
await runtime.runPromise(__rspack_external_effect_Scope_f87b0bd6.close(scope, __rspack_external_effect_Exit_1ca64b33["void"]));
|
|
77
77
|
}
|
|
78
78
|
await runtime.dispose();
|
|
79
79
|
}
|
|
@@ -81,7 +81,7 @@ function makeEffectRpcClient(group, options) {
|
|
|
81
81
|
return clientWithDispose;
|
|
82
82
|
} catch (error) {
|
|
83
83
|
try {
|
|
84
|
-
await runtime.runPromise(
|
|
84
|
+
await runtime.runPromise(__rspack_external_effect_Scope_f87b0bd6.close(scope, __rspack_external_effect_Exit_1ca64b33["void"]));
|
|
85
85
|
} catch {}
|
|
86
86
|
try {
|
|
87
87
|
await runtime.dispose();
|
|
@@ -94,5 +94,5 @@ function makeEffectRpcClient(group, options) {
|
|
|
94
94
|
})
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
|
-
const runEffectRequest =
|
|
98
|
-
export { EffectRpcClientError, HttpApi, HttpApiClient, HttpApiEndpoint, HttpApiGroup, HttpApiSchema, Rpc, RpcClient, RpcGroup, RpcSchema, RpcSerialization,
|
|
97
|
+
const runEffectRequest = __rspack_external_effect_Effect_41060786.runPromise;
|
|
98
|
+
export { EffectRpcClientError, HttpApi, HttpApiClient, HttpApiEndpoint, HttpApiGroup, HttpApiSchema, Rpc, RpcClient, RpcGroup, RpcSchema, RpcSerialization, __rspack_external_effect_Effect_41060786 as Effect, __rspack_external_effect_Layer_69c46453 as Layer, __rspack_external_effect_Schema_6065f72d as Schema, __rspack_external_effect_unstable_http_HttpClientError_4b9eaee6 as HttpClientError, makeEffectHttpApiClient, makeEffectRpcClient, mask, runEffectRequest, runEffectView, view };
|
|
@@ -21,4 +21,4 @@ async function parseResponseLikeCreateRequest(response) {
|
|
|
21
21
|
if (contentType.includes('image/png')) return response;
|
|
22
22
|
return response.text();
|
|
23
23
|
}
|
|
24
|
-
export {
|
|
24
|
+
export { isBatchResponsePayload, parseResponseLikeCreateRequest };
|
|
@@ -61,4 +61,4 @@ async function dispatchEffectBffRequestWithContext(handler, request, options) {
|
|
|
61
61
|
return createSafeFailureResponse(error);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
export {
|
|
64
|
+
export { dispatchEffectBffRequestWithContext };
|
|
@@ -61,4 +61,4 @@ async function extractHttpApiFromModule(mod, isHttpApi) {
|
|
|
61
61
|
function createEffectEndpointContractHash(endpoint, requestId) {
|
|
62
62
|
return createOperationContractHash(createEffectOperationContractSource(endpoint), requestId);
|
|
63
63
|
}
|
|
64
|
-
export { collectEffectEndpoints, createEffectEndpointContractHash,
|
|
64
|
+
export { collectEffectEndpoints, createEffectEndpointContractHash, ensureLeadingSlash, extractHttpApiFromModule, normalizeEffectPrefix, toOperationContractSources };
|
|
@@ -34,4 +34,4 @@ function createEntryShapeFacts(module, predicates, legacyShape) {
|
|
|
34
34
|
hasRuntimeLayer
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
export { EFFECT_VALIDATOR_AWARE_FACTORY, classifyEffectBffEntryModule,
|
|
37
|
+
export { EFFECT_VALIDATOR_AWARE_FACTORY, classifyEffectBffEntryModule, isValidatorAwareHandlerFactory, strictEffectApproachMessage };
|
|
@@ -7,11 +7,11 @@ import { createOpenApiLayer } from "./openapi.mjs";
|
|
|
7
7
|
import { getRequestPathname, isRpcRequest } from "./routing.mjs";
|
|
8
8
|
import { createRpcApiHandler, normalizeRpcPath } from "./rpc.mjs";
|
|
9
9
|
import { toEffectServiceContext } from "./types.mjs";
|
|
10
|
-
import * as
|
|
10
|
+
import * as __rspack_external_effect_Layer_69c46453 from "effect/Layer";
|
|
11
11
|
function createHttpApiHandler(options) {
|
|
12
|
-
const apiLayer = options.layer.pipe(
|
|
12
|
+
const apiLayer = options.layer.pipe(__rspack_external_effect_Layer_69c46453.provide(HttpServer.layerServices));
|
|
13
13
|
const openApiLayer = createOpenApiLayer(options.api, options.openapi);
|
|
14
|
-
const mergedLayer = openApiLayer ?
|
|
14
|
+
const mergedLayer = openApiLayer ? __rspack_external_effect_Layer_69c46453.mergeAll(apiLayer, openApiLayer) : apiLayer;
|
|
15
15
|
const httpApiHandler = HttpRouter.toWebHandler(mergedLayer);
|
|
16
16
|
const withDataPlatformValidation = async (request, context)=>{
|
|
17
17
|
const policyDenial = options.validateRequest?.(request);
|
|
@@ -2,7 +2,7 @@ import "node:module";
|
|
|
2
2
|
import { HttpRouter } from "effect/unstable/http";
|
|
3
3
|
import { RpcServer } from "effect/unstable/rpc";
|
|
4
4
|
import { getRpcSerializationLayer } from "../rpcSerialization.mjs";
|
|
5
|
-
import * as
|
|
5
|
+
import * as __rspack_external_effect_Layer_69c46453 from "effect/Layer";
|
|
6
6
|
function normalizeRpcPath(pathname) {
|
|
7
7
|
if (!pathname || '/' === pathname) return '/rpc';
|
|
8
8
|
if (!pathname.startsWith('/')) return `/${pathname}`;
|
|
@@ -10,14 +10,14 @@ function normalizeRpcPath(pathname) {
|
|
|
10
10
|
}
|
|
11
11
|
function createRpcApiHandler(options) {
|
|
12
12
|
const rpcPath = normalizeRpcPath(options.path);
|
|
13
|
-
const rpcLayer =
|
|
13
|
+
const rpcLayer = __rspack_external_effect_Layer_69c46453.provide(RpcServer.layerHttp({
|
|
14
14
|
group: options.group,
|
|
15
15
|
path: rpcPath,
|
|
16
16
|
protocol: 'http',
|
|
17
17
|
disableTracing: options.disableTracing,
|
|
18
18
|
spanPrefix: options.spanPrefix,
|
|
19
19
|
spanAttributes: options.spanAttributes
|
|
20
|
-
}),
|
|
20
|
+
}), __rspack_external_effect_Layer_69c46453.mergeAll(options.layer, getRpcSerializationLayer(options.serialization)));
|
|
21
21
|
return HttpRouter.toWebHandler(rpcLayer);
|
|
22
22
|
}
|
|
23
23
|
export { createRpcApiHandler, normalizeRpcPath };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
import * as
|
|
3
|
-
const emptyEffectServiceContext =
|
|
2
|
+
import * as __rspack_external_effect_Context_b3520bd3 from "effect/Context";
|
|
3
|
+
const emptyEffectServiceContext = __rspack_external_effect_Context_b3520bd3.empty();
|
|
4
4
|
const isEffectServiceContext = (context)=>'object' == typeof context && null !== context && 'mapUnsafe' in context;
|
|
5
5
|
const toEffectServiceContext = (context)=>isEffectServiceContext(context) ? context : emptyEffectServiceContext;
|
|
6
6
|
export { toEffectServiceContext };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
6
|
-
import * as
|
|
2
|
+
import * as __rspack_external_effect_Config_76cfa59d from "effect/Config";
|
|
3
|
+
import * as __rspack_external_effect_Effect_41060786 from "effect/Effect";
|
|
4
|
+
import * as __rspack_external_effect_Layer_69c46453 from "effect/Layer";
|
|
5
|
+
import * as __rspack_external_effect_Option_0498e63a from "effect/Option";
|
|
6
|
+
import * as __rspack_external_effect_Schema_6065f72d from "effect/Schema";
|
|
7
7
|
export * from "effect/unstable/http";
|
|
8
8
|
export * from "effect/unstable/httpapi";
|
|
9
9
|
export * from "effect/unstable/rpc";
|
|
@@ -12,4 +12,4 @@ export { HttpApiBuilder } from "effect/unstable/httpapi";
|
|
|
12
12
|
export { EFFECT_VALIDATOR_AWARE_FACTORY, isValidatorAwareHandlerFactory } from "./entry-shape.mjs";
|
|
13
13
|
export { defineEffectBff, defineEffectRpcBff } from "./handler/definition.mjs";
|
|
14
14
|
export { createHttpApiHandler } from "./handler/http.mjs";
|
|
15
|
-
export {
|
|
15
|
+
export { __rspack_external_effect_Config_76cfa59d as Config, __rspack_external_effect_Effect_41060786 as Effect, __rspack_external_effect_Layer_69c46453 as Layer, __rspack_external_effect_Option_0498e63a as Option, __rspack_external_effect_Schema_6065f72d as Schema };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
import * as
|
|
2
|
+
import * as __rspack_external__effect_opentelemetry_66324c75 from "@effect/opentelemetry";
|
|
3
3
|
export * from "./backend-federation.mjs";
|
|
4
4
|
export * from "./handler.mjs";
|
|
5
5
|
export { BACKEND_FEDERATION_CONTRACT_VERSION, BACKEND_FEDERATION_EFFECT_EXPOSE, BACKEND_FEDERATION_MANIFEST_FILE, BACKEND_FEDERATION_NODE_ADAPTER_VERSION, createBackendFederationLoadEntryPlugin, createBackendFederationRuntime, loadBackendFederatedEffectApi } from "./backend-federation.mjs";
|
|
6
6
|
export { BackendFederationManifestAdapterError, loadBackendFederatedEffectApiFromManifest, loadBackendFederationManifest, resolveBackendFederationRemoteFromManifest } from "./backend-federation-manifest.mjs";
|
|
7
7
|
export { createEffectOperationContext, runWithEffectContext, useEffectContext, useOperationContext } from "./context.mjs";
|
|
8
8
|
export { createEffectBffEdgeHandler, createEffectBffTestHandler, dispatchEffectBffRequest } from "./edge.mjs";
|
|
9
|
-
export {
|
|
9
|
+
export { __rspack_external__effect_opentelemetry_66324c75 as OpenTelemetry };
|
|
@@ -2,14 +2,14 @@ import "node:module";
|
|
|
2
2
|
import { HttpApi } from "effect/unstable/httpapi";
|
|
3
3
|
import { classifyEffectBffEntryModule, isValidatorAwareHandlerFactory, strictEffectApproachMessage } from "./entry-shape.mjs";
|
|
4
4
|
import { createHttpApiHandler } from "./handler.mjs";
|
|
5
|
-
import * as
|
|
5
|
+
import * as __rspack_external_effect_Context_b3520bd3 from "effect/Context";
|
|
6
6
|
function isRequestHandler(value) {
|
|
7
7
|
return 'function' == typeof value;
|
|
8
8
|
}
|
|
9
9
|
function isEffectServiceContext(context) {
|
|
10
10
|
return 'object' == typeof context && null !== context && 'mapUnsafe' in context;
|
|
11
11
|
}
|
|
12
|
-
const emptyEffectServiceContext =
|
|
12
|
+
const emptyEffectServiceContext = __rspack_external_effect_Context_b3520bd3.empty();
|
|
13
13
|
function rejectLegacyEffectModuleShape(options, shape) {
|
|
14
14
|
options.onWarning?.(`${strictEffectApproachMessage} Rejected ${shape}.`);
|
|
15
15
|
return true;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import "node:module";
|
|
2
2
|
import { createRequestContextHeaders } from "@modern-js/create-request";
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
3
|
+
import * as __rspack_external_effect_Effect_41060786 from "effect/Effect";
|
|
4
|
+
import * as __rspack_external_effect_Layer_69c46453 from "effect/Layer";
|
|
5
5
|
import { FetchHttpClient, HttpClient, HttpClientRequest } from "effect/unstable/http";
|
|
6
6
|
import { HttpApi, HttpApiClient, HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/unstable/httpapi";
|
|
7
7
|
import { Rpc, RpcClient, RpcGroup, RpcSchema, RpcSerialization } from "effect/unstable/rpc";
|
|
8
8
|
import { getRpcSerializationLayer } from "../effect/rpcSerialization.mjs";
|
|
9
|
-
import * as
|
|
10
|
-
import * as
|
|
11
|
-
import * as
|
|
12
|
-
import * as
|
|
13
|
-
import * as
|
|
14
|
-
import * as
|
|
15
|
-
class EffectRpcClientError extends
|
|
9
|
+
import * as __rspack_external_effect_Schema_6065f72d from "effect/Schema";
|
|
10
|
+
import * as __rspack_external_effect_unstable_http_HttpClientError_4b9eaee6 from "effect/unstable/http/HttpClientError";
|
|
11
|
+
import * as __rspack_external_effect_Data_2b3f4efb from "effect/Data";
|
|
12
|
+
import * as __rspack_external_effect_Exit_1ca64b33 from "effect/Exit";
|
|
13
|
+
import * as __rspack_external_effect_ManagedRuntime_bfe218e3 from "effect/ManagedRuntime";
|
|
14
|
+
import * as __rspack_external_effect_Scope_f87b0bd6 from "effect/Scope";
|
|
15
|
+
class EffectRpcClientError extends __rspack_external_effect_Data_2b3f4efb.TaggedError('EffectRpcClientError') {
|
|
16
16
|
}
|
|
17
17
|
function isRecord(value) {
|
|
18
18
|
return 'object' == typeof value && null !== value && !Array.isArray(value);
|
|
@@ -53,28 +53,28 @@ function makeEffectHttpApiClient(api, options) {
|
|
|
53
53
|
baseUrl: options?.baseUrl,
|
|
54
54
|
transformClient,
|
|
55
55
|
transformResponse: options?.transformResponse
|
|
56
|
-
}).pipe(
|
|
56
|
+
}).pipe(__rspack_external_effect_Effect_41060786.provide(FetchHttpClient.layer));
|
|
57
57
|
}
|
|
58
58
|
function makeEffectRpcClient(group, options) {
|
|
59
|
-
const protocolLayer =
|
|
59
|
+
const protocolLayer = __rspack_external_effect_Layer_69c46453.provide(RpcClient.layerProtocolHttp({
|
|
60
60
|
url: options.url
|
|
61
|
-
}),
|
|
62
|
-
const middlewareLayer = options.middlewareLayer ??
|
|
63
|
-
const runtimeLayer =
|
|
64
|
-
return
|
|
61
|
+
}), __rspack_external_effect_Layer_69c46453.mergeAll(getRpcSerializationLayer(options.serialization), FetchHttpClient.layer));
|
|
62
|
+
const middlewareLayer = options.middlewareLayer ?? __rspack_external_effect_Layer_69c46453.empty;
|
|
63
|
+
const runtimeLayer = __rspack_external_effect_Layer_69c46453.mergeAll(protocolLayer, middlewareLayer);
|
|
64
|
+
return __rspack_external_effect_Effect_41060786.tryPromise({
|
|
65
65
|
try: async ()=>{
|
|
66
|
-
const runtime =
|
|
67
|
-
const scope = await runtime.runPromise(
|
|
66
|
+
const runtime = __rspack_external_effect_ManagedRuntime_bfe218e3.make(runtimeLayer);
|
|
67
|
+
const scope = await runtime.runPromise(__rspack_external_effect_Scope_f87b0bd6.make());
|
|
68
68
|
try {
|
|
69
69
|
const client = await runtime.runPromise(RpcClient.make(group, {
|
|
70
70
|
flatten: options.flatten
|
|
71
|
-
}).pipe(
|
|
71
|
+
}).pipe(__rspack_external_effect_Effect_41060786.provideService(__rspack_external_effect_Scope_f87b0bd6.Scope, scope)));
|
|
72
72
|
let disposed = false;
|
|
73
73
|
const clientWithDispose = Object.assign(client, {
|
|
74
74
|
dispose: async ()=>{
|
|
75
75
|
if (!disposed) {
|
|
76
76
|
disposed = true;
|
|
77
|
-
await runtime.runPromise(
|
|
77
|
+
await runtime.runPromise(__rspack_external_effect_Scope_f87b0bd6.close(scope, __rspack_external_effect_Exit_1ca64b33["void"]));
|
|
78
78
|
}
|
|
79
79
|
await runtime.dispose();
|
|
80
80
|
}
|
|
@@ -82,7 +82,7 @@ function makeEffectRpcClient(group, options) {
|
|
|
82
82
|
return clientWithDispose;
|
|
83
83
|
} catch (error) {
|
|
84
84
|
try {
|
|
85
|
-
await runtime.runPromise(
|
|
85
|
+
await runtime.runPromise(__rspack_external_effect_Scope_f87b0bd6.close(scope, __rspack_external_effect_Exit_1ca64b33["void"]));
|
|
86
86
|
} catch {}
|
|
87
87
|
try {
|
|
88
88
|
await runtime.dispose();
|
|
@@ -95,5 +95,5 @@ function makeEffectRpcClient(group, options) {
|
|
|
95
95
|
})
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
|
-
const runEffectRequest =
|
|
99
|
-
export { EffectRpcClientError, HttpApi, HttpApiClient, HttpApiEndpoint, HttpApiGroup, HttpApiSchema, Rpc, RpcClient, RpcGroup, RpcSchema, RpcSerialization,
|
|
98
|
+
const runEffectRequest = __rspack_external_effect_Effect_41060786.runPromise;
|
|
99
|
+
export { EffectRpcClientError, HttpApi, HttpApiClient, HttpApiEndpoint, HttpApiGroup, HttpApiSchema, Rpc, RpcClient, RpcGroup, RpcSchema, RpcSerialization, __rspack_external_effect_Effect_41060786 as Effect, __rspack_external_effect_Layer_69c46453 as Layer, __rspack_external_effect_Schema_6065f72d as Schema, __rspack_external_effect_unstable_http_HttpClientError_4b9eaee6 as HttpClientError, makeEffectHttpApiClient, makeEffectRpcClient, mask, runEffectRequest, runEffectView, view };
|
|
@@ -1,25 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { DataBatchTransportOptions, DataTransportRequestInfo } from '../types';
|
|
2
2
|
type DataBatchFetch = NonNullable<DataBatchTransportOptions['fetch']>;
|
|
3
3
|
type CreateBatchTransportQueueOptions = {
|
|
4
4
|
options: DataBatchTransportOptions;
|
|
5
5
|
baseFetch: DataBatchFetch;
|
|
6
6
|
};
|
|
7
|
-
export type QueuedBatchRequest = {
|
|
8
|
-
key: string;
|
|
9
|
-
endpoint: string;
|
|
10
|
-
requestUrl: string;
|
|
11
|
-
requestInit: RequestInit;
|
|
12
|
-
item: DataBatchRequestItem;
|
|
13
|
-
size: number;
|
|
14
|
-
resolve: (value: unknown) => void;
|
|
15
|
-
reject: (reason: unknown) => void;
|
|
16
|
-
};
|
|
17
|
-
export type BatchBucket = {
|
|
18
|
-
items: QueuedBatchRequest[];
|
|
19
|
-
bytes: number;
|
|
20
|
-
timer: ReturnType<typeof setTimeout> | null;
|
|
21
|
-
flushing: boolean;
|
|
22
|
-
};
|
|
23
|
-
export declare function ensureBucket(buckets: Map<string, BatchBucket>, endpoint: string): BatchBucket;
|
|
24
7
|
export declare function createBatchTransportQueue({ options, baseFetch, }: CreateBatchTransportQueueOptions): (input: DataTransportRequestInfo, init?: RequestInit) => Promise<any>;
|
|
25
8
|
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function isBatchResponseItem(value: unknown): value is DataBatchResponseItem;
|
|
1
|
+
import type { DataBatchResponsePayload } from '../types';
|
|
3
2
|
export declare function isBatchResponsePayload(value: unknown): value is DataBatchResponsePayload;
|
|
4
3
|
export declare function parseResponseLikeCreateRequest(response: Response): Promise<any>;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { ServerPluginAPI } from '@modern-js/server-core';
|
|
2
2
|
import { type ResolvedCrossProjectPolicy } from '../../../utils/crossProjectServerPolicy';
|
|
3
3
|
import { type EffectApiModule } from '../module';
|
|
4
|
-
export declare function loadEffectAdapterHandlerFromModule(api: ServerPluginAPI, mod: EffectApiModule, crossProjectPolicy: ResolvedCrossProjectPolicy | undefined): Promise<
|
|
4
|
+
export declare function loadEffectAdapterHandlerFromModule(api: ServerPluginAPI, mod: EffectApiModule, crossProjectPolicy: ResolvedCrossProjectPolicy | undefined): Promise<{
|
|
5
|
+
handler: import("../module").EffectBffRequestHandler;
|
|
6
|
+
dispose?: () => Promise<void>;
|
|
7
|
+
} | null>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EffectBffRequestHandler } from './module';
|
|
2
2
|
import { type EffectContext } from './operation-context';
|
|
3
|
-
|
|
3
|
+
type EffectDispatchContextRunner = <T>(context: EffectContext, cb: () => T) => T;
|
|
4
4
|
export type DispatchEffectBffRequestOptions = {
|
|
5
5
|
prefix?: string;
|
|
6
6
|
env?: Record<string, unknown>;
|
|
@@ -9,9 +9,5 @@ export type DispatchEffectBffRequestOptions = {
|
|
|
9
9
|
runWithEffectContext: EffectDispatchContextRunner;
|
|
10
10
|
onError?: (error: unknown, context: EffectContext) => Promise<Response> | Response;
|
|
11
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
12
|
export declare function dispatchEffectBffRequestWithContext(handler: EffectBffRequestHandler, request: Request, options: DispatchEffectBffRequestOptions): Promise<Response>;
|
|
13
|
+
export {};
|
|
@@ -15,7 +15,6 @@ export type EffectBffEdgeHandlerOptions = {
|
|
|
15
15
|
onError?: (error: unknown, context: EffectContext) => Promise<Response> | Response;
|
|
16
16
|
onWarning?: (message: string) => void;
|
|
17
17
|
};
|
|
18
|
-
export type EffectBffEdgeRequestDispatcher = (request: Request, dispatchOptions?: Omit<EffectBffEdgeDispatchOptions, 'prefix' | 'onError'>) => Promise<Response>;
|
|
19
18
|
export declare function dispatchEffectBffRequest(handler: EffectBffRequestHandler, request: Request, options?: EffectBffEdgeDispatchOptions): Promise<Response>;
|
|
20
19
|
export declare function createEffectBffEdgeDispatcher(options: EffectBffEdgeHandlerOptions): Promise<{
|
|
21
20
|
dispatch: (request: Request, dispatchOptions?: Omit<EffectBffEdgeDispatchOptions, 'prefix' | 'onError'>) => Promise<Response>;
|
|
@@ -21,10 +21,10 @@ export type EffectEndpointMeta = {
|
|
|
21
21
|
export type HttpApiLike = {
|
|
22
22
|
identifier?: unknown;
|
|
23
23
|
};
|
|
24
|
-
|
|
24
|
+
type HttpApiGroupLike = {
|
|
25
25
|
identifier?: unknown;
|
|
26
26
|
};
|
|
27
|
-
|
|
27
|
+
type HttpApiEndpointLike = {
|
|
28
28
|
name?: unknown;
|
|
29
29
|
method?: unknown;
|
|
30
30
|
path?: unknown;
|
|
@@ -39,8 +39,6 @@ export type HttpApiReflect = (api: unknown, handlers: {
|
|
|
39
39
|
}) => void;
|
|
40
40
|
export declare function ensureLeadingSlash(pathname: string): string;
|
|
41
41
|
export declare function normalizeEffectPrefix(prefix: string): string;
|
|
42
|
-
export declare function getEffectRoutePath(prefix: string, endpointPath: string): string;
|
|
43
|
-
export declare function resolveEffectApiId(api: HttpApiLike): string;
|
|
44
42
|
export declare function collectEffectEndpoints(reflect: HttpApiReflect, api: HttpApiLike, prefix: string): EffectEndpointMeta[];
|
|
45
43
|
/**
|
|
46
44
|
* Maps reflected endpoints onto operation-contract sources for
|
|
@@ -48,7 +46,6 @@ export declare function collectEffectEndpoints(reflect: HttpApiReflect, api: Htt
|
|
|
48
46
|
* carry no zod metadata, so the contract hash covers the endpoint identity.
|
|
49
47
|
*/
|
|
50
48
|
export declare function toOperationContractSources(endpoints: EffectEndpointMeta[]): OperationContractSource[];
|
|
51
|
-
export declare function createEffectOperationContractSource(endpoint: EffectEndpointMeta): OperationContractSource;
|
|
52
49
|
/**
|
|
53
50
|
* Extracts the HttpApi instance from a loaded effect entry module. Mirrors
|
|
54
51
|
* the shared entry-shape policy accepted by `resolveEffectBffModuleHandler`,
|
|
@@ -60,3 +57,4 @@ export declare function extractHttpApiFromModule(mod: unknown, isHttpApi: (value
|
|
|
60
57
|
* contract map (it is the same bff-core hash over the same inputs).
|
|
61
58
|
*/
|
|
62
59
|
export declare function createEffectEndpointContractHash(endpoint: EffectEndpointMeta, requestId: string): string;
|
|
60
|
+
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
type EffectBffEntryModule = {
|
|
2
2
|
api?: unknown;
|
|
3
3
|
layer?: unknown;
|
|
4
4
|
handler?: unknown;
|
|
5
5
|
createHandler?: unknown;
|
|
6
6
|
default?: unknown;
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
type LegacyEffectBffEntryShape = '`handler` export' | 'default request handler';
|
|
9
9
|
export type EffectBffEntryShapeFacts = {
|
|
10
10
|
module: EffectBffEntryModule;
|
|
11
11
|
legacyShape?: LegacyEffectBffEntryShape;
|
|
@@ -15,7 +15,7 @@ export type EffectBffEntryShapeFacts = {
|
|
|
15
15
|
layer?: unknown;
|
|
16
16
|
hasRuntimeLayer: boolean;
|
|
17
17
|
};
|
|
18
|
-
|
|
18
|
+
type EffectBffEntryShapePredicates = {
|
|
19
19
|
isRequestHandler: (value: unknown) => boolean;
|
|
20
20
|
isValidatorAwareHandlerFactory: (value: unknown) => boolean;
|
|
21
21
|
isHttpApi: (value: unknown) => boolean;
|
|
@@ -27,5 +27,5 @@ export declare const EFFECT_VALIDATOR_AWARE_FACTORY: symbol;
|
|
|
27
27
|
*/
|
|
28
28
|
export declare function isValidatorAwareHandlerFactory(factory: unknown): boolean;
|
|
29
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
30
|
export declare function classifyEffectBffEntryModule(value: unknown, predicates: EffectBffEntryShapePredicates): EffectBffEntryShapeFacts | null;
|
|
31
|
+
export {};
|
|
@@ -17,11 +17,11 @@ export type EffectApiModule = {
|
|
|
17
17
|
createHandler?: EffectBffHandlerFactory;
|
|
18
18
|
default?: unknown;
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
type LoadedEffectBffHandler = {
|
|
21
21
|
handler: EffectBffRequestHandler;
|
|
22
22
|
dispose?: () => Promise<void>;
|
|
23
23
|
};
|
|
24
|
-
|
|
24
|
+
type ResolveEffectBffModuleHandlerOptions = {
|
|
25
25
|
openapi?: EffectBffOpenApiConfig;
|
|
26
26
|
dataPlatform?: EffectDataPlatformValidationOptions;
|
|
27
27
|
/**
|
|
@@ -33,3 +33,4 @@ export type ResolveEffectBffModuleHandlerOptions = {
|
|
|
33
33
|
onWarning?: (message: string) => void;
|
|
34
34
|
};
|
|
35
35
|
export declare function resolveEffectBffModuleHandler(mod: EffectApiModule, options?: ResolveEffectBffModuleHandlerOptions): Promise<LoadedEffectBffHandler | null>;
|
|
36
|
+
export {};
|
package/package.json
CHANGED
|
@@ -17,10 +17,11 @@
|
|
|
17
17
|
"modern",
|
|
18
18
|
"modern.js"
|
|
19
19
|
],
|
|
20
|
-
"version": "3.5.0-ultramodern.
|
|
20
|
+
"version": "3.5.0-ultramodern.37",
|
|
21
21
|
"types": "./dist/types/cli.d.ts",
|
|
22
22
|
"main": "./dist/cjs/cli.js",
|
|
23
23
|
"exports": {
|
|
24
|
+
"./package.json": "./package.json",
|
|
24
25
|
".": {
|
|
25
26
|
"types": "./dist/types/cli.d.ts",
|
|
26
27
|
"node": {
|
|
@@ -153,44 +154,37 @@
|
|
|
153
154
|
}
|
|
154
155
|
},
|
|
155
156
|
"dependencies": {
|
|
156
|
-
"@effect/opentelemetry": "4.0.0-beta.
|
|
157
|
-
"@module-federation/runtime": "2.
|
|
157
|
+
"@effect/opentelemetry": "4.0.0-beta.94",
|
|
158
|
+
"@module-federation/runtime": "2.7.0",
|
|
158
159
|
"@opentelemetry/api": "1.9.1",
|
|
159
|
-
"@opentelemetry/
|
|
160
|
-
"@opentelemetry/resources": "2.8.0",
|
|
161
|
-
"@opentelemetry/sdk-logs": "0.219.0",
|
|
162
|
-
"@opentelemetry/sdk-metrics": "2.8.0",
|
|
163
|
-
"@opentelemetry/sdk-trace-base": "2.8.0",
|
|
164
|
-
"@opentelemetry/sdk-trace-node": "2.8.0",
|
|
165
|
-
"@opentelemetry/sdk-trace-web": "2.8.0",
|
|
166
|
-
"@opentelemetry/semantic-conventions": "1.41.1",
|
|
160
|
+
"@opentelemetry/semantic-conventions": "^1.42.0",
|
|
167
161
|
"@swc/core": "1.15.43",
|
|
168
162
|
"@swc/helpers": "^0.5.23",
|
|
169
|
-
"effect": "4.0.0-beta.
|
|
163
|
+
"effect": "4.0.0-beta.94",
|
|
170
164
|
"qs": "^6.15.3",
|
|
171
165
|
"type-is": "^2.1.0",
|
|
172
|
-
"@modern-js/bff-core": "npm:@bleedingdev/modern-js-bff-core@3.5.0-ultramodern.
|
|
173
|
-
"@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.5.0-ultramodern.
|
|
174
|
-
"@modern-js/create-request": "npm:@bleedingdev/modern-js-create-request@3.5.0-ultramodern.
|
|
175
|
-
"@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.5.0-ultramodern.
|
|
176
|
-
"@modern-js/server-utils": "npm:@bleedingdev/modern-js-server-utils@3.5.0-ultramodern.
|
|
177
|
-
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.5.0-ultramodern.
|
|
166
|
+
"@modern-js/bff-core": "npm:@bleedingdev/modern-js-bff-core@3.5.0-ultramodern.37",
|
|
167
|
+
"@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.5.0-ultramodern.37",
|
|
168
|
+
"@modern-js/create-request": "npm:@bleedingdev/modern-js-create-request@3.5.0-ultramodern.37",
|
|
169
|
+
"@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.5.0-ultramodern.37",
|
|
170
|
+
"@modern-js/server-utils": "npm:@bleedingdev/modern-js-server-utils@3.5.0-ultramodern.37",
|
|
171
|
+
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.5.0-ultramodern.37"
|
|
178
172
|
},
|
|
179
173
|
"devDependencies": {
|
|
180
|
-
"@rsbuild/core": "2.1.
|
|
181
|
-
"@rslib/core": "0.23.
|
|
182
|
-
"@types/node": "^26.
|
|
174
|
+
"@rsbuild/core": "2.1.5",
|
|
175
|
+
"@rslib/core": "0.23.2",
|
|
176
|
+
"@types/node": "^26.1.1",
|
|
183
177
|
"@types/qs": "^6.15.1",
|
|
184
178
|
"@types/type-is": "^1.6.7",
|
|
185
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
186
|
-
"memfs": "^4.
|
|
187
|
-
"typescript": "^
|
|
179
|
+
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
180
|
+
"memfs": "^4.64.0",
|
|
181
|
+
"typescript": "^7.0.2",
|
|
188
182
|
"zod": "^4.4.3",
|
|
189
|
-
"@modern-js/app-tools": "npm:@bleedingdev/modern-js-app-tools@3.5.0-ultramodern.
|
|
190
|
-
"@modern-js/bff-runtime": "npm:@bleedingdev/modern-js-bff-runtime@3.5.0-ultramodern.
|
|
191
|
-
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.5.0-ultramodern.
|
|
192
|
-
"@modern-js/
|
|
193
|
-
"@modern-js/
|
|
183
|
+
"@modern-js/app-tools": "npm:@bleedingdev/modern-js-app-tools@3.5.0-ultramodern.37",
|
|
184
|
+
"@modern-js/bff-runtime": "npm:@bleedingdev/modern-js-bff-runtime@3.5.0-ultramodern.37",
|
|
185
|
+
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.5.0-ultramodern.37",
|
|
186
|
+
"@modern-js/runtime": "npm:@bleedingdev/modern-js-runtime@3.5.0-ultramodern.37",
|
|
187
|
+
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.5.0-ultramodern.37",
|
|
194
188
|
"@scripts/rstest-config": "2.66.0"
|
|
195
189
|
},
|
|
196
190
|
"sideEffects": false,
|