@bleedingdev/modern-js-bff-effect 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/LICENSE +21 -0
- package/README.md +25 -0
- package/dist/cjs/data-platform/batch/protocol.js +130 -0
- package/dist/cjs/data-platform/batch/queue.js +623 -0
- package/dist/cjs/data-platform/batch/request.js +121 -0
- package/dist/cjs/data-platform/batch/response.js +65 -0
- package/dist/cjs/data-platform/batch/telemetry.js +71 -0
- package/dist/cjs/data-platform/batch/url.js +69 -0
- package/dist/cjs/data-platform/batch-transport.js +59 -0
- package/dist/cjs/data-platform/codec.js +155 -0
- package/dist/cjs/data-platform/index.js +124 -0
- package/dist/cjs/data-platform/invalidation.js +61 -0
- package/dist/cjs/data-platform/trace.js +73 -0
- package/dist/cjs/data-platform/types.js +48 -0
- package/dist/cjs/data-platform/validation.js +178 -0
- package/dist/cjs/effect/context.js +59 -0
- package/dist/cjs/effect/dispatch.js +101 -0
- package/dist/cjs/effect/edge-context.js +61 -0
- package/dist/cjs/effect/edge-dispatcher.js +354 -0
- package/dist/cjs/effect/edge.js +62 -0
- package/dist/cjs/effect/endpoint-contracts.js +121 -0
- package/dist/cjs/effect/entry-shape-registry.js +31 -0
- package/dist/cjs/effect/entry-shape.js +113 -0
- package/dist/cjs/effect/handler/batch-handler.js +270 -0
- package/dist/cjs/effect/handler/batch.js +170 -0
- package/dist/cjs/effect/handler/definition.js +99 -0
- package/dist/cjs/effect/handler/envelope.js +104 -0
- package/dist/cjs/effect/handler/http.js +107 -0
- package/dist/cjs/effect/handler/openapi.js +58 -0
- package/dist/cjs/effect/handler/routing.js +100 -0
- package/dist/cjs/effect/handler/rpc.js +63 -0
- package/dist/cjs/effect/handler/types.js +43 -0
- package/dist/cjs/effect/handler.js +173 -0
- package/dist/cjs/effect/index.js +137 -0
- package/dist/cjs/effect/module.js +118 -0
- package/dist/cjs/effect/operation-context.js +116 -0
- package/dist/cjs/effect/rpcSerialization.js +54 -0
- package/dist/cjs/effect-client/batch.js +73 -0
- package/dist/cjs/effect-client/envelope.js +145 -0
- package/dist/cjs/effect-client/guards.js +44 -0
- package/dist/cjs/effect-client/index.js +208 -0
- package/dist/cjs/effect-client/request-context.js +64 -0
- package/dist/cjs/effect-client/request.js +66 -0
- package/dist/cjs/effect-client/runtime.js +100 -0
- package/dist/cjs/effect-client/types.js +18 -0
- package/dist/cjs/headers.js +46 -0
- package/dist/cjs/index.js +83 -0
- package/dist/esm/data-platform/batch/protocol.mjs +71 -0
- package/dist/esm/data-platform/batch/queue.mjs +582 -0
- package/dist/esm/data-platform/batch/request.mjs +68 -0
- package/dist/esm/data-platform/batch/response.mjs +24 -0
- package/dist/esm/data-platform/batch/telemetry.mjs +27 -0
- package/dist/esm/data-platform/batch/url.mjs +25 -0
- package/dist/esm/data-platform/batch-transport.mjs +12 -0
- package/dist/esm/data-platform/codec.mjs +90 -0
- package/dist/esm/data-platform/index.mjs +7 -0
- package/dist/esm/data-platform/invalidation.mjs +20 -0
- package/dist/esm/data-platform/trace.mjs +29 -0
- package/dist/esm/data-platform/types.mjs +4 -0
- package/dist/esm/data-platform/validation.mjs +128 -0
- package/dist/esm/effect/context.mjs +12 -0
- package/dist/esm/effect/dispatch.mjs +63 -0
- package/dist/esm/effect/edge-context.mjs +14 -0
- package/dist/esm/effect/edge-dispatcher.mjs +115 -0
- package/dist/esm/effect/edge.mjs +1 -0
- package/dist/esm/effect/endpoint-contracts.mjs +68 -0
- package/dist/esm/effect/entry-shape-registry.mjs +17 -0
- package/dist/esm/effect/entry-shape.mjs +51 -0
- package/dist/esm/effect/handler/batch-handler.mjs +232 -0
- package/dist/esm/effect/handler/batch.mjs +105 -0
- package/dist/esm/effect/handler/definition.mjs +58 -0
- package/dist/esm/effect/handler/envelope.mjs +63 -0
- package/dist/esm/effect/handler/http.mjs +69 -0
- package/dist/esm/effect/handler/openapi.mjs +20 -0
- package/dist/esm/effect/handler/routing.mjs +50 -0
- package/dist/esm/effect/handler/rpc.mjs +22 -0
- package/dist/esm/effect/handler/types.mjs +5 -0
- package/dist/esm/effect/handler.mjs +13 -0
- package/dist/esm/effect/index.mjs +7 -0
- package/dist/esm/effect/module.mjs +80 -0
- package/dist/esm/effect/operation-context.mjs +75 -0
- package/dist/esm/effect/rpcSerialization.mjs +16 -0
- package/dist/esm/effect-client/batch.mjs +35 -0
- package/dist/esm/effect-client/envelope.mjs +104 -0
- package/dist/esm/effect-client/guards.mjs +3 -0
- package/dist/esm/effect-client/index.mjs +110 -0
- package/dist/esm/effect-client/request-context.mjs +23 -0
- package/dist/esm/effect-client/request.mjs +28 -0
- package/dist/esm/effect-client/runtime.mjs +62 -0
- package/dist/esm/effect-client/types.mjs +0 -0
- package/dist/esm/headers.mjs +8 -0
- package/dist/esm/index.mjs +4 -0
- package/dist/esm/rslib-runtime.mjs +18 -0
- package/dist/esm-node/data-platform/batch/protocol.mjs +72 -0
- package/dist/esm-node/data-platform/batch/queue.mjs +583 -0
- package/dist/esm-node/data-platform/batch/request.mjs +69 -0
- package/dist/esm-node/data-platform/batch/response.mjs +25 -0
- package/dist/esm-node/data-platform/batch/telemetry.mjs +28 -0
- package/dist/esm-node/data-platform/batch/url.mjs +26 -0
- package/dist/esm-node/data-platform/batch-transport.mjs +13 -0
- package/dist/esm-node/data-platform/codec.mjs +91 -0
- package/dist/esm-node/data-platform/index.mjs +8 -0
- package/dist/esm-node/data-platform/invalidation.mjs +21 -0
- package/dist/esm-node/data-platform/trace.mjs +30 -0
- package/dist/esm-node/data-platform/types.mjs +5 -0
- package/dist/esm-node/data-platform/validation.mjs +129 -0
- package/dist/esm-node/effect/context.mjs +13 -0
- package/dist/esm-node/effect/dispatch.mjs +64 -0
- package/dist/esm-node/effect/edge-context.mjs +15 -0
- package/dist/esm-node/effect/edge-dispatcher.mjs +116 -0
- package/dist/esm-node/effect/edge.mjs +2 -0
- package/dist/esm-node/effect/endpoint-contracts.mjs +69 -0
- package/dist/esm-node/effect/entry-shape-registry.mjs +18 -0
- package/dist/esm-node/effect/entry-shape.mjs +63 -0
- package/dist/esm-node/effect/handler/batch-handler.mjs +233 -0
- package/dist/esm-node/effect/handler/batch.mjs +106 -0
- package/dist/esm-node/effect/handler/definition.mjs +59 -0
- package/dist/esm-node/effect/handler/envelope.mjs +64 -0
- package/dist/esm-node/effect/handler/http.mjs +70 -0
- package/dist/esm-node/effect/handler/openapi.mjs +21 -0
- package/dist/esm-node/effect/handler/routing.mjs +51 -0
- package/dist/esm-node/effect/handler/rpc.mjs +23 -0
- package/dist/esm-node/effect/handler/types.mjs +6 -0
- package/dist/esm-node/effect/handler.mjs +14 -0
- package/dist/esm-node/effect/index.mjs +8 -0
- package/dist/esm-node/effect/module.mjs +81 -0
- package/dist/esm-node/effect/operation-context.mjs +76 -0
- package/dist/esm-node/effect/rpcSerialization.mjs +17 -0
- package/dist/esm-node/effect-client/batch.mjs +36 -0
- package/dist/esm-node/effect-client/envelope.mjs +105 -0
- package/dist/esm-node/effect-client/guards.mjs +4 -0
- package/dist/esm-node/effect-client/index.mjs +111 -0
- package/dist/esm-node/effect-client/request-context.mjs +24 -0
- package/dist/esm-node/effect-client/request.mjs +29 -0
- package/dist/esm-node/effect-client/runtime.mjs +63 -0
- package/dist/esm-node/effect-client/types.mjs +1 -0
- package/dist/esm-node/headers.mjs +9 -0
- package/dist/esm-node/index.mjs +5 -0
- package/dist/esm-node/rslib-runtime.mjs +19 -0
- package/dist/types/data-platform/batch/protocol.d.ts +9 -0
- package/dist/types/data-platform/batch/queue.d.ts +47 -0
- package/dist/types/data-platform/batch/request.d.ts +19 -0
- package/dist/types/data-platform/batch/response.d.ts +3 -0
- package/dist/types/data-platform/batch/telemetry.d.ts +4 -0
- package/dist/types/data-platform/batch/url.d.ts +4 -0
- package/dist/types/data-platform/batch-transport.d.ts +3 -0
- package/dist/types/data-platform/codec.d.ts +17 -0
- package/dist/types/data-platform/index.d.ts +8 -0
- package/dist/types/data-platform/invalidation.d.ts +8 -0
- package/dist/types/data-platform/trace.d.ts +4 -0
- package/dist/types/data-platform/types.d.ts +151 -0
- package/dist/types/data-platform/validation.d.ts +29 -0
- package/dist/types/effect/context.d.ts +5 -0
- package/dist/types/effect/dispatch.d.ts +13 -0
- package/dist/types/effect/edge-context.d.ts +5 -0
- package/dist/types/effect/edge-dispatcher.d.ts +37 -0
- package/dist/types/effect/edge.d.ts +1 -0
- package/dist/types/effect/endpoint-contracts.d.ts +67 -0
- package/dist/types/effect/entry-shape.d.ts +32 -0
- package/dist/types/effect/handler/batch-handler.d.ts +11 -0
- package/dist/types/effect/handler/batch.d.ts +15 -0
- package/dist/types/effect/handler/definition.d.ts +7 -0
- package/dist/types/effect/handler/envelope.d.ts +13 -0
- package/dist/types/effect/handler/http.d.ts +15 -0
- package/dist/types/effect/handler/openapi.d.ts +4 -0
- package/dist/types/effect/handler/routing.d.ts +5 -0
- package/dist/types/effect/handler/rpc.d.ts +7 -0
- package/dist/types/effect/handler/types.d.ts +153 -0
- package/dist/types/effect/handler.d.ts +13 -0
- package/dist/types/effect/index.d.ts +6 -0
- package/dist/types/effect/module.d.ts +36 -0
- package/dist/types/effect/operation-context.d.ts +15 -0
- package/dist/types/effect/rpcSerialization.d.ts +3 -0
- package/dist/types/effect-client/batch.d.ts +2 -0
- package/dist/types/effect-client/envelope.d.ts +15 -0
- package/dist/types/effect-client/guards.d.ts +2 -0
- package/dist/types/effect-client/index.d.ts +58 -0
- package/dist/types/effect-client/request-context.d.ts +3 -0
- package/dist/types/effect-client/request.d.ts +1 -0
- package/dist/types/effect-client/runtime.d.ts +5 -0
- package/dist/types/effect-client/types.d.ts +68 -0
- package/dist/types/headers.d.ts +1 -0
- package/dist/types/index.d.ts +3 -0
- package/package.json +164 -0
- package/src/data-platform/batch/protocol.ts +112 -0
- package/src/data-platform/batch/queue.ts +876 -0
- package/src/data-platform/batch/request.ts +130 -0
- package/src/data-platform/batch/response.ts +74 -0
- package/src/data-platform/batch/telemetry.ts +47 -0
- package/src/data-platform/batch/url.ts +54 -0
- package/src/data-platform/batch-transport.ts +22 -0
- package/src/data-platform/codec.ts +145 -0
- package/src/data-platform/index.ts +63 -0
- package/src/data-platform/invalidation.ts +57 -0
- package/src/data-platform/trace.ts +49 -0
- package/src/data-platform/types.ts +186 -0
- package/src/data-platform/validation.ts +303 -0
- package/src/effect/context.ts +37 -0
- package/src/effect/dispatch.ts +132 -0
- package/src/effect/edge-context.ts +51 -0
- package/src/effect/edge-dispatcher.ts +310 -0
- package/src/effect/edge.ts +1 -0
- package/src/effect/endpoint-contracts.ts +191 -0
- package/src/effect/entry-shape-registry.cjs +16 -0
- package/src/effect/entry-shape-registry.d.cts +6 -0
- package/src/effect/entry-shape.ts +155 -0
- package/src/effect/handler/batch-handler.ts +475 -0
- package/src/effect/handler/batch.ts +182 -0
- package/src/effect/handler/definition.ts +121 -0
- package/src/effect/handler/envelope.ts +133 -0
- package/src/effect/handler/http.ts +133 -0
- package/src/effect/handler/openapi.ts +45 -0
- package/src/effect/handler/routing.ts +91 -0
- package/src/effect/handler/rpc.ts +45 -0
- package/src/effect/handler/types.ts +255 -0
- package/src/effect/handler.ts +33 -0
- package/src/effect/index.ts +22 -0
- package/src/effect/module.ts +186 -0
- package/src/effect/operation-context.ts +144 -0
- package/src/effect/rpcSerialization.ts +20 -0
- package/src/effect-client/batch.ts +50 -0
- package/src/effect-client/envelope.ts +238 -0
- package/src/effect-client/guards.ts +6 -0
- package/src/effect-client/index.ts +325 -0
- package/src/effect-client/request-context.ts +54 -0
- package/src/effect-client/request.ts +51 -0
- package/src/effect-client/runtime.ts +122 -0
- package/src/effect-client/types.ts +84 -0
- package/src/headers.ts +7 -0
- package/src/index.ts +3 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
+
Effect: ()=>Effect_namespaceObject,
|
|
32
|
+
EffectRpcClientError: ()=>EffectRpcClientError,
|
|
33
|
+
HttpApi: ()=>httpapi_namespaceObject.HttpApi,
|
|
34
|
+
HttpApiClient: ()=>httpapi_namespaceObject.HttpApiClient,
|
|
35
|
+
HttpApiEndpoint: ()=>httpapi_namespaceObject.HttpApiEndpoint,
|
|
36
|
+
HttpApiGroup: ()=>httpapi_namespaceObject.HttpApiGroup,
|
|
37
|
+
HttpApiSchema: ()=>httpapi_namespaceObject.HttpApiSchema,
|
|
38
|
+
HttpClientError: ()=>HttpClientError_namespaceObject,
|
|
39
|
+
Layer: ()=>Layer_namespaceObject,
|
|
40
|
+
Rpc: ()=>rpc_namespaceObject.Rpc,
|
|
41
|
+
RpcClient: ()=>rpc_namespaceObject.RpcClient,
|
|
42
|
+
RpcGroup: ()=>rpc_namespaceObject.RpcGroup,
|
|
43
|
+
RpcSchema: ()=>rpc_namespaceObject.RpcSchema,
|
|
44
|
+
RpcSerialization: ()=>rpc_namespaceObject.RpcSerialization,
|
|
45
|
+
Schema: ()=>Schema_namespaceObject,
|
|
46
|
+
makeEffectHttpApiClient: ()=>makeEffectHttpApiClient,
|
|
47
|
+
makeEffectRpcClient: ()=>makeEffectRpcClient,
|
|
48
|
+
mask: ()=>mask,
|
|
49
|
+
runEffectRequest: ()=>runEffectRequest,
|
|
50
|
+
runEffectView: ()=>runEffectView,
|
|
51
|
+
view: ()=>view
|
|
52
|
+
});
|
|
53
|
+
const create_request_namespaceObject = require("@modern-js/create-request");
|
|
54
|
+
const Data_namespaceObject = require("effect/Data");
|
|
55
|
+
const Effect_namespaceObject = require("effect/Effect");
|
|
56
|
+
const Exit_namespaceObject = require("effect/Exit");
|
|
57
|
+
const Layer_namespaceObject = require("effect/Layer");
|
|
58
|
+
const ManagedRuntime_namespaceObject = require("effect/ManagedRuntime");
|
|
59
|
+
const Scope_namespaceObject = require("effect/Scope");
|
|
60
|
+
const http_namespaceObject = require("effect/unstable/http");
|
|
61
|
+
const httpapi_namespaceObject = require("effect/unstable/httpapi");
|
|
62
|
+
const rpc_namespaceObject = require("effect/unstable/rpc");
|
|
63
|
+
const rpcSerialization_js_namespaceObject = require("../effect/rpcSerialization.js");
|
|
64
|
+
const Schema_namespaceObject = require("effect/Schema");
|
|
65
|
+
const HttpClientError_namespaceObject = require("effect/unstable/http/HttpClientError");
|
|
66
|
+
class EffectRpcClientError extends Data_namespaceObject.TaggedError('EffectRpcClientError') {
|
|
67
|
+
}
|
|
68
|
+
function isRecord(value) {
|
|
69
|
+
return 'object' == typeof value && null !== value && !Array.isArray(value);
|
|
70
|
+
}
|
|
71
|
+
function applySelection(value, selection) {
|
|
72
|
+
if (true === selection || void 0 === selection) return value;
|
|
73
|
+
if (Array.isArray(value)) return value.map((item)=>applySelection(item, selection));
|
|
74
|
+
if (!isRecord(value) || !isRecord(selection)) return value;
|
|
75
|
+
const masked = {};
|
|
76
|
+
for (const key of Object.keys(selection)){
|
|
77
|
+
const selected = selection[key];
|
|
78
|
+
if (void 0 !== selected && key in value && (true === selected || isRecord(selected))) masked[key] = applySelection(value[key], selected);
|
|
79
|
+
}
|
|
80
|
+
return masked;
|
|
81
|
+
}
|
|
82
|
+
function view() {
|
|
83
|
+
return (selection)=>selection;
|
|
84
|
+
}
|
|
85
|
+
function mask(value, selection) {
|
|
86
|
+
return applySelection(value, selection);
|
|
87
|
+
}
|
|
88
|
+
function runEffectView(request, selection) {
|
|
89
|
+
return new Promise((resolve, reject)=>{
|
|
90
|
+
request.then((value)=>resolve(mask(value, selection)), (reason)=>reject(reason));
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function makeEffectHttpApiClient(api, options) {
|
|
94
|
+
const requestContextHeaders = (0, create_request_namespaceObject.createRequestContextHeaders)(options?.requestContext);
|
|
95
|
+
const transformClient = (client)=>{
|
|
96
|
+
const contextClient = 0 === Object.keys(requestContextHeaders).length ? client : client.pipe(http_namespaceObject.HttpClient.mapRequest((request)=>{
|
|
97
|
+
let nextRequest = request;
|
|
98
|
+
for (const [header, value] of Object.entries(requestContextHeaders))if (void 0 === nextRequest.headers[header.toLowerCase()]) nextRequest = http_namespaceObject.HttpClientRequest.setHeader(nextRequest, header, value);
|
|
99
|
+
return nextRequest;
|
|
100
|
+
}));
|
|
101
|
+
return 'function' == typeof options?.transformClient ? options.transformClient(contextClient) : contextClient;
|
|
102
|
+
};
|
|
103
|
+
return httpapi_namespaceObject.HttpApiClient.make(api, {
|
|
104
|
+
baseUrl: options?.baseUrl,
|
|
105
|
+
transformClient,
|
|
106
|
+
transformResponse: options?.transformResponse
|
|
107
|
+
}).pipe(Effect_namespaceObject.provide(http_namespaceObject.FetchHttpClient.layer));
|
|
108
|
+
}
|
|
109
|
+
function makeEffectRpcClient(group, options) {
|
|
110
|
+
const protocolLayer = Layer_namespaceObject.provide(rpc_namespaceObject.RpcClient.layerProtocolHttp({
|
|
111
|
+
url: options.url
|
|
112
|
+
}), Layer_namespaceObject.mergeAll((0, rpcSerialization_js_namespaceObject.getRpcSerializationLayer)(options.serialization), http_namespaceObject.FetchHttpClient.layer));
|
|
113
|
+
const middlewareLayer = options.middlewareLayer ?? Layer_namespaceObject.empty;
|
|
114
|
+
const runtimeLayer = Layer_namespaceObject.mergeAll(protocolLayer, middlewareLayer);
|
|
115
|
+
return Effect_namespaceObject.tryPromise({
|
|
116
|
+
try: async ()=>{
|
|
117
|
+
const runtime = ManagedRuntime_namespaceObject.make(runtimeLayer);
|
|
118
|
+
let scope;
|
|
119
|
+
try {
|
|
120
|
+
const clientScope = await runtime.runPromise(Scope_namespaceObject.make());
|
|
121
|
+
scope = clientScope;
|
|
122
|
+
const client = await runtime.runPromise(rpc_namespaceObject.RpcClient.make(group, {
|
|
123
|
+
flatten: options.flatten
|
|
124
|
+
}).pipe(Effect_namespaceObject.provideService(Scope_namespaceObject.Scope, clientScope)));
|
|
125
|
+
let disposePromise;
|
|
126
|
+
const clientWithDispose = Object.assign(client, {
|
|
127
|
+
dispose: ()=>{
|
|
128
|
+
disposePromise ??= (async ()=>{
|
|
129
|
+
let scopeCloseError;
|
|
130
|
+
try {
|
|
131
|
+
await runtime.runPromise(Scope_namespaceObject.close(clientScope, Exit_namespaceObject["void"]));
|
|
132
|
+
} catch (error) {
|
|
133
|
+
scopeCloseError = error;
|
|
134
|
+
}
|
|
135
|
+
try {
|
|
136
|
+
await runtime.dispose();
|
|
137
|
+
} catch (error) {
|
|
138
|
+
if (void 0 === scopeCloseError) throw error;
|
|
139
|
+
}
|
|
140
|
+
if (void 0 !== scopeCloseError) throw scopeCloseError;
|
|
141
|
+
})();
|
|
142
|
+
return disposePromise;
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
return clientWithDispose;
|
|
146
|
+
} catch (error) {
|
|
147
|
+
if (void 0 !== scope) try {
|
|
148
|
+
await runtime.runPromise(Scope_namespaceObject.close(scope, Exit_namespaceObject["void"]));
|
|
149
|
+
} catch {}
|
|
150
|
+
try {
|
|
151
|
+
await runtime.dispose();
|
|
152
|
+
} catch {}
|
|
153
|
+
throw error;
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
catch: (error)=>new EffectRpcClientError({
|
|
157
|
+
cause: error
|
|
158
|
+
})
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
const runEffectRequest = Effect_namespaceObject.runPromise;
|
|
162
|
+
exports.Effect = __webpack_exports__.Effect;
|
|
163
|
+
exports.EffectRpcClientError = __webpack_exports__.EffectRpcClientError;
|
|
164
|
+
exports.HttpApi = __webpack_exports__.HttpApi;
|
|
165
|
+
exports.HttpApiClient = __webpack_exports__.HttpApiClient;
|
|
166
|
+
exports.HttpApiEndpoint = __webpack_exports__.HttpApiEndpoint;
|
|
167
|
+
exports.HttpApiGroup = __webpack_exports__.HttpApiGroup;
|
|
168
|
+
exports.HttpApiSchema = __webpack_exports__.HttpApiSchema;
|
|
169
|
+
exports.HttpClientError = __webpack_exports__.HttpClientError;
|
|
170
|
+
exports.Layer = __webpack_exports__.Layer;
|
|
171
|
+
exports.Rpc = __webpack_exports__.Rpc;
|
|
172
|
+
exports.RpcClient = __webpack_exports__.RpcClient;
|
|
173
|
+
exports.RpcGroup = __webpack_exports__.RpcGroup;
|
|
174
|
+
exports.RpcSchema = __webpack_exports__.RpcSchema;
|
|
175
|
+
exports.RpcSerialization = __webpack_exports__.RpcSerialization;
|
|
176
|
+
exports.Schema = __webpack_exports__.Schema;
|
|
177
|
+
exports.makeEffectHttpApiClient = __webpack_exports__.makeEffectHttpApiClient;
|
|
178
|
+
exports.makeEffectRpcClient = __webpack_exports__.makeEffectRpcClient;
|
|
179
|
+
exports.mask = __webpack_exports__.mask;
|
|
180
|
+
exports.runEffectRequest = __webpack_exports__.runEffectRequest;
|
|
181
|
+
exports.runEffectView = __webpack_exports__.runEffectView;
|
|
182
|
+
exports.view = __webpack_exports__.view;
|
|
183
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
184
|
+
"Effect",
|
|
185
|
+
"EffectRpcClientError",
|
|
186
|
+
"HttpApi",
|
|
187
|
+
"HttpApiClient",
|
|
188
|
+
"HttpApiEndpoint",
|
|
189
|
+
"HttpApiGroup",
|
|
190
|
+
"HttpApiSchema",
|
|
191
|
+
"HttpClientError",
|
|
192
|
+
"Layer",
|
|
193
|
+
"Rpc",
|
|
194
|
+
"RpcClient",
|
|
195
|
+
"RpcGroup",
|
|
196
|
+
"RpcSchema",
|
|
197
|
+
"RpcSerialization",
|
|
198
|
+
"Schema",
|
|
199
|
+
"makeEffectHttpApiClient",
|
|
200
|
+
"makeEffectRpcClient",
|
|
201
|
+
"mask",
|
|
202
|
+
"runEffectRequest",
|
|
203
|
+
"runEffectView",
|
|
204
|
+
"view"
|
|
205
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
206
|
+
Object.defineProperty(exports, '__esModule', {
|
|
207
|
+
value: true
|
|
208
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
+
applyRequestContext: ()=>applyRequestContext,
|
|
32
|
+
createEffectRequestContext: ()=>createEffectRequestContext
|
|
33
|
+
});
|
|
34
|
+
const external_guards_js_namespaceObject = require("./guards.js");
|
|
35
|
+
const createEffectRequestContext = (createRequestContextHeaders, requestContext)=>{
|
|
36
|
+
if (!(0, external_guards_js_namespaceObject.isRecord)(requestContext)) return {};
|
|
37
|
+
const headers = createRequestContextHeaders ? createRequestContextHeaders(requestContext) : {};
|
|
38
|
+
return {
|
|
39
|
+
...requestContext,
|
|
40
|
+
headers
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
const applyRequestContext = (normalizedRequest, request, createRequestContext)=>{
|
|
44
|
+
if (!(0, external_guards_js_namespaceObject.isRecord)(request) || !(0, external_guards_js_namespaceObject.isRecord)(request.requestContext)) return normalizedRequest;
|
|
45
|
+
const requestContext = createRequestContext(request.requestContext);
|
|
46
|
+
const requestHeaders = (0, external_guards_js_namespaceObject.isRecord)(requestContext.headers) ? requestContext.headers : {};
|
|
47
|
+
if (0 === Object.keys(requestHeaders).length) return normalizedRequest;
|
|
48
|
+
return {
|
|
49
|
+
...normalizedRequest,
|
|
50
|
+
headers: {
|
|
51
|
+
...(0, external_guards_js_namespaceObject.isRecord)(normalizedRequest.headers) ? normalizedRequest.headers : {},
|
|
52
|
+
...requestHeaders
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
exports.applyRequestContext = __webpack_exports__.applyRequestContext;
|
|
57
|
+
exports.createEffectRequestContext = __webpack_exports__.createEffectRequestContext;
|
|
58
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
59
|
+
"applyRequestContext",
|
|
60
|
+
"createEffectRequestContext"
|
|
61
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
62
|
+
Object.defineProperty(exports, '__esModule', {
|
|
63
|
+
value: true
|
|
64
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
+
normalizeRequest: ()=>normalizeRequest
|
|
32
|
+
});
|
|
33
|
+
const external_guards_js_namespaceObject = require("./guards.js");
|
|
34
|
+
const METHODS_WITHOUT_BODY = new Set([
|
|
35
|
+
'GET',
|
|
36
|
+
'DELETE',
|
|
37
|
+
'HEAD',
|
|
38
|
+
'OPTIONS'
|
|
39
|
+
]);
|
|
40
|
+
const normalizeRequest = (method, request)=>{
|
|
41
|
+
if (!(0, external_guards_js_namespaceObject.isRecord)(request)) return {};
|
|
42
|
+
const payload = {
|
|
43
|
+
...request
|
|
44
|
+
};
|
|
45
|
+
if ((0, external_guards_js_namespaceObject.isRecord)(request.path) && !(0, external_guards_js_namespaceObject.isRecord)(payload.params)) payload.params = request.path;
|
|
46
|
+
if ((0, external_guards_js_namespaceObject.isRecord)(request.urlParams) && !(0, external_guards_js_namespaceObject.isRecord)(payload.query)) payload.query = request.urlParams;
|
|
47
|
+
if ((0, external_guards_js_namespaceObject.isRecord)(request.headers) && !(0, external_guards_js_namespaceObject.isRecord)(payload.headers)) payload.headers = request.headers;
|
|
48
|
+
if ('payload' in request && void 0 !== request.payload) if ("u" > typeof FormData && request.payload instanceof FormData && !('formData' in payload)) payload.formData = request.payload;
|
|
49
|
+
else if (METHODS_WITHOUT_BODY.has(method)) {
|
|
50
|
+
if ((0, external_guards_js_namespaceObject.isRecord)(request.payload)) payload.query = (0, external_guards_js_namespaceObject.isRecord)(payload.query) ? {
|
|
51
|
+
...payload.query,
|
|
52
|
+
...request.payload
|
|
53
|
+
} : request.payload;
|
|
54
|
+
else if (!('body' in payload)) payload.body = request.payload;
|
|
55
|
+
} else if (!(0, external_guards_js_namespaceObject.isRecord)(request.payload) || 'data' in payload) {
|
|
56
|
+
if (!('body' in payload)) payload.body = request.payload;
|
|
57
|
+
} else payload.data = request.payload;
|
|
58
|
+
return payload;
|
|
59
|
+
};
|
|
60
|
+
exports.normalizeRequest = __webpack_exports__.normalizeRequest;
|
|
61
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
62
|
+
"normalizeRequest"
|
|
63
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
64
|
+
Object.defineProperty(exports, '__esModule', {
|
|
65
|
+
value: true
|
|
66
|
+
});
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
+
createGeneratedEffectClient: ()=>createGeneratedEffectClient
|
|
32
|
+
});
|
|
33
|
+
const external_batch_js_namespaceObject = require("./batch.js");
|
|
34
|
+
const external_envelope_js_namespaceObject = require("./envelope.js");
|
|
35
|
+
const external_request_context_js_namespaceObject = require("./request-context.js");
|
|
36
|
+
const createGeneratedEffectClient = (manifest, config, requestRuntime)=>{
|
|
37
|
+
const createRequest = requestRuntime.createRequest;
|
|
38
|
+
const configureRequest = 'function' == typeof requestRuntime.configure ? requestRuntime.configure : void 0;
|
|
39
|
+
const createRequestContextHeaders = 'function' == typeof requestRuntime.createRequestContextHeaders ? requestRuntime.createRequestContextHeaders : void 0;
|
|
40
|
+
const httpMethodDecider = config.httpMethodDecider || 'functionName';
|
|
41
|
+
const port = config.useEnvPort && "u" > typeof process && process.env && process.env.PORT ? process.env.PORT : config.port;
|
|
42
|
+
(0, external_batch_js_namespaceObject.configureGeneratedEffectClientRuntime)(config, configureRequest);
|
|
43
|
+
const createEffectRequestContext = (requestContext)=>(0, external_request_context_js_namespaceObject.createEffectRequestContext)(createRequestContextHeaders, requestContext);
|
|
44
|
+
const client = {};
|
|
45
|
+
const operationManifest = {};
|
|
46
|
+
for (const endpoint of manifest.endpoints){
|
|
47
|
+
const operationId = `${endpoint.method}:${endpoint.routePath}`;
|
|
48
|
+
const operation = {
|
|
49
|
+
appNamespace: config.appNamespace,
|
|
50
|
+
apiId: endpoint.apiId,
|
|
51
|
+
group: endpoint.group,
|
|
52
|
+
endpoint: endpoint.endpoint,
|
|
53
|
+
operationId,
|
|
54
|
+
routePath: endpoint.routePath,
|
|
55
|
+
method: endpoint.method,
|
|
56
|
+
operationVersion: endpoint.operationVersion,
|
|
57
|
+
schemaHash: endpoint.schemaHash,
|
|
58
|
+
version: endpoint.operationVersion
|
|
59
|
+
};
|
|
60
|
+
const sender = createRequest({
|
|
61
|
+
path: endpoint.routePath,
|
|
62
|
+
method: endpoint.method,
|
|
63
|
+
port,
|
|
64
|
+
operationContext: {
|
|
65
|
+
operationId,
|
|
66
|
+
routePath: endpoint.routePath,
|
|
67
|
+
method: endpoint.method,
|
|
68
|
+
schemaHash: endpoint.schemaHash,
|
|
69
|
+
operationVersion: endpoint.operationVersion
|
|
70
|
+
},
|
|
71
|
+
httpMethodDecider,
|
|
72
|
+
...config.requestId ? {
|
|
73
|
+
requestId: config.requestId
|
|
74
|
+
} : {}
|
|
75
|
+
});
|
|
76
|
+
const call = (request = {})=>sender((0, external_envelope_js_namespaceObject.prepareEffectRequest)({
|
|
77
|
+
endpoint,
|
|
78
|
+
operation,
|
|
79
|
+
request,
|
|
80
|
+
config,
|
|
81
|
+
createEffectRequestContext
|
|
82
|
+
}));
|
|
83
|
+
client[endpoint.group] ??= {};
|
|
84
|
+
client[endpoint.group][endpoint.endpoint] = call;
|
|
85
|
+
operationManifest[endpoint.group] ??= {};
|
|
86
|
+
operationManifest[endpoint.group][endpoint.endpoint] = operation;
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
client,
|
|
90
|
+
operationManifest,
|
|
91
|
+
createEffectRequestContext
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
exports.createGeneratedEffectClient = __webpack_exports__.createGeneratedEffectClient;
|
|
95
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
96
|
+
"createGeneratedEffectClient"
|
|
97
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
98
|
+
Object.defineProperty(exports, '__esModule', {
|
|
99
|
+
value: true
|
|
100
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.r = (exports1)=>{
|
|
5
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
6
|
+
value: 'Module'
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
9
|
+
value: true
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
})();
|
|
13
|
+
var __webpack_exports__ = {};
|
|
14
|
+
__webpack_require__.r(__webpack_exports__);
|
|
15
|
+
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
16
|
+
Object.defineProperty(exports, '__esModule', {
|
|
17
|
+
value: true
|
|
18
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
function toHeaderRecord(headers) {
|
|
31
|
+
const record = {};
|
|
32
|
+
headers.forEach((value, key)=>{
|
|
33
|
+
record[key] = value;
|
|
34
|
+
});
|
|
35
|
+
return record;
|
|
36
|
+
}
|
|
37
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
38
|
+
toHeaderRecord: ()=>toHeaderRecord
|
|
39
|
+
});
|
|
40
|
+
exports.toHeaderRecord = __webpack_exports__.toHeaderRecord;
|
|
41
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
42
|
+
"toHeaderRecord"
|
|
43
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
44
|
+
Object.defineProperty(exports, '__esModule', {
|
|
45
|
+
value: true
|
|
46
|
+
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_modules__ = {
|
|
3
|
+
"./data-platform" (module) {
|
|
4
|
+
module.exports = require("./data-platform/index.js");
|
|
5
|
+
},
|
|
6
|
+
"./effect-client" (module) {
|
|
7
|
+
module.exports = require("./effect-client/index.js");
|
|
8
|
+
},
|
|
9
|
+
"./effect" (module) {
|
|
10
|
+
module.exports = require("./effect/index.js");
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
var __webpack_module_cache__ = {};
|
|
14
|
+
function __webpack_require__(moduleId) {
|
|
15
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
16
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
17
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
18
|
+
exports: {}
|
|
19
|
+
};
|
|
20
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
21
|
+
return module.exports;
|
|
22
|
+
}
|
|
23
|
+
(()=>{
|
|
24
|
+
__webpack_require__.n = (module)=>{
|
|
25
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
26
|
+
__webpack_require__.d(getter, {
|
|
27
|
+
a: getter
|
|
28
|
+
});
|
|
29
|
+
return getter;
|
|
30
|
+
};
|
|
31
|
+
})();
|
|
32
|
+
(()=>{
|
|
33
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
34
|
+
var define = (defs, kind)=>{
|
|
35
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
[kind]: defs[key]
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
define(getters, "get");
|
|
41
|
+
define(values, "value");
|
|
42
|
+
};
|
|
43
|
+
})();
|
|
44
|
+
(()=>{
|
|
45
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
46
|
+
})();
|
|
47
|
+
(()=>{
|
|
48
|
+
__webpack_require__.r = (exports1)=>{
|
|
49
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
50
|
+
value: 'Module'
|
|
51
|
+
});
|
|
52
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
53
|
+
value: true
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
})();
|
|
57
|
+
var __webpack_exports__ = {};
|
|
58
|
+
(()=>{
|
|
59
|
+
__webpack_require__.r(__webpack_exports__);
|
|
60
|
+
var _data_platform__rspack_import_0 = __webpack_require__("./data-platform");
|
|
61
|
+
var _effect__rspack_import_1 = __webpack_require__("./effect");
|
|
62
|
+
var __rspack_reexport = {};
|
|
63
|
+
for(const __rspack_import_key in _effect__rspack_import_1)if ([
|
|
64
|
+
"EffectClient",
|
|
65
|
+
"DataPlatform",
|
|
66
|
+
"default"
|
|
67
|
+
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_effect__rspack_import_1[__rspack_import_key];
|
|
68
|
+
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
69
|
+
var _effect_client__rspack_import_2 = __webpack_require__("./effect-client");
|
|
70
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
71
|
+
DataPlatform: ()=>_data_platform__rspack_import_0,
|
|
72
|
+
EffectClient: ()=>_effect_client__rspack_import_2
|
|
73
|
+
});
|
|
74
|
+
})();
|
|
75
|
+
exports.DataPlatform = __webpack_exports__.DataPlatform;
|
|
76
|
+
exports.EffectClient = __webpack_exports__.EffectClient;
|
|
77
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
78
|
+
"DataPlatform",
|
|
79
|
+
"EffectClient"
|
|
80
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
81
|
+
Object.defineProperty(exports, '__esModule', {
|
|
82
|
+
value: true
|
|
83
|
+
});
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { isPlainObject } from "../codec.mjs";
|
|
2
|
+
const BASE64_CHUNK_SIZE = 0x8000;
|
|
3
|
+
const CANONICAL_BASE64 = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;
|
|
4
|
+
const RESPONSE_BLOCKED_HEADERS = new Set([
|
|
5
|
+
'connection',
|
|
6
|
+
'content-length',
|
|
7
|
+
'keep-alive',
|
|
8
|
+
'proxy-authenticate',
|
|
9
|
+
'proxy-authorization',
|
|
10
|
+
'proxy-connection',
|
|
11
|
+
'set-cookie',
|
|
12
|
+
'te',
|
|
13
|
+
'trailer',
|
|
14
|
+
'transfer-encoding',
|
|
15
|
+
'upgrade'
|
|
16
|
+
]);
|
|
17
|
+
const NULL_BODY_STATUSES = new Set([
|
|
18
|
+
204,
|
|
19
|
+
205,
|
|
20
|
+
304
|
|
21
|
+
]);
|
|
22
|
+
function encodeBatchBody(bytes) {
|
|
23
|
+
let binary = '';
|
|
24
|
+
for(let offset = 0; offset < bytes.byteLength; offset += BASE64_CHUNK_SIZE)binary += String.fromCharCode(...bytes.subarray(offset, offset + BASE64_CHUNK_SIZE));
|
|
25
|
+
return {
|
|
26
|
+
encoding: 'base64',
|
|
27
|
+
data: btoa(binary)
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function encodeBatchText(value) {
|
|
31
|
+
return encodeBatchBody(new TextEncoder().encode(value));
|
|
32
|
+
}
|
|
33
|
+
function decodeBatchBody(body) {
|
|
34
|
+
const binary = atob(body.data);
|
|
35
|
+
const bytes = new Uint8Array(binary.length);
|
|
36
|
+
for(let index = 0; index < binary.length; index += 1)bytes[index] = binary.charCodeAt(index);
|
|
37
|
+
return bytes;
|
|
38
|
+
}
|
|
39
|
+
function isBatchBody(value) {
|
|
40
|
+
return isPlainObject(value) && 'base64' === value.encoding && 'string' == typeof value.data && CANONICAL_BASE64.test(value.data) && btoa(atob(value.data)) === value.data;
|
|
41
|
+
}
|
|
42
|
+
function isBatchHeaderList(value) {
|
|
43
|
+
return Array.isArray(value) && value.every((entry)=>Array.isArray(entry) && 2 === entry.length && 'string' == typeof entry[0] && 'string' == typeof entry[1]);
|
|
44
|
+
}
|
|
45
|
+
function isNullBodyStatus(status) {
|
|
46
|
+
return NULL_BODY_STATUSES.has(status);
|
|
47
|
+
}
|
|
48
|
+
function toBatchResponseHeaders(headers) {
|
|
49
|
+
const connectionHeaders = new Set((headers.get('connection') || '').split(',').map((header)=>header.trim().toLowerCase()).filter(Boolean));
|
|
50
|
+
const output = [];
|
|
51
|
+
headers.forEach((value, name)=>{
|
|
52
|
+
const normalizedName = name.toLowerCase();
|
|
53
|
+
if (!RESPONSE_BLOCKED_HEADERS.has(normalizedName) && !connectionHeaders.has(normalizedName)) output.push([
|
|
54
|
+
normalizedName,
|
|
55
|
+
value
|
|
56
|
+
]);
|
|
57
|
+
});
|
|
58
|
+
return output;
|
|
59
|
+
}
|
|
60
|
+
async function toBatchResponseItem(id, response, omitBody = false) {
|
|
61
|
+
const body = omitBody || null === response.body ? void 0 : encodeBatchBody(new Uint8Array(await response.arrayBuffer()));
|
|
62
|
+
return {
|
|
63
|
+
id,
|
|
64
|
+
status: response.status,
|
|
65
|
+
headers: toBatchResponseHeaders(response.headers),
|
|
66
|
+
...body ? {
|
|
67
|
+
body
|
|
68
|
+
} : {}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
export { decodeBatchBody, encodeBatchBody, encodeBatchText, isBatchBody, isBatchHeaderList, isNullBodyStatus, toBatchResponseHeaders, toBatchResponseItem };
|