@mionjs/client 0.8.0-alpha.0
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/_virtual/jit-fns.cjs +315 -0
- package/.dist/cjs/_virtual/jit-fns.cjs.map +1 -0
- package/.dist/cjs/_virtual/pure-fns.cjs +56 -0
- package/.dist/cjs/_virtual/pure-fns.cjs.map +1 -0
- package/.dist/cjs/_virtual/router-cache.cjs +2 -0
- package/.dist/cjs/_virtual/router-cache.cjs.map +1 -0
- package/.dist/cjs/index.cjs +2 -0
- package/.dist/cjs/index.cjs.map +1 -0
- package/.dist/cjs/index.d.ts +11 -0
- package/.dist/cjs/package.json +1 -0
- package/.dist/cjs/src/aot/loadClientAOTCaches.cjs +2 -0
- package/.dist/cjs/src/aot/loadClientAOTCaches.cjs.map +1 -0
- package/.dist/cjs/src/aot/loadClientAOTCaches.d.ts +8 -0
- package/.dist/cjs/src/client.cjs +2 -0
- package/.dist/cjs/src/client.cjs.map +1 -0
- package/.dist/cjs/src/client.d.ts +28 -0
- package/.dist/cjs/src/clientMethodsMetadata.cjs +2 -0
- package/.dist/cjs/src/clientMethodsMetadata.cjs.map +1 -0
- package/.dist/cjs/src/clientMethodsMetadata.d.ts +10 -0
- package/.dist/cjs/src/constants.cjs +2 -0
- package/.dist/cjs/src/constants.cjs.map +1 -0
- package/.dist/cjs/src/constants.d.ts +6 -0
- package/.dist/cjs/src/handlersRegistry.cjs +2 -0
- package/.dist/cjs/src/handlersRegistry.cjs.map +1 -0
- package/.dist/cjs/src/handlersRegistry.d.ts +18 -0
- package/.dist/cjs/src/request.cjs +2 -0
- package/.dist/cjs/src/request.cjs.map +1 -0
- package/.dist/cjs/src/request.d.ts +30 -0
- package/.dist/cjs/src/routesFlow.cjs +2 -0
- package/.dist/cjs/src/routesFlow.cjs.map +1 -0
- package/.dist/cjs/src/routesFlow.d.ts +6 -0
- package/.dist/cjs/src/serializer.cjs +2 -0
- package/.dist/cjs/src/serializer.cjs.map +1 -0
- package/.dist/cjs/src/serializer.d.ts +13 -0
- package/.dist/cjs/src/storage.cjs +2 -0
- package/.dist/cjs/src/storage.cjs.map +1 -0
- package/.dist/cjs/src/storage.d.ts +11 -0
- package/.dist/cjs/src/subRequest.cjs +2 -0
- package/.dist/cjs/src/subRequest.cjs.map +1 -0
- package/.dist/cjs/src/subRequest.d.ts +23 -0
- package/.dist/cjs/src/testUtils.cjs +2 -0
- package/.dist/cjs/src/testUtils.cjs.map +1 -0
- package/.dist/cjs/src/testUtils.d.ts +1 -0
- package/.dist/cjs/src/typedEvent.cjs +2 -0
- package/.dist/cjs/src/typedEvent.cjs.map +1 -0
- package/.dist/cjs/src/typedEvent.d.ts +17 -0
- package/.dist/cjs/src/types.cjs +2 -0
- package/.dist/cjs/src/types.cjs.map +1 -0
- package/.dist/cjs/src/types.d.ts +152 -0
- package/.dist/cjs/src/validation.cjs +2 -0
- package/.dist/cjs/src/validation.cjs.map +1 -0
- package/.dist/cjs/src/validation.d.ts +4 -0
- package/.dist/esm/_virtual/jit-fns.js +1391 -0
- package/.dist/esm/_virtual/jit-fns.js.map +1 -0
- package/.dist/esm/_virtual/pure-fns.js +109 -0
- package/.dist/esm/_virtual/pure-fns.js.map +1 -0
- package/.dist/esm/_virtual/router-cache.js +5 -0
- package/.dist/esm/_virtual/router-cache.js.map +1 -0
- package/.dist/esm/index.d.ts +11 -0
- package/.dist/esm/index.js +80 -0
- package/.dist/esm/index.js.map +1 -0
- package/.dist/esm/src/aot/loadClientAOTCaches.d.ts +8 -0
- package/.dist/esm/src/aot/loadClientAOTCaches.js +19 -0
- package/.dist/esm/src/aot/loadClientAOTCaches.js.map +1 -0
- package/.dist/esm/src/client.d.ts +28 -0
- package/.dist/esm/src/client.js +185 -0
- package/.dist/esm/src/client.js.map +1 -0
- package/.dist/esm/src/clientMethodsMetadata.d.ts +10 -0
- package/.dist/esm/src/clientMethodsMetadata.js +162 -0
- package/.dist/esm/src/clientMethodsMetadata.js.map +1 -0
- package/.dist/esm/src/constants.d.ts +6 -0
- package/.dist/esm/src/constants.js +25 -0
- package/.dist/esm/src/constants.js.map +1 -0
- package/.dist/esm/src/handlersRegistry.d.ts +18 -0
- package/.dist/esm/src/handlersRegistry.js +70 -0
- package/.dist/esm/src/handlersRegistry.js.map +1 -0
- package/.dist/esm/src/request.d.ts +30 -0
- package/.dist/esm/src/request.js +289 -0
- package/.dist/esm/src/request.js.map +1 -0
- package/.dist/esm/src/routesFlow.d.ts +6 -0
- package/.dist/esm/src/routesFlow.js +61 -0
- package/.dist/esm/src/routesFlow.js.map +1 -0
- package/.dist/esm/src/serializer.d.ts +13 -0
- package/.dist/esm/src/serializer.js +139 -0
- package/.dist/esm/src/serializer.js.map +1 -0
- package/.dist/esm/src/storage.d.ts +11 -0
- package/.dist/esm/src/storage.js +48 -0
- package/.dist/esm/src/storage.js.map +1 -0
- package/.dist/esm/src/subRequest.d.ts +23 -0
- package/.dist/esm/src/subRequest.js +73 -0
- package/.dist/esm/src/subRequest.js.map +1 -0
- package/.dist/esm/src/testUtils.d.ts +1 -0
- package/.dist/esm/src/testUtils.js +48 -0
- package/.dist/esm/src/testUtils.js.map +1 -0
- package/.dist/esm/src/typedEvent.d.ts +17 -0
- package/.dist/esm/src/typedEvent.js +41 -0
- package/.dist/esm/src/typedEvent.js.map +1 -0
- package/.dist/esm/src/types.d.ts +152 -0
- package/.dist/esm/src/types.js +42 -0
- package/.dist/esm/src/types.js.map +1 -0
- package/.dist/esm/src/validation.d.ts +4 -0
- package/.dist/esm/src/validation.js +57 -0
- package/.dist/esm/src/validation.js.map +1 -0
- package/LICENSE +21 -0
- package/README.md +34 -0
- package/package.json +74 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const pureFnsCache={mion:{asJSONString:{namespace:"mion",paramNames:[],code:`if (typeof Bun !== "undefined") return JSON.stringify;
|
|
2
|
+
const STR_ESCAPE = /[\\u0000-\\u001f\\u0022\\u005c\\ud800-\\udfff]/;
|
|
3
|
+
const MAX_SCAPE_TEST_LENGTH = 1e3;
|
|
4
|
+
return function _asJSONStringRegexOnly(str) {
|
|
5
|
+
if (str.length < MAX_SCAPE_TEST_LENGTH && STR_ESCAPE.test(str) === false) {
|
|
6
|
+
return '"' + str + '"';
|
|
7
|
+
} else {
|
|
8
|
+
return JSON.stringify(str);
|
|
9
|
+
}
|
|
10
|
+
};`,fnName:"asJSONString",bodyHash:"4WYkR03dXOzAUe",pureFnDependencies:[],createPureFn:function(){if(typeof Bun<"u")return JSON.stringify;const STR_ESCAPE=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/,MAX_SCAPE_TEST_LENGTH=1e3;return function(str){return str.length<MAX_SCAPE_TEST_LENGTH&&STR_ESCAPE.test(str)===!1?'"'+str+'"':JSON.stringify(str)}},fn:void 0},getUnknownKeysFromArray:{namespace:"mion",paramNames:[],code:`const MAX_UNKNOWN_KEYS = 10;
|
|
11
|
+
return function _getUnknownKeysFromArray(obj, keys) {
|
|
12
|
+
const unknownKeys = [];
|
|
13
|
+
for (const prop in obj) {
|
|
14
|
+
let found = false;
|
|
15
|
+
for (let j = 0; j < keys.length; j++) {
|
|
16
|
+
if (keys[j] === prop) {
|
|
17
|
+
found = true;
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
if (!found) {
|
|
22
|
+
unknownKeys.push(prop);
|
|
23
|
+
if (unknownKeys.length >= MAX_UNKNOWN_KEYS) throw new Error("Too many unknown keys");
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return unknownKeys;
|
|
27
|
+
};`,fnName:"getUnknownKeysFromArray",bodyHash:"D2CDXI8OoGLGyW",pureFnDependencies:[],createPureFn:function(){return function(obj,keys){const unknownKeys=[];for(const prop in obj){let found=!1;for(let j=0;j<keys.length;j++)if(keys[j]===prop){found=!0;break}if(!found&&(unknownKeys.push(prop),unknownKeys.length>=10))throw new Error("Too many unknown keys")}return unknownKeys}},fn:void 0},hasUnknownKeysFromArray:{namespace:"mion",paramNames:[],code:`return function _hasUnknownKeysFromArray(obj, keys) {
|
|
28
|
+
for (const prop in obj) {
|
|
29
|
+
let found = false;
|
|
30
|
+
for (let j = 0; j < keys.length; j++) {
|
|
31
|
+
if (keys[j] === prop) {
|
|
32
|
+
found = true;
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (!found) return true;
|
|
37
|
+
}
|
|
38
|
+
return false;
|
|
39
|
+
};`,fnName:"hasUnknownKeysFromArray",bodyHash:"K7uzDGNnPwcqQ9",pureFnDependencies:[],createPureFn:function(){return function(obj,keys){for(const prop in obj){let found=!1;for(let j=0;j<keys.length;j++)if(keys[j]===prop){found=!0;break}if(!found)return!0}return!1}},fn:void 0},newRunTypeErr:{namespace:"mion",paramNames:[],code:`return function _err(p\\u03BBth, \\u03B5rr, expected, accessPath) {
|
|
40
|
+
const path = accessPath?.length ? [...p\\u03BBth, ...accessPath] : [...p\\u03BBth];
|
|
41
|
+
const runTypeErr = { expected, path };
|
|
42
|
+
\\u03B5rr.push(runTypeErr);
|
|
43
|
+
};`,fnName:"newRunTypeErr",bodyHash:"eCwDrS1nuSv7ge",pureFnDependencies:[],createPureFn:function(){return function(pλth,εrr,expected,accessPath){const path=accessPath?.length?[...pλth,...accessPath]:[...pλth],runTypeErr={expected,path};εrr.push(runTypeErr)}},fn:void 0},formatErr:{namespace:"mion",paramNames:[],code:`return function _formatErr(p\\u03BBth, \\u03B5rr, expected, fmtName, paramName, paramVal, fmtPath, accessPath, fmtAccessPath) {
|
|
44
|
+
const path = accessPath?.length ? [...p\\u03BBth, ...accessPath] : [...p\\u03BBth];
|
|
45
|
+
const formatPath = fmtAccessPath?.length ? [...fmtPath, ...fmtAccessPath, paramName] : [...fmtPath, paramName];
|
|
46
|
+
const format = { name: fmtName, formatPath, val: paramVal };
|
|
47
|
+
const runTypeErr = { expected, path, format };
|
|
48
|
+
\\u03B5rr.push(runTypeErr);
|
|
49
|
+
};`,fnName:"formatErr",bodyHash:"2isPiuLWPtohVR",pureFnDependencies:[],createPureFn:function(){return function(pλth,εrr,expected,fmtName,paramName,paramVal,fmtPath,accessPath,fmtAccessPath){const path=accessPath?.length?[...pλth,...accessPath]:[...pλth],formatPath=fmtAccessPath?.length?[...fmtPath,...fmtAccessPath,paramName]:[...fmtPath,paramName],runTypeErr={expected,path,format:{name:fmtName,formatPath,val:paramVal}};εrr.push(runTypeErr)}},fn:void 0},safeIterableKey:{namespace:"mion",paramNames:[],code:`return function _safeKey(value) {
|
|
50
|
+
if (value === void 0) return null;
|
|
51
|
+
if (value === null) return null;
|
|
52
|
+
const type = typeof value;
|
|
53
|
+
if (type === "number" || type === "string" || type === "boolean") return value;
|
|
54
|
+
return null;
|
|
55
|
+
};`,fnName:"safeIterableKey",bodyHash:"BrjL47E-GRjUpQ",pureFnDependencies:[],createPureFn:function(){return function(value){if(value===void 0||value===null)return null;const type=typeof value;return type==="number"||type==="string"||type==="boolean"?value:null}},fn:void 0}}};exports.pureFnsCache=pureFnsCache;
|
|
56
|
+
//# sourceMappingURL=pure-fns.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pure-fns.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const routerCache={"@thrownErrors":{paramNames:[],type:1,id:"@thrownErrors",isAsync:!1,hasReturnData:!0,paramsJitHash:"",returnJitHash:"cm6MsK",pointer:["@thrownErrors"],nestLevel:0,options:{runOnError:!1,validateParams:!0,validateReturn:!1,serializer:"json"}},"mion@notFound":{paramNames:[],type:1,id:"mion@notFound",isAsync:!1,hasReturnData:!0,paramsJitHash:"",returnJitHash:"a8UQwC",pointer:["mion@notFound"],nestLevel:0,options:{runOnError:!1,validateParams:!0,validateReturn:!1,serializer:"json"}},"mion@platformError":{paramNames:[],type:1,id:"mion@platformError",isAsync:!1,hasReturnData:!0,paramsJitHash:"",returnJitHash:"zxRrbt",pointer:["mion@platformError"],nestLevel:0,options:{runOnError:!1,validateParams:!0,validateReturn:!1,serializer:"json"}},"mion@methodsMetadataById":{paramNames:["methodsIds","getAllRemoteMethods"],type:1,id:"mion@methodsMetadataById",isAsync:!1,hasReturnData:!0,paramsJitHash:"JtnVhp",returnJitHash:"rFrbJx",pointer:["mion@methodsMetadataById"],nestLevel:0,options:{runOnError:!1,validateParams:!0,validateReturn:!1,serializer:"stringifyJson"}},"mion@methodsMetadataByPath":{paramNames:["path","getAllRemoteMethods"],type:1,id:"mion@methodsMetadataByPath",isAsync:!1,hasReturnData:!0,paramsJitHash:"hZzD9z",returnJitHash:"rFrbJx",pointer:["mion@methodsMetadataByPath"],nestLevel:0,options:{runOnError:!1,validateParams:!0,validateReturn:!1,serializer:"stringifyJson"}},"mion@mionEmptyMiddleFn":{paramNames:[],type:2,id:"mion@mionEmptyMiddleFn",isAsync:!1,hasReturnData:!1,paramsJitHash:"",returnJitHash:"",pointer:["mion@mionEmptyMiddleFn"],nestLevel:0,options:{runOnError:!1,validateParams:!0,validateReturn:!1}}};exports.routerCache=routerCache;
|
|
2
|
+
//# sourceMappingURL=router-cache.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router-cache.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const src_types=require("./src/types.cjs"),src_constants=require("./src/constants.cjs"),src_storage=require("./src/storage.cjs"),src_validation=require("./src/validation.cjs"),src_serializer=require("./src/serializer.cjs"),src_clientMethodsMetadata=require("./src/clientMethodsMetadata.cjs"),src_request=require("./src/request.cjs"),src_client=require("./src/client.cjs"),src_typedEvent=require("./src/typedEvent.cjs"),src_handlersRegistry=require("./src/handlersRegistry.cjs"),src_routesFlow=require("./src/routesFlow.cjs");exports.__ΩCallWithMiddleFnsResult=src_types.__ΩCallWithMiddleFnsResult;exports.__ΩCleaned=src_types.__ΩCleaned;exports.__ΩClientMiddleFns=src_types.__ΩClientMiddleFns;exports.__ΩClientOptions=src_types.__ΩClientOptions;exports.__ΩClientRoutes=src_types.__ΩClientRoutes;exports.__ΩErrorHandler=src_types.__ΩErrorHandler;exports.__ΩFailResponse=src_types.__ΩFailResponse;exports.__ΩFailResponses=src_types.__ΩFailResponses;exports.__ΩHSubRequest=src_types.__ΩHSubRequest;exports.__ΩHandlerErrors=src_types.__ΩHandlerErrors;exports.__ΩHandlerFailResponse=src_types.__ΩHandlerFailResponse;exports.__ΩHandlerResponse=src_types.__ΩHandlerResponse;exports.__ΩHandlerSuccessResponse=src_types.__ΩHandlerSuccessResponse;exports.__ΩHeadersParamsType=src_types.__ΩHeadersParamsType;exports.__ΩInitClientOptions=src_types.__ΩInitClientOptions;exports.__ΩMiddleFnError=src_types.__ΩMiddleFnError;exports.__ΩMiddleFnSuccess=src_types.__ΩMiddleFnSuccess;exports.__ΩNonClientMiddleFn=src_types.__ΩNonClientMiddleFn;exports.__ΩNonClientRoute=src_types.__ΩNonClientRoute;exports.__ΩPrefilledMiddleFnsCache=src_types.__ΩPrefilledMiddleFnsCache;exports.__ΩRSubRequest=src_types.__ΩRSubRequest;exports.__ΩRequestBody=src_types.__ΩRequestBody;exports.__ΩRequestErrors=src_types.__ΩRequestErrors;exports.__ΩRequestHeaders=src_types.__ΩRequestHeaders;exports.__ΩResult=src_types.__ΩResult;exports.__ΩRouteParamType=src_types.__ΩRouteParamType;exports.__ΩRouteParamsType=src_types.__ΩRouteParamsType;exports.__ΩRouteReturnType=src_types.__ΩRouteReturnType;exports.__ΩSubRequest=src_types.__ΩSubRequest;exports.__ΩSuccessClientResponse=src_types.__ΩSuccessClientResponse;exports.__ΩSuccessHandler=src_types.__ΩSuccessHandler;exports.__ΩSuccessResponse=src_types.__ΩSuccessResponse;exports.__ΩSuccessResponses=src_types.__ΩSuccessResponses;exports.__ΩUnknownErrorHandler=src_types.__ΩUnknownErrorHandler;exports.__ΩWorkflowResult=src_types.__ΩWorkflowResult;exports.__ΩWorkflowRouteErrors=src_types.__ΩWorkflowRouteErrors;exports.__ΩWorkflowRouteResults=src_types.__ΩWorkflowRouteResults;exports.DEFAULT_PREFILL_OPTIONS=src_constants.DEFAULT_PREFILL_OPTIONS;exports.MAX_GET_URL_LENGTH=src_constants.MAX_GET_URL_LENGTH;exports.ROUTES_FLOW_KEY=src_constants.ROUTES_FLOW_KEY;exports.ROUTES_FLOW_PATH=src_constants.ROUTES_FLOW_PATH;exports.STORAGE_KEY=src_constants.STORAGE_KEY;exports.MemoryStorage=src_storage.MemoryStorage;exports.getStorage=src_storage.getStorage;exports.resetStorageInstance=src_storage.resetStorageInstance;exports.validateSubRequest=src_validation.validateSubRequest;exports.validateSubRequests=src_validation.validateSubRequests;exports.__ΩContentType=src_serializer.__ΩContentType;exports.__ΩSerializedBody=src_serializer.__ΩSerializedBody;exports.__ΩSerializedRequest=src_serializer.__ΩSerializedRequest;exports.deserializeResponseBody=src_serializer.deserializeResponseBody;exports.serializeRequestBody=src_serializer.serializeRequestBody;exports.fetchRemoteMethodsMetadata=src_clientMethodsMetadata.fetchRemoteMethodsMetadata;exports.getAOTCaches=src_clientMethodsMetadata.getAOTCaches;exports.restoreAllDependencies=src_clientMethodsMetadata.restoreAllDependencies;exports.storeDependencies=src_clientMethodsMetadata.storeDependencies;exports.storeMethodsMetadata=src_clientMethodsMetadata.storeMethodsMetadata;exports.MionClientRequest=src_request.MionClientRequest;exports.MionClient=src_client.MionClient;exports.initClient=src_client.initClient;exports.TypedEvent=src_typedEvent.TypedEvent;exports.HandlersRegistry=src_handlersRegistry.HandlersRegistry;exports.isMapFromRef=src_routesFlow.isMapFromRef;exports.mapFrom=src_routesFlow.mapFrom;exports.mapFromSymbol=src_routesFlow.mapFromSymbol;exports.routesFlow=src_routesFlow.routesFlow;
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './src/types.ts';
|
|
2
|
+
export * from './src/constants.ts';
|
|
3
|
+
export * from './src/storage.ts';
|
|
4
|
+
export * from './src/validation.ts';
|
|
5
|
+
export * from './src/serializer.ts';
|
|
6
|
+
export * from './src/clientMethodsMetadata.ts';
|
|
7
|
+
export * from './src/request.ts';
|
|
8
|
+
export * from './src/client.ts';
|
|
9
|
+
export * from './src/typedEvent.ts';
|
|
10
|
+
export * from './src/handlersRegistry.ts';
|
|
11
|
+
export * from './src/routesFlow.ts';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const core=require("@mionjs/core"),jitFns=require("../../_virtual/jit-fns.cjs"),pureFns=require("../../_virtual/pure-fns.cjs"),routerCache=require("../../_virtual/router-cache.cjs"),src_client=require("../client.cjs"),src_types=require("../types.cjs");function loadClientAotCaches(){core.addAOTCaches(jitFns.jitFnsCache,pureFns.pureFnsCache),core.addRoutesToCache(routerCache.routerCache)}loadClientAotCaches.__type=["loadClientAotCaches",'P"/!'];function initAOTClient(options){return loadClientAotCaches(),src_client.initClient.Ω=[["RemoteApi",'"w!']],src_client.initClient(options)}initAOTClient.__type=[()=>src_types.__ΩInitClientOptions,"options","initAOTClient",'Pn!2""/#'];exports.initAOTClient=initAOTClient;exports.loadClientAotCaches=loadClientAotCaches;
|
|
2
|
+
//# sourceMappingURL=loadClientAOTCaches.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadClientAOTCaches.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InitClientOptions } from '../types.ts';
|
|
2
|
+
import { RemoteApi } from '@mionjs/router';
|
|
3
|
+
export declare function loadClientAotCaches(): void;
|
|
4
|
+
export declare function initAOTClient<RM extends RemoteApi>(options: InitClientOptions): {
|
|
5
|
+
client: import('../client.ts').MionClient;
|
|
6
|
+
routes: { [Property in keyof RM as RM[Property] extends import('../types.ts').NonClientRoute ? never : Property]: RM[Property] extends import('@mionjs/router').PublicRoute<any> ? (...params: Parameters<RM[Property]["handler"]>) => import('../types.ts').RSubRequest<RM[Property]["handler"]> : RM[Property] extends RemoteApi ? (RM[Property] extends infer T_2 extends RemoteApi ? { [Property_2 in keyof T_2 as RM[Property][Property_2] extends import('../types.ts').NonClientRoute ? never : Property_2]: T_2[Property_2] extends import('@mionjs/router').PublicRoute<any> ? (...params: Parameters<T_2[Property_2]["handler"]>) => import('../types.ts').RSubRequest<T_2[Property_2]["handler"]> : T_2[Property_2] extends RemoteApi ? (T_2[Property_2] extends infer T_4 extends RemoteApi ? { [Property_3 in keyof T_4 as T_2[Property_2][Property_3] extends import('../types.ts').NonClientRoute ? never : Property_3]: T_4[Property_3] extends import('@mionjs/router').PublicRoute<any> ? (...params: Parameters<T_4[Property_3]["handler"]>) => import('../types.ts').RSubRequest<T_4[Property_3]["handler"]> : T_4[Property_3] extends RemoteApi ? (T_4[Property_3] extends infer T_6 extends RemoteApi ? { [Property_4 in keyof T_6 as T_4[Property_3][Property_4] extends import('../types.ts').NonClientRoute ? never : Property_4]: T_6[Property_4] extends import('@mionjs/router').PublicRoute<any> ? (...params: Parameters<T_6[Property_4]["handler"]>) => import('../types.ts').RSubRequest<T_6[Property_4]["handler"]> : T_6[Property_4] extends RemoteApi ? (T_6[Property_4] extends infer T_8 extends RemoteApi ? { [Property_5 in keyof T_8 as T_6[Property_4][Property_5] extends import('../types.ts').NonClientRoute ? never : Property_5]: T_8[Property_5] extends import('@mionjs/router').PublicRoute<any> ? (...params: Parameters<T_8[Property_5]["handler"]>) => import('../types.ts').RSubRequest<T_8[Property_5]["handler"]> : T_8[Property_5] extends RemoteApi ? (T_8[Property_5] extends infer T_10 extends RemoteApi ? { [Property_6 in keyof T_10 as T_8[Property_5][Property_6] extends import('../types.ts').NonClientRoute ? never : Property_6]: T_10[Property_6] extends import('@mionjs/router').PublicRoute<any> ? (...params: Parameters<T_10[Property_6]["handler"]>) => import('../types.ts').RSubRequest<T_10[Property_6]["handler"]> : T_10[Property_6] extends RemoteApi ? (T_10[Property_6] extends infer T_12 extends RemoteApi ? { [Property_7 in keyof T_12 as T_10[Property_6][Property_7] extends import('../types.ts').NonClientRoute ? never : Property_7]: T_12[Property_7] extends import('@mionjs/router').PublicRoute<any> ? (...params: Parameters<T_12[Property_7]["handler"]>) => import('../types.ts').RSubRequest<T_12[Property_7]["handler"]> : T_12[Property_7] extends RemoteApi ? (T_12[Property_7] extends infer T_14 extends RemoteApi ? { [Property_8 in keyof T_14 as T_12[Property_7][Property_8] extends import('../types.ts').NonClientRoute ? never : Property_8]: T_14[Property_8] extends import('@mionjs/router').PublicRoute<any> ? (...params: Parameters<T_14[Property_8]["handler"]>) => import('../types.ts').RSubRequest<T_14[Property_8]["handler"]> : T_14[Property_8] extends RemoteApi ? (T_14[Property_8] extends infer T_16 extends RemoteApi ? { [Property_9 in keyof T_16 as T_14[Property_8][Property_9] extends import('../types.ts').NonClientRoute ? never : Property_9]: T_16[Property_9] extends import('@mionjs/router').PublicRoute<any> ? (...params: Parameters<T_16[Property_9]["handler"]>) => import('../types.ts').RSubRequest<T_16[Property_9]["handler"]> : T_16[Property_9] extends RemoteApi ? (T_16[Property_9] extends infer T_18 extends RemoteApi ? { [Property_10 in keyof T_18 as T_16[Property_9][Property_10] extends import('../types.ts').NonClientRoute ? never : Property_10]: T_18[Property_10] extends import('@mionjs/router').PublicRoute<any> ? (...params: Parameters<T_18[Property_10]["handler"]>) => import('../types.ts').RSubRequest<T_18[Property_10]["handler"]> : T_18[Property_10] extends RemoteApi ? (T_18[Property_10] extends infer T_20 extends RemoteApi ? { [Property_11 in keyof T_20 as T_18[Property_10][Property_11] extends import('../types.ts').NonClientRoute ? never : Property_11]: T_20[Property_11] extends import('@mionjs/router').PublicRoute<any> ? (...params: Parameters<T_20[Property_11]["handler"]>) => import('../types.ts').RSubRequest<T_20[Property_11]["handler"]> : T_20[Property_11] extends RemoteApi ? any : never; } : never) extends infer T_19 ? { [P_10 in keyof T_19]: T_19[P_10]; } : never : never; } : never) extends infer T_17 ? { [P_9 in keyof T_17]: T_17[P_9]; } : never : never; } : never) extends infer T_15 ? { [P_8 in keyof T_15]: T_15[P_8]; } : never : never; } : never) extends infer T_13 ? { [P_7 in keyof T_13]: T_13[P_7]; } : never : never; } : never) extends infer T_11 ? { [P_6 in keyof T_11]: T_11[P_6]; } : never : never; } : never) extends infer T_9 ? { [P_5 in keyof T_9]: T_9[P_5]; } : never : never; } : never) extends infer T_7 ? { [P_4 in keyof T_7]: T_7[P_4]; } : never : never; } : never) extends infer T_5 ? { [P_3 in keyof T_5]: T_5[P_3]; } : never : never; } : never) extends infer T_3 ? { [P_2 in keyof T_3]: T_3[P_2]; } : never : never; } : never) extends infer T_1 ? { [P_1 in keyof T_1]: T_1[P_1]; } : never : never; } extends infer T ? { [P in keyof T]: T[P]; } : never;
|
|
7
|
+
middleFns: { [Property_1 in keyof RM as RM[Property_1] extends import('../types.ts').NonClientMiddleFn ? never : Property_1]: RM[Property_1] extends import('@mionjs/router').PublicMiddleFn<any> | import('@mionjs/router').PublicHeadersFn<any> ? (...params: Parameters<RM[Property_1]["handler"]>) => import('../types.ts').HSubRequest<RM[Property_1]["handler"]> : RM[Property_1] extends RemoteApi ? (RM[Property_1] extends infer T_3 extends RemoteApi ? { [Property_3 in keyof T_3 as RM[Property_1][Property_3] extends import('../types.ts').NonClientMiddleFn ? never : Property_3]: T_3[Property_3] extends import('@mionjs/router').PublicMiddleFn<any> | import('@mionjs/router').PublicHeadersFn<any> ? (...params: Parameters<T_3[Property_3]["handler"]>) => import('../types.ts').HSubRequest<T_3[Property_3]["handler"]> : T_3[Property_3] extends RemoteApi ? (T_3[Property_3] extends infer T_5 extends RemoteApi ? { [Property_4 in keyof T_5 as T_3[Property_3][Property_4] extends import('../types.ts').NonClientMiddleFn ? never : Property_4]: T_5[Property_4] extends import('@mionjs/router').PublicMiddleFn<any> | import('@mionjs/router').PublicHeadersFn<any> ? (...params: Parameters<T_5[Property_4]["handler"]>) => import('../types.ts').HSubRequest<T_5[Property_4]["handler"]> : T_5[Property_4] extends RemoteApi ? (T_5[Property_4] extends infer T_7 extends RemoteApi ? { [Property_5 in keyof T_7 as T_5[Property_4][Property_5] extends import('../types.ts').NonClientMiddleFn ? never : Property_5]: T_7[Property_5] extends import('@mionjs/router').PublicMiddleFn<any> | import('@mionjs/router').PublicHeadersFn<any> ? (...params: Parameters<T_7[Property_5]["handler"]>) => import('../types.ts').HSubRequest<T_7[Property_5]["handler"]> : T_7[Property_5] extends RemoteApi ? (T_7[Property_5] extends infer T_9 extends RemoteApi ? { [Property_6 in keyof T_9 as T_7[Property_5][Property_6] extends import('../types.ts').NonClientMiddleFn ? never : Property_6]: T_9[Property_6] extends import('@mionjs/router').PublicMiddleFn<any> | import('@mionjs/router').PublicHeadersFn<any> ? (...params: Parameters<T_9[Property_6]["handler"]>) => import('../types.ts').HSubRequest<T_9[Property_6]["handler"]> : T_9[Property_6] extends RemoteApi ? (T_9[Property_6] extends infer T_11 extends RemoteApi ? { [Property_7 in keyof T_11 as T_9[Property_6][Property_7] extends import('../types.ts').NonClientMiddleFn ? never : Property_7]: T_11[Property_7] extends import('@mionjs/router').PublicMiddleFn<any> | import('@mionjs/router').PublicHeadersFn<any> ? (...params: Parameters<T_11[Property_7]["handler"]>) => import('../types.ts').HSubRequest<T_11[Property_7]["handler"]> : T_11[Property_7] extends RemoteApi ? (T_11[Property_7] extends infer T_13 extends RemoteApi ? { [Property_8 in keyof T_13 as T_11[Property_7][Property_8] extends import('../types.ts').NonClientMiddleFn ? never : Property_8]: T_13[Property_8] extends import('@mionjs/router').PublicMiddleFn<any> | import('@mionjs/router').PublicHeadersFn<any> ? (...params: Parameters<T_13[Property_8]["handler"]>) => import('../types.ts').HSubRequest<T_13[Property_8]["handler"]> : T_13[Property_8] extends RemoteApi ? (T_13[Property_8] extends infer T_15 extends RemoteApi ? { [Property_9 in keyof T_15 as T_13[Property_8][Property_9] extends import('../types.ts').NonClientMiddleFn ? never : Property_9]: T_15[Property_9] extends import('@mionjs/router').PublicMiddleFn<any> | import('@mionjs/router').PublicHeadersFn<any> ? (...params: Parameters<T_15[Property_9]["handler"]>) => import('../types.ts').HSubRequest<T_15[Property_9]["handler"]> : T_15[Property_9] extends RemoteApi ? (T_15[Property_9] extends infer T_17 extends RemoteApi ? { [Property_10 in keyof T_17 as T_15[Property_9][Property_10] extends import('../types.ts').NonClientMiddleFn ? never : Property_10]: T_17[Property_10] extends import('@mionjs/router').PublicMiddleFn<any> | import('@mionjs/router').PublicHeadersFn<any> ? (...params: Parameters<T_17[Property_10]["handler"]>) => import('../types.ts').HSubRequest<T_17[Property_10]["handler"]> : T_17[Property_10] extends RemoteApi ? (T_17[Property_10] extends infer T_19 extends RemoteApi ? { [Property_11 in keyof T_19 as T_17[Property_10][Property_11] extends import('../types.ts').NonClientMiddleFn ? never : Property_11]: T_19[Property_11] extends import('@mionjs/router').PublicMiddleFn<any> | import('@mionjs/router').PublicHeadersFn<any> ? (...params: Parameters<T_19[Property_11]["handler"]>) => import('../types.ts').HSubRequest<T_19[Property_11]["handler"]> : T_19[Property_11] extends RemoteApi ? (T_19[Property_11] extends infer T_21 extends RemoteApi ? { [Property_12 in keyof T_21 as T_19[Property_11][Property_12] extends import('../types.ts').NonClientMiddleFn ? never : Property_12]: T_21[Property_12] extends import('@mionjs/router').PublicMiddleFn<any> | import('@mionjs/router').PublicHeadersFn<any> ? (...params: Parameters<T_21[Property_12]["handler"]>) => import('../types.ts').HSubRequest<T_21[Property_12]["handler"]> : T_21[Property_12] extends RemoteApi ? any : never; } : never) extends infer T_20 ? { [P_11 in keyof T_20]: T_20[P_11]; } : never : never; } : never) extends infer T_18 ? { [P_10 in keyof T_18]: T_18[P_10]; } : never : never; } : never) extends infer T_16 ? { [P_9 in keyof T_16]: T_16[P_9]; } : never : never; } : never) extends infer T_14 ? { [P_8 in keyof T_14]: T_14[P_8]; } : never : never; } : never) extends infer T_12 ? { [P_7 in keyof T_12]: T_12[P_7]; } : never : never; } : never) extends infer T_10 ? { [P_6 in keyof T_10]: T_10[P_6]; } : never : never; } : never) extends infer T_8 ? { [P_5 in keyof T_8]: T_8[P_5]; } : never : never; } : never) extends infer T_6 ? { [P_4 in keyof T_6]: T_6[P_4]; } : never : never; } : never) extends infer T_4 ? { [P_3 in keyof T_4]: T_4[P_3]; } : never : never; } : never) extends infer T_2 ? { [P_2 in keyof T_2]: T_2[P_2]; } : never : never; } extends infer T_1 ? { [P_1 in keyof T_1]: T_1[P_1]; } : never;
|
|
8
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const src_constants=require("./constants.cjs"),src_types=require("./types.cjs"),core=require("@mionjs/core"),src_request=require("./request.cjs"),src_handlersRegistry=require("./handlersRegistry.cjs"),src_subRequest=require("./subRequest.cjs"),__ΩRecord=["K","T","Record",`l'e#"Rb!b"Pde"!N#!w#y`];function __assignType(fn,args){return fn.__type=args,fn}function initClient(options){core.registerErrorDeserializers();const clientOptions={...src_constants.DEFAULT_PREFILL_OPTIONS,...options},client=new MionClient(clientOptions),rootProxy=new MethodProxy([],client,clientOptions);return{client,routes:rootProxy.proxy,middleFns:rootProxy.proxy}}initClient.__type=[()=>src_types.__ΩInitClientOptions,"options",()=>MionClient,"client",()=>src_types.__ΩClientRoutes,"routes",()=>src_types.__ΩClientMiddleFns,"middleFns","initClient",`Pn!2"PP7#4$"o%"4&"o'"4(M/)`];class MionClient{clientOptions;handlersRegistry=new src_handlersRegistry.HandlersRegistry;prefilledMiddleFnsCache=(Map.Ω=[["&"],[()=>src_types.__ΩSubRequest,'"o!"']],new Map);pendingPrefills=[];constructor(clientOptions){this.clientOptions=clientOptions}executeCall(routeSubRequest){return this.executeRequest(routeSubRequest,void 0,void 0)}executeCallWithMiddleFns(routeSubRequest,middleFnsRecord){return this.executeRequest(routeSubRequest,void 0,middleFnsRecord)}executeCallWithWorkflow(workflowSubRequests,middleFnsRecord){return this.executeRequest(void 0,workflowSubRequests,middleFnsRecord)}async executeRequest(routeSubRequest,workflowSubRequests,middleFnsRecord){this.pendingPrefills.length>0&&await Promise.allSettled([...this.pendingPrefills]);const middleFnSubRequests=middleFnsRecord?Object.values(middleFnsRecord):[],request=new src_request.MionClientRequest(this.clientOptions,this.prefilledMiddleFnsCache,routeSubRequest,middleFnSubRequests,workflowSubRequests);try{await request.call();const routeIds=this.getRouteIds(routeSubRequest,workflowSubRequests),allMiddleFns=this.getAllMiddleFnsFromRequest(request,routeIds);return this.processMiddleFnsResponses(allMiddleFns,void 0),this.buildResult(routeSubRequest,workflowSubRequests,middleFnsRecord||allMiddleFns,void 0)}catch(errors){const routeIds=this.getRouteIds(routeSubRequest,workflowSubRequests),allMiddleFns=this.getAllMiddleFnsFromRequest(request,routeIds);return this.processMiddleFnsResponses(allMiddleFns,errors),this.buildResult(routeSubRequest,workflowSubRequests,middleFnsRecord||allMiddleFns,errors)}}getRouteIds(routeSubRequest,workflowSubRequests){const routeIds=(Set.Ω=[["&"]],new Set);return routeSubRequest&&routeIds.add(routeSubRequest.id),workflowSubRequests&&workflowSubRequests.forEach(__assignType(sr=>routeIds.add(sr.id),["sr","",'P"2!"/"'])),routeIds}getAllMiddleFnsFromRequest(request,excludedIds){return Object.entries(request.subRequestList).filter(__assignType(([id])=>!excludedIds.has(id),["param0","",'P"2!"/"'])).map(__assignType(([,subRequest])=>subRequest,["param0","",'P"2!"/"']))}processMiddleFnsResponses(middleFnSubRequests,errors){for(const middleFn of middleFnSubRequests){const middleFnError=errors?.get(middleFn.id);middleFnError?this.handlersRegistry.executeHandler(middleFn.id,middleFnError):middleFn.resolvedValue!==void 0&&this.handlersRegistry.executeSuccessHandler(middleFn.id,middleFn.resolvedValue)}}buildResult(routeSubRequest,workflowSubRequests,middleFns,errors){const middleFnsResults={},middleFnsErrors={},processedIds=(Set.Ω=[["&"]],new Set);let routeResultPart,routeErrorPart;if(routeSubRequest){processedIds.add(routeSubRequest.id);const routeError=errors?.get(routeSubRequest.id)||(errors?src_subRequest.findSubRequestError(routeSubRequest,errors):void 0);routeResultPart=routeError?void 0:routeSubRequest.resolvedValue,routeErrorPart=routeError}else if(workflowSubRequests){const routeResults=[],routeErrors=[];for(const routeSubRequest2 of workflowSubRequests){processedIds.add(routeSubRequest2.id);const routeError=errors?.get(routeSubRequest2.id);routeError?(routeResults.push(void 0),routeErrors.push(routeError)):(routeResults.push(routeSubRequest2.resolvedValue),routeErrors.push(void 0))}const hasAnyResult=routeResults.some(__assignType(r=>r!==void 0,["r","",'P"2!"/"'])),hasAnyError=routeErrors.some(__assignType(e=>e!==void 0,["e","",'P"2!"/"']));routeResultPart=hasAnyResult?routeResults:void 0,routeErrorPart=hasAnyError?routeErrors:void 0}if(Array.isArray(middleFns))for(const middleFn of middleFns){processedIds.add(middleFn.id);const middleFnError=errors?.get(middleFn.id);middleFnError?middleFnsErrors[middleFn.id]=middleFnError:middleFn.resolvedValue!==void 0&&(middleFnsResults[middleFn.id]=middleFn.resolvedValue)}else for(const[name,middleFn]of Object.entries(middleFns)){processedIds.add(middleFn.id);const middleFnError=errors?.get(middleFn.id);middleFnError?middleFnsErrors[name]=middleFnError:middleFn.resolvedValue!==void 0&&(middleFnsResults[name]=middleFn.resolvedValue)}if(errors)for(const[id,error]of errors)processedIds.has(id)||(middleFnsErrors[id]=error);return[routeResultPart,routeErrorPart,middleFnsResults,middleFnsErrors]}typeErrors(...subRequest){return new src_request.MionClientRequest(this.clientOptions,this.prefilledMiddleFnsCache).validateParams(subRequest)}prefill(...subRequest){const promise=new src_request.MionClientRequest(this.clientOptions,this.prefilledMiddleFnsCache).prefill(subRequest);return this.pendingPrefills.push(promise),promise.finally(()=>{const index=this.pendingPrefills.indexOf(promise);index>=0&&this.pendingPrefills.splice(index,1)}),promise}removePrefill(...subRequest){return new src_request.MionClientRequest(this.clientOptions,this.prefilledMiddleFnsCache).removePrefill(subRequest)}destroy(){this.handlersRegistry.clearAll()}static __type=["handlersRegistry",function(){return new src_handlersRegistry.HandlersRegistry},"prefilledMiddleFnsCache",function(){return Map.Ω=[["&"],[()=>src_types.__ΩSubRequest,'"o!"']],new Map},"pendingPrefills",function(){return[]},()=>src_types.__ΩClientOptions,"clientOptions","constructor","routeSubRequest",()=>src_types.__ΩResult,"executeCall",()=>src_types.__ΩRSubRequest,"middleFnsRecord",()=>src_types.__ΩCallWithMiddleFnsResult,"executeCallWithMiddleFns","workflowSubRequests",()=>src_types.__ΩWorkflowResult,"executeCallWithWorkflow",()=>src_types.__ΩRSubRequest,"executeRequest",()=>src_types.__ΩRSubRequest,()=>src_types.__ΩRSubRequest,"getRouteIds",()=>src_request.MionClientRequest,"request","excludedIds",()=>src_types.__ΩHSubRequest,"getAllMiddleFnsFromRequest",()=>src_types.__ΩHSubRequest,"middleFnSubRequests",()=>src_types.__ΩRequestErrors,"errors","processMiddleFnsResponses",()=>src_types.__ΩRSubRequest,()=>src_types.__ΩHSubRequest,"middleFns",()=>src_types.__ΩRequestErrors,()=>src_types.__ΩCallWithMiddleFnsResult,()=>src_types.__ΩWorkflowResult,()=>src_types.__ΩResult,"buildResult","subRequest","RunTypeError","typeErrors","prefill","removePrefill","destroy","MionClient",'!3!9>"!3#9>$$`F3%;>&Pn\'2(;"0)P"2*""o+#`0,P"o-"2*"2."""o/$`00P"21"2.""o2#`03PP"o4"-J2*P"-J21P"-J2."`05;PP"o6"-J2*P"o7"F-J21&D08;PP""792:&D2;"o<"F0=;P"o>"F2?Pn@-J2A$0B;PP"oC"-J2*P"-J21P""oD"FJ2EPnF-J2AP"""oG$""oH#""oI#J0J;P"@2K"wLF`0MP"@2K$`0NP"@2K$`0OP$0P5wQ']}class MethodProxy{parentProps;client;clientOptions;propsProxies={};handler={apply:__assignType((_target,_thisArg,argArray)=>{const handlerId=core.getRouterItemId(this.parentProps);return new src_subRequest.MionSubRequest(this.parentProps,handlerId,argArray,this.client)},["_target","_thisArg","argArray",()=>src_types.__ΩRSubRequest,()=>src_types.__ΩHSubRequest,"",'P"2!"2""2#8P"o$""o%"K/&']),get:__assignType((_target,prop)=>{const existing=this.propsProxies[prop];if(existing)return existing.proxy;const newMethodProxy=new MethodProxy([...this.parentProps,prop],this.client,this.clientOptions);return this.propsProxies[prop]=newMethodProxy,newMethodProxy.proxy},["_target","prop",()=>Proxy,"",'P"2!&2"i#/$'])};proxy;constructor(parentProps,client,clientOptions){this.parentProps=parentProps,this.client=client,this.clientOptions=clientOptions;const target=()=>null;this.proxy=new Proxy(target,this.handler)}static __type=[()=>__ΩRecord,()=>MethodProxy,"propsProxies",function(){return{}},"handler",function(){return{apply:__assignType((_target,_thisArg,argArray)=>{const handlerId=core.getRouterItemId(this.parentProps);return new src_subRequest.MionSubRequest(this.parentProps,handlerId,argArray,this.client)},["_target","_thisArg","argArray",()=>src_types.__ΩRSubRequest,()=>src_types.__ΩHSubRequest,"",'P"2!"2""2#8P"o$""o%"K/&']),get:__assignType((_target,prop)=>{const existing=this.propsProxies[prop];if(existing)return existing.proxy;const newMethodProxy=new MethodProxy([...this.parentProps,prop],this.client,this.clientOptions);return this.propsProxies[prop]=newMethodProxy,newMethodProxy.proxy},["_target","prop",()=>Proxy,"",'P"2!&2"i#/$'])}},()=>Proxy,"proxy","parentProps",()=>MionClient,"client",()=>src_types.__ΩClientOptions,"clientOptions","constructor","MethodProxy",`&P7"o!#3#>$!3%>&i'3(P&F2):P7*2+;n,2-;"0.5w/`]}exports.MionClient=MionClient;exports.initClient=initClient;
|
|
2
|
+
//# sourceMappingURL=client.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { CallWithMiddleFnsResult, ClientOptions, HSubRequest, InitClientOptions, RSubRequest, SubRequest, ClientRoutes, ClientMiddleFns, Result, WorkflowResult } from './types.ts';
|
|
2
|
+
import { RemoteApi } from '@mionjs/router';
|
|
3
|
+
import { RunTypeError } from '@mionjs/core';
|
|
4
|
+
import { HandlersRegistry } from './handlersRegistry.ts';
|
|
5
|
+
export declare function initClient<RM extends RemoteApi>(options: InitClientOptions): {
|
|
6
|
+
client: MionClient;
|
|
7
|
+
routes: ClientRoutes<RM>;
|
|
8
|
+
middleFns: ClientMiddleFns<RM>;
|
|
9
|
+
};
|
|
10
|
+
export declare class MionClient {
|
|
11
|
+
private clientOptions;
|
|
12
|
+
readonly handlersRegistry: HandlersRegistry;
|
|
13
|
+
readonly prefilledMiddleFnsCache: Map<string, SubRequest<any>>;
|
|
14
|
+
private pendingPrefills;
|
|
15
|
+
constructor(clientOptions: ClientOptions);
|
|
16
|
+
executeCall<RR extends RSubRequest<any>>(routeSubRequest: RR): Promise<Result<any, any>>;
|
|
17
|
+
executeCallWithMiddleFns<H extends Record<string, HSubRequest<any>>>(routeSubRequest: RSubRequest<any>, middleFnsRecord: H): Promise<CallWithMiddleFnsResult<any, any, H>>;
|
|
18
|
+
executeCallWithWorkflow<Routes extends RSubRequest<any>[], H extends Record<string, HSubRequest<any>>>(workflowSubRequests: Routes, middleFnsRecord: H): Promise<WorkflowResult<Routes, H>>;
|
|
19
|
+
private executeRequest;
|
|
20
|
+
private getRouteIds;
|
|
21
|
+
private getAllMiddleFnsFromRequest;
|
|
22
|
+
private processMiddleFnsResponses;
|
|
23
|
+
private buildResult;
|
|
24
|
+
typeErrors<List extends SubRequest<any>[]>(...subRequest: List): Promise<RunTypeError[]>;
|
|
25
|
+
prefill<List extends HSubRequest<any>[]>(...subRequest: List): Promise<void>;
|
|
26
|
+
removePrefill<List extends HSubRequest<any>[]>(...subRequest: List): Promise<void>;
|
|
27
|
+
destroy(): void;
|
|
28
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const caches=require("virtual:mion-aot/caches"),core=require("@mionjs/core"),src_types=require("./types.cjs"),src_constants=require("./constants.cjs"),src_serializer=require("./serializer.cjs"),src_storage=require("./storage.cjs"),__ΩRecord=["K","T","Record",`l'e#"Rb!b"Pde"!N#!w#y`];function __assignType(fn,args){return fn.__type=args,fn}async function fetchRemoteMethodsMetadata(methodIds,options){validateClientCaches(),restoreFromLocalStorage(methodIds,options);const missingAfterLocal=methodIds.filter(__assignType(path=>!core.routesCache.hasMetadata(path),["path","",'P"2!"/"']));if(!missingAfterLocal.length)return;const shouldReturnAllMethods=!0,body={[core.MION_ROUTES.methodsMetadataById]:[missingAfterLocal,shouldReturnAllMethods]};try{const path=core.getRoutePath([core.MION_ROUTES.methodsMetadataById],options),url=new URL(path,options.baseURL),response=await fetch(url,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(body)}),deserialized=await src_serializer.deserializeResponseBody(response),platformError=deserialized[core.MION_ROUTES.platformError],serializableMethodsData=deserialized[core.MION_ROUTES.methodsMetadataById];if(core.isRpcError(platformError))throw platformError;if(core.isRpcError(serializableMethodsData))throw serializableMethodsData;if(!serializableMethodsData)throw new core.RpcError({type:"cant-fetch-remote-methods-metadata",publicMessage:"Failed to fetch remote methods metadata",errorData:{response}});storeDependencies(serializableMethodsData.deps,serializableMethodsData.purFnDeps,options),storeMethodsMetadata(serializableMethodsData.methods,options),addToCaches(serializableMethodsData)}catch(error){throw new Error(`Error fetching validation and serialization metadata: ${error?.message}`)}}fetchRemoteMethodsMetadata.__type=["methodIds",()=>src_types.__ΩClientOptions,"options","fetchRemoteMethodsMetadata",'P&F2!n"2#"/$'];function getSerializedMethodDataKey(methodId,options){return`${src_constants.STORAGE_KEY}:serialized-method-data:${options.baseURL}:${methodId}`}getSerializedMethodDataKey.__type=["methodId",()=>src_types.__ΩClientOptions,"options","getSerializedMethodDataKey",'P&2!n"2#"/$'];function getJitCompiledFnKey(jitFnHash,options){return`${src_constants.STORAGE_KEY}:jit-compiled-fn:${options.baseURL}:${jitFnHash}`}getJitCompiledFnKey.__type=["jitFnHash",()=>src_types.__ΩClientOptions,"options","getJitCompiledFnKey",'P&2!n"2#"/$'];function getJitPureFnKey(namespace,pureFnHash,options){return`${src_constants.STORAGE_KEY}:jit-pure-fn:${options.baseURL}:${namespace}:${pureFnHash}`}getJitPureFnKey.__type=["namespace","pureFnHash",()=>src_types.__ΩClientOptions,"options","getJitPureFnKey",'P&2!&2"n#2$"/%'];function storeDependencies(deps,pureFnDeps,options){Object.entries(deps).forEach(__assignType(([hash,jitFnData])=>{const key=getJitCompiledFnKey(hash,options);try{src_storage.getStorage().setItem(key,JSON.stringify(jitFnData))}catch(error){console.warn(`Failed to store JIT function dependency ${hash}:`,error)}},["JitCompiledFnData","param0","",'PP&"w!G2""/#'])),Object.entries(pureFnDeps).forEach(__assignType(([namespace,nsPureFns])=>{Object.entries(nsPureFns).forEach(__assignType(([fnHash,pureFnData])=>{const key=getJitPureFnKey(namespace,fnHash,options);try{src_storage.getStorage().setItem(key,JSON.stringify(pureFnData))}catch(error){console.warn(`Failed to store pure function dependency ${namespace}::${fnHash}:`,error)}},["PureFunctionData","param0","",'PP&"w!G2""/#']))},["param0","",'P"2!"/"']))}storeDependencies.__type=[()=>__ΩRecord,"JitCompiledFnData","deps","PureFnsDataCache","pureFnDeps",()=>src_types.__ΩClientOptions,"options","storeDependencies",`P&"w"o!#2#"w$2%n&2'"/(`];function storeMethodsMetadata(methods,options){Object.entries(methods).forEach(__assignType(([methodId,methodData])=>{const key=getSerializedMethodDataKey(methodId,options);try{src_storage.getStorage().setItem(key,JSON.stringify(methodData))}catch(error){console.warn(`Failed to store method metadata ${methodId}:`,error)}},["param0","",'P"2!"/"']))}storeMethodsMetadata.__type=["MethodsCache","methods",()=>src_types.__ΩClientOptions,"options","storeMethodsMetadata",'P"w!2"n#2$"/%'];function restoreAllDependencies(options){const deps={},pureFnDeps={},pureFnKeyPrefix=`${src_constants.STORAGE_KEY}:jit-pure-fn:${options.baseURL}:`;for(let i=0;i<src_storage.getStorage().length;i++){const key=src_storage.getStorage().key(i);if(key?.startsWith(`${src_constants.STORAGE_KEY}:jit-compiled-fn:${options.baseURL}:`))try{const data=src_storage.getStorage().getItem(key);if(data){const parsedData=JSON.parse(data);deps[parsedData.jitFnHash]=parsedData}}catch(error){console.warn(`Failed to restore JIT function from key ${key}:`,error)}}for(let i=0;i<src_storage.getStorage().length;i++){const key=src_storage.getStorage().key(i);if(key?.startsWith(pureFnKeyPrefix))try{const data=src_storage.getStorage().getItem(key);if(data){const parsedData=JSON.parse(data),namespace=key.slice(pureFnKeyPrefix.length).split(":")[0]||parsedData.namespace;pureFnDeps[namespace]||(pureFnDeps[namespace]={}),pureFnDeps[namespace][parsedData.fnName]=parsedData}}catch(error){console.warn(`Failed to restore pure function from key ${key}:`,error)}}(Object.keys(deps).length>0||Object.keys(pureFnDeps).length>0)&&core.addSerializedJitCaches(deps,pureFnDeps)}restoreAllDependencies.__type=[()=>src_types.__ΩClientOptions,"options","restoreAllDependencies",'Pn!2""/#'];function restoreFromLocalStorage(methodIds,options){restoreAllDependencies(options);const methods={};let anyMethodsRestored=!1;methodIds.forEach(__assignType(id=>{if(core.routesCache.hasMetadata(id))return;const methodKey=getSerializedMethodDataKey(id,options),methodMetaJson=src_storage.getStorage().getItem(methodKey);if(methodMetaJson)try{const methodMeta=JSON.parse(methodMetaJson);methods[id]=methodMeta,anyMethodsRestored=!0}catch(error){console.warn(`Failed to restore method metadata for ${id}:`,error),src_storage.getStorage().removeItem(methodKey)}},["id","",'P"2!"/"'])),anyMethodsRestored&&addToCaches({methods,deps:{},purFnDeps:{}})}restoreFromLocalStorage.__type=["methodIds",()=>src_types.__ΩClientOptions,"options","restoreFromLocalStorage",'P&F2!n"2#"/$'];function addToCaches(serializableMethodsData){core.addSerializedJitCaches(serializableMethodsData.deps,serializableMethodsData.purFnDeps),core.addRoutesToCache(serializableMethodsData.methods)}addToCaches.__type=["SerializableMethodsData","serializableMethodsData","addToCaches",'P"w!2""/#'];function getAOTCaches(){return{jitFnsCache:caches.jitFnsCache,pureFnsCache:caches.pureFnsCache}}getAOTCaches.__type=["getAOTCaches",'P"/!'];let clientCachesValidated=!1;function validateClientCaches(){if(clientCachesValidated||core.isTestEnv())return;clientCachesValidated=!0;const missingRoutes=Object.values(core.MION_ROUTES).filter(__assignType(routeId=>!core.routesCache.hasMetadata(routeId),["routeId","",'P"2!"/"']));if(missingRoutes.length>0)throw new Error(`AOT cache not loaded: Required MION_ROUTES not found in router cache: ${missingRoutes.join(", ")}. Make sure to import '@mionjs/client/aot' or 'virtual:mion-aot/caches' before using the client.`)}validateClientCaches.__type=["validateClientCaches",'P"/!'];exports.fetchRemoteMethodsMetadata=fetchRemoteMethodsMetadata;exports.getAOTCaches=getAOTCaches;exports.restoreAllDependencies=restoreAllDependencies;exports.storeDependencies=storeDependencies;exports.storeMethodsMetadata=storeMethodsMetadata;
|
|
2
|
+
//# sourceMappingURL=clientMethodsMetadata.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientMethodsMetadata.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ClientOptions } from './types.ts';
|
|
2
|
+
import { JitCompiledFnData, MethodsCache, PureFnsDataCache } from '@mionjs/core';
|
|
3
|
+
export declare function fetchRemoteMethodsMetadata(methodIds: string[], options: ClientOptions): Promise<void>;
|
|
4
|
+
export declare function storeDependencies(deps: Record<string, JitCompiledFnData>, pureFnDeps: PureFnsDataCache, options: ClientOptions): void;
|
|
5
|
+
export declare function storeMethodsMetadata(methods: MethodsCache, options: ClientOptions): void;
|
|
6
|
+
export declare function restoreAllDependencies(options: ClientOptions): void;
|
|
7
|
+
export declare function getAOTCaches(): {
|
|
8
|
+
jitFnsCache: Record<string, any>;
|
|
9
|
+
pureFnsCache: Record<string, Record<string, any>>;
|
|
10
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const DEFAULT_PREFILL_OPTIONS={baseURL:"",fetchOptions:{method:"PUT",headers:{"Content-Type":"application/json"}},basePath:"",suffix:"",validateParams:!0,autoGenerateErrorId:!1,serializer:"stringifyJson"},MAX_GET_URL_LENGTH=4096,STORAGE_KEY="mionkit:client",ROUTES_FLOW_KEY="mion-routes-flow",ROUTES_FLOW_PATH=`/${ROUTES_FLOW_KEY}`;exports.DEFAULT_PREFILL_OPTIONS=DEFAULT_PREFILL_OPTIONS;exports.MAX_GET_URL_LENGTH=MAX_GET_URL_LENGTH;exports.ROUTES_FLOW_KEY=ROUTES_FLOW_KEY;exports.ROUTES_FLOW_PATH=ROUTES_FLOW_PATH;exports.STORAGE_KEY=STORAGE_KEY;
|
|
2
|
+
//# sourceMappingURL=constants.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ClientOptions } from './types.ts';
|
|
2
|
+
export declare const DEFAULT_PREFILL_OPTIONS: ClientOptions;
|
|
3
|
+
export declare const MAX_GET_URL_LENGTH = 4096;
|
|
4
|
+
export declare const STORAGE_KEY = "mionkit:client";
|
|
5
|
+
export declare const ROUTES_FLOW_KEY = "mion-routes-flow";
|
|
6
|
+
export declare const ROUTES_FLOW_PATH = "/mion-routes-flow";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class HandlersRegistry{errorHandlers=new Map;successHandlers=new Map;register(handlerId,errorType,handler){let handlerMap=this.errorHandlers.get(handlerId);handlerMap||(handlerMap=new Map,this.errorHandlers.set(handlerId,handlerMap)),handlerMap.set(errorType,handler)}unregister(handlerId,errorType){const handlerMap=this.errorHandlers.get(handlerId);handlerMap&&(handlerMap.delete(errorType),handlerMap.size===0&&this.errorHandlers.delete(handlerId))}hasHandler(handlerId,errorType){return this.errorHandlers.get(handlerId)?.has(errorType)??!1}executeHandler(handlerId,error){const handlerMap=this.errorHandlers.get(handlerId);if(!handlerMap)return!1;const handler=handlerMap.get(error.type);return handler?(handler(error),!0):!1}registerSuccess(handlerId,handler){this.successHandlers.set(handlerId,handler)}unregisterSuccess(handlerId){this.successHandlers.delete(handlerId)}hasSuccessHandler(handlerId){return this.successHandlers.has(handlerId)}executeSuccessHandler(handlerId,result){const handler=this.successHandlers.get(handlerId);return handler?(handler(result),!0):!1}clearHandlers(handlerId){this.errorHandlers.delete(handlerId),this.successHandlers.delete(handlerId)}clearAll(){this.errorHandlers.clear(),this.successHandlers.clear()}getHandlerIds(){const errorIds=Array.from(this.errorHandlers.keys()),successIds=Array.from(this.successHandlers.keys());return[...new Set([...errorIds,...successIds])]}getErrorTypes(handlerId){const handlerMap=this.errorHandlers.get(handlerId);return handlerMap?Array.from(handlerMap.keys()):[]}static __type=["ErrorHandler","errorHandlers",function(){return new Map},"SuccessHandler","successHandlers",function(){return new Map},"handlerId","errorType","handler","register","unregister","hasHandler","RpcError","error","executeHandler","registerSuccess","unregisterSuccess","hasSuccessHandler","result","executeSuccessHandler","clearHandlers","clearAll","getHandlerIds","getErrorTypes","HandlersRegistry",`&&"w!EE3";>#&"w$E3%;>&P&2'&2("w!2)$0*P&2'&2($0+P&2'&2()0,P&2'"w-2.)0/P&2'"w$2)$00P&2'$01P&2')02P&2'"23)04P&2'$05P$06P&F07P&2'&F085w9`]}exports.HandlersRegistry=HandlersRegistry;
|
|
2
|
+
//# sourceMappingURL=handlersRegistry.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handlersRegistry.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { RpcError } from '@mionjs/core';
|
|
2
|
+
import { ErrorHandler, SuccessHandler } from './types';
|
|
3
|
+
export declare class HandlersRegistry {
|
|
4
|
+
private errorHandlers;
|
|
5
|
+
private successHandlers;
|
|
6
|
+
register(handlerId: string, errorType: string, handler: ErrorHandler<any>): void;
|
|
7
|
+
unregister(handlerId: string, errorType: string): void;
|
|
8
|
+
hasHandler(handlerId: string, errorType: string): boolean;
|
|
9
|
+
executeHandler(handlerId: string, error: RpcError<string>): boolean;
|
|
10
|
+
registerSuccess(handlerId: string, handler: SuccessHandler<any>): void;
|
|
11
|
+
unregisterSuccess(handlerId: string): void;
|
|
12
|
+
hasSuccessHandler(handlerId: string): boolean;
|
|
13
|
+
executeSuccessHandler(handlerId: string, result: any): boolean;
|
|
14
|
+
clearHandlers(handlerId: string): void;
|
|
15
|
+
clearAll(): void;
|
|
16
|
+
getHandlerIds(): string[];
|
|
17
|
+
getErrorTypes(handlerId: string): string[];
|
|
18
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const src_types=require("./types.cjs"),core=require("@mionjs/core"),src_clientMethodsMetadata=require("./clientMethodsMetadata.cjs"),src_validation=require("./validation.cjs"),src_serializer=require("./serializer.cjs"),src_constants=require("./constants.cjs"),__ΩRecord=["K","T","Record",`l'e#"Rb!b"Pde"!N#!w#y`];function __assignType(fn,args){return fn.__type=args,fn}class MionClientRequest{options;prefilledMiddleFnsCache;route;middleFns;workflowSubRequests;path;requestId;subRequestList={};response;constructor(options,prefilledMiddleFnsCache,route,middleFns,workflowSubRequests){if(this.options=options,this.prefilledMiddleFnsCache=prefilledMiddleFnsCache,this.route=route,this.middleFns=middleFns,this.workflowSubRequests=workflowSubRequests,workflowSubRequests&&workflowSubRequests.length>0){const routePaths=workflowSubRequests.map(__assignType(sr=>core.getRoutePath(sr.pointer,this.options),["sr","",'P"2!"/"'])),query=buildRoutesFlowQuery(routePaths,workflowSubRequests),flowPath=core.getRoutePath([src_constants.ROUTES_FLOW_KEY],this.options);this.path=`${flowPath}?data=${core.toBase64Url(JSON.stringify(query))}`,this.requestId="mion-routes-flow",workflowSubRequests.forEach(__assignType(sr=>this.addSubRequest(sr),["sr","",'P"2!"/"']))}else this.path=route?core.getRoutePath(route.pointer,this.options):"no-route",this.requestId=route?route.id:"no-route",route&&this.addSubRequest(route);middleFns&&middleFns.forEach(__assignType(middleFn=>this.addSubRequest(middleFn),["middleFn","",'P"2!"/"']))}async call(){const errors=new Map;try{const subRequestIds=Object.keys(this.subRequestList);if(await src_clientMethodsMetadata.fetchRemoteMethodsMetadata(subRequestIds,this.options),this.restorePrefilledMiddleFns(errors),errors.size||(src_validation.validateSubRequests(subRequestIds,this,errors),errors.size))return Promise.reject(errors)}catch(error){return this.onError(error,"Error preparing request",errors),Promise.reject(errors)}try{const serialized=src_serializer.serializeRequestBody(this),headersFromParams=extractRequestHeaders(this),url=new URL(this.path,this.options.baseURL);let fetchOptions;if(this.isQueryRoute()&&serialized.contentType.includes("json")){const encoded=core.toBase64Url(serialized.body),testUrl=new URL(this.path,this.options.baseURL);testUrl.searchParams.set("data",encoded),testUrl.toString().length<=src_constants.MAX_GET_URL_LENGTH?(url.searchParams.set("data",encoded),fetchOptions={...this.options.fetchOptions,method:"GET",headers:{...this.options.fetchOptions.headers,...headersFromParams},body:void 0}):fetchOptions={...this.options.fetchOptions,method:"POST",headers:{...this.options.fetchOptions.headers,...headersFromParams,"Content-Type":serialized.contentType},body:serialized.body}}else fetchOptions={...this.options.fetchOptions,method:"POST",headers:{...this.options.fetchOptions.headers,...headersFromParams,"Content-Type":serialized.contentType},body:serialized.body};this.response=await fetch(url,fetchOptions)}catch(error){return this.onError(error,"Error executing request",errors),Promise.reject(errors)}try{const deserialized=await src_serializer.deserializeResponseBody(this.response);if(core.MION_ROUTES.platformError in deserialized){const platformError=deserialized[core.MION_ROUTES.platformError];return Object.entries(this.subRequestList).forEach(__assignType(([id,methodMeta])=>{methodMeta.isResolved=!0,methodMeta.error=platformError,errors.set(id,platformError)},["param0","",'P"2!"/"'])),Promise.reject(errors)}return Object.entries(this.subRequestList).forEach(__assignType(([id,methodMeta])=>{const resp=this.getResponseValueFromBodyOrHeader(id,deserialized,this.response.headers);methodMeta.isResolved=!0,core.isRpcError(resp)?(methodMeta.error=resp,errors.set(id,resp)):methodMeta.resolvedValue=resp},["param0","",'P"2!"/"'])),Object.entries(deserialized).forEach(__assignType(([id,value])=>{!(id in this.subRequestList)&&core.isRpcError(value)&&errors.set(id,value)},["param0","",'P"2!"/"'])),errors.size?Promise.reject(errors):deserialized}catch(error){return this.onError(error,"Error parsing response",errors),Promise.reject(errors)}}async validateParams(subReqList){subReqList&&subReqList.forEach(__assignType(subRequest=>this.addSubRequest(subRequest),["subRequest","",'P"2!"/"']));const errors=new Map;try{const subRequestIds=Object.keys(this.subRequestList);return await src_clientMethodsMetadata.fetchRemoteMethodsMetadata(subRequestIds,this.options),src_validation.validateSubRequests(subRequestIds,this,errors,!1),Object.values(this.subRequestList).map(__assignType(subRequest=>subRequest.error?.errorData||[],["subRequest","",'P"2!"/"'])).flat()}catch(error){return this.onError(error,"Error preparing request",errors),Promise.reject(errors)}}async prefill(subReqList){subReqList&&subReqList.forEach(__assignType(subRequest=>this.addSubRequest(subRequest),["subRequest","",'P"2!"/"']));const errors=new Map;try{const subRequestIds=Object.keys(this.subRequestList);return await src_clientMethodsMetadata.fetchRemoteMethodsMetadata(subRequestIds,this.options),src_validation.validateSubRequests(subRequestIds,this,errors,!1),errors.size||(src_serializer.serializeRequestBody(this),this.storePrefilledMiddleFns(errors),errors.size)?Promise.reject(errors):void 0}catch(error){return this.onError(error,"Error preparing request",errors),Promise.reject(errors)}}async removePrefill(subRequests){subRequests&&subRequests.forEach(__assignType(subRequest=>this.addSubRequest(subRequest),["subRequest","",'P"2!"/"'])),this.removePrefilledMiddleFns()}addSubRequest(subRequest){if(subRequest.isResolved)throw new Error(`SubRequest ${subRequest.id} is already resolved`);this.subRequestList[subRequest.id]=subRequest}onError(error,stageMessage,errors){if(core.isRpcError(error)){errors.set(this.requestId,error);return}const message=error?.message?`${stageMessage}: ${error.message}`:`${stageMessage}: Unknown Error`;errors.set(this.requestId,new core.RpcError({type:error?.name||"unknown-error",publicMessage:message,originalError:error instanceof Error?error:void 0}))}getResponseValueFromBodyOrHeader(id,respBody,headers){const headersSubset=reconstructHeadersSubsetFromResponse(id,headers);return headersSubset||respBody[id]}restorePrefilledMiddleFns(errors){if(this.workflowSubRequests&&this.workflowSubRequests.length>0){this.restorePrefilledMiddleFnsForWorkflow(errors);return}const methodMeta=core.routesCache.getMetadata(this.requestId);if(!methodMeta){errors.set(this.requestId,new core.RpcError({type:"route-metadata-not-found",publicMessage:`Metadata for Route '${this.requestId} not found.'.`}));return}(methodMeta.middleFnIds?.filter(__assignType(id=>!!id&&this.requestId!==id,["id","",'P"2!"/"']))||[]).forEach(__assignType(id=>{if(this.subRequestList[id])return;const cacheKey=this.getPrefilledMiddleFnCacheKey(id),cachedSubRequest=this.prefilledMiddleFnsCache.get(cacheKey);if(cachedSubRequest){const clonedSubRequest={...cachedSubRequest,isResolved:!1,resolvedValue:void 0,error:void 0};this.addSubRequest(clonedSubRequest)}},["id","",'P"2!"/"']))}restorePrefilledMiddleFnsForWorkflow(errors){const workflowRouteIds=new Set(this.workflowSubRequests.map(__assignType(sr=>sr.id,["sr","",'P"2!"/"'])));for(const routeSubRequest of this.workflowSubRequests){const methodMeta=core.routesCache.getMetadata(routeSubRequest.id);if(!methodMeta){errors.set(routeSubRequest.id,new core.RpcError({type:"route-metadata-not-found",publicMessage:`Metadata for Route '${routeSubRequest.id}' not found.`}));continue}(methodMeta.middleFnIds?.filter(__assignType(id=>!!id&&!workflowRouteIds.has(id),["id","",'P"2!"/"']))||[]).forEach(__assignType(id=>{if(this.subRequestList[id])return;const cacheKey=this.getPrefilledMiddleFnCacheKey(id),cachedSubRequest=this.prefilledMiddleFnsCache.get(cacheKey);if(cachedSubRequest){const clonedSubRequest={...cachedSubRequest,isResolved:!1,resolvedValue:void 0,error:void 0};this.addSubRequest(clonedSubRequest)}},["id","",'P"2!"/"']))}}storePrefilledMiddleFns(errors){Object.keys(this.subRequestList).forEach(__assignType(id=>{const subRequest=this.subRequestList[id],methodMeta=core.routesCache.getMetadata(id);if(!methodMeta)throw new Error(`Remote method ${id} not found.`);if(methodMeta.type===core.HandlerType.route){errors.set(id,new core.RpcError({type:"routes-cant-be-prefilled",publicMessage:`Remote method ${id} is a route and can't be prefilled.`}));return}const cacheKey=this.getPrefilledMiddleFnCacheKey(id);this.prefilledMiddleFnsCache.set(cacheKey,subRequest)},["id","",'P"2!"/"']))}removePrefilledMiddleFns(){Object.keys(this.subRequestList).forEach(__assignType(id=>{const cacheKey=this.getPrefilledMiddleFnCacheKey(id);this.prefilledMiddleFnsCache.delete(cacheKey)},["id","",'P"2!"/"']))}isQueryRoute(){return this.workflowSubRequests?!1:core.routesCache.getMetadata(this.requestId)?.options?.isMutation===!1}getPrefilledMiddleFnCacheKey(id){return`${this.options.baseURL}:${id}`}static __type=["RR","MiddleFnRequestsList","path","requestId",()=>src_types.__ΩSubRequest,"subRequestList",function(){return{}},"response",()=>src_types.__ΩClientOptions,"options",()=>src_types.__ΩPrefilledMiddleFnsCache,"prefilledMiddleFnsCache","route","middleFns",()=>src_types.__ΩRSubRequest,"workflowSubRequests","constructor","ResponseBody","call",()=>src_types.__ΩSubRequest,"subReqList","RunTypeError","validateParams",()=>src_types.__ΩSubRequest,"prefill",()=>src_types.__ΩSubRequest,"subRequests","removePrefill",()=>src_types.__ΩSubRequest,"subRequest","addSubRequest","error","stageMessage",()=>src_types.__ΩRequestErrors,"errors","onError","id","respBody","headers","getResponseValueFromBodyOrHeader",()=>src_types.__ΩRequestErrors,"restorePrefilledMiddleFns",()=>src_types.__ΩRequestErrors,"restorePrefilledMiddleFnsForWorkflow",()=>src_types.__ΩRequestErrors,"storePrefilledMiddleFns","removePrefilledMiddleFns","isQueryRoute","getPrefilledMiddleFnCacheKey","MionClientRequest",'b!b"&3#9&3$9P&"o%"LM3&9>\'P!-J3(Pn)2*:9n+2,;9e"!2-8:9e""2.8:9"o/"F208:9"01P"w2`03P"o4"F258"w6F`07P"o8"F258$`09P"o:"F2;8$`0<P"o="2>"0?P"2@&2AnB2C$0D;P&2E"w22F!2G"0H;PnI2C$0J;PnK2C$0L;PnM2C$0N;P$0O;P)0P;P&2E&0Q;5wR']}function extractRequestHeaders(req){const headers={},subRequestIds=Object.keys(req.subRequestList);for(let i=0;i<subRequestIds.length;i++){const id=subRequestIds[i],subRequest=req.subRequestList[id];if(!subRequest)continue;const method=core.routesCache.getMetadata(id);if(!method||method.type!==core.HandlerType.headersMiddleFn||!method.headersParam)continue;const params=subRequest.params,extracted=extractHeadersFromParams(params);Object.assign(headers,extracted)}return headers}extractRequestHeaders.__type=[()=>MionClientRequest,"req",()=>__ΩRecord,"extractRequestHeaders",'PP""7!2"&&o##/$'];function extractHeadersFromParams(params){if(!params||params.length===0)throw new core.RpcError({type:"missing-headers-param",publicMessage:"HeadersFn requires a HeadersSubset parameter."});const firstParam=params[0];if(firstParam instanceof core.HeadersSubset||firstParam&&typeof firstParam=="object"&&"headers"in firstParam&&typeof firstParam.headers=="object")return firstParam.headers;throw new core.RpcError({type:"invalid-headers-param",publicMessage:"HeadersFn first parameter must be a HeadersSubset instance or object with headers property."})}extractHeadersFromParams.__type=["params",()=>__ΩRecord,"extractHeadersFromParams",'P"F2!&&o"#/#'];function reconstructHeadersSubsetFromResponse(methodId,responseHeaders){const method=core.routesCache.getMetadata(methodId);if(!method?.headersReturn?.headerNames||method.headersReturn.headerNames.length===0)return;const headerNames=method.headersReturn.headerNames,headersMap={};for(const name of headerNames){const value=responseHeaders.get(name);value!=null&&(headersMap[name]=value)}if(Object.keys(headersMap).length>0)return new core.HeadersSubset(headersMap)}reconstructHeadersSubsetFromResponse.__type=["methodId","responseHeaders",()=>core.HeadersSubset,"reconstructHeadersSubsetFromResponse",'P&2!!2"PP&&7#-J/$'];function buildRoutesFlowQuery(routePaths,workflowSubRequests){const allMappings=[];for(const sr of workflowSubRequests){const mappings=sr.mappings;if(Array.isArray(mappings)&&mappings.length>0)for(const ref of mappings)allMappings.push({fromId:ref.fromRequestId,toId:ref.toRequestId,bodyHash:ref.bodyHash,paramIndex:ref.paramIndex})}return{routes:routePaths,mappings:allMappings.length>0?allMappings:void 0}}buildRoutesFlowQuery.__type=["routePaths",()=>src_types.__ΩRSubRequest,"workflowSubRequests","RoutesFlowQuery","buildRoutesFlowQuery",'P&F2!"o""F2#"w$/%'];exports.MionClientRequest=MionClientRequest;
|
|
2
|
+
//# sourceMappingURL=request.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ResponseBody } from '@mionjs/router';
|
|
2
|
+
import { ClientOptions, HSubRequest, SubRequest, RSubRequest, PrefilledMiddleFnsCache } from './types.ts';
|
|
3
|
+
import { RunTypeError } from '@mionjs/core';
|
|
4
|
+
export declare class MionClientRequest<RR extends RSubRequest<any>, MiddleFnRequestsList extends HSubRequest<any>[]> {
|
|
5
|
+
readonly options: ClientOptions;
|
|
6
|
+
private readonly prefilledMiddleFnsCache;
|
|
7
|
+
readonly route?: RR | undefined;
|
|
8
|
+
readonly middleFns?: MiddleFnRequestsList | undefined;
|
|
9
|
+
readonly workflowSubRequests?: RSubRequest<any>[] | undefined;
|
|
10
|
+
readonly path: string;
|
|
11
|
+
readonly requestId: string;
|
|
12
|
+
readonly subRequestList: {
|
|
13
|
+
[key: string]: SubRequest<any>;
|
|
14
|
+
};
|
|
15
|
+
response: Response | undefined;
|
|
16
|
+
constructor(options: ClientOptions, prefilledMiddleFnsCache: PrefilledMiddleFnsCache, route?: RR | undefined, middleFns?: MiddleFnRequestsList | undefined, workflowSubRequests?: RSubRequest<any>[] | undefined);
|
|
17
|
+
call(): Promise<ResponseBody>;
|
|
18
|
+
validateParams(subReqList?: SubRequest<any>[]): Promise<RunTypeError[]>;
|
|
19
|
+
prefill(subReqList?: SubRequest<any>[]): Promise<void>;
|
|
20
|
+
removePrefill(subRequests?: SubRequest<any>[]): Promise<void>;
|
|
21
|
+
addSubRequest(subRequest: SubRequest<any>): void;
|
|
22
|
+
private onError;
|
|
23
|
+
private getResponseValueFromBodyOrHeader;
|
|
24
|
+
private restorePrefilledMiddleFns;
|
|
25
|
+
private restorePrefilledMiddleFnsForWorkflow;
|
|
26
|
+
private storePrefilledMiddleFns;
|
|
27
|
+
private removePrefilledMiddleFns;
|
|
28
|
+
private isQueryRoute;
|
|
29
|
+
private getPrefilledMiddleFnCacheKey;
|
|
30
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const core=require("@mionjs/core");function __assignType(fn,args){return fn.__type=args,fn}async function routesFlow(routeSubRequests,middleFns){if(!routeSubRequests||routeSubRequests.length===0)throw new core.RpcError({type:"routesFlow-empty-routes",publicMessage:"RoutesFlow requires at least one route subrequest."});const firstSubRequest=routeSubRequests[0];if(!firstSubRequest.client)throw new core.RpcError({type:"routesFlow-missing-client",publicMessage:"Could not extract MionClient from subrequest. Ensure subrequests are created via routes proxy."});const client=firstSubRequest.client;for(let i=1;i<routeSubRequests.length;i++)if(routeSubRequests[i].client!==client)throw new core.RpcError({type:"routesFlow-client-mismatch",publicMessage:`All subrequests in a routesFlow must use the same client instance. Subrequest at index ${i} has a different client.`});const[results,errors,middleFnResults,middleFnErrors]=await client.executeCallWithWorkflow(routeSubRequests,middleFns??{}),emptyResults=routeSubRequests.map(()=>{}),emptyErrors=routeSubRequests.map(()=>{});return[results??emptyResults,errors??emptyErrors,middleFnResults,middleFnErrors]}routesFlow.__type=["routeSubRequests","middleFns","WorkflowResult","routesFlow",'PP"@G2!"2"8"w#`/$'];const mapFromSymbol=Symbol("MapFromServerFnRef");function mapFrom(source,mapper,bodyHash){if(!bodyHash)throw new Error("mapFrom() requires mion vite plugin transform to inject bodyHash");const ref={mapFromSymbol,namespace:core.PURE_SERVER_FN_NAMESPACE,fnName:bodyHash,bodyHash,pureFn:mapper,isFactory:!1,fromRequestId:source.id,toRequestId:"",paramIndex:-1,type:__assignType(function(){return ref},["type",'P"/!'])};return ref}mapFrom.__type=["source","resolvedValue","value","","mapper","bodyHash",()=>core.__ΩMapFromServerFnRef,"resolvedValue","mapFrom",`P"2!P"."f2#"/$2%&2&8P".(f2#"/$o'"/)`];function isMapFromRef(ref){return ref&&ref.mapFromSymbol===mapFromSymbol}isMapFromRef.__type=["ref","isMapFromRef",'P"2!!/"'];exports.isMapFromRef=isMapFromRef;exports.mapFrom=mapFrom;exports.mapFromSymbol=mapFromSymbol;exports.routesFlow=routesFlow;
|
|
2
|
+
//# sourceMappingURL=routesFlow.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routesFlow.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HSubRequest, RSubRequest, SubRequest, WorkflowResult } from './types.ts';
|
|
2
|
+
import { MapFromServerFnRef } from '@mionjs/core';
|
|
3
|
+
export declare function routesFlow<Routes extends RSubRequest<any>[], MiddleFns extends Record<string, HSubRequest<any>> = Record<string, never>>(routeSubRequests: [...Routes], middleFns?: MiddleFns): Promise<WorkflowResult<Routes, MiddleFns>>;
|
|
4
|
+
export declare const mapFromSymbol: unique symbol;
|
|
5
|
+
export declare function mapFrom<FromSR extends SubRequest<any>, MappedInput>(source: FromSR, mapper: (value: FromSR['resolvedValue']) => MappedInput, bodyHash?: string): MapFromServerFnRef<(value: FromSR['resolvedValue']) => MappedInput>;
|
|
6
|
+
export declare function isMapFromRef(ref: any): ref is MapFromServerFnRef<any>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const core=require("@mionjs/core"),src_constants=require("./constants.cjs");function __assignType(fn,args){return fn.__type=args,fn}const __ΩSerializedBody=["SerializedBody","P&WJw!y"],__ΩContentType=["application/json; charset=utf-8","application/octet-stream","ContentType",'P.!."Jw#y'],__ΩSerializedRequest=[()=>__ΩSerializedBody,"body",()=>__ΩContentType,"contentType","SerializedRequest",'Pn!4"n#4$Mw%y'];function getSerializerMode(req){const methodId=req.route?.id??req.workflowSubRequests?.[0]?.id,serializerMode=core.routesCache.getMethodJitFns(methodId)?.options.serializer||src_constants.DEFAULT_PREFILL_OPTIONS.serializer;return serializerMode==="json"?src_constants.DEFAULT_PREFILL_OPTIONS.serializer:serializerMode}getSerializerMode.__type=["MionClientRequest","req","SerializerMode","getSerializerMode",'P"w!2""w#/$'];function serializeRequestBody(req){const serializerMode=getSerializerMode(req);switch(serializerMode){case"json":case"stringifyJson":return{body:stringifyBody(req),contentType:"application/json; charset=utf-8"};case"binary":return{body:serializeBinaryBody(req),contentType:"application/octet-stream"};default:throw new Error(`Invalid serializer mode ${serializerMode}`)}}serializeRequestBody.__type=["MionClientRequest","req",()=>__ΩSerializedRequest,"serializeRequestBody",'P"w!2"n#/$'];function serializeBinaryBody(req){const subRequestIds=Object.keys(req.subRequestList),body={},executionChain=[];for(const id of subRequestIds){let params=req.subRequestList[id].params;const method=core.routesCache.useMethodJitFns(id);method.type===core.HandlerType.headersMiddleFn&&method.headersParam&&(params=getParamsWithoutHeadersSubset(params)),body[id]=params,executionChain.push(method)}const workflowRouteIds=req.workflowSubRequests?.map(__assignType(sr=>sr.id,["sr","",'P"2!"/"'])),{buffer}=core.serializeBinaryBody(req.path,executionChain,body,!1,workflowRouteIds);return new Uint8Array(buffer)}serializeBinaryBody.__type=["MionClientRequest","req","serializeBinaryBody",'P"w!2"W/#'];async function deserializeResponseBody(response){const contentType=response.headers.get("content-type"),isJson=contentType?.includes("application/json"),isBinary=contentType?.includes("application/octet-stream");let parsedBody;if(isJson?parsedBody=await deserializeJsonResponseBody(response):isBinary?parsedBody=await deserializeBinaryResponseBody(response):parsedBody=await deserializeJsonResponseBody(response),core.MION_ROUTES.thrownErrors in parsedBody){const unexpectedErrors=parsedBody[core.MION_ROUTES.thrownErrors];if(core.MION_ROUTES.platformError in unexpectedErrors){const globalErrorValue=unexpectedErrors[core.MION_ROUTES.platformError],platformError=core.isRpcError(globalErrorValue)?new core.RpcError(globalErrorValue):globalErrorValue;return{[core.MION_ROUTES.platformError]:platformError}}Object.assign(parsedBody,unexpectedErrors),delete parsedBody[core.MION_ROUTES.thrownErrors]}if(isJson||!isJson&&!isBinary){const deserializedBody={};return Object.entries(parsedBody).forEach(__assignType(([methodId,returnValue])=>{const method=core.routesCache.useMethodJitFns(methodId),deserialized=parseHandlerReturnValue(method,returnValue);deserializedBody[methodId]=deserialized},["param0","",'P"2!"/"'])),deserializedBody}return parsedBody}deserializeResponseBody.__type=["response","ResponseBody","deserializeResponseBody",'P!2!"w"`/#'];async function deserializeJsonResponseBody(response){try{return await response.json()}catch(err){throw new core.RpcError({type:"parsing-json-response-error",publicMessage:`Invalid json response body: ${err?.message||"unknown parsing error."}`})}}deserializeJsonResponseBody.__type=["response","deserializeJsonResponseBody",'P!2!"`/"'];async function deserializeBinaryResponseBody(response){const arrayBuffer=await response.arrayBuffer(),{body}=core.deserializeBinaryBody("client-response",arrayBuffer,!0);return body}deserializeBinaryResponseBody.__type=["response","ResponseBody","deserializeBinaryResponseBody",'P!2!"w"`/#'];function stringifyBody(req){const props=[],subRequestIds=Object.keys(req.subRequestList);for(let i=0;i<subRequestIds.length;i++){const id=subRequestIds[i],subRequest=req.subRequestList[id];if(!subRequest)continue;let params=subRequest.params;const method=core.routesCache.useMethodJitFns(id);method.type===core.HandlerType.headersMiddleFn&&method.headersParam&&(params=getParamsWithoutHeadersSubset(params));try{const jsonValue=stringifyHandlerParams(method,params);if(!jsonValue)continue;props.push(`${JSON.stringify(id)}:${jsonValue}`)}catch(e){throw new core.RpcError({type:"json-stringify-request-error",publicMessage:`Failed to stringify params for handler ${id}`,originalError:e})}}return`{${props.join(",")}}`}stringifyBody.__type=["MionClientRequest","req","stringifyBody",'P"w!2"&/#'];function getParamsWithoutHeadersSubset(params){return!params||params.length===0?[]:params.slice(1)}getParamsWithoutHeadersSubset.__type=["params","getParamsWithoutHeadersSubset",'P"F2!"F/"'];function stringifyHandlerParams(method,params){if(!method.paramNames||method.paramNames.length===0)return"";const paramsJit=method.paramsJitFns;return paramsJit.prepareForJson.isNoop?JSON.stringify(params):paramsJit.stringifyJson.fn(params)}stringifyHandlerParams.__type=["MethodWithJitFns","method","params","stringifyHandlerParams",'P"w!2""F2#&/$'];function parseHandlerReturnValue(method,returnValue){if(!method.hasReturnData)return returnValue;const returnJit=method.returnJitFns;if(returnJit.restoreFromJson.isNoop||!returnValue)return returnValue;try{return returnValue instanceof core.RpcError?returnValue:core.isRpcError(returnValue)?new core.RpcError(returnValue):returnJit.restoreFromJson.fn(returnValue)}catch(e){return new core.RpcError({type:"deserialization-error",publicMessage:`Invalid response from Route or MiddleFn '${method.id}', can not deserialize return value: ${e.message}`,errorData:e?.errors})}}parseHandlerReturnValue.__type=["MethodWithJitFns","method","returnValue","parseHandlerReturnValue",'P"w!2""2#"/$'];exports.__ΩContentType=__ΩContentType;exports.__ΩSerializedBody=__ΩSerializedBody;exports.__ΩSerializedRequest=__ΩSerializedRequest;exports.deserializeResponseBody=deserializeResponseBody;exports.serializeRequestBody=serializeRequestBody;
|
|
2
|
+
//# sourceMappingURL=serializer.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializer.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ResponseBody } from '@mionjs/router';
|
|
2
|
+
import { MionClientRequest } from './request.ts';
|
|
3
|
+
export type SerializedBody = string | Uint8Array;
|
|
4
|
+
export type ContentType = 'application/json; charset=utf-8' | 'application/octet-stream';
|
|
5
|
+
export interface SerializedRequest {
|
|
6
|
+
body: SerializedBody;
|
|
7
|
+
contentType: ContentType;
|
|
8
|
+
}
|
|
9
|
+
export declare function serializeRequestBody(req: MionClientRequest<any, any>): SerializedRequest;
|
|
10
|
+
export declare function deserializeResponseBody(response: Response): Promise<ResponseBody>;
|
|
11
|
+
export declare type __ΩSerializedBody = any[];
|
|
12
|
+
export declare type __ΩContentType = any[];
|
|
13
|
+
export declare type __ΩSerializedRequest = any[];
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const STORAGE_GLOBAL_KEY="__mion_storage__";class MemoryStorage{data=(Map.Ω=[["&"],["&"]],new Map);get length(){return this.data.size}getItem(key){return this.data.get(key)??null}setItem(key,value){this.data.set(key,value)}removeItem(key){this.data.delete(key)}clear(){this.data.clear()}key(index){return[...this.data.keys()][index]??null}static __type=["data",function(){return Map.Ω=[["&"],["&"]],new Map},"key","getItem","value","setItem","removeItem","clear","index","MemoryStorage",`!3!;>"!P&2#P&,J0$P&2#&2%"0&P&2#"0'P"0(P'2)P&,J0#5w*`]}function getStorage(){const existing=globalThis[STORAGE_GLOBAL_KEY];if(existing)return existing;let storage;try{typeof localStorage<"u"?(localStorage.setItem("__mion_test__","1"),localStorage.removeItem("__mion_test__"),storage=localStorage):storage=new MemoryStorage}catch{storage=new MemoryStorage}return globalThis[STORAGE_GLOBAL_KEY]=storage,storage}getStorage.__type=[()=>MemoryStorage,"getStorage",'PP!P7!J/"'];function resetStorageInstance(){delete globalThis[STORAGE_GLOBAL_KEY]}resetStorageInstance.__type=["resetStorageInstance",'P"/!'];exports.MemoryStorage=MemoryStorage;exports.getStorage=getStorage;exports.resetStorageInstance=resetStorageInstance;
|
|
2
|
+
//# sourceMappingURL=storage.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class MemoryStorage {
|
|
2
|
+
private data;
|
|
3
|
+
get length(): number;
|
|
4
|
+
getItem(key: string): string | null;
|
|
5
|
+
setItem(key: string, value: string): void;
|
|
6
|
+
removeItem(key: string): void;
|
|
7
|
+
clear(): void;
|
|
8
|
+
key(index: number): string | null;
|
|
9
|
+
}
|
|
10
|
+
export declare function getStorage(): Storage | MemoryStorage;
|
|
11
|
+
export declare function resetStorageInstance(): void;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const core=require("@mionjs/core"),src_typedEvent=require("./typedEvent.cjs"),src_routesFlow=require("./routesFlow.cjs");function __assignType(fn,args){return fn.__type=args,fn}class MionSubRequest{client;pointer;id;isResolved=!1;params;resolvedValue;error;serializedParams;mappings=[];constructor(parentProps,handlerId,argArray,client){this.client=client,this.pointer=[...parentProps],this.id=handlerId,this.params=argArray.map(__assignType((arg,index)=>src_routesFlow.isMapFromRef(arg)?(arg.toRequestId=this.id,arg.paramIndex=index,this.mappings.push(arg),null):arg,["arg","index","",'P"2!"2""/#']))}prefill(){const typedEvent=(src_typedEvent.TypedEvent.Ω=[["!"],["!"]],new src_typedEvent.TypedEvent(this.id,this.client.handlersRegistry));return this.client.prefill(this).catch(__assignType(errors=>{console.error("Prefill error:",findSubRequestError(this,errors))},["RequestErrors","errors","",'P"w!2""/#'])),typedEvent}removePrefill(){return this.client.handlersRegistry.clearHandlers(this.id),this.client.removePrefill(this)}call(){return this.client.executeCall(this)}callWithMiddleFns(middleFns){if(Object.keys(middleFns).length===0)throw new Error("callWithMiddleFns requires at least one middleFn. Use call() instead for requests without middleFns.");return this.client.executeCallWithMiddleFns(this,middleFns)}async callWithWorkflow(otherRoutes,middleFns){const allRoutes=[this,...otherRoutes],[results,errors,middleFnResults,middleFnErrors]=await this.client.executeCallWithWorkflow(allRoutes,middleFns??{}),emptyResults=allRoutes.map(()=>{}),emptyErrors=allRoutes.map(()=>{});return[results??emptyResults,errors??emptyErrors,middleFnResults,middleFnErrors]}typeErrors(){return this.client.typeErrors(this).catch(__assignType(errors=>Promise.reject(findSubRequestError(this,errors)),["RequestErrors","errors","",'P"w!2""/#']))}static __type=["S","E","pointer","id","isResolved",function(){return!1},"params","resolvedValue","error","serializedParams","MapFromServerFnRef","mappings",function(){return[]},"parentProps","handlerId","argArray","MionClient","client","constructor",()=>src_typedEvent.TypedEvent,"prefill","removePrefill","Result","call","middleFns","CallWithMiddleFnsResult","callWithMiddleFns","otherRoutes","WorkflowResult","callWithWorkflow","RunTypeError","typeErrors","RSubRequest","HSubRequest","MionSubRequest",'"c!"c"&F3#&3$)3%>&"F3\'e!!3(8e!"3)8"F3*8"w+F3,>-P&F2.&2/"F20"w1229"03PPe#!e#"7405P$`06P"w7`08P"29"w:`0;PP"@G2<"298"w=`0>P"w?F`0@5"wA"wBx#wC']}function findSubRequestError(subRequest,errors){const specificError=errors.get(subRequest.id);if(specificError)return specificError;const firstError=errors.values().next().value;return firstError||new core.RpcError({type:"unknown-error",publicMessage:"An unknown error occurred"})}findSubRequestError.__type=["SubRequest","subRequest","RequestErrors","errors",()=>core.RpcError,"findSubRequestError",'P"w!2""w#2$P&7%/&'];exports.MionSubRequest=MionSubRequest;exports.findSubRequestError=findSubRequestError;
|
|
2
|
+
//# sourceMappingURL=subRequest.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subRequest.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { RpcError, RunTypeError, MapFromServerFnRef } from '@mionjs/core';
|
|
2
|
+
import { CallWithMiddleFnsResult, HSubRequest, RequestErrors, Result, RSubRequest, SubRequest, WorkflowResult } from './types.ts';
|
|
3
|
+
import { MionClient } from './client.ts';
|
|
4
|
+
import { TypedEvent } from './typedEvent.ts';
|
|
5
|
+
export declare class MionSubRequest<S = any, E extends RpcError<string, any> = any> implements RSubRequest<any>, HSubRequest<any> {
|
|
6
|
+
readonly client: MionClient;
|
|
7
|
+
pointer: string[];
|
|
8
|
+
id: string;
|
|
9
|
+
isResolved: boolean;
|
|
10
|
+
params: any[];
|
|
11
|
+
resolvedValue?: S;
|
|
12
|
+
error?: E;
|
|
13
|
+
serializedParams?: any[];
|
|
14
|
+
mappings: MapFromServerFnRef[];
|
|
15
|
+
constructor(parentProps: string[], handlerId: string, argArray: any[], client: MionClient);
|
|
16
|
+
prefill(): TypedEvent<S, E>;
|
|
17
|
+
removePrefill(): Promise<void>;
|
|
18
|
+
call(): Promise<Result<S, E>>;
|
|
19
|
+
callWithMiddleFns<H extends Record<string, HSubRequest<any>>>(middleFns: H): Promise<CallWithMiddleFnsResult<S, E, H>>;
|
|
20
|
+
callWithWorkflow<OtherRoutes extends RSubRequest<any>[], H extends Record<string, HSubRequest<any>>>(otherRoutes: [...OtherRoutes], middleFns?: H): Promise<WorkflowResult<[RSubRequest<any>, ...OtherRoutes], H>>;
|
|
21
|
+
typeErrors(): Promise<RunTypeError[]>;
|
|
22
|
+
}
|
|
23
|
+
export declare function findSubRequestError(subRequest: SubRequest<any>, errors: RequestErrors): RpcError<string>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const core=require("@mionjs/core"),src_clientMethodsMetadata=require("./clientMethodsMetadata.cjs");function resetClientCaches(){const{jitFnsCache,pureFnsCache}=src_clientMethodsMetadata.getAOTCaches(),mionRouteIds=new Set(Object.values(core.MION_ROUTES)),cache=core.routesCache.getCache();for(const key in cache)mionRouteIds.has(key)||delete cache[key];core.resetJitFnCaches(),core.resetJitFunctionsCache();const neededJitHashes=(Set.Ω=[["&"]],new Set),neededPureFnKeys=(Set.Ω=[["&"]],new Set);for(const routeId of mionRouteIds){const meta=core.routesCache.getMetadata(routeId);meta&&(collectJitDepsFromParentHash(meta.paramsJitHash,neededJitHashes,neededPureFnKeys,jitFnsCache),collectJitDepsFromParentHash(meta.returnJitHash,neededJitHashes,neededPureFnKeys,jitFnsCache),meta.headersParam&&collectJitDepsFromParentHash(meta.headersParam.jitHash,neededJitHashes,neededPureFnKeys,jitFnsCache),meta.headersReturn&&collectJitDepsFromParentHash(meta.headersReturn.jitHash,neededJitHashes,neededPureFnKeys,jitFnsCache))}const filteredJitFns={};for(const hash of neededJitHashes)hash in jitFnsCache&&(filteredJitFns[hash]=jitFnsCache[hash]);const filteredPureFns={};for(const key of neededPureFnKeys){const[ns,fnHash]=key.split("::");pureFnsCache[ns]?.[fnHash]&&(filteredPureFns[ns]||(filteredPureFns[ns]={}),filteredPureFns[ns][fnHash]=pureFnsCache[ns][fnHash])}(Object.keys(filteredJitFns).length>0||Object.keys(filteredPureFns).length>0)&&core.addAOTCaches(filteredJitFns,filteredPureFns)}resetClientCaches.__type=["resetClientCaches",'P"/!'];function collectJitDepsFromParentHash(parentHash,jitHashes,pureFnKeys,jitFnsCache){if(!parentHash)return;const hashes=core.getJitFnHashes(parentHash);for(const individualHash of Object.values(hashes))collectJitDeps(individualHash,jitHashes,pureFnKeys,jitFnsCache)}collectJitDepsFromParentHash.__type=["parentHash","jitHashes","pureFnKeys","PersistedJitFunctionsCache","jitFnsCache","collectJitDepsFromParentHash",'P&2!&D2"&D2#"w$2%"/&'];function collectJitDeps(hash,jitHashes,pureFnKeys,jitFnsCache){if(!hash||jitHashes.has(hash))return;jitHashes.add(hash);const entry=jitFnsCache[hash];if(entry){for(const dep of entry.jitDependencies)collectJitDeps(dep,jitHashes,pureFnKeys,jitFnsCache);for(const pureDep of entry.pureFnDependencies)pureFnKeys.add(pureDep)}}collectJitDeps.__type=["hash","jitHashes","pureFnKeys","PersistedJitFunctionsCache","jitFnsCache","collectJitDeps",'P&2!&D2"&D2#"w$2%"/&'];exports.resetClientCaches=resetClientCaches;
|
|
2
|
+
//# sourceMappingURL=testUtils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testUtils.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function resetClientCaches(): void;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const __ΩExtract=["T","U","Extract",`l6e$!R!RPe#!e$"qk#'QRb!b"Pde"!p)w#y`];class TypedEvent{handlerId;registry;constructor(handlerId,registry){this.handlerId=handlerId,this.registry=registry}onSuccess(handler){return this.registry.registerSuccess(this.handlerId,handler),this}offSuccess(){return this.registry.unregisterSuccess(this.handlerId),this}onError(errorType,handler){return this.registry.register(this.handlerId,errorType,handler),this}offError(errorType){return this.registry.unregister(this.handlerId,errorType),this}getHandlerId(){return this.handlerId}hasErrorHandler(errorType){return this.registry.hasHandler(this.handlerId,errorType)}hasSuccessHandler(){return this.registry.hasSuccessHandler(this.handlerId)}static __type=["S","E","handlerId","HandlersRegistry","registry","constructor","SuccessHandler","handler",()=>TypedEvent,"onSuccess",()=>TypedEvent,"offSuccess","errorType",()=>__ΩExtract,"type","error","",()=>TypedEvent,"onError",()=>TypedEvent,"offError","getHandlerId","hasErrorHandler","hasSuccessHandler","TypedEvent",`$c!!c"P&2#;9"w$2%;9"0&P"w'2(Pe#!e#"7)0*PPe#!e#"7+0,P"2-Pe#"P"4/Mo.#20$/12(Pe#!e#"7203P"2-Pe#!e#"7405P&06P&2-)07P)085w9`]}exports.TypedEvent=TypedEvent;
|
|
2
|
+
//# sourceMappingURL=typedEvent.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typedEvent.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RpcError } from '@mionjs/core';
|
|
2
|
+
import { HandlersRegistry } from './handlersRegistry.ts';
|
|
3
|
+
import { SuccessHandler } from './types.ts';
|
|
4
|
+
export declare class TypedEvent<S = void, E extends RpcError<string, any> = never> {
|
|
5
|
+
private readonly handlerId;
|
|
6
|
+
private readonly registry;
|
|
7
|
+
constructor(handlerId: string, registry: HandlersRegistry);
|
|
8
|
+
onSuccess(handler: SuccessHandler<S>): TypedEvent<S, E>;
|
|
9
|
+
offSuccess(): TypedEvent<S, E>;
|
|
10
|
+
onError<T extends E['type']>(errorType: T, handler: (error: Extract<E, {
|
|
11
|
+
type: T;
|
|
12
|
+
}>) => void): TypedEvent<S, E>;
|
|
13
|
+
offError<T extends E['type']>(errorType: T): TypedEvent<S, E>;
|
|
14
|
+
getHandlerId(): string;
|
|
15
|
+
hasErrorHandler(errorType: string): boolean;
|
|
16
|
+
hasSuccessHandler(): boolean;
|
|
17
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const core=require("@mionjs/core"),__ΩRecord=["K","T","Record",`l'e#"Rb!b"Pde"!N#!w#y`],__ΩPartial=["T","Partial",'l+e#!e"!fRb!Pde"!gN#"w"y'],__ΩParameters=["T","args","","Parameters",`l>e"!R!RPde#!Ph"!@2""/#qk#'QRb!Pde"!p)w$y`],__ΩAwaited=["T","onfulfilled","args","then","value","",0,"Awaited",`le$!Re"!o'"R!RPde#!Ph"!2%h&"@2#"/&qk'.QRPde#!p0Re$!RPdde#!P%PPh$!2"h$"@2#"1$MKqkJRQRPde%!pVRPe#!P,-Jqk#vQRb!Pde"!p~w(y`],__ΩReturnType=["T","args","","ReturnType",`l>e"!R"RPde#!P"@2"h"!/#qk#'QRb!Pde"!p)w$y`],__ΩExclude=["T","U","Exclude",'l6!Re$!RPe#!e$"qk#%QRb!b"Pde"!p)w#y'],__ΩExtract=["T","U","Extract",`l6e$!R!RPe#!e$"qk#'QRb!b"Pde"!p)w#y`],__ΩRequired=["T","Required",'l+e#!e"!fRb!Pde"!gN##w"y'],__ΩResult=["RouteSuccess","RouteError",()=>__ΩRecord,"MiddleFnsResults",()=>__ΩRecord,()=>core.RpcError,"MiddleFnsErrors","Result",`b!b"&#o##c$&P&o%#c'PPe#!-JPe#"-JPe##-JPe#$-JGw(y`],__ΩMiddleFnSuccess=["H",()=>__ΩHSubRequest,()=>__ΩHandlerSuccessResponse,"MiddleFnSuccess",'l=e"!o#"R!RPde#!h!!o""qk#*QRb!Pde"!p,w$y'],__ΩMiddleFnError=["H",()=>__ΩHSubRequest,()=>__ΩSimplify,()=>__ΩHandlerErrors,"MiddleFnError",'l@e"!o$"o#"R!RPde#!h!!o""qk#-QRb!Pde"!p/w%y'],__ΩCallWithMiddleFnsResult=["RouteSuccess","RouteError","MiddleFns","ValidationError",()=>__ΩMiddleFnSuccess,()=>__ΩMiddleFnError,"CallWithMiddleFnsResult",`l9e%#e"!fo%"Re%#e"!fo&"Rb!b"b#PPe#!-JPe#""w$-JPPde$#gN#"-JPPde$#gN."-JGw'y`],__ΩWorkflowResult=["Routes",()=>__ΩRecord,()=>__ΩHSubRequest,"MiddleFns",()=>__ΩWorkflowRouteResults,()=>__ΩWorkflowRouteErrors,()=>__ΩMiddleFnSuccess,()=>__ΩMiddleFnError,"WorkflowResult",`l9e%"e"!fo'"Re%"e"!fo("Rb!&"o#"o"#c$Pe"!o%"e"!o&"PPde$"gN#"-JPPde$"gN."-JGw)y`],__ΩWorkflowRouteResults=["Routes",()=>__ΩRSubRequest,()=>__ΩHandlerSuccessResponse,"WorkflowRouteResults",'lDPe#!o#"-JR!RPde$!e#!fh!!o""qk#-QRb!Pde"!gN/!w$y'],__ΩWorkflowRouteErrors=["Routes",()=>__ΩRSubRequest,()=>__ΩSimplify,()=>__ΩHandlerErrors,"WorkflowRouteErrors",'lGPe#!o$"o#"-JR!RPde$!e#!fh!!o""qk#0QRb!Pde"!gN2!w%y'],__ΩClientOptions=["CoreRouterOptions","baseURL","basePath","suffix","autoGenerateErrorId","fetchOptions","validateParams","SerializerMode","serializer","ClientOptions",`P"w!&4"&4#&4$)4%!4&)4'"w(4)Mw*y`],__ΩExtractHandler=["PM","handler","ExtractHandler",`l;e"!R!RPde#!Ph"!4"Mqk#'QRb!Pde"!p)w#y`],__ΩInitClientOptions=[()=>__ΩPartial,()=>__ΩClientOptions,"baseURL","InitClientOptions",'Pn"o!"P&4#MKw$y'],__ΩRequestHeaders=["RequestHeaders","P&&LMw!y"],__ΩRequestBody=["RequestBody",'P&"FLMw!y'],__ΩRouteParamsType=["PM",()=>__ΩParameters,()=>__ΩExtractHandler,"RouteParamsType",'b!e!!o#"o""w$y'],__ΩRouteParamType=["PM","Index",()=>__ΩParameters,()=>__ΩExtractHandler,"RouteParamType",'b!b"e!!o$"o#"e!"fw%y'],__ΩHeadersParamsType=["PM",()=>__ΩParameters,()=>__ΩExtractHandler,0,"HeadersParamsType",'b!e!!o#"o"".$fw%y'],__ΩRouteReturnType=["PM",()=>__ΩHandlerSuccessResponse,()=>__ΩExtractHandler,"RouteReturnType",'b!e!!o#"o""w$y'],__ΩHandlerResponse=["PH",()=>__ΩAwaited,()=>__ΩReturnType,"HandlerResponse",'b!e!!o#"o""w$y'],__ΩHandlerSuccessResponse=["PH",()=>__ΩExclude,()=>__ΩHandlerResponse,()=>core.RpcError,"HandlerSuccessResponse",'b!e!!o#"P&7$o"#w%y'],__ΩHandlerFailResponse=["PH",()=>__ΩExtract,()=>__ΩHandlerResponse,()=>core.RpcError,"HandlerFailResponse",'b!e!!o#"P&7$o"#w%y'],__ΩSuccessResponse=["MR",()=>__ΩRequired,"resolvedValue","SuccessResponse",'b!e!!o"".#fw$y'],__ΩSuccessResponses=["List",()=>__ΩSuccessResponse,"SuccessResponses",'l.e#!e"!fo""Rb!Pde"!gN#!w#y'],__ΩFailResponse=["MR",()=>__ΩRequired,"error","FailResponse",'b!e!!o"".#fw$y'],__ΩFailResponses=["List",()=>__ΩFailResponse,"FailResponses",'l.e#!e"!fo""Rb!Pde"!gN#!w#y'],__ΩRequestErrors=[()=>core.RpcError,"RequestErrors",'&P&7!Ew"y'],__ΩErrorHandler=["E","error","","ErrorHandler",'b!Pe"!2"$/#w$y'],__ΩUnknownErrorHandler=[()=>core.RpcError,"error","","UnknownErrorHandler",'PP&"7!2"$/#w$y'],__ΩSuccessHandler=["S","result","","SuccessHandler",'b!Pe"!2"$/#w$y'],__ΩSimplify=["T","Simplify",`l4e$!R!RPe#!"qk#'QRb!Pde"!p)w"y`],__ΩHandlerErrors=["PH",()=>__ΩSimplify,()=>__ΩExtract,()=>__ΩHandlerResponse,()=>core.RpcError,"ValidationError","HandlerErrors",`b!Pe"!o$"P&"7%o##"w&Jo""w'y`],__ΩSubRequest=["PH","pointer","id","isResolved",()=>__ΩParameters,"params",()=>__ΩHandlerSuccessResponse,"resolvedValue",()=>__ΩHandlerFailResponse,"error","serializedParams","SubRequest",`b!P&F4"&4#)4$e"!o%"4&e"!o'"4(8e"!o)"4*8"F4+8Mw,y`],__ΩRSubRequest=["PH",()=>__ΩSubRequest,"RunTypeError","","typeErrors",()=>__ΩResult,()=>__ΩHandlerSuccessResponse,()=>__ΩSimplify,()=>__ΩHandlerErrors,()=>__ΩRecord,()=>__ΩRecord,()=>core.RpcError,"ValidationError","call","middleFns",()=>__ΩCallWithMiddleFnsResult,()=>__ΩHandlerSuccessResponse,()=>__ΩSimplify,()=>__ΩHandlerErrors,"callWithMiddleFns","otherRoutes",()=>__ΩWorkflowResult,"callWithWorkflow","RSubRequest",'b!Pe"!o""P"w#F`/$4%Pe#!o\'"e#!o)"o("&#o*#&PP,"w-Jo+#o&%`/$4.P"2/e#!o1"e#!o3"o2""o0$`/$44PP"@G25"2/8""o6#`/$47Mw8y'],__ΩHSubRequest=["PH",()=>__ΩSubRequest,"RunTypeError","","typeErrors","TypedEvent","prefill","removePrefill","HSubRequest",'b!Pe"!o""P"w#F`/$4%P"w&/$4\'P$`/$4(Mw)y'],__ΩNonClientRoute=["PublicMiddleFn","PublicHeadersFn","NonClientRoute",'P!"w!"w"Jw#y'],__ΩClientRoutes=["RA","Prettify","ClientRoutes",'b!"w"w#y'],__ΩNonClientMiddleFn=["PublicRoute","NonClientMiddleFn",'P!"w!P&"w!LMJw"y'],__ΩClientMiddleFns=["RA","Prettify","ClientMiddleFns",'b!"w"w#y'],__ΩCleaned=["RMS","Cleaned",'lA!Re%!RPe$!e#!fPe%!e$!f!qk#%QGRb!Pde"!gt)!w"y'],__ΩSuccessClientResponse=["RS","RHList",()=>__ΩSuccessResponse,()=>__ΩSuccessResponses,"SuccessClientResponse",'b!b"Pe"!o#"e""o$"@Gw%y'],__ΩPrefilledMiddleFnsCache=[()=>__ΩSubRequest,"PrefilledMiddleFnsCache",'&"o!"Ew"y'];exports.__ΩCallWithMiddleFnsResult=__ΩCallWithMiddleFnsResult;exports.__ΩCleaned=__ΩCleaned;exports.__ΩClientMiddleFns=__ΩClientMiddleFns;exports.__ΩClientOptions=__ΩClientOptions;exports.__ΩClientRoutes=__ΩClientRoutes;exports.__ΩErrorHandler=__ΩErrorHandler;exports.__ΩFailResponse=__ΩFailResponse;exports.__ΩFailResponses=__ΩFailResponses;exports.__ΩHSubRequest=__ΩHSubRequest;exports.__ΩHandlerErrors=__ΩHandlerErrors;exports.__ΩHandlerFailResponse=__ΩHandlerFailResponse;exports.__ΩHandlerResponse=__ΩHandlerResponse;exports.__ΩHandlerSuccessResponse=__ΩHandlerSuccessResponse;exports.__ΩHeadersParamsType=__ΩHeadersParamsType;exports.__ΩInitClientOptions=__ΩInitClientOptions;exports.__ΩMiddleFnError=__ΩMiddleFnError;exports.__ΩMiddleFnSuccess=__ΩMiddleFnSuccess;exports.__ΩNonClientMiddleFn=__ΩNonClientMiddleFn;exports.__ΩNonClientRoute=__ΩNonClientRoute;exports.__ΩPrefilledMiddleFnsCache=__ΩPrefilledMiddleFnsCache;exports.__ΩRSubRequest=__ΩRSubRequest;exports.__ΩRequestBody=__ΩRequestBody;exports.__ΩRequestErrors=__ΩRequestErrors;exports.__ΩRequestHeaders=__ΩRequestHeaders;exports.__ΩResult=__ΩResult;exports.__ΩRouteParamType=__ΩRouteParamType;exports.__ΩRouteParamsType=__ΩRouteParamsType;exports.__ΩRouteReturnType=__ΩRouteReturnType;exports.__ΩSubRequest=__ΩSubRequest;exports.__ΩSuccessClientResponse=__ΩSuccessClientResponse;exports.__ΩSuccessHandler=__ΩSuccessHandler;exports.__ΩSuccessResponse=__ΩSuccessResponse;exports.__ΩSuccessResponses=__ΩSuccessResponses;exports.__ΩUnknownErrorHandler=__ΩUnknownErrorHandler;exports.__ΩWorkflowResult=__ΩWorkflowResult;exports.__ΩWorkflowRouteErrors=__ΩWorkflowRouteErrors;exports.__ΩWorkflowRouteResults=__ΩWorkflowRouteResults;
|
|
2
|
+
//# sourceMappingURL=types.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|