@mionjs/core 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.
Files changed (136) hide show
  1. package/.dist/cjs/index.cjs +245 -0
  2. package/.dist/cjs/index.cjs.map +1 -0
  3. package/.dist/cjs/index.d.ts +21 -0
  4. package/.dist/cjs/package.json +1 -0
  5. package/.dist/cjs/src/binary/bodyDeserializer.cjs +54 -0
  6. package/.dist/cjs/src/binary/bodyDeserializer.cjs.map +1 -0
  7. package/.dist/cjs/src/binary/bodyDeserializer.d.ts +5 -0
  8. package/.dist/cjs/src/binary/bodySerializer.cjs +49 -0
  9. package/.dist/cjs/src/binary/bodySerializer.cjs.map +1 -0
  10. package/.dist/cjs/src/binary/bodySerializer.d.ts +6 -0
  11. package/.dist/cjs/src/binary/dataView.cjs +212 -0
  12. package/.dist/cjs/src/binary/dataView.cjs.map +1 -0
  13. package/.dist/cjs/src/binary/dataView.d.ts +16 -0
  14. package/.dist/cjs/src/constants.cjs +84 -0
  15. package/.dist/cjs/src/constants.cjs.map +1 -0
  16. package/.dist/cjs/src/constants.d.ts +50 -0
  17. package/.dist/cjs/src/errors.cjs +170 -0
  18. package/.dist/cjs/src/errors.cjs.map +1 -0
  19. package/.dist/cjs/src/errors.d.ts +24 -0
  20. package/.dist/cjs/src/friendlyErrors.cjs +235 -0
  21. package/.dist/cjs/src/friendlyErrors.cjs.map +1 -0
  22. package/.dist/cjs/src/friendlyErrors.d.ts +4 -0
  23. package/.dist/cjs/src/headers.cjs +11 -0
  24. package/.dist/cjs/src/headers.cjs.map +1 -0
  25. package/.dist/cjs/src/headers.d.ts +12 -0
  26. package/.dist/cjs/src/jit/jitUtils.cjs +173 -0
  27. package/.dist/cjs/src/jit/jitUtils.cjs.map +1 -0
  28. package/.dist/cjs/src/jit/jitUtils.d.ts +30 -0
  29. package/.dist/cjs/src/pureFns/pureFn.cjs +80 -0
  30. package/.dist/cjs/src/pureFns/pureFn.cjs.map +1 -0
  31. package/.dist/cjs/src/pureFns/pureFn.d.ts +2 -0
  32. package/.dist/cjs/src/pureFns/pureServerFn.cjs +20 -0
  33. package/.dist/cjs/src/pureFns/pureServerFn.cjs.map +1 -0
  34. package/.dist/cjs/src/pureFns/pureServerFn.d.ts +4 -0
  35. package/.dist/cjs/src/pureFns/quickHash.cjs +62 -0
  36. package/.dist/cjs/src/pureFns/quickHash.cjs.map +1 -0
  37. package/.dist/cjs/src/pureFns/quickHash.d.ts +7 -0
  38. package/.dist/cjs/src/pureFns/restoreJitFns.cjs +88 -0
  39. package/.dist/cjs/src/pureFns/restoreJitFns.cjs.map +1 -0
  40. package/.dist/cjs/src/pureFns/restoreJitFns.d.ts +3 -0
  41. package/.dist/cjs/src/routerUtils.cjs +209 -0
  42. package/.dist/cjs/src/routerUtils.cjs.map +1 -0
  43. package/.dist/cjs/src/routerUtils.d.ts +24 -0
  44. package/.dist/cjs/src/types/formats/formatBrands.types.cjs +45 -0
  45. package/.dist/cjs/src/types/formats/formatBrands.types.cjs.map +1 -0
  46. package/.dist/cjs/src/types/formats/formatBrands.types.d.ts +45 -0
  47. package/.dist/cjs/src/types/formats/formats.types.cjs +27 -0
  48. package/.dist/cjs/src/types/formats/formats.types.cjs.map +1 -0
  49. package/.dist/cjs/src/types/formats/formats.types.d.ts +37 -0
  50. package/.dist/cjs/src/types/formats/formatsParams.types.cjs +60 -0
  51. package/.dist/cjs/src/types/formats/formatsParams.types.cjs.map +1 -0
  52. package/.dist/cjs/src/types/formats/formatsParams.types.d.ts +234 -0
  53. package/.dist/cjs/src/types/formats/friendlyErrors.types.cjs +53 -0
  54. package/.dist/cjs/src/types/formats/friendlyErrors.types.cjs.map +1 -0
  55. package/.dist/cjs/src/types/formats/friendlyErrors.types.d.ts +71 -0
  56. package/.dist/cjs/src/types/general.types.cjs +145 -0
  57. package/.dist/cjs/src/types/general.types.cjs.map +1 -0
  58. package/.dist/cjs/src/types/general.types.d.ts +246 -0
  59. package/.dist/cjs/src/types/method.types.cjs +26 -0
  60. package/.dist/cjs/src/types/method.types.cjs.map +1 -0
  61. package/.dist/cjs/src/types/method.types.d.ts +60 -0
  62. package/.dist/cjs/src/types/pureFunctions.types.cjs +39 -0
  63. package/.dist/cjs/src/types/pureFunctions.types.cjs.map +1 -0
  64. package/.dist/cjs/src/types/pureFunctions.types.d.ts +75 -0
  65. package/.dist/cjs/src/utils.cjs +47 -0
  66. package/.dist/cjs/src/utils.cjs.map +1 -0
  67. package/.dist/cjs/src/utils.d.ts +9 -0
  68. package/.dist/esm/index.d.ts +21 -0
  69. package/.dist/esm/index.js +245 -0
  70. package/.dist/esm/index.js.map +1 -0
  71. package/.dist/esm/src/binary/bodyDeserializer.d.ts +5 -0
  72. package/.dist/esm/src/binary/bodyDeserializer.js +54 -0
  73. package/.dist/esm/src/binary/bodyDeserializer.js.map +1 -0
  74. package/.dist/esm/src/binary/bodySerializer.d.ts +6 -0
  75. package/.dist/esm/src/binary/bodySerializer.js +49 -0
  76. package/.dist/esm/src/binary/bodySerializer.js.map +1 -0
  77. package/.dist/esm/src/binary/dataView.d.ts +16 -0
  78. package/.dist/esm/src/binary/dataView.js +212 -0
  79. package/.dist/esm/src/binary/dataView.js.map +1 -0
  80. package/.dist/esm/src/constants.d.ts +50 -0
  81. package/.dist/esm/src/constants.js +84 -0
  82. package/.dist/esm/src/constants.js.map +1 -0
  83. package/.dist/esm/src/errors.d.ts +24 -0
  84. package/.dist/esm/src/errors.js +170 -0
  85. package/.dist/esm/src/errors.js.map +1 -0
  86. package/.dist/esm/src/friendlyErrors.d.ts +4 -0
  87. package/.dist/esm/src/friendlyErrors.js +235 -0
  88. package/.dist/esm/src/friendlyErrors.js.map +1 -0
  89. package/.dist/esm/src/headers.d.ts +12 -0
  90. package/.dist/esm/src/headers.js +11 -0
  91. package/.dist/esm/src/headers.js.map +1 -0
  92. package/.dist/esm/src/jit/jitUtils.d.ts +30 -0
  93. package/.dist/esm/src/jit/jitUtils.js +173 -0
  94. package/.dist/esm/src/jit/jitUtils.js.map +1 -0
  95. package/.dist/esm/src/pureFns/pureFn.d.ts +2 -0
  96. package/.dist/esm/src/pureFns/pureFn.js +80 -0
  97. package/.dist/esm/src/pureFns/pureFn.js.map +1 -0
  98. package/.dist/esm/src/pureFns/pureServerFn.d.ts +4 -0
  99. package/.dist/esm/src/pureFns/pureServerFn.js +20 -0
  100. package/.dist/esm/src/pureFns/pureServerFn.js.map +1 -0
  101. package/.dist/esm/src/pureFns/quickHash.d.ts +7 -0
  102. package/.dist/esm/src/pureFns/quickHash.js +62 -0
  103. package/.dist/esm/src/pureFns/quickHash.js.map +1 -0
  104. package/.dist/esm/src/pureFns/restoreJitFns.d.ts +3 -0
  105. package/.dist/esm/src/pureFns/restoreJitFns.js +88 -0
  106. package/.dist/esm/src/pureFns/restoreJitFns.js.map +1 -0
  107. package/.dist/esm/src/routerUtils.d.ts +24 -0
  108. package/.dist/esm/src/routerUtils.js +209 -0
  109. package/.dist/esm/src/routerUtils.js.map +1 -0
  110. package/.dist/esm/src/types/formats/formatBrands.types.d.ts +45 -0
  111. package/.dist/esm/src/types/formats/formatBrands.types.js +45 -0
  112. package/.dist/esm/src/types/formats/formatBrands.types.js.map +1 -0
  113. package/.dist/esm/src/types/formats/formats.types.d.ts +37 -0
  114. package/.dist/esm/src/types/formats/formats.types.js +27 -0
  115. package/.dist/esm/src/types/formats/formats.types.js.map +1 -0
  116. package/.dist/esm/src/types/formats/formatsParams.types.d.ts +234 -0
  117. package/.dist/esm/src/types/formats/formatsParams.types.js +60 -0
  118. package/.dist/esm/src/types/formats/formatsParams.types.js.map +1 -0
  119. package/.dist/esm/src/types/formats/friendlyErrors.types.d.ts +71 -0
  120. package/.dist/esm/src/types/formats/friendlyErrors.types.js +53 -0
  121. package/.dist/esm/src/types/formats/friendlyErrors.types.js.map +1 -0
  122. package/.dist/esm/src/types/general.types.d.ts +246 -0
  123. package/.dist/esm/src/types/general.types.js +145 -0
  124. package/.dist/esm/src/types/general.types.js.map +1 -0
  125. package/.dist/esm/src/types/method.types.d.ts +60 -0
  126. package/.dist/esm/src/types/method.types.js +26 -0
  127. package/.dist/esm/src/types/method.types.js.map +1 -0
  128. package/.dist/esm/src/types/pureFunctions.types.d.ts +75 -0
  129. package/.dist/esm/src/types/pureFunctions.types.js +39 -0
  130. package/.dist/esm/src/types/pureFunctions.types.js.map +1 -0
  131. package/.dist/esm/src/utils.d.ts +9 -0
  132. package/.dist/esm/src/utils.js +47 -0
  133. package/.dist/esm/src/utils.js.map +1 -0
  134. package/LICENSE +21 -0
  135. package/README.md +32 -0
  136. package/package.json +58 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restoreJitFns.cjs","sources":["../../../../src/pureFns/restoreJitFns.ts"],"sourcesContent":["/* ########\n * 2025 mion\n * Author: Ma-jerez\n * License: MIT\n * The software is provided \"as is\", without warranty of any kind.\n * ######## */\n\nimport type {\n Mutable,\n JitCompiledFn,\n PersistedJitFunctionsCache,\n PersistedPureFunctionsCache,\n FnsDataCache,\n PureFnsDataCache,\n PureFunctionsCache,\n JitCompiledFnData,\n PersistedJitFn,\n} from '../types/general.types.ts';\nimport {JITUtils} from '../jit/jitUtils.ts';\nimport type {PersistedPureFunction} from '../types/pureFunctions.types.ts';\nimport type {CompiledPureFunction} from '../types/pureFunctions.types.ts';\nimport type {PureFunctionData} from '../types/pureFunctions.types.ts';\nimport type {PureFunctionFactory} from '../types/pureFunctions.types.ts';\nimport {TypedError} from '../errors.ts';\n\n/**\n * Restores the full state of a persisted/serialized jit functions.\n * This functions mutates the input caches!!!\n * Persisted functions are jit functions written to code that contains the createJitFn closure but not the fn.\n * Serialized functions are jit functions sent over the network that contains the code to recreate the createJitFn closure and fn.\n * The JIT fn itself can't be compiled to code as it contains references to context code and jitUtils.\n * So we need to restore it manually by invoking the closure function.\n * */\nexport function restoreCompiledJitFns(\n jitCache: PersistedJitFunctionsCache | FnsDataCache,\n pureCache: PureFunctionsCache | PersistedPureFunctionsCache | PureFnsDataCache,\n jUtil: JITUtils\n): void {\n // Use visited sets to prevent infinite recursion on circular dependencies\n // This is needed because during restoration, the `fn` property is not set until after\n // all dependencies are restored, so checking `fn` alone can't prevent circular calls\n const visitedPure = new Set<string>();\n const visitedJit = new Set<string>();\n\n // Iterate over all namespaces and restore pure functions\n for (const namespace in pureCache) {\n const nsCache = pureCache[namespace];\n const keysPureFns = Object.keys(nsCache);\n keysPureFns.forEach((key) => restoreCompiledPureFn(pureCache, namespace, key, jUtil, visitedPure));\n }\n const keysJitFns = Object.keys(jitCache);\n keysJitFns.forEach((key) => restoreCompiledJitFn(jitCache, pureCache, key, jUtil, visitedPure, visitedJit));\n}\n\nfunction restoreCompiledPureFn(\n pureCache: PureFunctionsCache | PersistedPureFunctionsCache | PureFnsDataCache,\n namespace: string,\n fnName: string,\n jUtil: JITUtils,\n visited: Set<string>\n) {\n // Use namespace:fnName as the visited key to handle same function names in different namespaces\n const visitedKey = `${namespace}:${fnName}`;\n // Skip if already visited (handles circular dependencies)\n if (visited.has(visitedKey)) return;\n visited.add(visitedKey);\n\n const nsCache = pureCache[namespace];\n if (!nsCache) throw new Error(`Pure function namespace ${namespace} not found`);\n const pureCompiled = nsCache[fnName];\n if (!pureCompiled) throw new Error(`Pure function ${fnName} not found in namespace ${namespace}`);\n if ((pureCompiled as CompiledPureFunction).fn) return;\n const dependencies = pureCompiled.pureFnDependencies;\n // Dependencies are in the same namespace\n dependencies.forEach((depName) => restoreCompiledPureFn(pureCache, namespace, depName, jUtil, visited));\n // persisted pure functions (AOT code caches) have the createJitFn but not the fn\n if ((pureCompiled as PersistedPureFunction).createPureFn) {\n (pureCompiled as any as Mutable<CompiledPureFunction>).fn = (pureCompiled as PersistedPureFunction).createPureFn(jUtil);\n return;\n }\n // serialized pure functions (network sent) do not contains neither createJitFn nor fn\n restorePureFunction(pureCompiled, jUtil);\n}\n\nfunction restoreCompiledJitFn(\n jitCache: PersistedJitFunctionsCache | FnsDataCache,\n pureCache: PureFunctionsCache | PersistedPureFunctionsCache | PureFnsDataCache,\n fnHash: string,\n jUtil: JITUtils,\n visitedPure: Set<string>,\n visitedJit: Set<string>\n) {\n // Skip if already visited (handles circular dependencies)\n if (visitedJit.has(fnHash)) return;\n visitedJit.add(fnHash);\n\n const jitCompiled = jitCache[fnHash];\n if (!jitCompiled) throw new Error(`Jit function ${fnHash} not found`);\n if ((jitCompiled as JitCompiledFn).fn) return;\n const pureDependencies = jitCompiled.pureFnDependencies;\n // Pure function dependencies are stored as \"namespace::fnHash\"\n pureDependencies.forEach((dep) => {\n const parts = dep.split('::');\n if (parts.length !== 2) throw new Error(`Invalid pure function dependency format: ${dep}, expected \"namespace::fnHash\"`);\n const [namespace, fnHash] = parts;\n restoreCompiledPureFn(pureCache, namespace, fnHash, jUtil, visitedPure);\n });\n const dependencies = jitCompiled.jitDependencies;\n dependencies.forEach((dep) => restoreCompiledJitFn(jitCache, pureCache, dep, jUtil, visitedPure, visitedJit));\n if ((jitCompiled as PersistedJitFn).createJitFn) {\n (jitCompiled as any as Mutable<JitCompiledFn>).fn = (jitCompiled as PersistedJitFn).createJitFn(jUtil);\n return;\n }\n restoreCreateJitFn(jitCompiled, jUtil);\n}\n\n/**\n * Restores a JIT function from serialized function data.\n * This functionsMutates the input data!!!\n * Creates a dynamic function using the serialized code (which already contains the complete function with context),\n * then executes it with jitUtils to produce the final JIT function.\n * @param fnData - The serialized function data containing code, args, and metadata\n * @returns A JitCompiledFn with both the createJitFn closure and the executed fn\n */\nfunction restoreCreateJitFn(fnData: JitCompiledFnData, jUtil: JITUtils): JitCompiledFn {\n const fnName = fnData.jitFnHash;\n // fnData.code already contains the complete function with context (e.g., \"const x = ...; return function fnName(args){...}\")\n const fnWithContext = `'use strict'; ${fnData.code}`;\n try {\n // Create wrapper function that works as a factory and returns the actual jit function\n const wrapperWithContext = new Function('utl', fnWithContext) as (utl: JITUtils) => (...args: any[]) => any;\n // Execute the wrapper with jitUtils to get the final function\n const fn = wrapperWithContext(jUtil);\n const jitFn = fnData as Mutable<JitCompiledFn>;\n jitFn.createJitFn = wrapperWithContext;\n jitFn.fn = fn;\n return jitFn;\n } catch (e: any) {\n throw new TypedError({\n type: 'jit-fn-restore-error',\n message: `Failed to restore JIT function ${fnName}: ${e?.message}`,\n });\n }\n}\n\n/**\n * Restores a pure function from serialized function data.\n * This function mutates the input data!!!\n * Creates a dynamic function using the serialized code (which already contains the complete function with context),\n * then executes it with jitUtils to produce the final pure function.\n * @param pureFnData - The serialized pure function data containing code and metadata\n * @returns A CompiledPureFunction with both the createJitFn closure and the executed fn\n */\nfunction restorePureFunction(pureFnData: PureFunctionData, jUtil: JITUtils): CompiledPureFunction {\n const fnName = pureFnData.fnName;\n // pureFnData.code already contains the complete function with context\n const fnWithContext = `'use strict'; ${pureFnData.code}`;\n try {\n // Create wrapper function that works as a factory and returns the actual pure function\n const wrapperWithContext = new Function('utl', fnWithContext) as PureFunctionFactory;\n // Execute the wrapper with jitUtils to get the final function\n const fn = wrapperWithContext(jUtil);\n const pureFn = pureFnData as Mutable<CompiledPureFunction>;\n pureFn.createPureFn = wrapperWithContext;\n pureFn.fn = fn;\n return pureFn;\n } catch (e: any) {\n throw new TypedError({\n type: 'pure-fn-restore-error',\n message: `Failed to restore pure function ${fnName}: ${e?.message}`,\n });\n }\n}\n"],"names":["fnHash","TypedError"],"mappings":";;;AAiCO,SAAS,sBACZ,UACA,WACA,OACI;AAIJ,QAAM,kCAAkB,IAAA;AACxB,QAAM,iCAAiB,IAAA;AAGvB,aAAW,aAAa,WAAW;AAC/B,UAAM,UAAU,UAAU,SAAS;AACnC,UAAM,cAAc,OAAO,KAAK,OAAO;AACvC,gBAAY,QAAQ,CAAC,QAAQ,sBAAsB,WAAW,WAAW,KAAK,OAAO,WAAW,CAAC;AAAA,EACrG;AACA,QAAM,aAAa,OAAO,KAAK,QAAQ;AACvC,aAAW,QAAQ,CAAC,QAAQ,qBAAqB,UAAU,WAAW,KAAK,OAAO,aAAa,UAAU,CAAC;AAC9G;AAEA,SA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BAA8C,KAAM,YAA+B,YAAY,KAAK;AACrG;AAAA,EACJ;AACA,qBAAmB,aAAa,KAAK;AACzC;AAUA,SAAS,mBAAmB,QAA2B,OAAgC;AACnF,QAAM,SAAS,OAAO;AAEtB,QAAM,gBAAgB,iBAAiB,OAAO,IAAI;AAClD,MAAI;AAEA,UAAM,qBAAqB,IAAI,SAAS,OAAO,aAAa;AAE5D,UAAM,KAAK,mBAAmB,KAAK;AACnC,UAAM,QAAQ;AACd,UAAM,cAAc;AACpB,UAAM,KAAK;AACX,WAAO;AAAA,EACX,SAAS,GAAQ;AACb,UAAM,IAAIC,WAAAA,WAAW;AAAA,MACjB,MAAM;AAAA,MACN,SAAS,kCAAkC,MAAM,KAAK,GAAG,OAAO;AAAA,IAAA,CACnE;AAAA,EACL;AACJ;AAUA,SAAS,oBAAoB,YAA8B,OAAuC;AAC9F,QAAM,SAAS,WAAW;AAE1B,QAAM,gBAAgB,iBAAiB,WAAW,IAAI;AACtD,MAAI;AAEA,UAAM,qBAAqB,IAAI,SAAS,OAAO,aAAa;AAE5D,UAAM,KAAK,mBAAmB,KAAK;AACnC,UAAM,SAAS;AACf,WAAO,eAAe;AACtB,WAAO,KAAK;AACZ,WAAO;AAAA,EACX,SAAS,GAAQ;AACb,UAAM,IAAIA,WAAAA,WAAW;AAAA,MACjB,MAAM;AAAA,MACN,SAAS,mCAAmC,MAAM,KAAK,GAAG,OAAO;AAAA,IAAA,CACpE;AAAA,EACL;AACJ;;"}
@@ -0,0 +1,3 @@
1
+ import { PersistedJitFunctionsCache, PersistedPureFunctionsCache, FnsDataCache, PureFnsDataCache, PureFunctionsCache } from '../types/general.types.ts';
2
+ import { JITUtils } from '../jit/jitUtils.ts';
3
+ export declare function restoreCompiledJitFns(jitCache: PersistedJitFunctionsCache | FnsDataCache, pureCache: PureFunctionsCache | PersistedPureFunctionsCache | PureFnsDataCache, jUtil: JITUtils): void;
@@ -0,0 +1,209 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const src_constants = require("./constants.cjs");
4
+ const src_jit_jitUtils = require("./jit/jitUtils.cjs");
5
+ const methodsCache = {};
6
+ const methodsOptionsCache = {};
7
+ const jitFunctionsCache = /* @__PURE__ */ new Map();
8
+ const headerJitFunctionsCache = /* @__PURE__ */ new Map();
9
+ const routesCache = {
10
+ /**
11
+ * Get method metadata from the router cache by id.
12
+ * @param id - The method id
13
+ * @returns The method metadata or undefined if not found
14
+ */
15
+ getMetadata(id) {
16
+ return methodsCache[id];
17
+ },
18
+ /**
19
+ * Set method metadata in the router cache
20
+ * @param id - The method id
21
+ * @param methodData - The method metadata
22
+ */
23
+ setMetadata(id, methodData) {
24
+ methodsCache[id] = methodData;
25
+ },
26
+ /**
27
+ * Check if the router cache contains a method by id.
28
+ * @param id - The method id
29
+ * @returns True if the method exists in the cache
30
+ */
31
+ hasMetadata(id) {
32
+ return id in methodsCache;
33
+ },
34
+ /**
35
+ * Get the raw router cache object.
36
+ * Use with caution - prefer using get/set/has methods.
37
+ * @returns The router cache object
38
+ */
39
+ getCache() {
40
+ return methodsCache;
41
+ },
42
+ /**
43
+ * Get method metadata with JIT functions restored from the router cache by id.
44
+ * This augments the MethodWithOptions with paramsJitFns and returnJitFns.
45
+ * JIT functions are cached in the entry after first access for performance.
46
+ * @param id - The method id
47
+ * @returns The method metadata with JIT functions or undefined if not found
48
+ */
49
+ getMethodJitFns(id) {
50
+ if (id in methodsCache) {
51
+ const cached = methodsCache[id];
52
+ if (cached.paramsJitFns && cached.returnJitFns) {
53
+ return cached;
54
+ }
55
+ }
56
+ const metadata = this.getMetadata(id);
57
+ if (!metadata) return void 0;
58
+ const paramsJitFns = getJitFunctionsFromHash(metadata.paramsJitHash);
59
+ const returnJitFns = getJitFunctionsFromHash(metadata.returnJitHash);
60
+ const headersParam = metadata.headersParam ? { ...metadata.headersParam, jitFns: getHeaderJitFunctionsFromHash(metadata.headersParam.jitHash) } : void 0;
61
+ const headersReturn = metadata.headersReturn ? { ...metadata.headersReturn, jitFns: getHeaderJitFunctionsFromHash(metadata.headersReturn.jitHash) } : void 0;
62
+ const result = {
63
+ ...metadata,
64
+ paramsJitFns,
65
+ returnJitFns,
66
+ headersParam,
67
+ headersReturn
68
+ };
69
+ methodsCache[id] = result;
70
+ return result;
71
+ },
72
+ /**
73
+ * Get method metadata with JIT functions restored from the router cache by id.
74
+ * @param id
75
+ * @returns
76
+ */
77
+ useMethodJitFns(id) {
78
+ const MethodWithOptsAndJitFns = this.getMethodJitFns(id);
79
+ if (!MethodWithOptsAndJitFns) throw new Error(`Metadata for remote method ${id} not found`);
80
+ return MethodWithOptsAndJitFns;
81
+ },
82
+ /**
83
+ * Set method metadata with JIT functions in the router cache.
84
+ * This stores the complete MethodWithOptsAndJitFns object directly.
85
+ * @param id - The method id
86
+ * @param MethodWithOptsAndJitFns - The method metadata with JIT functions
87
+ */
88
+ setMethodJitFns(id, MethodWithOptsAndJitFns) {
89
+ methodsCache[id] = MethodWithOptsAndJitFns;
90
+ }
91
+ };
92
+ const methodOptsCache = {
93
+ getMethodOptions(id) {
94
+ return methodsOptionsCache[id];
95
+ },
96
+ setMethodOptions(id, options) {
97
+ methodsOptionsCache[id] = options;
98
+ }
99
+ };
100
+ function addRoutesToCache(newCache) {
101
+ for (const key in newCache) {
102
+ if (!(key in methodsCache)) {
103
+ methodsCache[key] = { ...newCache[key] };
104
+ }
105
+ }
106
+ }
107
+ function getJitFnHashes(jitHash) {
108
+ return {
109
+ isType: `${src_constants.JIT_FUNCTION_IDS.isType}_${jitHash}`,
110
+ typeErrors: `${src_constants.JIT_FUNCTION_IDS.typeErrors}_${jitHash}`,
111
+ prepareForJson: `${src_constants.JIT_FUNCTION_IDS.prepareForJson}_${jitHash}`,
112
+ restoreFromJson: `${src_constants.JIT_FUNCTION_IDS.restoreFromJson}_${jitHash}`,
113
+ stringifyJson: `${src_constants.JIT_FUNCTION_IDS.stringifyJson}_${jitHash}`,
114
+ toBinary: `${src_constants.JIT_FUNCTION_IDS.toBinary}_${jitHash}`,
115
+ fromBinary: `${src_constants.JIT_FUNCTION_IDS.fromBinary}_${jitHash}`
116
+ };
117
+ }
118
+ function getJitFunctionsFromHash(jitHash) {
119
+ if (jitHash === src_constants.EMPTY_HASH) return noopJitFns;
120
+ const cached = jitFunctionsCache.get(jitHash);
121
+ if (cached) return cached;
122
+ const hashes = getJitFnHashes(jitHash);
123
+ const jUtils = src_jit_jitUtils.getJitUtils();
124
+ const jitFns = {
125
+ isType: jUtils.getJIT(hashes.isType),
126
+ typeErrors: jUtils.getJIT(hashes.typeErrors),
127
+ prepareForJson: jUtils.getJIT(hashes.prepareForJson),
128
+ restoreFromJson: jUtils.getJIT(hashes.restoreFromJson),
129
+ stringifyJson: jUtils.getJIT(hashes.stringifyJson),
130
+ toBinary: jUtils.getJIT(hashes.toBinary),
131
+ fromBinary: jUtils.getJIT(hashes.fromBinary)
132
+ };
133
+ for (const key in jitFns) {
134
+ if (!jitFns[key]) throw new Error(`Jit function ${key} not found for jitHash ${jitHash}`);
135
+ }
136
+ jitFunctionsCache.set(jitHash, jitFns);
137
+ return jitFns;
138
+ }
139
+ function getHeaderJitFunctionsFromHash(jitHash) {
140
+ const cached = headerJitFunctionsCache.get(jitHash);
141
+ if (cached) return cached;
142
+ const hashes = getJitFnHashes(jitHash);
143
+ const jUtils = src_jit_jitUtils.getJitUtils();
144
+ const jitFns = {
145
+ isType: jUtils.getJIT(hashes.isType),
146
+ typeErrors: jUtils.getJIT(hashes.typeErrors)
147
+ };
148
+ headerJitFunctionsCache.set(jitHash, jitFns);
149
+ return jitFns;
150
+ }
151
+ function getRouterItemId(itemPointer) {
152
+ return itemPointer.join(src_constants.ROUTER_ITEM_SEPARATOR_CHAR);
153
+ }
154
+ function getRoutePath(pathPointer, routerOptions) {
155
+ const pathId = getRouterItemId(pathPointer);
156
+ const basePath = routerOptions.basePath.startsWith(src_constants.ROUTE_PATH_ROOT) ? routerOptions.basePath : `${src_constants.ROUTE_PATH_ROOT}${routerOptions.basePath}`;
157
+ const routePath = basePath.endsWith(src_constants.PATH_SEPARATOR) ? `${basePath}${pathId}` : `${basePath}${src_constants.PATH_SEPARATOR}${pathId}`;
158
+ return routerOptions.suffix ? routePath + routerOptions.suffix : routePath;
159
+ }
160
+ function resetRoutesCache() {
161
+ for (const k in methodsCache) delete methodsCache[k];
162
+ }
163
+ function resetJitFunctionsCache() {
164
+ jitFunctionsCache.clear();
165
+ headerJitFunctionsCache.clear();
166
+ }
167
+ const noopJitFns = {
168
+ isType: fakeJitFn(src_constants.JIT_FUNCTION_IDS.isType),
169
+ typeErrors: fakeJitFn(src_constants.JIT_FUNCTION_IDS.typeErrors),
170
+ prepareForJson: fakeJitFn(src_constants.JIT_FUNCTION_IDS.prepareForJson),
171
+ restoreFromJson: fakeJitFn(src_constants.JIT_FUNCTION_IDS.restoreFromJson),
172
+ stringifyJson: fakeJitFn(src_constants.JIT_FUNCTION_IDS.stringifyJson),
173
+ toBinary: fakeJitFn(src_constants.JIT_FUNCTION_IDS.toBinary),
174
+ fromBinary: fakeJitFn(src_constants.JIT_FUNCTION_IDS.fromBinary)
175
+ };
176
+ function fakeJitFn(fnID) {
177
+ return {
178
+ typeName: "mionNoopJit",
179
+ fnID,
180
+ jitFnHash: src_constants.EMPTY_HASH,
181
+ args: { vλl: "v" },
182
+ defaultParamValues: { vλl: "v" },
183
+ isNoop: true,
184
+ code: "",
185
+ jitDependencies: [],
186
+ pureFnDependencies: [],
187
+ createJitFn: () => {
188
+ throw new Error("isNoop JIT functions should not be called, this is a function when jit is never used");
189
+ },
190
+ fn: () => {
191
+ throw new Error("isNoop JIT functions should not be called, this is a function when jit is never used");
192
+ }
193
+ };
194
+ }
195
+ function getNoopJitFns() {
196
+ return noopJitFns;
197
+ }
198
+ exports.addRoutesToCache = addRoutesToCache;
199
+ exports.getHeaderJitFunctionsFromHash = getHeaderJitFunctionsFromHash;
200
+ exports.getJitFnHashes = getJitFnHashes;
201
+ exports.getJitFunctionsFromHash = getJitFunctionsFromHash;
202
+ exports.getNoopJitFns = getNoopJitFns;
203
+ exports.getRoutePath = getRoutePath;
204
+ exports.getRouterItemId = getRouterItemId;
205
+ exports.methodOptsCache = methodOptsCache;
206
+ exports.resetJitFunctionsCache = resetJitFunctionsCache;
207
+ exports.resetRoutesCache = resetRoutesCache;
208
+ exports.routesCache = routesCache;
209
+ //# sourceMappingURL=routerUtils.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routerUtils.cjs","sources":["../../../src/routerUtils.ts"],"sourcesContent":["/* ########\n * 2023 mion\n * Author: Ma-jerez\n * License: MIT\n * The software is provided \"as is\", without warranty of any kind.\n * ######## */\n\nimport {JIT_FUNCTION_IDS, PATH_SEPARATOR, ROUTER_ITEM_SEPARATOR_CHAR, ROUTE_PATH_ROOT, EMPTY_HASH} from './constants.ts';\nimport type {RemoteMethodOpts, MethodWithOptions, MethodsCache, MethodWithOptsAndJitFns} from './types/method.types.ts';\nimport type {CoreRouterOptions, JitCompiledFn, JitCompiledFunctions, JitFunctionsHashes} from './types/general.types.ts';\nimport {getJitUtils} from './jit/jitUtils.ts';\n\nconst methodsCache: MethodsCache = {};\nconst methodsOptionsCache: Record<string, RemoteMethodOpts> = {};\n\n// Cache for JitCompiledFunctions objects keyed by jitHash\nconst jitFunctionsCache = new Map<string, JitCompiledFunctions>();\nconst headerJitFunctionsCache = new Map<string, Pick<JitCompiledFunctions, 'isType' | 'typeErrors'>>();\n\n/**\n * Utilities for accessing and modifying the router cache.\n * The router cache stores method metadata for routes registered via addRoutesToCache() or virtual modules.\n */\nexport const routesCache = {\n /**\n * Get method metadata from the router cache by id.\n * @param id - The method id\n * @returns The method metadata or undefined if not found\n */\n getMetadata(id: string): MethodWithOptions | undefined {\n return methodsCache[id] as MethodWithOptions | undefined;\n },\n\n /**\n * Set method metadata in the router cache\n * @param id - The method id\n * @param methodData - The method metadata\n */\n setMetadata(id: string, methodData: MethodWithOptions): void {\n methodsCache[id] = methodData as any;\n },\n\n /**\n * Check if the router cache contains a method by id.\n * @param id - The method id\n * @returns True if the method exists in the cache\n */\n hasMetadata(id: string): boolean {\n return id in methodsCache;\n },\n\n /**\n * Get the raw router cache object.\n * Use with caution - prefer using get/set/has methods.\n * @returns The router cache object\n */\n getCache(): MethodsCache {\n return methodsCache;\n },\n\n /**\n * Get method metadata with JIT functions restored from the router cache by id.\n * This augments the MethodWithOptions with paramsJitFns and returnJitFns.\n * JIT functions are cached in the entry after first access for performance.\n * @param id - The method id\n * @returns The method metadata with JIT functions or undefined if not found\n */\n getMethodJitFns(id: string): MethodWithOptsAndJitFns | undefined {\n if (id in methodsCache) {\n const cached = methodsCache[id] as any;\n if (cached.paramsJitFns && cached.returnJitFns) {\n return cached as MethodWithOptsAndJitFns;\n }\n }\n\n const metadata = this.getMetadata(id);\n if (!metadata) return undefined;\n\n const paramsJitFns = getJitFunctionsFromHash(metadata.paramsJitHash);\n const returnJitFns = getJitFunctionsFromHash(metadata.returnJitHash);\n const headersParam = metadata.headersParam\n ? {...metadata.headersParam, jitFns: getHeaderJitFunctionsFromHash(metadata.headersParam.jitHash)}\n : undefined;\n const headersReturn = metadata.headersReturn\n ? {...metadata.headersReturn, jitFns: getHeaderJitFunctionsFromHash(metadata.headersReturn.jitHash)}\n : undefined;\n\n const result: MethodWithOptsAndJitFns = {\n ...metadata,\n paramsJitFns,\n returnJitFns,\n headersParam,\n headersReturn,\n };\n\n methodsCache[id] = result;\n return result as MethodWithOptsAndJitFns;\n },\n\n /**\n * Get method metadata with JIT functions restored from the router cache by id.\n * @param id\n * @returns\n */\n useMethodJitFns(id: string): MethodWithOptsAndJitFns {\n const MethodWithOptsAndJitFns = this.getMethodJitFns(id);\n if (!MethodWithOptsAndJitFns) throw new Error(`Metadata for remote method ${id} not found`);\n return MethodWithOptsAndJitFns;\n },\n\n /**\n * Set method metadata with JIT functions in the router cache.\n * This stores the complete MethodWithOptsAndJitFns object directly.\n * @param id - The method id\n * @param MethodWithOptsAndJitFns - The method metadata with JIT functions\n */\n setMethodJitFns(id: string, MethodWithOptsAndJitFns: MethodWithOptsAndJitFns): void {\n methodsCache[id] = MethodWithOptsAndJitFns as any;\n },\n};\n\nexport const methodOptsCache = {\n getMethodOptions(id: string): RemoteMethodOpts | undefined {\n return methodsOptionsCache[id];\n },\n setMethodOptions(id: string, options: RemoteMethodOpts): void {\n methodsOptionsCache[id] = options;\n },\n};\n\n/**\n * Adds new routes to the router cache.\n * This is the public API for registering routes - called by virtual modules or directly.\n * @param newCache\n */\nexport function addRoutesToCache(newCache: MethodsCache) {\n for (const key in newCache) {\n if (!(key in methodsCache)) {\n // Clone the cache entry to avoid mutating the original\n methodsCache[key] = {...newCache[key]} as MethodWithOptions;\n }\n }\n}\n\nexport function getJitFnHashes(jitHash: string): JitFunctionsHashes {\n return {\n isType: `${JIT_FUNCTION_IDS.isType}_${jitHash}`,\n typeErrors: `${JIT_FUNCTION_IDS.typeErrors}_${jitHash}`,\n prepareForJson: `${JIT_FUNCTION_IDS.prepareForJson}_${jitHash}`,\n restoreFromJson: `${JIT_FUNCTION_IDS.restoreFromJson}_${jitHash}`,\n stringifyJson: `${JIT_FUNCTION_IDS.stringifyJson}_${jitHash}`,\n toBinary: `${JIT_FUNCTION_IDS.toBinary}_${jitHash}`,\n fromBinary: `${JIT_FUNCTION_IDS.fromBinary}_${jitHash}`,\n };\n}\n\n/**\n * Helper function to get JIT functions from a JIT hash\n * Returns nullJitFns for empty hash (handlers with no params or void return)\n * Results are cached to avoid creating duplicate objects.\n */\nexport function getJitFunctionsFromHash(jitHash: string): JitCompiledFunctions {\n // Empty hash means no JIT functions were generated (optimization for no params or void return)\n if (jitHash === EMPTY_HASH) return noopJitFns;\n\n // Check cache first\n const cached = jitFunctionsCache.get(jitHash);\n if (cached) return cached;\n\n const hashes = getJitFnHashes(jitHash);\n const jUtils = getJitUtils();\n const jitFns = {\n isType: jUtils.getJIT(hashes.isType),\n typeErrors: jUtils.getJIT(hashes.typeErrors),\n prepareForJson: jUtils.getJIT(hashes.prepareForJson),\n restoreFromJson: jUtils.getJIT(hashes.restoreFromJson),\n stringifyJson: jUtils.getJIT(hashes.stringifyJson),\n toBinary: jUtils.getJIT(hashes.toBinary),\n fromBinary: jUtils.getJIT(hashes.fromBinary),\n } as JitCompiledFunctions;\n for (const key in jitFns) {\n if (!jitFns[key]) throw new Error(`Jit function ${key} not found for jitHash ${jitHash}`);\n }\n\n // Cache for future calls\n jitFunctionsCache.set(jitHash, jitFns);\n return jitFns;\n}\n\n/**\n * Helper function to get header JIT functions from a JIT hash\n * Results are cached to avoid creating duplicate objects.\n */\nexport function getHeaderJitFunctionsFromHash(jitHash: string): Pick<JitCompiledFunctions, 'isType' | 'typeErrors'> {\n // Check cache first\n const cached = headerJitFunctionsCache.get(jitHash);\n if (cached) return cached;\n\n const hashes = getJitFnHashes(jitHash);\n const jUtils = getJitUtils();\n const jitFns = {\n isType: jUtils.getJIT(hashes.isType),\n typeErrors: jUtils.getJIT(hashes.typeErrors),\n } as Pick<JitCompiledFunctions, 'isType' | 'typeErrors'>;\n\n // Cache for future calls\n headerJitFunctionsCache.set(jitHash, jitFns);\n return jitFns;\n}\n\n/**\n * Get the router id for Routes or MiddleFns\n * @param itemPointer - The pointer to the item within the Routes object\n * i.e:\n * const routes = {\n * auth: () => {},\n * users: {\n * getUser: () => {}\n * }\n * login: () => {}\n * }\n *\n * then the pointer for getUser is => ['users', 'getUser']\n */\nexport function getRouterItemId(itemPointer: string[]) {\n return itemPointer.join(ROUTER_ITEM_SEPARATOR_CHAR);\n}\n\n/** Gets a route path from a route pointer */\nexport function getRoutePath(pathPointer: string[], routerOptions: CoreRouterOptions) {\n const pathId = getRouterItemId(pathPointer);\n const basePath = routerOptions.basePath.startsWith(ROUTE_PATH_ROOT)\n ? routerOptions.basePath\n : `${ROUTE_PATH_ROOT}${routerOptions.basePath}`;\n const routePath = basePath.endsWith(PATH_SEPARATOR) ? `${basePath}${pathId}` : `${basePath}${PATH_SEPARATOR}${pathId}`;\n return routerOptions.suffix ? routePath + routerOptions.suffix : routePath;\n}\n\nexport function resetRoutesCache() {\n for (const k in methodsCache) delete methodsCache[k];\n}\n\n/** Resets the JIT functions cache. Useful for testing purposes only. */\nexport function resetJitFunctionsCache(): void {\n jitFunctionsCache.clear();\n headerJitFunctionsCache.clear();\n}\n\n// Noop JIT functions used for handlers with no params or void return\n// prettier-ignore\nconst noopJitFns: JitCompiledFunctions = {\n isType: fakeJitFn(JIT_FUNCTION_IDS.isType),\n typeErrors: fakeJitFn(JIT_FUNCTION_IDS.typeErrors),\n prepareForJson: fakeJitFn(JIT_FUNCTION_IDS.prepareForJson),\n restoreFromJson: fakeJitFn(JIT_FUNCTION_IDS.restoreFromJson),\n stringifyJson: fakeJitFn(JIT_FUNCTION_IDS.stringifyJson),\n toBinary: fakeJitFn(JIT_FUNCTION_IDS.toBinary),\n fromBinary: fakeJitFn(JIT_FUNCTION_IDS.fromBinary),\n} as any;\n\n/** Creates a fake JIT function with isNoop=true for handlers with no params or void return */\nfunction fakeJitFn(fnID: string): JitCompiledFn<any> {\n return {\n typeName: 'mionNoopJit',\n fnID,\n jitFnHash: EMPTY_HASH,\n args: {vλl: 'v'},\n defaultParamValues: {vλl: 'v'},\n isNoop: true,\n code: '',\n jitDependencies: [],\n pureFnDependencies: [],\n createJitFn: () => {\n throw new Error('isNoop JIT functions should not be called, this is a function when jit is never used');\n },\n fn: () => {\n throw new Error('isNoop JIT functions should not be called, this is a function when jit is never used');\n },\n };\n}\n\nexport function getNoopJitFns(): JitCompiledFunctions {\n return noopJitFns;\n}\n"],"names":["JIT_FUNCTION_IDS","EMPTY_HASH","getJitUtils","ROUTER_ITEM_SEPARATOR_CHAR","ROUTE_PATH_ROOT","PATH_SEPARATOR"],"mappings":";;;;AAYA,MAAM,eAA6B,CAAA;AACnC,MAAM,sBAAwD,CAAA;AAG9D,MAAM,wCAAwB,IAAA;AAC9B,MAAM,8CAA8B,IAAA;AAM7B,MAAM,cAAc;AAAA;AAAA;AAAA;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B,MAAA;AAC5B;AAIA,MAAM,aAAmC;AAAA,EACrC,QAAQ,UAAUL,cAAAA,iBAAiB,MAAM;AAAA,EACzC,YAAY,UAAUA,cAAAA,iBAAiB,UAAU;AAAA,EACjD,gBAAgB,UAAUA,cAAAA,iBAAiB,cAAc;AAAA,EACzD,iBAAiB,UAAUA,cAAAA,iBAAiB,eAAe;AAAA,EAC3D,eAAe,UAAUA,cAAAA,iBAAiB,aAAa;AAAA,EACvD,UAAU,UAAUA,cAAAA,iBAAiB,QAAQ;AAAA,EAC7C,YAAY,UAAUA,cAAAA,iBAAiB,UAAU;AACrD;AAGA,SAAS,UAAU,MAAkC;AACjD,SAAO;AAAA,IACH,UAAU;AAAA,IACV;AAAA,IACA,WAAWC,cAAAA;AAAAA,IACX,MAAM,EAAC,KAAK,IAAA;AAAA,IACZ,oBAAoB,EAAC,KAAK,IAAA;AAAA,IAC1B,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,iBAAiB,CAAA;AAAA,IACjB,oBAAoB,CAAA;AAAA,IACpB,aAAa,MAAM;AACf,YAAM,IAAI,MAAM,sFAAsF;AAAA,IAC1G;AAAA,IACA,IAAI,MAAM;AACN,YAAM,IAAI,MAAM,sFAAsF;AAAA,IAC1G;AAAA,EAAA;AAER;AAEO,SAAS,gBAAsC;AAClD,SAAO;AACX;;;;;;;;;;;;"}
@@ -0,0 +1,24 @@
1
+ import { RemoteMethodOpts, MethodWithOptions, MethodsCache, MethodWithOptsAndJitFns } from './types/method.types.ts';
2
+ import { CoreRouterOptions, JitCompiledFunctions, JitFunctionsHashes } from './types/general.types.ts';
3
+ export declare const routesCache: {
4
+ getMetadata(id: string): MethodWithOptions | undefined;
5
+ setMetadata(id: string, methodData: MethodWithOptions): void;
6
+ hasMetadata(id: string): boolean;
7
+ getCache(): MethodsCache;
8
+ getMethodJitFns(id: string): MethodWithOptsAndJitFns | undefined;
9
+ useMethodJitFns(id: string): MethodWithOptsAndJitFns;
10
+ setMethodJitFns(id: string, MethodWithOptsAndJitFns: MethodWithOptsAndJitFns): void;
11
+ };
12
+ export declare const methodOptsCache: {
13
+ getMethodOptions(id: string): RemoteMethodOpts | undefined;
14
+ setMethodOptions(id: string, options: RemoteMethodOpts): void;
15
+ };
16
+ export declare function addRoutesToCache(newCache: MethodsCache): void;
17
+ export declare function getJitFnHashes(jitHash: string): JitFunctionsHashes;
18
+ export declare function getJitFunctionsFromHash(jitHash: string): JitCompiledFunctions;
19
+ export declare function getHeaderJitFunctionsFromHash(jitHash: string): Pick<JitCompiledFunctions, 'isType' | 'typeErrors'>;
20
+ export declare function getRouterItemId(itemPointer: string[]): string;
21
+ export declare function getRoutePath(pathPointer: string[], routerOptions: CoreRouterOptions): string;
22
+ export declare function resetRoutesCache(): void;
23
+ export declare function resetJitFunctionsCache(): void;
24
+ export declare function getNoopJitFns(): JitCompiledFunctions;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const __ΩBrand = ["BaseType", "Name", "brand", "Brand", 'b!b"Pe"!Pe#"4#MKw$y'];
4
+ const __ΩBrandEmail = [() => __ΩBrand, "email", "BrandEmail", '&."o!#w#y'];
5
+ const __ΩBrandUUID = [() => __ΩBrand, "uuid", "BrandUUID", '&."o!#w#y'];
6
+ const __ΩBrandUrl = [() => __ΩBrand, "url", "BrandUrl", '&."o!#w#y'];
7
+ const __ΩBrandDomain = [() => __ΩBrand, "domain", "BrandDomain", '&."o!#w#y'];
8
+ const __ΩBrandIP = [() => __ΩBrand, "ip", "BrandIP", '&."o!#w#y'];
9
+ const __ΩBrandDate = [() => __ΩBrand, "date", "BrandDate", '&."o!#w#y'];
10
+ const __ΩBrandTime = [() => __ΩBrand, "time", "BrandTime", '&."o!#w#y'];
11
+ const __ΩBrandDateTime = [() => __ΩBrand, "dateTime", "BrandDateTime", '&."o!#w#y'];
12
+ const __ΩBrandInteger = [() => __ΩBrand, "integer", "BrandInteger", `'."o!#w#y`];
13
+ const __ΩBrandFloat = [() => __ΩBrand, "float", "BrandFloat", `'."o!#w#y`];
14
+ const __ΩBrandPositive = [() => __ΩBrand, "positive", "BrandPositive", `'."o!#w#y`];
15
+ const __ΩBrandNegative = [() => __ΩBrand, "negative", "BrandNegative", `'."o!#w#y`];
16
+ const __ΩBrandPositiveInt = [() => __ΩBrand, "positiveInt", "BrandPositiveInt", `'."o!#w#y`];
17
+ const __ΩBrandNegativeInt = [() => __ΩBrand, "negativeInt", "BrandNegativeInt", `'."o!#w#y`];
18
+ const __ΩBrandInt8 = [() => __ΩBrand, "int8", "BrandInt8", `'."o!#w#y`];
19
+ const __ΩBrandInt16 = [() => __ΩBrand, "int16", "BrandInt16", `'."o!#w#y`];
20
+ const __ΩBrandInt32 = [() => __ΩBrand, "int32", "BrandInt32", `'."o!#w#y`];
21
+ const __ΩBrandUInt8 = [() => __ΩBrand, "uint8", "BrandUInt8", `'."o!#w#y`];
22
+ const __ΩBrandUInt16 = [() => __ΩBrand, "uint16", "BrandUInt16", `'."o!#w#y`];
23
+ const __ΩBrandUInt32 = [() => __ΩBrand, "uint32", "BrandUInt32", `'."o!#w#y`];
24
+ exports.__ΩBrand = __ΩBrand;
25
+ exports.__ΩBrandDate = __ΩBrandDate;
26
+ exports.__ΩBrandDateTime = __ΩBrandDateTime;
27
+ exports.__ΩBrandDomain = __ΩBrandDomain;
28
+ exports.__ΩBrandEmail = __ΩBrandEmail;
29
+ exports.__ΩBrandFloat = __ΩBrandFloat;
30
+ exports.__ΩBrandIP = __ΩBrandIP;
31
+ exports.__ΩBrandInt16 = __ΩBrandInt16;
32
+ exports.__ΩBrandInt32 = __ΩBrandInt32;
33
+ exports.__ΩBrandInt8 = __ΩBrandInt8;
34
+ exports.__ΩBrandInteger = __ΩBrandInteger;
35
+ exports.__ΩBrandNegative = __ΩBrandNegative;
36
+ exports.__ΩBrandNegativeInt = __ΩBrandNegativeInt;
37
+ exports.__ΩBrandPositive = __ΩBrandPositive;
38
+ exports.__ΩBrandPositiveInt = __ΩBrandPositiveInt;
39
+ exports.__ΩBrandTime = __ΩBrandTime;
40
+ exports.__ΩBrandUInt16 = __ΩBrandUInt16;
41
+ exports.__ΩBrandUInt32 = __ΩBrandUInt32;
42
+ exports.__ΩBrandUInt8 = __ΩBrandUInt8;
43
+ exports.__ΩBrandUUID = __ΩBrandUUID;
44
+ exports.__ΩBrandUrl = __ΩBrandUrl;
45
+ //# sourceMappingURL=formatBrands.types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatBrands.types.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,45 @@
1
+ import { TypeFormatPrimitives } from './formats.types.ts';
2
+ export type Brand<BaseType extends TypeFormatPrimitives, Name extends string> = BaseType & {
3
+ brand: Name;
4
+ };
5
+ export type BrandEmail = Brand<string, 'email'>;
6
+ export type BrandUUID = Brand<string, 'uuid'>;
7
+ export type BrandUrl = Brand<string, 'url'>;
8
+ export type BrandDomain = Brand<string, 'domain'>;
9
+ export type BrandIP = Brand<string, 'ip'>;
10
+ export type BrandDate = Brand<string, 'date'>;
11
+ export type BrandTime = Brand<string, 'time'>;
12
+ export type BrandDateTime = Brand<string, 'dateTime'>;
13
+ export type BrandInteger = Brand<number, 'integer'>;
14
+ export type BrandFloat = Brand<number, 'float'>;
15
+ export type BrandPositive = Brand<number, 'positive'>;
16
+ export type BrandNegative = Brand<number, 'negative'>;
17
+ export type BrandPositiveInt = Brand<number, 'positiveInt'>;
18
+ export type BrandNegativeInt = Brand<number, 'negativeInt'>;
19
+ export type BrandInt8 = Brand<number, 'int8'>;
20
+ export type BrandInt16 = Brand<number, 'int16'>;
21
+ export type BrandInt32 = Brand<number, 'int32'>;
22
+ export type BrandUInt8 = Brand<number, 'uint8'>;
23
+ export type BrandUInt16 = Brand<number, 'uint16'>;
24
+ export type BrandUInt32 = Brand<number, 'uint32'>;
25
+ export declare type __ΩBrand = any[];
26
+ export declare type __ΩBrandEmail = any[];
27
+ export declare type __ΩBrandUUID = any[];
28
+ export declare type __ΩBrandUrl = any[];
29
+ export declare type __ΩBrandDomain = any[];
30
+ export declare type __ΩBrandIP = any[];
31
+ export declare type __ΩBrandDate = any[];
32
+ export declare type __ΩBrandTime = any[];
33
+ export declare type __ΩBrandDateTime = any[];
34
+ export declare type __ΩBrandInteger = any[];
35
+ export declare type __ΩBrandFloat = any[];
36
+ export declare type __ΩBrandPositive = any[];
37
+ export declare type __ΩBrandNegative = any[];
38
+ export declare type __ΩBrandPositiveInt = any[];
39
+ export declare type __ΩBrandNegativeInt = any[];
40
+ export declare type __ΩBrandInt8 = any[];
41
+ export declare type __ΩBrandInt16 = any[];
42
+ export declare type __ΩBrandInt32 = any[];
43
+ export declare type __ΩBrandUInt8 = any[];
44
+ export declare type __ΩBrandUInt16 = any[];
45
+ export declare type __ΩBrandUInt32 = any[];
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const __ΩRecord = ["K", "T", "Record", `l'e#"Rb!b"Pde"!N#!w#y`];
4
+ const __ΩStrNumber = ["StrNumber", "P&'Jw!y"];
5
+ const __ΩTypeFormatPrimitives = ["TypeFormatPrimitives", "P&'*TJw!y"];
6
+ const __ΩFormatParamLiteral = ["FormatParamLiteral", "P&')A*Jw!y"];
7
+ const __ΩTypeFormatValue = [() => __ΩFormatParamLiteral, 0, 0, "TypeFormatValue", 'Pn!n"F9P&Pn#-!JLMJw$y'];
8
+ const __ΩFormatParamMeta = [() => __ΩTypeFormatValue, "L", "val", "errorMessage", "desc", "FormatParamMeta", 'n!c"Pe"!4#&4$&4%8Mw&y'];
9
+ const __ΩFormatParam = ["L", () => __ΩFormatParamMeta, "FormatParam", 'b!Pe"!e"!o""Jw#y'];
10
+ const __ΩTypeFormatParams = [() => __ΩRecord, () => __ΩTypeFormatValue, "TypeFormatParams", '&Pn"-!Jo!#w#y'];
11
+ const __ΩTypeFormatParsedParams = ["__jitId", () => __ΩTypeFormatValue, "TypeFormatParsedParams", 'P&4!&n"LMw#y'];
12
+ const __ΩAliasTypeAnnotation = ["Name", "Options", "AliasTypeAnnotation", 'b!!c"#w#y'];
13
+ const __ΩAliasTypeFormat = ["BaseType", "Name", "P", () => __ΩAliasTypeAnnotation, "AliasTypeFormat", 'b!b"b#Pe"!e""e"#o$#Kw%y'];
14
+ const __ΩExtractFormatParams = ["T", () => __ΩAliasTypeFormat, "ExtractFormatParams", `lBe"#R-RPddde#!h!!h!"h!#o"$qk#'QRb!Pde"!p)w#y`];
15
+ const __ΩTypeFormatError = ["name", () => __ΩStrNumber, () => __ΩStrNumber, "val", () => __ΩStrNumber, "formatPath", "TypeFormatError", `P&4!Pn")*Pn#)*JFJ4$n%F4&Mw'y`];
16
+ exports.__ΩAliasTypeAnnotation = __ΩAliasTypeAnnotation;
17
+ exports.__ΩAliasTypeFormat = __ΩAliasTypeFormat;
18
+ exports.__ΩExtractFormatParams = __ΩExtractFormatParams;
19
+ exports.__ΩFormatParam = __ΩFormatParam;
20
+ exports.__ΩFormatParamLiteral = __ΩFormatParamLiteral;
21
+ exports.__ΩFormatParamMeta = __ΩFormatParamMeta;
22
+ exports.__ΩTypeFormatError = __ΩTypeFormatError;
23
+ exports.__ΩTypeFormatParams = __ΩTypeFormatParams;
24
+ exports.__ΩTypeFormatParsedParams = __ΩTypeFormatParsedParams;
25
+ exports.__ΩTypeFormatPrimitives = __ΩTypeFormatPrimitives;
26
+ exports.__ΩTypeFormatValue = __ΩTypeFormatValue;
27
+ //# sourceMappingURL=formats.types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formats.types.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,37 @@
1
+ type StrNumber = string | number;
2
+ export type TypeFormatPrimitives = string | number | bigint | Date;
3
+ export type FormatParamLiteral = string | number | boolean | RegExp | bigint;
4
+ export type TypeFormatValue = FormatParamLiteral | readonly TypeFormatValue[] | {
5
+ [key: string]: TypeFormatValue | undefined | never;
6
+ };
7
+ export type FormatParamMeta<L extends TypeFormatValue = TypeFormatValue> = {
8
+ val: L;
9
+ errorMessage: string;
10
+ desc?: string;
11
+ };
12
+ export type FormatParam<L extends TypeFormatValue> = L | FormatParamMeta<L>;
13
+ export type TypeFormatParams = Record<string, TypeFormatValue | undefined | never>;
14
+ export type TypeFormatParsedParams = {
15
+ __jitId: string;
16
+ [key: string]: TypeFormatValue;
17
+ };
18
+ export type AliasTypeAnnotation<Name extends string, Options = never> = unknown;
19
+ export type AliasTypeFormat<BaseType extends string | number | bigint, Name extends string, P extends TypeFormatParams> = BaseType & AliasTypeAnnotation<Name, P>;
20
+ export type ExtractFormatParams<T> = T extends AliasTypeFormat<infer Base, infer Name, infer P> ? P : undefined;
21
+ export type TypeFormatError = {
22
+ name: string;
23
+ val: StrNumber | boolean | bigint | (StrNumber | boolean | bigint)[];
24
+ formatPath: StrNumber[];
25
+ };
26
+ export {};
27
+ export declare type __ΩTypeFormatPrimitives = any[];
28
+ export declare type __ΩFormatParamLiteral = any[];
29
+ export declare type __ΩTypeFormatValue = any[];
30
+ export declare type __ΩFormatParamMeta = any[];
31
+ export declare type __ΩFormatParam = any[];
32
+ export declare type __ΩTypeFormatParams = any[];
33
+ export declare type __ΩTypeFormatParsedParams = any[];
34
+ export declare type __ΩAliasTypeAnnotation = any[];
35
+ export declare type __ΩAliasTypeFormat = any[];
36
+ export declare type __ΩExtractFormatParams = any[];
37
+ export declare type __ΩTypeFormatError = any[];
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const src_types_formats_formats_types = require("./formats.types.cjs");
4
+ const __ΩOmit = ["T", "K", () => __ΩPick, () => __ΩExclude, "Omit", 'b!b"e!!e!!ge!"o$#o##w%y'];
5
+ const __ΩPick = ["T", "K", "Pick", 'l+e#!e"!fRb!b"Pde""N#!w#y'];
6
+ const __ΩExclude = ["T", "U", "Exclude", 'l6!Re$!RPe#!e$"qk#%QRb!b"Pde"!p)w#y'];
7
+ const __ΩSamples = ["Samples", "P&&F9Jw!y"];
8
+ const __ΩStringValidators = ["val", "errorMessage", "desc", "maxLength", "minLength", "length", "ignoreCase", "mockSamples", "disallowedChars", () => __ΩSamples, "disallowedValues", () => __ΩSamples, "pattern", () => __ΩSamples, "allowedChars", () => __ΩSamples, "allowedValues", "StringValidators", `PP'P'4!&4"&4#8MJ4$8P'P'4!&4"&4#8MJ4%8P'P'4!&4"&4#8MJ4&8P&4!&4"&4#8)4'8&4(M4)8P&F94!&4"&4#8)4'8n*4(M4+8PA4!&4"&4#8)4'8n,4(M4-8P&4!&4"&4#8)4'8n.4(8M4/8P&F94!&4"&4#8)4'8n04(8M418Mw2y`];
9
+ const __ΩStringTransformers = ["lowercase", "uppercase", "capitalize", "trim", "searchValue", "replaceValue", "replace", "replaceAll", "StringTransformers", `P)4!8)4"8)4#8)4$8P&4%&4&M4'8P&4%&4&M4(8Mw)y`];
10
+ const __ΩStringParams = [() => __ΩStringValidators, () => __ΩStringTransformers, "StringParams", 'Pn!n"Kw#y'];
11
+ const __ΩDateFmt = ["ISO", "YYYY-MM-DD", "DD-MM-YYYY", "MM-DD-YYYY", "MM-DD", "DD-MM", "YYYY-MM", "DateFmt", `P.!.".#.$.%.&.'Jw(y`];
12
+ const __ΩFormatParams_Date = [() => src_types_formats_formats_types.__ΩFormatParam, () => __ΩDateFmt, "format", "FormatParams_Date", 'Pn"o!"4#Mw$y'];
13
+ const __ΩTimeFmt = ["ISO", "HH:mm:ss[.mmm]TZ", "HH:mm:ss[.mmm]", "HH:mm:ss", "HH:mm", "mm:ss", "HH", "mm", "ss", "TimeFmt", `P.!.".#.$.%.&.'.(.)Jw*y`];
14
+ const __ΩFormatParams_Time = [() => src_types_formats_formats_types.__ΩFormatParam, () => __ΩTimeFmt, "format", "FormatParams_Time", 'Pn"o!"4#Mw$y'];
15
+ const __ΩFormatParams_DateTime = [() => __ΩFormatParams_Date, "date", () => __ΩFormatParams_Time, "time", () => src_types_formats_formats_types.__ΩFormatParam, "splitChar", "FormatParams_DateTime", `Pn!4"n#4$&o%"4&Mw'y`];
16
+ const __ΩFormatParams_EmailPattern = [() => __ΩOmit, () => __ΩStringValidators, "length", "allowedChars", "disallowedChars", "allowedValues", "FormatParams_EmailPattern", `n"P.#.$.%.&Jo!#w'y`];
17
+ const __ΩFormatParams_Email = [() => __ΩFormatParams_EmailPattern, () => __ΩStringValidators, "localPart", () => __ΩFormatParams_Domain, "domain", "FormatParams_Email", 'Pn!Pn"4#8n$4%8MKw&y'];
18
+ const __ΩFormatParams_UrlPattern = [() => __ΩOmit, () => __ΩStringParams, "allowedChars", "disallowedChars", "allowedValues", "disallowedValues", "FormatParams_UrlPattern", `n"P.#.$.%.&Jo!#w'y`];
19
+ const __ΩFormatParams_Url = [() => __ΩFormatParams_UrlPattern, () => __ΩFormatParams_IP, "ip", () => __ΩFormatParams_Domain, "domain", "FormatParams_Url", 'Pn!Pn"4#8n$4%8MKw&y'];
20
+ const __ΩFormatParams_DomainName = [() => __ΩOmit, () => __ΩStringValidators, "length", "allowedChars", "disallowedChars", "FormatParams_DomainName", 'n"P.#.$.%Jo!#w&y'];
21
+ const __ΩFormatParams_Tld = [() => __ΩOmit, () => __ΩStringValidators, "length", "allowedChars", "disallowedChars", "FormatParams_Tld", 'n"P.#.$.%Jo!#w&y'];
22
+ const __ΩFormatParam_Pattern = [() => __ΩStringValidators, "pattern", "FormatParam_Pattern", 'n!."fw#y'];
23
+ const __ΩFormatParams_DomainCore = ["names", "tld", () => __ΩFormatParam_Pattern, "pattern", () => __ΩFormatParams_DomainName, () => __ΩFormatParams_Tld, "FormatParams_DomainCore", `PP!4!8!4"8n#4$MPn%4!n&4"!4$8MJw'y`];
24
+ const __ΩFormatParams_Domain = [() => src_types_formats_formats_types.__ΩFormatParam, "maxLength", () => src_types_formats_formats_types.__ΩFormatParam, "minLength", () => src_types_formats_formats_types.__ΩFormatParam, "maxParts", () => src_types_formats_formats_types.__ΩFormatParam, "minParts", () => __ΩFormatParams_DomainCore, "FormatParams_Domain", `PP'o!"4"8'o#"4$8'o%"4&8'o'"4(8Mn)Kw*y`];
25
+ const __ΩFormatParams_IP = [() => src_types_formats_formats_types.__ΩFormatParam, 4, 6, "any", "version", () => src_types_formats_formats_types.__ΩFormatParam, "allowLocalHost", () => src_types_formats_formats_types.__ΩFormatParam, "allowPort", "FormatParams_IP", `PP.".#.$Jo!"4%)o&"4'8)o("4)8Mw*y`];
26
+ const __ΩFormatParams_UUID = [() => src_types_formats_formats_types.__ΩFormatParam, "4", "7", "version", "FormatParams_UUID", 'PP.".#Jo!"4$Mw%y'];
27
+ const __ΩNumberMax = ["val", "errorMessage", "desc", "max", "gt", "NumberMax", `PPP'P'4!&4"&4#8MJ4$8!4%8MP!4$8P'P'4!&4"&4#8MJ4%8MJw&y`];
28
+ const __ΩNumberMin = ["val", "errorMessage", "desc", "min", "lt", "NumberMin", `PPP'P'4!&4"&4#8MJ4$8!4%8MP!4$8P'P'4!&4"&4#8MJ4%8MJw&y`];
29
+ const __ΩNumberType = ["val", "errorMessage", "desc", "integer", "float", "NumberType", 'PPP)P)4!&4"&4#8MJ4$8!4%8MP!4$8P)P)4!&4"&4#8MJ4%8MJw&y'];
30
+ const __ΩFormatParams_Number = [() => __ΩNumberMax, () => __ΩNumberMin, () => __ΩNumberType, "val", "errorMessage", "desc", "multipleOf", "FormatParams_Number", `Pn!n"n#PP'P'4$&4%&4&8MJ4'8MKw(y`];
31
+ const __ΩBigIntMax = ["val", "errorMessage", "desc", "max", "gt", "BigIntMax", 'PPP*P*4!&4"&4#8MJ4$8!4%8MP!4$8P*P*4!&4"&4#8MJ4%8MJw&y'];
32
+ const __ΩBigIntMin = ["val", "errorMessage", "desc", "min", "lt", "BigIntMin", 'PPP*P*4!&4"&4#8MJ4$8!4%8MP!4$8P*P*4!&4"&4#8MJ4%8MJw&y'];
33
+ const __ΩFormatParams_BigInt = [() => __ΩBigIntMax, () => __ΩBigIntMin, "val", "errorMessage", "desc", "multipleOf", "FormatParams_BigInt", `Pn!n"PP*P*4#&4$&4%8MJ4&8MKw'y`];
34
+ const __ΩAnyStringFormatParam = [() => __ΩStringParams, () => __ΩFormatParams_Email, () => __ΩFormatParams_Url, () => __ΩFormatParams_Domain, () => __ΩFormatParams_IP, () => __ΩFormatParams_UUID, () => __ΩFormatParams_DateTime, () => __ΩFormatParams_Date, () => __ΩFormatParams_Time, "AnyStringFormatParam", `Pn!n"n#n$n%n&n'n(n)Jw*y`];
35
+ const __ΩAnyFormatParams = [() => __ΩAnyStringFormatParam, () => __ΩFormatParams_Number, () => __ΩFormatParams_BigInt, "AnyFormatParams", 'Pn!n"n#Jw$y'];
36
+ exports.__ΩAnyFormatParams = __ΩAnyFormatParams;
37
+ exports.__ΩAnyStringFormatParam = __ΩAnyStringFormatParam;
38
+ exports.__ΩDateFmt = __ΩDateFmt;
39
+ exports.__ΩFormatParam_Pattern = __ΩFormatParam_Pattern;
40
+ exports.__ΩFormatParams_BigInt = __ΩFormatParams_BigInt;
41
+ exports.__ΩFormatParams_Date = __ΩFormatParams_Date;
42
+ exports.__ΩFormatParams_DateTime = __ΩFormatParams_DateTime;
43
+ exports.__ΩFormatParams_Domain = __ΩFormatParams_Domain;
44
+ exports.__ΩFormatParams_DomainCore = __ΩFormatParams_DomainCore;
45
+ exports.__ΩFormatParams_DomainName = __ΩFormatParams_DomainName;
46
+ exports.__ΩFormatParams_Email = __ΩFormatParams_Email;
47
+ exports.__ΩFormatParams_EmailPattern = __ΩFormatParams_EmailPattern;
48
+ exports.__ΩFormatParams_IP = __ΩFormatParams_IP;
49
+ exports.__ΩFormatParams_Number = __ΩFormatParams_Number;
50
+ exports.__ΩFormatParams_Time = __ΩFormatParams_Time;
51
+ exports.__ΩFormatParams_Tld = __ΩFormatParams_Tld;
52
+ exports.__ΩFormatParams_UUID = __ΩFormatParams_UUID;
53
+ exports.__ΩFormatParams_Url = __ΩFormatParams_Url;
54
+ exports.__ΩFormatParams_UrlPattern = __ΩFormatParams_UrlPattern;
55
+ exports.__ΩSamples = __ΩSamples;
56
+ exports.__ΩStringParams = __ΩStringParams;
57
+ exports.__ΩStringTransformers = __ΩStringTransformers;
58
+ exports.__ΩStringValidators = __ΩStringValidators;
59
+ exports.__ΩTimeFmt = __ΩTimeFmt;
60
+ //# sourceMappingURL=formatsParams.types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatsParams.types.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}