@layerzerolabs/base-definitions 0.0.30 → 0.0.32
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/.turbo/turbo-build.log +21 -21
- package/.turbo/turbo-test.log +3 -3
- package/dist/77NH5QOZ.js +15 -0
- package/dist/77NH5QOZ.js.map +1 -0
- package/dist/{L7S4WI2G.js → BFFQH6TB.js} +5 -3
- package/dist/BFFQH6TB.js.map +1 -0
- package/dist/{QVJ3X3OI.cjs → CC3IHCUD.cjs} +5 -3
- package/dist/CC3IHCUD.cjs.map +1 -0
- package/dist/M3BJNIOI.cjs +17 -0
- package/dist/M3BJNIOI.cjs.map +1 -0
- package/dist/definitions.cjs +4 -4
- package/dist/definitions.d.ts +34 -19
- package/dist/definitions.d.ts.map +1 -1
- package/dist/definitions.js +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.js +2 -2
- package/dist/utils.cjs +3 -3
- package/dist/utils.d.ts +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +2 -2
- package/package.json +7 -7
- package/src/definitions.ts +91 -22
- package/src/utils.ts +7 -7
- package/tsconfig.tsbuildinfo +1 -0
- package/dist/4FVZVXV2.cjs +0 -17
- package/dist/4FVZVXV2.cjs.map +0 -1
- package/dist/L7S4WI2G.js.map +0 -1
- package/dist/QVJ3X3OI.cjs.map +0 -1
- package/dist/RDR5ZF6L.js +0 -15
- package/dist/RDR5ZF6L.js.map +0 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -10,45 +10,45 @@
|
|
|
10
10
|
[34mCLI[39m Cleaning output folder
|
|
11
11
|
[34mCJS[39m Build start
|
|
12
12
|
[34mESM[39m Build start
|
|
13
|
-
[32mCJS[39m [1mdist/index.cjs [22m[32m1.12 KB[39m
|
|
14
|
-
[32mCJS[39m [1mdist/lzyringe.cjs [22m[32m302.00 B[39m
|
|
15
13
|
[32mCJS[39m [1mdist/definitions.cjs [22m[32m594.00 B[39m
|
|
16
|
-
[32mCJS[39m [1mdist/
|
|
14
|
+
[32mCJS[39m [1mdist/lzyringe.cjs [22m[32m302.00 B[39m
|
|
17
15
|
[32mCJS[39m [1mdist/registrarBuilder.cjs [22m[32m320.00 B[39m
|
|
16
|
+
[32mCJS[39m [1mdist/JKTGUQY4.cjs [22m[32m1.70 KB[39m
|
|
17
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m1.12 KB[39m
|
|
18
|
+
[32mCJS[39m [1mdist/utils.cjs [22m[32m341.00 B[39m
|
|
18
19
|
[32mCJS[39m [1mdist/LBRYOOPE.cjs [22m[32m4.11 KB[39m
|
|
19
|
-
[32mCJS[39m [1mdist/
|
|
20
|
-
[32mCJS[39m [1mdist/4FVZVXV2.cjs [22m[32m862.00 B[39m
|
|
21
|
-
[32mCJS[39m [1mdist/QVJ3X3OI.cjs [22m[32m1.21 KB[39m
|
|
20
|
+
[32mCJS[39m [1mdist/M3BJNIOI.cjs [22m[32m812.00 B[39m
|
|
22
21
|
[32mCJS[39m [1mdist/YJF4D23A.cjs [22m[32m245.00 B[39m
|
|
23
|
-
[32mCJS[39m [1mdist/
|
|
24
|
-
[32mCJS[39m [1mdist/lzyringe.cjs.map [22m[32m73.00 B[39m
|
|
22
|
+
[32mCJS[39m [1mdist/CC3IHCUD.cjs [22m[32m1.28 KB[39m
|
|
25
23
|
[32mCJS[39m [1mdist/definitions.cjs.map [22m[32m76.00 B[39m
|
|
24
|
+
[32mCJS[39m [1mdist/lzyringe.cjs.map [22m[32m73.00 B[39m
|
|
26
25
|
[32mCJS[39m [1mdist/JKTGUQY4.cjs.map [22m[32m3.78 KB[39m
|
|
27
26
|
[32mCJS[39m [1mdist/registrarBuilder.cjs.map [22m[32m81.00 B[39m
|
|
28
|
-
[32mCJS[39m [1mdist/
|
|
27
|
+
[32mCJS[39m [1mdist/index.cjs.map [22m[32m70.00 B[39m
|
|
29
28
|
[32mCJS[39m [1mdist/utils.cjs.map [22m[32m70.00 B[39m
|
|
30
|
-
[32mCJS[39m [1mdist/
|
|
31
|
-
[32mCJS[39m [1mdist/QVJ3X3OI.cjs.map [22m[32m9.58 KB[39m
|
|
29
|
+
[32mCJS[39m [1mdist/LBRYOOPE.cjs.map [22m[32m11.37 KB[39m
|
|
32
30
|
[32mCJS[39m [1mdist/YJF4D23A.cjs.map [22m[32m73.00 B[39m
|
|
33
|
-
[32mCJS[39m
|
|
31
|
+
[32mCJS[39m [1mdist/M3BJNIOI.cjs.map [22m[32m1.83 KB[39m
|
|
32
|
+
[32mCJS[39m [1mdist/CC3IHCUD.cjs.map [22m[32m12.10 KB[39m
|
|
33
|
+
[32mCJS[39m ⚡️ Build success in 221ms
|
|
34
34
|
[32mESM[39m [1mdist/definitions.js [22m[32m193.00 B[39m
|
|
35
|
-
[32mESM[39m [1mdist/index.js [22m[32m338.00 B[39m
|
|
36
35
|
[32mESM[39m [1mdist/lzyringe.js [22m[32m146.00 B[39m
|
|
37
|
-
[32mESM[39m [1mdist/
|
|
36
|
+
[32mESM[39m [1mdist/index.js [22m[32m338.00 B[39m
|
|
38
37
|
[32mESM[39m [1mdist/registrarBuilder.js [22m[32m163.00 B[39m
|
|
39
38
|
[32mESM[39m [1mdist/RFHQF55L.js [22m[32m4.01 KB[39m
|
|
39
|
+
[32mESM[39m [1mdist/JJBD65HU.js [22m[32m1.65 KB[39m
|
|
40
|
+
[32mESM[39m [1mdist/77NH5QOZ.js [22m[32m733.00 B[39m
|
|
40
41
|
[32mESM[39m [1mdist/utils.js [22m[32m173.00 B[39m
|
|
41
|
-
[32mESM[39m [1mdist/
|
|
42
|
-
[32mESM[39m [1mdist/RDR5ZF6L.js [22m[32m783.00 B[39m
|
|
42
|
+
[32mESM[39m [1mdist/BFFQH6TB.js [22m[32m1.12 KB[39m
|
|
43
43
|
[32mESM[39m [1mdist/VUOMXK5T.js [22m[32m222.00 B[39m
|
|
44
44
|
[32mESM[39m [1mdist/definitions.js.map [22m[32m75.00 B[39m
|
|
45
|
-
[32mESM[39m [1mdist/index.js.map [22m[32m69.00 B[39m
|
|
46
45
|
[32mESM[39m [1mdist/lzyringe.js.map [22m[32m72.00 B[39m
|
|
47
|
-
[32mESM[39m [1mdist/
|
|
46
|
+
[32mESM[39m [1mdist/index.js.map [22m[32m69.00 B[39m
|
|
48
47
|
[32mESM[39m [1mdist/registrarBuilder.js.map [22m[32m80.00 B[39m
|
|
49
48
|
[32mESM[39m [1mdist/RFHQF55L.js.map [22m[32m11.36 KB[39m
|
|
49
|
+
[32mESM[39m [1mdist/JJBD65HU.js.map [22m[32m3.78 KB[39m
|
|
50
|
+
[32mESM[39m [1mdist/77NH5QOZ.js.map [22m[32m1.82 KB[39m
|
|
50
51
|
[32mESM[39m [1mdist/utils.js.map [22m[32m69.00 B[39m
|
|
51
|
-
[32mESM[39m [1mdist/
|
|
52
|
-
[32mESM[39m [1mdist/RDR5ZF6L.js.map [22m[32m1.87 KB[39m
|
|
52
|
+
[32mESM[39m [1mdist/BFFQH6TB.js.map [22m[32m12.08 KB[39m
|
|
53
53
|
[32mESM[39m [1mdist/VUOMXK5T.js.map [22m[32m72.00 B[39m
|
|
54
|
-
[32mESM[39m ⚡️ Build success in
|
|
54
|
+
[32mESM[39m ⚡️ Build success in 221ms
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
[1m[46m RUN [49m[22m [36mv3.2.3 [39m[90m/home/runner/work/monorepo-internal/monorepo-internal/packages/framework/definitions/base-definitions[39m
|
|
7
7
|
|
|
8
|
-
[32m✓[39m test/registrarBuilder.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
8
|
+
[32m✓[39m test/registrarBuilder.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 9[2mms[22m[39m
|
|
9
9
|
|
|
10
10
|
[2m Test Files [22m [1m[32m1 passed[39m[22m[90m (1)[39m
|
|
11
11
|
[2m Tests [22m [1m[32m4 passed[39m[22m[90m (4)[39m
|
|
12
|
-
[2m Start at [22m
|
|
13
|
-
[2m Duration [22m
|
|
12
|
+
[2m Start at [22m 22:46:16
|
|
13
|
+
[2m Duration [22m 559ms[2m (transform 103ms, setup 0ms, collect 98ms, tests 9ms, environment 0ms, prepare 159ms)[22m
|
|
14
14
|
|
package/dist/77NH5QOZ.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { serializeDimensions } from './BFFQH6TB.js';
|
|
2
|
+
import { __name } from './VUOMXK5T.js';
|
|
3
|
+
|
|
4
|
+
// src/utils.ts
|
|
5
|
+
var extractSchemaFromFactory = /* @__PURE__ */ __name((factory, dimension) => {
|
|
6
|
+
const schema = (factory.dimensionToSchemaMap.byDimension && Object.values(factory.dimensionToSchemaMap.byDimension).find(([dim]) => serializeDimensions(dim) === serializeDimensions(dimension))?.[1]) ?? factory.dimensionToSchemaMap.base;
|
|
7
|
+
if (!schema?.shape) {
|
|
8
|
+
throw new Error(`Couldn't resolve the schema of factory ${factory.name} for dim ${JSON.stringify(dimension)}`);
|
|
9
|
+
}
|
|
10
|
+
return schema;
|
|
11
|
+
}, "extractSchemaFromFactory");
|
|
12
|
+
|
|
13
|
+
export { extractSchemaFromFactory };
|
|
14
|
+
//# sourceMappingURL=77NH5QOZ.js.map
|
|
15
|
+
//# sourceMappingURL=77NH5QOZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils.ts"],"names":["extractSchemaFromFactory","factory","dimension","schema","dimensionToSchemaMap","byDimension","Object","values","find","dim","serializeDimensions","base","shape","Error","name","JSON","stringify"],"mappings":";;;;AAOO,IAAMA,wBAAAA,mBAA2B,MAAA,CAAA,CACpCC,OAAAA,EACAC,SAAAA,KAAAA;AAEA,EAAA,MAAMC,MAAAA,GAAAA,CACDF,OAAAA,CAAQG,oBAAAA,CAAqBC,WAAAA,IAC1BC,MAAAA,CAAOC,OAAON,OAAAA,CAAQG,oBAAAA,CAAqBC,WAAW,CAAA,CAAoBG,IAAAA,CACtE,CAAC,CAACC,GAAAA,CAAAA,KAASC,mBAAAA,CAAoBD,GAAAA,CAAAA,KAASC,mBAAAA,CAAoBR,SAAAA,CAAAA,CAAAA,GAC5D,CAAA,CAAA,KACRD,OAAAA,CAAQG,oBAAAA,CAAqBO,IAAAA;AACjC,EAAA,IAAI,CAACR,QAAQS,KAAAA,EAAO;AAChB,IAAA,MAAM,IAAIC,KAAAA,CACN,CAAA,uCAAA,EAA0CZ,OAAAA,CAAQa,IAAI,YAAYC,IAAAA,CAAKC,SAAAA,CAAUd,SAAAA,CAAAA,CAAAA,CAAY,CAAA;AAErG,EAAA;AAEA,EAAA,OAAOC,MAAAA;AACX,CAAA,EAjBwC,0BAAA","file":"77NH5QOZ.js","sourcesContent":["import type z from 'zod/v4';\n\nimport type { AdvancedRecord } from '@layerzerolabs/typescript-utils';\n\nimport type { Factory } from './definitions';\nimport { type FactoryDefinition, serializeDimensions } from './definitions';\n\nexport const extractSchemaFromFactory = <Dim extends z.ZodObject>(\n factory: FactoryDefinition<any, Dim, any, any, any> | Factory<any, any, any, any>,\n dimension: z.infer<Dim>,\n): z.ZodObject => {\n const schema =\n (factory.dimensionToSchemaMap.byDimension &&\n Object.values(factory.dimensionToSchemaMap.byDimension as AdvancedRecord).find(\n ([dim]) => serializeDimensions(dim) === serializeDimensions(dimension),\n )?.[1]) ??\n factory.dimensionToSchemaMap.base;\n if (!schema?.shape) {\n throw new Error(\n `Couldn't resolve the schema of factory ${factory.name} for dim ${JSON.stringify(dimension)}`,\n );\n }\n\n return schema;\n};\n"]}
|
|
@@ -6,11 +6,13 @@ var FactoryDefinition = class extends DependencyNode {
|
|
|
6
6
|
__name(this, "FactoryDefinition");
|
|
7
7
|
}
|
|
8
8
|
dimensions;
|
|
9
|
+
specialization;
|
|
9
10
|
dimensionToSchemaMap;
|
|
10
11
|
getFactory;
|
|
11
|
-
constructor({ dimensions, dimensionToSchemaMap, getFactory, ...args }) {
|
|
12
|
+
constructor({ dimensions, specialization, dimensionToSchemaMap, getFactory, ...args }) {
|
|
12
13
|
super(args);
|
|
13
14
|
this.dimensions = dimensions;
|
|
15
|
+
this.specialization = specialization;
|
|
14
16
|
this.dimensionToSchemaMap = dimensionToSchemaMap;
|
|
15
17
|
this.getFactory = getFactory;
|
|
16
18
|
}
|
|
@@ -30,5 +32,5 @@ var serializeDimensions = /* @__PURE__ */ __name((dim = {}) => {
|
|
|
30
32
|
}, "serializeDimensions");
|
|
31
33
|
|
|
32
34
|
export { FactoryDefinition, ObjectDefinition, serializeDimensions };
|
|
33
|
-
//# sourceMappingURL=
|
|
34
|
-
//# sourceMappingURL=
|
|
35
|
+
//# sourceMappingURL=BFFQH6TB.js.map
|
|
36
|
+
//# sourceMappingURL=BFFQH6TB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/definitions.ts"],"names":["FactoryDefinition","DependencyNode","dimensions","specialization","dimensionToSchemaMap","getFactory","args","ObjectDefinition","schema","serializeDimensions","dim","Object","keys","length","entries","sort","map","dimName","dimVal","join"],"mappings":";;;AA8HO,IAAMA,iBAAAA,GAAN,cAMGC,cAAAA,CAAAA;EAhIV;;;AAiIoBC,EAAAA,UAAAA;AACAC,EAAAA,cAAAA;AACAC,EAAAA,oBAAAA;AACAC,EAAAA,UAAAA;AAChB,EAAA,WAAA,CAAY,EACRH,UAAAA,EACAC,cAAAA,EACAC,sBACAC,UAAAA,EACA,GAAGC,MAAAA,EAMmE;AACtE,IAAA,KAAA,CAAMA,IAAAA,CAAAA;AACN,IAAA,IAAA,CAAKJ,UAAAA,GAAaA,UAAAA;AAClB,IAAA,IAAA,CAAKC,cAAAA,GAAiBA,cAAAA;AACtB,IAAA,IAAA,CAAKC,oBAAAA,GAAuBA,oBAAAA;AAC5B,IAAA,IAAA,CAAKC,UAAAA,GAAaA,UAAAA;AACtB,EAAA;AACJ;AAYO,IAAeE,gBAAAA,GAAf,cAIGN,cAAAA,CAAAA;EAvKV;;;AAwKoBO,EAAAA,MAAAA;AAEhB,EAAA,WAAA,CAAY,EACRA,MAAAA,EACA,GAAGF,IAAAA,EAAAA,EAGmE;AACtE,IAAA,KAAA,CAAMA,IAAAA,CAAAA;AACN,IAAA,IAAA,CAAKE,MAAAA,GAASA,MAAAA;AAClB,EAAA;AACJ;AAuFO,IAAMC,mBAAAA,mBAAsB,MAAA,CAAA,CAACC,GAAAA,GAAc,EAAC,KAAC;AAChD,EAAA,OAAOC,MAAAA,CAAOC,IAAAA,CAAKF,GAAAA,CAAAA,CAAKG,MAAAA,GAClBF,MAAAA,CAAOG,OAAAA,CAAQJ,GAAAA,CAAAA,CACVK,IAAAA,EAAI,CACJC,GAAAA,CAAI,CAAC,CAACC,OAAAA,EAASC,MAAAA,CAAAA,KAAY,CAAA,EAAGD,OAAAA,CAAAA,CAAAA,EAAWC,MAAAA,CAAAA,CAAAA,EAAU,EAAA,CAAA,CACnDC,IAAAA,CAAK,GAAA,CAAA,GACV,OAAA;AACV,CAAA,EAPmC,qBAAA","file":"BFFQH6TB.js","sourcesContent":["import type { z } from 'zod/v4';\n\nimport type { FunctionPointer } from '@layerzerolabs/common-utils';\nimport type { Dependencies } from '@layerzerolabs/dependency-graph';\nimport { DependencyNode } from '@layerzerolabs/dependency-graph';\nimport type {\n AdvancedRecord,\n AdvancedRecordLookup,\n Merge,\n MethodNameOf,\n RemoveNever,\n UnionToIntersection,\n} from '@layerzerolabs/typescript-utils';\n\nexport type DimensionToSchemaMap<DimConstraint extends object = object> = {\n byDimension?: AdvancedRecord<DimConstraint, z.ZodType>;\n base: z.ZodType;\n};\n\nexport type FactorySpecialization<DMap extends DimensionToSchemaMap = DimensionToSchemaMap> = {\n spec: z.ZodObject<any>;\n exempt: readonly (keyof GetSupersetOfModelsFromSchema<DMap>)[];\n};\n\nexport type WithInjectedSpecialization<T, Specialization extends FactorySpecialization<any>> = [\n {},\n] extends [z.infer<Specialization['spec']>]\n ? T\n : {\n [K in keyof T]: K extends Specialization['exempt'][number]\n ? T[K]\n : T[K] extends (...args: infer A) => infer R\n ? (specialization: z.infer<Specialization['spec']>, ...args: A) => R\n : T[K];\n };\n\nexport type WithSpecializeMethod<WithInjection, WithoutInjection, S> = {} extends S\n ? WithoutInjection\n : WithInjection extends (...args: infer Args) => infer Ret\n ? (...args: Args) => Ret\n : WithInjection & {\n specialize: (specialization: S) => WithoutInjection;\n };\n\nexport type GetModelFromSchema<DMap extends DimensionToSchemaMap, Dim> =\n AdvancedRecordLookup<DMap['byDimension'], Dim> extends never\n ? z.infer<DMap['base']>\n : Merge<z.infer<DMap['base']>, z.infer<AdvancedRecordLookup<DMap['byDimension'], Dim>>>;\n\nexport type GetSupersetOfModelsFromSchema<DMap extends DimensionToSchemaMap> = UnionToIntersection<\n {\n [Key in keyof DMap['byDimension']]: DMap['byDimension'][Key] extends [any, any]\n ? z.infer<DMap['byDimension'][Key][1]>\n : never;\n }[keyof DMap['byDimension']]\n> &\n z.infer<DMap['base']>;\n\ntype GetImplFunctionWithConditionalOptionalDim<Dim, Return> = {} extends Dim\n ? (dim?: Dim) => Return\n : (dim: Dim) => Return;\n\ntype GetImplOverloads<\n Dim extends z.ZodObject<any>,\n Specialization extends FactorySpecialization<DMap>,\n DMap extends DimensionToSchemaMap<z.infer<Dim>>,\n> = UnionToIntersection<\n | {\n [I in keyof DMap['byDimension']]: DMap['byDimension'][I] extends readonly [infer K, any]\n ? {\n getImpl: GetImplFunctionWithConditionalOptionalDim<\n K,\n WithSpecializeMethod<\n WithInjectedSpecialization<GetModelFromSchema<DMap, K>, Specialization>,\n GetModelFromSchema<DMap, K>,\n z.infer<Specialization['spec']>\n >\n >;\n }\n : never;\n }[keyof DMap['byDimension']]\n | {\n getImpl: GetImplFunctionWithConditionalOptionalDim<\n z.infer<Dim>,\n WithSpecializeMethod<\n WithInjectedSpecialization<z.infer<DMap['base']>, Specialization>,\n z.infer<DMap['base']>,\n z.infer<Specialization['spec']>\n >\n >;\n }\n>;\n\nexport type Factory<\n _Dependencies extends Dependencies,\n Dim extends z.ZodObject<any>,\n Specialization extends FactorySpecialization<DMap>,\n DMap extends DimensionToSchemaMap<z.infer<Dim>>,\n> = {\n name: string;\n implKeys: string[];\n dimensionToSchemaMap: DMap;\n} & GetImplOverloads<Dim, Specialization, DMap>;\n\nexport type GetFactory<\n _Dependencies extends Dependencies,\n Dim extends z.ZodObject<any>,\n Specialization extends FactorySpecialization<DMap>,\n DMap extends DimensionToSchemaMap<z.infer<Dim>>,\n> = () =>\n | Factory<_Dependencies, Dim, Specialization, DMap>\n | Promise<Factory<_Dependencies, Dim, Specialization, DMap>>;\n\n/**\n * Factory definitions are a type of dependency node that shall be resolved to a *factory*.\n * A factory is an object that provides a getImpl method which accepts some parameters *dim*,\n * and returns some object getImplMetadata.getModel(dim).\n * That is, a factory definition is given by the set of parameters it uses to get its implementations,\n * and a function defining the schema it will return for each set of parameters.\n * @param name inherited from {@link DependencyNode}\n * @param dependencies inherited from {@link DependencyNode}\n * @param dimensions a Zod schema for the parameters this factory operates on.\n * @param dimensionToSchemaMap A map from dimension objects to the Zod schema for the implementation.\n * @param getFactory a method that should return an object with a getImpl method that returns\n * entities adhering to the schema for the corresponding getModel call\n */\nexport class FactoryDefinition<\n Name extends string,\n Dim extends z.ZodObject<any>,\n const Specialization extends FactorySpecialization<DMap>,\n DMap extends DimensionToSchemaMap<z.infer<Dim>>,\n _Dependencies extends Dependencies,\n> extends DependencyNode<Name, _Dependencies> {\n public readonly dimensions: Dim;\n public readonly specialization: Specialization;\n public readonly dimensionToSchemaMap: DMap;\n public readonly getFactory: GetFactory<_Dependencies, Dim, Specialization, DMap>;\n constructor({\n dimensions,\n specialization,\n dimensionToSchemaMap,\n getFactory,\n ...args\n }: {\n dimensions: Dim;\n specialization: Specialization;\n dimensionToSchemaMap: DMap;\n getFactory: GetFactory<_Dependencies, Dim, Specialization, DMap>;\n } & ConstructorParameters<typeof DependencyNode<Name, _Dependencies>>[0]) {\n super(args);\n this.dimensions = dimensions;\n this.specialization = specialization;\n this.dimensionToSchemaMap = dimensionToSchemaMap;\n this.getFactory = getFactory;\n }\n}\n\n/**\n * An object definition is a dependency node that refers to some entity\n * matching a given schema. That is, it may be resolved to any entity\n * that adheres to the {@link schema}.\n * The object definition is abstract, as it cannot be meaningfully resolved without\n * additional information. For an example of an object definition, see ReflexiveObjectDefinition or ContextDefinition\n * @param name inherited from {@link DependencyNode}\n * @param dependencies inherited from {@link DependencyNode}\n * @param schema a Zod schema defining the expected resolution for this definition\n */\nexport abstract class ObjectDefinition<\n Name extends string,\n Schema extends z.ZodSchema,\n _Dependencies extends Dependencies,\n> extends DependencyNode<Name, _Dependencies> {\n public readonly schema: Schema;\n\n constructor({\n schema,\n ...args\n }: {\n schema: Schema;\n } & ConstructorParameters<typeof DependencyNode<Name, _Dependencies>>[0]) {\n super(args);\n this.schema = schema;\n }\n}\n\nexport type Definition<Name extends string> =\n | FactoryDefinition<Name, any, any, any, any>\n | ObjectDefinition<Name, any, any>;\n\n/**\n * Infers the expected type of a definition once it has been resolved\n */\nexport type ResolvedDefinition<Definition extends DependencyNode<any, any>> =\n Definition extends ObjectDefinition<any, infer Schema, any>\n ? z.infer<Schema>\n : Definition extends FactoryDefinition<\n any,\n infer Dim,\n infer Specialization,\n infer DMap,\n any\n >\n ? Factory<Definition['dependencies'], Dim, Specialization, DMap>\n : Definition extends FactoryDefinition<any, any, any, any, any>\n ? Factory<\n Definition['dependencies'],\n Definition['dimensions'],\n Definition['specialization'],\n Definition['dimensionToSchemaMap']\n >\n : unknown;\n\n/**\n * Given a record from string to definition, maps each definition T to ResolvedDefinition<T>\n */\nexport type ResolvedDefinitionMap<Deps extends Dependencies> = {\n [Key in keyof Deps]: ResolvedDefinition<Deps[Key]>;\n};\n\n/**\n * For some factory definition F and some dimension D s.t. D ⊇ F.dimensions, infers the expected return type of\n * ResolvedDefinition<F>.getImpl(D)\n */\nexport type ResolvedFactoryImplementation<Definition extends DependencyNode<any, any>, Dim> =\n Definition extends FactoryDefinition<any, any, any, any, any>\n ? WithSpecializeMethod<\n WithInjectedSpecialization<\n GetModelFromSchema<Definition['dimensionToSchemaMap'], Dim>,\n Definition['specialization']\n >,\n GetModelFromSchema<Definition['dimensionToSchemaMap'], Dim>,\n z.infer<Definition['specialization']['spec']>\n >\n : never;\n\n/**\n * Given a record from string to definition and some dimension D, maps each definition T to ResolvedFactoryImplementation<T, D>\n */\nexport type ResolvedFactoryImplementationMap<Deps extends Dependencies, Dim> = RemoveNever<{\n [Key in keyof Deps]: ResolvedFactoryImplementation<Deps[Key], Dim>;\n}>;\n\ntype ActivityFactoryContext<\n _FactoryDefinition extends FactoryDefinition<any, any, any, any, any>,\n Dim,\n> = {\n getFunctionPointer: <\n MethodName extends MethodNameOf<ResolvedFactoryImplementation<_FactoryDefinition, Dim>>,\n >(\n methodName: MethodName,\n ) => FunctionPointer<ResolvedFactoryImplementation<_FactoryDefinition, Dim>[MethodName]>;\n};\n\n/**\n * The parameters that shall be received by a factory's implementation getter\n */\nexport type Context<_FactoryDefinition extends FactoryDefinition<any, any, any, any, any>, Dim> = {\n name: _FactoryDefinition extends FactoryDefinition<infer Name, any, any, any, any>\n ? Name\n : never;\n dependencies: _FactoryDefinition extends FactoryDefinition<any, any, any, any, infer Deps>\n ? ResolvedDefinitionMap<Deps>\n : never;\n dim: Dim;\n impls: _FactoryDefinition extends FactoryDefinition<any, any, any, any, infer Deps>\n ? ResolvedFactoryImplementationMap<Deps, Dim>\n : never;\n self: ResolvedFactoryImplementation<_FactoryDefinition, Dim>;\n} & ActivityFactoryContext<_FactoryDefinition, Dim>;\n\nexport const serializeDimensions = (dim: object = {}) => {\n return Object.keys(dim).length\n ? Object.entries(dim)\n .sort()\n .map(([dimName, dimVal]) => `${dimName}_${dimVal}`, '')\n .join('&')\n : '_base';\n};\n"]}
|
|
@@ -8,11 +8,13 @@ var FactoryDefinition = class extends dependencyGraph.DependencyNode {
|
|
|
8
8
|
YJF4D23A_cjs.__name(this, "FactoryDefinition");
|
|
9
9
|
}
|
|
10
10
|
dimensions;
|
|
11
|
+
specialization;
|
|
11
12
|
dimensionToSchemaMap;
|
|
12
13
|
getFactory;
|
|
13
|
-
constructor({ dimensions, dimensionToSchemaMap, getFactory, ...args }) {
|
|
14
|
+
constructor({ dimensions, specialization, dimensionToSchemaMap, getFactory, ...args }) {
|
|
14
15
|
super(args);
|
|
15
16
|
this.dimensions = dimensions;
|
|
17
|
+
this.specialization = specialization;
|
|
16
18
|
this.dimensionToSchemaMap = dimensionToSchemaMap;
|
|
17
19
|
this.getFactory = getFactory;
|
|
18
20
|
}
|
|
@@ -34,5 +36,5 @@ var serializeDimensions = /* @__PURE__ */ YJF4D23A_cjs.__name((dim = {}) => {
|
|
|
34
36
|
exports.FactoryDefinition = FactoryDefinition;
|
|
35
37
|
exports.ObjectDefinition = ObjectDefinition;
|
|
36
38
|
exports.serializeDimensions = serializeDimensions;
|
|
37
|
-
//# sourceMappingURL=
|
|
38
|
-
//# sourceMappingURL=
|
|
39
|
+
//# sourceMappingURL=CC3IHCUD.cjs.map
|
|
40
|
+
//# sourceMappingURL=CC3IHCUD.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/definitions.ts"],"names":["FactoryDefinition","DependencyNode","dimensions","specialization","dimensionToSchemaMap","getFactory","args","ObjectDefinition","schema","serializeDimensions","__name","dim","Object","keys","length","entries","sort","map","dimName","dimVal","join"],"mappings":";;;;;AA8HO,IAAMA,iBAAAA,GAAN,cAMGC,8BAAAA,CAAAA;EAhIV;;;AAiIoBC,EAAAA,UAAAA;AACAC,EAAAA,cAAAA;AACAC,EAAAA,oBAAAA;AACAC,EAAAA,UAAAA;AAChB,EAAA,WAAA,CAAY,EACRH,UAAAA,EACAC,cAAAA,EACAC,sBACAC,UAAAA,EACA,GAAGC,MAAAA,EAMmE;AACtE,IAAA,KAAA,CAAMA,IAAAA,CAAAA;AACN,IAAA,IAAA,CAAKJ,UAAAA,GAAaA,UAAAA;AAClB,IAAA,IAAA,CAAKC,cAAAA,GAAiBA,cAAAA;AACtB,IAAA,IAAA,CAAKC,oBAAAA,GAAuBA,oBAAAA;AAC5B,IAAA,IAAA,CAAKC,UAAAA,GAAaA,UAAAA;AACtB,EAAA;AACJ;AAYO,IAAeE,gBAAAA,GAAf,cAIGN,8BAAAA,CAAAA;EAvKV;;;AAwKoBO,EAAAA,MAAAA;AAEhB,EAAA,WAAA,CAAY,EACRA,MAAAA,EACA,GAAGF,IAAAA,EAAAA,EAGmE;AACtE,IAAA,KAAA,CAAMA,IAAAA,CAAAA;AACN,IAAA,IAAA,CAAKE,MAAAA,GAASA,MAAAA;AAClB,EAAA;AACJ;AAuFO,IAAMC,mBAAAA,mBAAsBC,mBAAA,CAAA,CAACC,GAAAA,GAAc,EAAC,KAAC;AAChD,EAAA,OAAOC,MAAAA,CAAOC,IAAAA,CAAKF,GAAAA,CAAAA,CAAKG,MAAAA,GAClBF,MAAAA,CAAOG,OAAAA,CAAQJ,GAAAA,CAAAA,CACVK,IAAAA,EAAI,CACJC,GAAAA,CAAI,CAAC,CAACC,OAAAA,EAASC,MAAAA,CAAAA,KAAY,CAAA,EAAGD,OAAAA,CAAAA,CAAAA,EAAWC,MAAAA,CAAAA,CAAAA,EAAU,EAAA,CAAA,CACnDC,IAAAA,CAAK,GAAA,CAAA,GACV,OAAA;AACV,CAAA,EAPmC,qBAAA","file":"CC3IHCUD.cjs","sourcesContent":["import type { z } from 'zod/v4';\n\nimport type { FunctionPointer } from '@layerzerolabs/common-utils';\nimport type { Dependencies } from '@layerzerolabs/dependency-graph';\nimport { DependencyNode } from '@layerzerolabs/dependency-graph';\nimport type {\n AdvancedRecord,\n AdvancedRecordLookup,\n Merge,\n MethodNameOf,\n RemoveNever,\n UnionToIntersection,\n} from '@layerzerolabs/typescript-utils';\n\nexport type DimensionToSchemaMap<DimConstraint extends object = object> = {\n byDimension?: AdvancedRecord<DimConstraint, z.ZodType>;\n base: z.ZodType;\n};\n\nexport type FactorySpecialization<DMap extends DimensionToSchemaMap = DimensionToSchemaMap> = {\n spec: z.ZodObject<any>;\n exempt: readonly (keyof GetSupersetOfModelsFromSchema<DMap>)[];\n};\n\nexport type WithInjectedSpecialization<T, Specialization extends FactorySpecialization<any>> = [\n {},\n] extends [z.infer<Specialization['spec']>]\n ? T\n : {\n [K in keyof T]: K extends Specialization['exempt'][number]\n ? T[K]\n : T[K] extends (...args: infer A) => infer R\n ? (specialization: z.infer<Specialization['spec']>, ...args: A) => R\n : T[K];\n };\n\nexport type WithSpecializeMethod<WithInjection, WithoutInjection, S> = {} extends S\n ? WithoutInjection\n : WithInjection extends (...args: infer Args) => infer Ret\n ? (...args: Args) => Ret\n : WithInjection & {\n specialize: (specialization: S) => WithoutInjection;\n };\n\nexport type GetModelFromSchema<DMap extends DimensionToSchemaMap, Dim> =\n AdvancedRecordLookup<DMap['byDimension'], Dim> extends never\n ? z.infer<DMap['base']>\n : Merge<z.infer<DMap['base']>, z.infer<AdvancedRecordLookup<DMap['byDimension'], Dim>>>;\n\nexport type GetSupersetOfModelsFromSchema<DMap extends DimensionToSchemaMap> = UnionToIntersection<\n {\n [Key in keyof DMap['byDimension']]: DMap['byDimension'][Key] extends [any, any]\n ? z.infer<DMap['byDimension'][Key][1]>\n : never;\n }[keyof DMap['byDimension']]\n> &\n z.infer<DMap['base']>;\n\ntype GetImplFunctionWithConditionalOptionalDim<Dim, Return> = {} extends Dim\n ? (dim?: Dim) => Return\n : (dim: Dim) => Return;\n\ntype GetImplOverloads<\n Dim extends z.ZodObject<any>,\n Specialization extends FactorySpecialization<DMap>,\n DMap extends DimensionToSchemaMap<z.infer<Dim>>,\n> = UnionToIntersection<\n | {\n [I in keyof DMap['byDimension']]: DMap['byDimension'][I] extends readonly [infer K, any]\n ? {\n getImpl: GetImplFunctionWithConditionalOptionalDim<\n K,\n WithSpecializeMethod<\n WithInjectedSpecialization<GetModelFromSchema<DMap, K>, Specialization>,\n GetModelFromSchema<DMap, K>,\n z.infer<Specialization['spec']>\n >\n >;\n }\n : never;\n }[keyof DMap['byDimension']]\n | {\n getImpl: GetImplFunctionWithConditionalOptionalDim<\n z.infer<Dim>,\n WithSpecializeMethod<\n WithInjectedSpecialization<z.infer<DMap['base']>, Specialization>,\n z.infer<DMap['base']>,\n z.infer<Specialization['spec']>\n >\n >;\n }\n>;\n\nexport type Factory<\n _Dependencies extends Dependencies,\n Dim extends z.ZodObject<any>,\n Specialization extends FactorySpecialization<DMap>,\n DMap extends DimensionToSchemaMap<z.infer<Dim>>,\n> = {\n name: string;\n implKeys: string[];\n dimensionToSchemaMap: DMap;\n} & GetImplOverloads<Dim, Specialization, DMap>;\n\nexport type GetFactory<\n _Dependencies extends Dependencies,\n Dim extends z.ZodObject<any>,\n Specialization extends FactorySpecialization<DMap>,\n DMap extends DimensionToSchemaMap<z.infer<Dim>>,\n> = () =>\n | Factory<_Dependencies, Dim, Specialization, DMap>\n | Promise<Factory<_Dependencies, Dim, Specialization, DMap>>;\n\n/**\n * Factory definitions are a type of dependency node that shall be resolved to a *factory*.\n * A factory is an object that provides a getImpl method which accepts some parameters *dim*,\n * and returns some object getImplMetadata.getModel(dim).\n * That is, a factory definition is given by the set of parameters it uses to get its implementations,\n * and a function defining the schema it will return for each set of parameters.\n * @param name inherited from {@link DependencyNode}\n * @param dependencies inherited from {@link DependencyNode}\n * @param dimensions a Zod schema for the parameters this factory operates on.\n * @param dimensionToSchemaMap A map from dimension objects to the Zod schema for the implementation.\n * @param getFactory a method that should return an object with a getImpl method that returns\n * entities adhering to the schema for the corresponding getModel call\n */\nexport class FactoryDefinition<\n Name extends string,\n Dim extends z.ZodObject<any>,\n const Specialization extends FactorySpecialization<DMap>,\n DMap extends DimensionToSchemaMap<z.infer<Dim>>,\n _Dependencies extends Dependencies,\n> extends DependencyNode<Name, _Dependencies> {\n public readonly dimensions: Dim;\n public readonly specialization: Specialization;\n public readonly dimensionToSchemaMap: DMap;\n public readonly getFactory: GetFactory<_Dependencies, Dim, Specialization, DMap>;\n constructor({\n dimensions,\n specialization,\n dimensionToSchemaMap,\n getFactory,\n ...args\n }: {\n dimensions: Dim;\n specialization: Specialization;\n dimensionToSchemaMap: DMap;\n getFactory: GetFactory<_Dependencies, Dim, Specialization, DMap>;\n } & ConstructorParameters<typeof DependencyNode<Name, _Dependencies>>[0]) {\n super(args);\n this.dimensions = dimensions;\n this.specialization = specialization;\n this.dimensionToSchemaMap = dimensionToSchemaMap;\n this.getFactory = getFactory;\n }\n}\n\n/**\n * An object definition is a dependency node that refers to some entity\n * matching a given schema. That is, it may be resolved to any entity\n * that adheres to the {@link schema}.\n * The object definition is abstract, as it cannot be meaningfully resolved without\n * additional information. For an example of an object definition, see ReflexiveObjectDefinition or ContextDefinition\n * @param name inherited from {@link DependencyNode}\n * @param dependencies inherited from {@link DependencyNode}\n * @param schema a Zod schema defining the expected resolution for this definition\n */\nexport abstract class ObjectDefinition<\n Name extends string,\n Schema extends z.ZodSchema,\n _Dependencies extends Dependencies,\n> extends DependencyNode<Name, _Dependencies> {\n public readonly schema: Schema;\n\n constructor({\n schema,\n ...args\n }: {\n schema: Schema;\n } & ConstructorParameters<typeof DependencyNode<Name, _Dependencies>>[0]) {\n super(args);\n this.schema = schema;\n }\n}\n\nexport type Definition<Name extends string> =\n | FactoryDefinition<Name, any, any, any, any>\n | ObjectDefinition<Name, any, any>;\n\n/**\n * Infers the expected type of a definition once it has been resolved\n */\nexport type ResolvedDefinition<Definition extends DependencyNode<any, any>> =\n Definition extends ObjectDefinition<any, infer Schema, any>\n ? z.infer<Schema>\n : Definition extends FactoryDefinition<\n any,\n infer Dim,\n infer Specialization,\n infer DMap,\n any\n >\n ? Factory<Definition['dependencies'], Dim, Specialization, DMap>\n : Definition extends FactoryDefinition<any, any, any, any, any>\n ? Factory<\n Definition['dependencies'],\n Definition['dimensions'],\n Definition['specialization'],\n Definition['dimensionToSchemaMap']\n >\n : unknown;\n\n/**\n * Given a record from string to definition, maps each definition T to ResolvedDefinition<T>\n */\nexport type ResolvedDefinitionMap<Deps extends Dependencies> = {\n [Key in keyof Deps]: ResolvedDefinition<Deps[Key]>;\n};\n\n/**\n * For some factory definition F and some dimension D s.t. D ⊇ F.dimensions, infers the expected return type of\n * ResolvedDefinition<F>.getImpl(D)\n */\nexport type ResolvedFactoryImplementation<Definition extends DependencyNode<any, any>, Dim> =\n Definition extends FactoryDefinition<any, any, any, any, any>\n ? WithSpecializeMethod<\n WithInjectedSpecialization<\n GetModelFromSchema<Definition['dimensionToSchemaMap'], Dim>,\n Definition['specialization']\n >,\n GetModelFromSchema<Definition['dimensionToSchemaMap'], Dim>,\n z.infer<Definition['specialization']['spec']>\n >\n : never;\n\n/**\n * Given a record from string to definition and some dimension D, maps each definition T to ResolvedFactoryImplementation<T, D>\n */\nexport type ResolvedFactoryImplementationMap<Deps extends Dependencies, Dim> = RemoveNever<{\n [Key in keyof Deps]: ResolvedFactoryImplementation<Deps[Key], Dim>;\n}>;\n\ntype ActivityFactoryContext<\n _FactoryDefinition extends FactoryDefinition<any, any, any, any, any>,\n Dim,\n> = {\n getFunctionPointer: <\n MethodName extends MethodNameOf<ResolvedFactoryImplementation<_FactoryDefinition, Dim>>,\n >(\n methodName: MethodName,\n ) => FunctionPointer<ResolvedFactoryImplementation<_FactoryDefinition, Dim>[MethodName]>;\n};\n\n/**\n * The parameters that shall be received by a factory's implementation getter\n */\nexport type Context<_FactoryDefinition extends FactoryDefinition<any, any, any, any, any>, Dim> = {\n name: _FactoryDefinition extends FactoryDefinition<infer Name, any, any, any, any>\n ? Name\n : never;\n dependencies: _FactoryDefinition extends FactoryDefinition<any, any, any, any, infer Deps>\n ? ResolvedDefinitionMap<Deps>\n : never;\n dim: Dim;\n impls: _FactoryDefinition extends FactoryDefinition<any, any, any, any, infer Deps>\n ? ResolvedFactoryImplementationMap<Deps, Dim>\n : never;\n self: ResolvedFactoryImplementation<_FactoryDefinition, Dim>;\n} & ActivityFactoryContext<_FactoryDefinition, Dim>;\n\nexport const serializeDimensions = (dim: object = {}) => {\n return Object.keys(dim).length\n ? Object.entries(dim)\n .sort()\n .map(([dimName, dimVal]) => `${dimName}_${dimVal}`, '')\n .join('&')\n : '_base';\n};\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var CC3IHCUD_cjs = require('./CC3IHCUD.cjs');
|
|
4
|
+
var YJF4D23A_cjs = require('./YJF4D23A.cjs');
|
|
5
|
+
|
|
6
|
+
// src/utils.ts
|
|
7
|
+
var extractSchemaFromFactory = /* @__PURE__ */ YJF4D23A_cjs.__name((factory, dimension) => {
|
|
8
|
+
const schema = (factory.dimensionToSchemaMap.byDimension && Object.values(factory.dimensionToSchemaMap.byDimension).find(([dim]) => CC3IHCUD_cjs.serializeDimensions(dim) === CC3IHCUD_cjs.serializeDimensions(dimension))?.[1]) ?? factory.dimensionToSchemaMap.base;
|
|
9
|
+
if (!schema?.shape) {
|
|
10
|
+
throw new Error(`Couldn't resolve the schema of factory ${factory.name} for dim ${JSON.stringify(dimension)}`);
|
|
11
|
+
}
|
|
12
|
+
return schema;
|
|
13
|
+
}, "extractSchemaFromFactory");
|
|
14
|
+
|
|
15
|
+
exports.extractSchemaFromFactory = extractSchemaFromFactory;
|
|
16
|
+
//# sourceMappingURL=M3BJNIOI.cjs.map
|
|
17
|
+
//# sourceMappingURL=M3BJNIOI.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils.ts"],"names":["extractSchemaFromFactory","__name","factory","dimension","schema","dimensionToSchemaMap","byDimension","Object","values","find","dim","serializeDimensions","base","shape","Error","name","JSON","stringify"],"mappings":";;;;;;AAOO,IAAMA,wBAAAA,mBAA2BC,mBAAA,CAAA,CACpCC,OAAAA,EACAC,SAAAA,KAAAA;AAEA,EAAA,MAAMC,MAAAA,GAAAA,CACDF,OAAAA,CAAQG,oBAAAA,CAAqBC,WAAAA,IAC1BC,MAAAA,CAAOC,OAAON,OAAAA,CAAQG,oBAAAA,CAAqBC,WAAW,CAAA,CAAoBG,IAAAA,CACtE,CAAC,CAACC,GAAAA,CAAAA,KAASC,gCAAAA,CAAoBD,GAAAA,CAAAA,KAASC,gCAAAA,CAAoBR,SAAAA,CAAAA,CAAAA,GAC5D,CAAA,CAAA,KACRD,OAAAA,CAAQG,oBAAAA,CAAqBO,IAAAA;AACjC,EAAA,IAAI,CAACR,QAAQS,KAAAA,EAAO;AAChB,IAAA,MAAM,IAAIC,KAAAA,CACN,CAAA,uCAAA,EAA0CZ,OAAAA,CAAQa,IAAI,YAAYC,IAAAA,CAAKC,SAAAA,CAAUd,SAAAA,CAAAA,CAAAA,CAAY,CAAA;AAErG,EAAA;AAEA,EAAA,OAAOC,MAAAA;AACX,CAAA,EAjBwC,0BAAA","file":"M3BJNIOI.cjs","sourcesContent":["import type z from 'zod/v4';\n\nimport type { AdvancedRecord } from '@layerzerolabs/typescript-utils';\n\nimport type { Factory } from './definitions';\nimport { type FactoryDefinition, serializeDimensions } from './definitions';\n\nexport const extractSchemaFromFactory = <Dim extends z.ZodObject>(\n factory: FactoryDefinition<any, Dim, any, any, any> | Factory<any, any, any, any>,\n dimension: z.infer<Dim>,\n): z.ZodObject => {\n const schema =\n (factory.dimensionToSchemaMap.byDimension &&\n Object.values(factory.dimensionToSchemaMap.byDimension as AdvancedRecord).find(\n ([dim]) => serializeDimensions(dim) === serializeDimensions(dimension),\n )?.[1]) ??\n factory.dimensionToSchemaMap.base;\n if (!schema?.shape) {\n throw new Error(\n `Couldn't resolve the schema of factory ${factory.name} for dim ${JSON.stringify(dimension)}`,\n );\n }\n\n return schema;\n};\n"]}
|
package/dist/definitions.cjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var CC3IHCUD_cjs = require('./CC3IHCUD.cjs');
|
|
4
4
|
require('./YJF4D23A.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "FactoryDefinition", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return CC3IHCUD_cjs.FactoryDefinition; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "ObjectDefinition", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return CC3IHCUD_cjs.ObjectDefinition; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "serializeDimensions", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return CC3IHCUD_cjs.serializeDimensions; }
|
|
19
19
|
});
|
|
20
20
|
//# sourceMappingURL=definitions.cjs.map
|
|
21
21
|
//# sourceMappingURL=definitions.cjs.map
|
package/dist/definitions.d.ts
CHANGED
|
@@ -7,24 +7,36 @@ export type DimensionToSchemaMap<DimConstraint extends object = object> = {
|
|
|
7
7
|
byDimension?: AdvancedRecord<DimConstraint, z.ZodType>;
|
|
8
8
|
base: z.ZodType;
|
|
9
9
|
};
|
|
10
|
+
export type FactorySpecialization<DMap extends DimensionToSchemaMap = DimensionToSchemaMap> = {
|
|
11
|
+
spec: z.ZodObject<any>;
|
|
12
|
+
exempt: readonly (keyof GetSupersetOfModelsFromSchema<DMap>)[];
|
|
13
|
+
};
|
|
14
|
+
export type WithInjectedSpecialization<T, Specialization extends FactorySpecialization<any>> = [
|
|
15
|
+
{}
|
|
16
|
+
] extends [z.infer<Specialization['spec']>] ? T : {
|
|
17
|
+
[K in keyof T]: K extends Specialization['exempt'][number] ? T[K] : T[K] extends (...args: infer A) => infer R ? (specialization: z.infer<Specialization['spec']>, ...args: A) => R : T[K];
|
|
18
|
+
};
|
|
19
|
+
export type WithSpecializeMethod<WithInjection, WithoutInjection, S> = {} extends S ? WithoutInjection : WithInjection extends (...args: infer Args) => infer Ret ? (...args: Args) => Ret : WithInjection & {
|
|
20
|
+
specialize: (specialization: S) => WithoutInjection;
|
|
21
|
+
};
|
|
10
22
|
export type GetModelFromSchema<DMap extends DimensionToSchemaMap, Dim> = AdvancedRecordLookup<DMap['byDimension'], Dim> extends never ? z.infer<DMap['base']> : Merge<z.infer<DMap['base']>, z.infer<AdvancedRecordLookup<DMap['byDimension'], Dim>>>;
|
|
11
23
|
export type GetSupersetOfModelsFromSchema<DMap extends DimensionToSchemaMap> = UnionToIntersection<{
|
|
12
24
|
[Key in keyof DMap['byDimension']]: DMap['byDimension'][Key] extends [any, any] ? z.infer<DMap['byDimension'][Key][1]> : never;
|
|
13
25
|
}[keyof DMap['byDimension']]> & z.infer<DMap['base']>;
|
|
14
26
|
type GetImplFunctionWithConditionalOptionalDim<Dim, Return> = {} extends Dim ? (dim?: Dim) => Return : (dim: Dim) => Return;
|
|
15
|
-
type GetImplOverloads<Dim extends z.ZodObject<any>, DMap extends DimensionToSchemaMap<z.infer<Dim>>> = UnionToIntersection<{
|
|
27
|
+
type GetImplOverloads<Dim extends z.ZodObject<any>, Specialization extends FactorySpecialization<DMap>, DMap extends DimensionToSchemaMap<z.infer<Dim>>> = UnionToIntersection<{
|
|
16
28
|
[I in keyof DMap['byDimension']]: DMap['byDimension'][I] extends readonly [infer K, any] ? {
|
|
17
|
-
getImpl: GetImplFunctionWithConditionalOptionalDim<K, GetModelFromSchema<DMap, K
|
|
29
|
+
getImpl: GetImplFunctionWithConditionalOptionalDim<K, WithSpecializeMethod<WithInjectedSpecialization<GetModelFromSchema<DMap, K>, Specialization>, GetModelFromSchema<DMap, K>, z.infer<Specialization['spec']>>>;
|
|
18
30
|
} : never;
|
|
19
31
|
}[keyof DMap['byDimension']] | {
|
|
20
|
-
getImpl: GetImplFunctionWithConditionalOptionalDim<z.infer<Dim>, z.infer<DMap['base']
|
|
32
|
+
getImpl: GetImplFunctionWithConditionalOptionalDim<z.infer<Dim>, WithSpecializeMethod<WithInjectedSpecialization<z.infer<DMap['base']>, Specialization>, z.infer<DMap['base']>, z.infer<Specialization['spec']>>>;
|
|
21
33
|
}>;
|
|
22
|
-
export type Factory<_Dependencies extends Dependencies, Dim extends z.ZodObject<any>, DMap extends DimensionToSchemaMap<z.infer<Dim>>> = {
|
|
34
|
+
export type Factory<_Dependencies extends Dependencies, Dim extends z.ZodObject<any>, Specialization extends FactorySpecialization<DMap>, DMap extends DimensionToSchemaMap<z.infer<Dim>>> = {
|
|
23
35
|
name: string;
|
|
24
36
|
implKeys: string[];
|
|
25
37
|
dimensionToSchemaMap: DMap;
|
|
26
|
-
} & GetImplOverloads<Dim, DMap>;
|
|
27
|
-
export type GetFactory<_Dependencies extends Dependencies, Dim extends z.ZodObject<any>, DMap extends DimensionToSchemaMap<z.infer<Dim>>> = () => Factory<_Dependencies, Dim, DMap> | Promise<Factory<_Dependencies, Dim, DMap>>;
|
|
38
|
+
} & GetImplOverloads<Dim, Specialization, DMap>;
|
|
39
|
+
export type GetFactory<_Dependencies extends Dependencies, Dim extends z.ZodObject<any>, Specialization extends FactorySpecialization<DMap>, DMap extends DimensionToSchemaMap<z.infer<Dim>>> = () => Factory<_Dependencies, Dim, Specialization, DMap> | Promise<Factory<_Dependencies, Dim, Specialization, DMap>>;
|
|
28
40
|
/**
|
|
29
41
|
* Factory definitions are a type of dependency node that shall be resolved to a *factory*.
|
|
30
42
|
* A factory is an object that provides a getImpl method which accepts some parameters *dim*,
|
|
@@ -38,14 +50,16 @@ export type GetFactory<_Dependencies extends Dependencies, Dim extends z.ZodObje
|
|
|
38
50
|
* @param getFactory a method that should return an object with a getImpl method that returns
|
|
39
51
|
* entities adhering to the schema for the corresponding getModel call
|
|
40
52
|
*/
|
|
41
|
-
export declare class FactoryDefinition<Name extends string, Dim extends z.ZodObject<any>, DMap extends DimensionToSchemaMap<z.infer<Dim>>, _Dependencies extends Dependencies> extends DependencyNode<Name, _Dependencies> {
|
|
53
|
+
export declare class FactoryDefinition<Name extends string, Dim extends z.ZodObject<any>, const Specialization extends FactorySpecialization<DMap>, DMap extends DimensionToSchemaMap<z.infer<Dim>>, _Dependencies extends Dependencies> extends DependencyNode<Name, _Dependencies> {
|
|
42
54
|
readonly dimensions: Dim;
|
|
55
|
+
readonly specialization: Specialization;
|
|
43
56
|
readonly dimensionToSchemaMap: DMap;
|
|
44
|
-
readonly getFactory: GetFactory<_Dependencies, Dim, DMap>;
|
|
45
|
-
constructor({ dimensions, dimensionToSchemaMap, getFactory, ...args }: {
|
|
57
|
+
readonly getFactory: GetFactory<_Dependencies, Dim, Specialization, DMap>;
|
|
58
|
+
constructor({ dimensions, specialization, dimensionToSchemaMap, getFactory, ...args }: {
|
|
46
59
|
dimensions: Dim;
|
|
60
|
+
specialization: Specialization;
|
|
47
61
|
dimensionToSchemaMap: DMap;
|
|
48
|
-
getFactory: GetFactory<_Dependencies, Dim, DMap>;
|
|
62
|
+
getFactory: GetFactory<_Dependencies, Dim, Specialization, DMap>;
|
|
49
63
|
} & ConstructorParameters<typeof DependencyNode<Name, _Dependencies>>[0]);
|
|
50
64
|
}
|
|
51
65
|
/**
|
|
@@ -64,11 +78,11 @@ export declare abstract class ObjectDefinition<Name extends string, Schema exten
|
|
|
64
78
|
schema: Schema;
|
|
65
79
|
} & ConstructorParameters<typeof DependencyNode<Name, _Dependencies>>[0]);
|
|
66
80
|
}
|
|
67
|
-
export type Definition<Name extends string> = FactoryDefinition<Name, any, any, any> | ObjectDefinition<Name, any, any>;
|
|
81
|
+
export type Definition<Name extends string> = FactoryDefinition<Name, any, any, any, any> | ObjectDefinition<Name, any, any>;
|
|
68
82
|
/**
|
|
69
83
|
* Infers the expected type of a definition once it has been resolved
|
|
70
84
|
*/
|
|
71
|
-
export type ResolvedDefinition<Definition extends DependencyNode<any, any>> = Definition extends ObjectDefinition<any, infer Schema, any> ? z.infer<Schema> : Definition extends FactoryDefinition<any, infer Dim, infer DMap, any> ? Factory<Definition['dependencies'], Dim, DMap> : Definition extends FactoryDefinition<any, any, any, any> ? Factory<Definition['dependencies'], Definition['dimensions'], Definition['dimensionToSchemaMap']> : unknown;
|
|
85
|
+
export type ResolvedDefinition<Definition extends DependencyNode<any, any>> = Definition extends ObjectDefinition<any, infer Schema, any> ? z.infer<Schema> : Definition extends FactoryDefinition<any, infer Dim, infer Specialization, infer DMap, any> ? Factory<Definition['dependencies'], Dim, Specialization, DMap> : Definition extends FactoryDefinition<any, any, any, any, any> ? Factory<Definition['dependencies'], Definition['dimensions'], Definition['specialization'], Definition['dimensionToSchemaMap']> : unknown;
|
|
72
86
|
/**
|
|
73
87
|
* Given a record from string to definition, maps each definition T to ResolvedDefinition<T>
|
|
74
88
|
*/
|
|
@@ -79,24 +93,25 @@ export type ResolvedDefinitionMap<Deps extends Dependencies> = {
|
|
|
79
93
|
* For some factory definition F and some dimension D s.t. D ⊇ F.dimensions, infers the expected return type of
|
|
80
94
|
* ResolvedDefinition<F>.getImpl(D)
|
|
81
95
|
*/
|
|
82
|
-
export type ResolvedFactoryImplementation<Definition extends DependencyNode<any, any>, Dim> = Definition extends FactoryDefinition<any, any, any, any> ? GetModelFromSchema<Definition['dimensionToSchemaMap'], Dim
|
|
96
|
+
export type ResolvedFactoryImplementation<Definition extends DependencyNode<any, any>, Dim> = Definition extends FactoryDefinition<any, any, any, any, any> ? WithSpecializeMethod<WithInjectedSpecialization<GetModelFromSchema<Definition['dimensionToSchemaMap'], Dim>, Definition['specialization']>, GetModelFromSchema<Definition['dimensionToSchemaMap'], Dim>, z.infer<Definition['specialization']['spec']>> : never;
|
|
83
97
|
/**
|
|
84
98
|
* Given a record from string to definition and some dimension D, maps each definition T to ResolvedFactoryImplementation<T, D>
|
|
85
99
|
*/
|
|
86
100
|
export type ResolvedFactoryImplementationMap<Deps extends Dependencies, Dim> = RemoveNever<{
|
|
87
101
|
[Key in keyof Deps]: ResolvedFactoryImplementation<Deps[Key], Dim>;
|
|
88
102
|
}>;
|
|
89
|
-
type ActivityFactoryContext<_FactoryDefinition extends FactoryDefinition<any, any, any, any>, Dim> = {
|
|
90
|
-
getFunctionPointer:
|
|
103
|
+
type ActivityFactoryContext<_FactoryDefinition extends FactoryDefinition<any, any, any, any, any>, Dim> = {
|
|
104
|
+
getFunctionPointer: <MethodName extends MethodNameOf<ResolvedFactoryImplementation<_FactoryDefinition, Dim>>>(methodName: MethodName) => FunctionPointer<ResolvedFactoryImplementation<_FactoryDefinition, Dim>[MethodName]>;
|
|
91
105
|
};
|
|
92
106
|
/**
|
|
93
107
|
* The parameters that shall be received by a factory's implementation getter
|
|
94
108
|
*/
|
|
95
|
-
export type Context<_FactoryDefinition extends FactoryDefinition<any, any, any, any>, Dim> = {
|
|
96
|
-
name: _FactoryDefinition extends FactoryDefinition<infer Name, any, any, any> ? Name : never;
|
|
97
|
-
dependencies: _FactoryDefinition extends FactoryDefinition<any, any, any, infer Deps> ? ResolvedDefinitionMap<Deps> : never;
|
|
109
|
+
export type Context<_FactoryDefinition extends FactoryDefinition<any, any, any, any, any>, Dim> = {
|
|
110
|
+
name: _FactoryDefinition extends FactoryDefinition<infer Name, any, any, any, any> ? Name : never;
|
|
111
|
+
dependencies: _FactoryDefinition extends FactoryDefinition<any, any, any, any, infer Deps> ? ResolvedDefinitionMap<Deps> : never;
|
|
98
112
|
dim: Dim;
|
|
99
|
-
impls: _FactoryDefinition extends FactoryDefinition<any, any, any, infer Deps> ? ResolvedFactoryImplementationMap<Deps, Dim> : never;
|
|
113
|
+
impls: _FactoryDefinition extends FactoryDefinition<any, any, any, any, infer Deps> ? ResolvedFactoryImplementationMap<Deps, Dim> : never;
|
|
114
|
+
self: ResolvedFactoryImplementation<_FactoryDefinition, Dim>;
|
|
100
115
|
} & ActivityFactoryContext<_FactoryDefinition, Dim>;
|
|
101
116
|
export declare const serializeDimensions: (dim?: object) => string;
|
|
102
117
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../src/definitions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EACR,cAAc,EACd,oBAAoB,EACpB,KAAK,EACL,YAAY,EACZ,WAAW,EACX,mBAAmB,EACtB,MAAM,iCAAiC,CAAC;AAEzC,MAAM,MAAM,oBAAoB,CAAC,aAAa,SAAS,MAAM,GAAG,MAAM,IAAI;IACtE,WAAW,CAAC,EAAE,cAAc,CAAC,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;IACvD,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAAC,IAAI,SAAS,oBAAoB,EAAE,GAAG,IACjE,oBAAoB,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,GAAG,CAAC,SAAS,KAAK,GACtD,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GACrB,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;AAEhG,MAAM,MAAM,6BAA6B,CAAC,IAAI,SAAS,oBAAoB,IAAI,mBAAmB,CAC9F;KACK,GAAG,IAAI,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,GACzE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GACpC,KAAK;CACd,CAAC,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,CAC/B,GACG,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AAE1B,KAAK,yCAAyC,CAAC,GAAG,EAAE,MAAM,IAAI,EAAE,SAAS,GAAG,GACtE,CAAC,GAAG,CAAC,EAAE,GAAG,KAAK,MAAM,GACrB,CAAC,GAAG,EAAE,GAAG,KAAK,MAAM,CAAC;AAE3B,KAAK,gBAAgB,CACjB,GAAG,SAAS,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,EAC5B,IAAI,SAAS,oBAAoB,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAC/C,mBAAmB,CACjB;KACK,CAAC,IAAI,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,SAAS,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,GAClF;QACI,OAAO,EAAE,yCAAyC,CAC9C,CAAC,EACD,kBAAkB,CAAC,IAAI,EAAE,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../src/definitions.ts"],"names":[],"mappings":"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"}
|
package/dist/definitions.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { FactoryDefinition, ObjectDefinition, serializeDimensions } from './
|
|
1
|
+
export { FactoryDefinition, ObjectDefinition, serializeDimensions } from './BFFQH6TB.js';
|
|
2
2
|
import './VUOMXK5T.js';
|
|
3
3
|
//# sourceMappingURL=definitions.js.map
|
|
4
4
|
//# sourceMappingURL=definitions.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var JKTGUQY4_cjs = require('./JKTGUQY4.cjs');
|
|
4
4
|
var LBRYOOPE_cjs = require('./LBRYOOPE.cjs');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var M3BJNIOI_cjs = require('./M3BJNIOI.cjs');
|
|
6
|
+
var CC3IHCUD_cjs = require('./CC3IHCUD.cjs');
|
|
7
7
|
require('./YJF4D23A.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
@@ -18,19 +18,19 @@ Object.defineProperty(exports, "RegistrarBuilder", {
|
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "extractSchemaFromFactory", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return M3BJNIOI_cjs.extractSchemaFromFactory; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "FactoryDefinition", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return CC3IHCUD_cjs.FactoryDefinition; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "ObjectDefinition", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return CC3IHCUD_cjs.ObjectDefinition; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "serializeDimensions", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return CC3IHCUD_cjs.serializeDimensions; }
|
|
34
34
|
});
|
|
35
35
|
//# sourceMappingURL=index.cjs.map
|
|
36
36
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { DependencyStore } from './JJBD65HU.js';
|
|
2
2
|
export { RegistrarBuilder } from './RFHQF55L.js';
|
|
3
|
-
export { extractSchemaFromFactory } from './
|
|
4
|
-
export { FactoryDefinition, ObjectDefinition, serializeDimensions } from './
|
|
3
|
+
export { extractSchemaFromFactory } from './77NH5QOZ.js';
|
|
4
|
+
export { FactoryDefinition, ObjectDefinition, serializeDimensions } from './BFFQH6TB.js';
|
|
5
5
|
import './VUOMXK5T.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
package/dist/utils.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./
|
|
3
|
+
var M3BJNIOI_cjs = require('./M3BJNIOI.cjs');
|
|
4
|
+
require('./CC3IHCUD.cjs');
|
|
5
5
|
require('./YJF4D23A.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "extractSchemaFromFactory", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return M3BJNIOI_cjs.extractSchemaFromFactory; }
|
|
12
12
|
});
|
|
13
13
|
//# sourceMappingURL=utils.cjs.map
|
|
14
14
|
//# sourceMappingURL=utils.cjs.map
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type z from 'zod/v4';
|
|
2
2
|
import type { Factory } from './definitions';
|
|
3
3
|
import { type FactoryDefinition } from './definitions';
|
|
4
|
-
export declare const extractSchemaFromFactory: <Dim extends z.ZodObject>(
|
|
4
|
+
export declare const extractSchemaFromFactory: <Dim extends z.ZodObject>(factory: FactoryDefinition<any, Dim, any, any, any> | Factory<any, any, any, any>, dimension: z.infer<Dim>) => z.ZodObject;
|
|
5
5
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAI5B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,KAAK,iBAAiB,EAAuB,MAAM,eAAe,CAAC;AAE5E,eAAO,MAAM,wBAAwB,GAAI,GAAG,SAAS,CAAC,CAAC,SAAS,EAC5D,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAI5B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,KAAK,iBAAiB,EAAuB,MAAM,eAAe,CAAC;AAE5E,eAAO,MAAM,wBAAwB,GAAI,GAAG,SAAS,CAAC,CAAC,SAAS,EAC5D,SAAS,iBAAiB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EACjF,WAAW,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,KACxB,CAAC,CAAC,SAcJ,CAAC"}
|
package/dist/utils.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@layerzerolabs/base-definitions",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.32",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -15,16 +15,16 @@
|
|
|
15
15
|
"types": "./dist/index.d.ts",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"zod": "^3.23.8",
|
|
18
|
-
"@layerzerolabs/
|
|
19
|
-
"@layerzerolabs/
|
|
20
|
-
"@layerzerolabs/
|
|
21
|
-
"@layerzerolabs/
|
|
18
|
+
"@layerzerolabs/dependency-graph": "0.0.32",
|
|
19
|
+
"@layerzerolabs/common-utils": "0.0.32",
|
|
20
|
+
"@layerzerolabs/typescript-utils": "0.0.32",
|
|
21
|
+
"@layerzerolabs/dfs": "0.0.32"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"tsup": "^8.4.0",
|
|
25
25
|
"vitest": "^3.2.3",
|
|
26
|
-
"@layerzerolabs/tsup-configuration": "0.0.
|
|
27
|
-
"@layerzerolabs/typescript-configuration": "0.0.
|
|
26
|
+
"@layerzerolabs/tsup-configuration": "0.0.32",
|
|
27
|
+
"@layerzerolabs/typescript-configuration": "0.0.32"
|
|
28
28
|
},
|
|
29
29
|
"publishConfig": {
|
|
30
30
|
"access": "restricted",
|
package/src/definitions.ts
CHANGED
|
@@ -17,6 +17,31 @@ export type DimensionToSchemaMap<DimConstraint extends object = object> = {
|
|
|
17
17
|
base: z.ZodType;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
+
export type FactorySpecialization<DMap extends DimensionToSchemaMap = DimensionToSchemaMap> = {
|
|
21
|
+
spec: z.ZodObject<any>;
|
|
22
|
+
exempt: readonly (keyof GetSupersetOfModelsFromSchema<DMap>)[];
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export type WithInjectedSpecialization<T, Specialization extends FactorySpecialization<any>> = [
|
|
26
|
+
{},
|
|
27
|
+
] extends [z.infer<Specialization['spec']>]
|
|
28
|
+
? T
|
|
29
|
+
: {
|
|
30
|
+
[K in keyof T]: K extends Specialization['exempt'][number]
|
|
31
|
+
? T[K]
|
|
32
|
+
: T[K] extends (...args: infer A) => infer R
|
|
33
|
+
? (specialization: z.infer<Specialization['spec']>, ...args: A) => R
|
|
34
|
+
: T[K];
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type WithSpecializeMethod<WithInjection, WithoutInjection, S> = {} extends S
|
|
38
|
+
? WithoutInjection
|
|
39
|
+
: WithInjection extends (...args: infer Args) => infer Ret
|
|
40
|
+
? (...args: Args) => Ret
|
|
41
|
+
: WithInjection & {
|
|
42
|
+
specialize: (specialization: S) => WithoutInjection;
|
|
43
|
+
};
|
|
44
|
+
|
|
20
45
|
export type GetModelFromSchema<DMap extends DimensionToSchemaMap, Dim> =
|
|
21
46
|
AdvancedRecordLookup<DMap['byDimension'], Dim> extends never
|
|
22
47
|
? z.infer<DMap['base']>
|
|
@@ -37,6 +62,7 @@ type GetImplFunctionWithConditionalOptionalDim<Dim, Return> = {} extends Dim
|
|
|
37
62
|
|
|
38
63
|
type GetImplOverloads<
|
|
39
64
|
Dim extends z.ZodObject<any>,
|
|
65
|
+
Specialization extends FactorySpecialization<DMap>,
|
|
40
66
|
DMap extends DimensionToSchemaMap<z.infer<Dim>>,
|
|
41
67
|
> = UnionToIntersection<
|
|
42
68
|
| {
|
|
@@ -44,25 +70,46 @@ type GetImplOverloads<
|
|
|
44
70
|
? {
|
|
45
71
|
getImpl: GetImplFunctionWithConditionalOptionalDim<
|
|
46
72
|
K,
|
|
47
|
-
|
|
73
|
+
WithSpecializeMethod<
|
|
74
|
+
WithInjectedSpecialization<GetModelFromSchema<DMap, K>, Specialization>,
|
|
75
|
+
GetModelFromSchema<DMap, K>,
|
|
76
|
+
z.infer<Specialization['spec']>
|
|
77
|
+
>
|
|
48
78
|
>;
|
|
49
79
|
}
|
|
50
80
|
: never;
|
|
51
81
|
}[keyof DMap['byDimension']]
|
|
52
|
-
| {
|
|
82
|
+
| {
|
|
83
|
+
getImpl: GetImplFunctionWithConditionalOptionalDim<
|
|
84
|
+
z.infer<Dim>,
|
|
85
|
+
WithSpecializeMethod<
|
|
86
|
+
WithInjectedSpecialization<z.infer<DMap['base']>, Specialization>,
|
|
87
|
+
z.infer<DMap['base']>,
|
|
88
|
+
z.infer<Specialization['spec']>
|
|
89
|
+
>
|
|
90
|
+
>;
|
|
91
|
+
}
|
|
53
92
|
>;
|
|
54
93
|
|
|
55
94
|
export type Factory<
|
|
56
95
|
_Dependencies extends Dependencies,
|
|
57
96
|
Dim extends z.ZodObject<any>,
|
|
97
|
+
Specialization extends FactorySpecialization<DMap>,
|
|
58
98
|
DMap extends DimensionToSchemaMap<z.infer<Dim>>,
|
|
59
|
-
> = {
|
|
99
|
+
> = {
|
|
100
|
+
name: string;
|
|
101
|
+
implKeys: string[];
|
|
102
|
+
dimensionToSchemaMap: DMap;
|
|
103
|
+
} & GetImplOverloads<Dim, Specialization, DMap>;
|
|
60
104
|
|
|
61
105
|
export type GetFactory<
|
|
62
106
|
_Dependencies extends Dependencies,
|
|
63
107
|
Dim extends z.ZodObject<any>,
|
|
108
|
+
Specialization extends FactorySpecialization<DMap>,
|
|
64
109
|
DMap extends DimensionToSchemaMap<z.infer<Dim>>,
|
|
65
|
-
> = () =>
|
|
110
|
+
> = () =>
|
|
111
|
+
| Factory<_Dependencies, Dim, Specialization, DMap>
|
|
112
|
+
| Promise<Factory<_Dependencies, Dim, Specialization, DMap>>;
|
|
66
113
|
|
|
67
114
|
/**
|
|
68
115
|
* Factory definitions are a type of dependency node that shall be resolved to a *factory*.
|
|
@@ -80,24 +127,29 @@ export type GetFactory<
|
|
|
80
127
|
export class FactoryDefinition<
|
|
81
128
|
Name extends string,
|
|
82
129
|
Dim extends z.ZodObject<any>,
|
|
130
|
+
const Specialization extends FactorySpecialization<DMap>,
|
|
83
131
|
DMap extends DimensionToSchemaMap<z.infer<Dim>>,
|
|
84
132
|
_Dependencies extends Dependencies,
|
|
85
133
|
> extends DependencyNode<Name, _Dependencies> {
|
|
86
134
|
public readonly dimensions: Dim;
|
|
135
|
+
public readonly specialization: Specialization;
|
|
87
136
|
public readonly dimensionToSchemaMap: DMap;
|
|
88
|
-
public readonly getFactory: GetFactory<_Dependencies, Dim, DMap>;
|
|
137
|
+
public readonly getFactory: GetFactory<_Dependencies, Dim, Specialization, DMap>;
|
|
89
138
|
constructor({
|
|
90
139
|
dimensions,
|
|
140
|
+
specialization,
|
|
91
141
|
dimensionToSchemaMap,
|
|
92
142
|
getFactory,
|
|
93
143
|
...args
|
|
94
144
|
}: {
|
|
95
145
|
dimensions: Dim;
|
|
146
|
+
specialization: Specialization;
|
|
96
147
|
dimensionToSchemaMap: DMap;
|
|
97
|
-
getFactory: GetFactory<_Dependencies, Dim, DMap>;
|
|
148
|
+
getFactory: GetFactory<_Dependencies, Dim, Specialization, DMap>;
|
|
98
149
|
} & ConstructorParameters<typeof DependencyNode<Name, _Dependencies>>[0]) {
|
|
99
150
|
super(args);
|
|
100
151
|
this.dimensions = dimensions;
|
|
152
|
+
this.specialization = specialization;
|
|
101
153
|
this.dimensionToSchemaMap = dimensionToSchemaMap;
|
|
102
154
|
this.getFactory = getFactory;
|
|
103
155
|
}
|
|
@@ -132,7 +184,7 @@ export abstract class ObjectDefinition<
|
|
|
132
184
|
}
|
|
133
185
|
|
|
134
186
|
export type Definition<Name extends string> =
|
|
135
|
-
| FactoryDefinition<Name, any, any, any>
|
|
187
|
+
| FactoryDefinition<Name, any, any, any, any>
|
|
136
188
|
| ObjectDefinition<Name, any, any>;
|
|
137
189
|
|
|
138
190
|
/**
|
|
@@ -141,12 +193,19 @@ export type Definition<Name extends string> =
|
|
|
141
193
|
export type ResolvedDefinition<Definition extends DependencyNode<any, any>> =
|
|
142
194
|
Definition extends ObjectDefinition<any, infer Schema, any>
|
|
143
195
|
? z.infer<Schema>
|
|
144
|
-
: Definition extends FactoryDefinition<
|
|
145
|
-
|
|
146
|
-
|
|
196
|
+
: Definition extends FactoryDefinition<
|
|
197
|
+
any,
|
|
198
|
+
infer Dim,
|
|
199
|
+
infer Specialization,
|
|
200
|
+
infer DMap,
|
|
201
|
+
any
|
|
202
|
+
>
|
|
203
|
+
? Factory<Definition['dependencies'], Dim, Specialization, DMap>
|
|
204
|
+
: Definition extends FactoryDefinition<any, any, any, any, any>
|
|
147
205
|
? Factory<
|
|
148
206
|
Definition['dependencies'],
|
|
149
207
|
Definition['dimensions'],
|
|
208
|
+
Definition['specialization'],
|
|
150
209
|
Definition['dimensionToSchemaMap']
|
|
151
210
|
>
|
|
152
211
|
: unknown;
|
|
@@ -163,8 +222,15 @@ export type ResolvedDefinitionMap<Deps extends Dependencies> = {
|
|
|
163
222
|
* ResolvedDefinition<F>.getImpl(D)
|
|
164
223
|
*/
|
|
165
224
|
export type ResolvedFactoryImplementation<Definition extends DependencyNode<any, any>, Dim> =
|
|
166
|
-
Definition extends FactoryDefinition<any, any, any, any>
|
|
167
|
-
?
|
|
225
|
+
Definition extends FactoryDefinition<any, any, any, any, any>
|
|
226
|
+
? WithSpecializeMethod<
|
|
227
|
+
WithInjectedSpecialization<
|
|
228
|
+
GetModelFromSchema<Definition['dimensionToSchemaMap'], Dim>,
|
|
229
|
+
Definition['specialization']
|
|
230
|
+
>,
|
|
231
|
+
GetModelFromSchema<Definition['dimensionToSchemaMap'], Dim>,
|
|
232
|
+
z.infer<Definition['specialization']['spec']>
|
|
233
|
+
>
|
|
168
234
|
: never;
|
|
169
235
|
|
|
170
236
|
/**
|
|
@@ -175,28 +241,31 @@ export type ResolvedFactoryImplementationMap<Deps extends Dependencies, Dim> = R
|
|
|
175
241
|
}>;
|
|
176
242
|
|
|
177
243
|
type ActivityFactoryContext<
|
|
178
|
-
_FactoryDefinition extends FactoryDefinition<any, any, any, any>,
|
|
244
|
+
_FactoryDefinition extends FactoryDefinition<any, any, any, any, any>,
|
|
179
245
|
Dim,
|
|
180
246
|
> = {
|
|
181
|
-
getFunctionPointer:
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
247
|
+
getFunctionPointer: <
|
|
248
|
+
MethodName extends MethodNameOf<ResolvedFactoryImplementation<_FactoryDefinition, Dim>>,
|
|
249
|
+
>(
|
|
250
|
+
methodName: MethodName,
|
|
251
|
+
) => FunctionPointer<ResolvedFactoryImplementation<_FactoryDefinition, Dim>[MethodName]>;
|
|
186
252
|
};
|
|
187
253
|
|
|
188
254
|
/**
|
|
189
255
|
* The parameters that shall be received by a factory's implementation getter
|
|
190
256
|
*/
|
|
191
|
-
export type Context<_FactoryDefinition extends FactoryDefinition<any, any, any, any>, Dim> = {
|
|
192
|
-
name: _FactoryDefinition extends FactoryDefinition<infer Name, any, any, any>
|
|
193
|
-
|
|
257
|
+
export type Context<_FactoryDefinition extends FactoryDefinition<any, any, any, any, any>, Dim> = {
|
|
258
|
+
name: _FactoryDefinition extends FactoryDefinition<infer Name, any, any, any, any>
|
|
259
|
+
? Name
|
|
260
|
+
: never;
|
|
261
|
+
dependencies: _FactoryDefinition extends FactoryDefinition<any, any, any, any, infer Deps>
|
|
194
262
|
? ResolvedDefinitionMap<Deps>
|
|
195
263
|
: never;
|
|
196
264
|
dim: Dim;
|
|
197
|
-
impls: _FactoryDefinition extends FactoryDefinition<any, any, any, infer Deps>
|
|
265
|
+
impls: _FactoryDefinition extends FactoryDefinition<any, any, any, any, infer Deps>
|
|
198
266
|
? ResolvedFactoryImplementationMap<Deps, Dim>
|
|
199
267
|
: never;
|
|
268
|
+
self: ResolvedFactoryImplementation<_FactoryDefinition, Dim>;
|
|
200
269
|
} & ActivityFactoryContext<_FactoryDefinition, Dim>;
|
|
201
270
|
|
|
202
271
|
export const serializeDimensions = (dim: object = {}) => {
|
package/src/utils.ts
CHANGED
|
@@ -6,18 +6,18 @@ import type { Factory } from './definitions';
|
|
|
6
6
|
import { type FactoryDefinition, serializeDimensions } from './definitions';
|
|
7
7
|
|
|
8
8
|
export const extractSchemaFromFactory = <Dim extends z.ZodObject>(
|
|
9
|
-
|
|
9
|
+
factory: FactoryDefinition<any, Dim, any, any, any> | Factory<any, any, any, any>,
|
|
10
10
|
dimension: z.infer<Dim>,
|
|
11
11
|
): z.ZodObject => {
|
|
12
12
|
const schema =
|
|
13
|
-
(
|
|
14
|
-
Object.values(
|
|
15
|
-
|
|
16
|
-
)
|
|
17
|
-
|
|
13
|
+
(factory.dimensionToSchemaMap.byDimension &&
|
|
14
|
+
Object.values(factory.dimensionToSchemaMap.byDimension as AdvancedRecord).find(
|
|
15
|
+
([dim]) => serializeDimensions(dim) === serializeDimensions(dimension),
|
|
16
|
+
)?.[1]) ??
|
|
17
|
+
factory.dimensionToSchemaMap.base;
|
|
18
18
|
if (!schema?.shape) {
|
|
19
19
|
throw new Error(
|
|
20
|
-
`Couldn't resolve the schema of factory ${
|
|
20
|
+
`Couldn't resolve the schema of factory ${factory.name} for dim ${JSON.stringify(dimension)}`,
|
|
21
21
|
);
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"fileNames":["../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es5.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2016.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2018.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2019.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2021.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2022.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.decorators.d.ts","../../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/core/standard-schema.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/core/util.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/core/versions.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/core/schemas.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/core/checks.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/core/errors.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/core/core.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/core/parse.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/core/regexes.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/ar.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/az.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/be.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/ca.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/cs.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/de.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/en.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/es.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/fa.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/fi.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/fr.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/fr-CA.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/he.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/hu.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/id.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/it.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/ja.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/kh.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/ko.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/mk.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/ms.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/nl.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/no.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/ota.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/pl.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/pt.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/ru.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/sl.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/sv.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/ta.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/th.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/tr.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/ua.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/ur.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/vi.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/zh-CN.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/zh-TW.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/locales/index.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/core/registries.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/core/doc.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/core/function.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/core/api.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/core/json-schema.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/core/to-json-schema.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/core/index.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/v4/core/index.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/classic/errors.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/classic/parse.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/classic/schemas.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/classic/checks.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/classic/compat.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/classic/iso.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/classic/coerce.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/classic/external.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/classic/index.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/types/v4/index.d.ts","../../../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/v4/index.d.ts","../../../common/common-utils/dist/bigint.d.ts","../../../common/common-utils/dist/concurrency.d.ts","../../../common/common-utils/dist/dedup.d.ts","../../../common/common-utils/dist/distPath.d.ts","../../../typescript-utils/dist/advancedRecord.d.ts","../../../typescript-utils/dist/branded.d.ts","../../../typescript-utils/dist/constructor.d.ts","../../../typescript-utils/dist/deep.d.ts","../../../typescript-utils/dist/disallowedAny.d.ts","../../../typescript-utils/dist/identity.d.ts","../../../typescript-utils/dist/lastOf.d.ts","../../../typescript-utils/dist/viem.d.ts","../../../typescript-utils/dist/merge.d.ts","../../../typescript-utils/dist/methodOf.d.ts","../../../typescript-utils/dist/removeNever.d.ts","../../../typescript-utils/dist/strings.d.ts","../../../typescript-utils/dist/tuples.d.ts","../../../typescript-utils/dist/valueOf.d.ts","../../../typescript-utils/dist/withRequired.d.ts","../../../typescript-utils/dist/index.d.ts","../../../common/common-utils/dist/encoding.d.ts","../../../common/common-utils/dist/envGetters.d.ts","../../../common/common-utils/dist/error.d.ts","../../../common/common-utils/dist/eta.d.ts","../../../common/common-utils/dist/objects.d.ts","../../../common/common-utils/dist/pointer.d.ts","../../../common/common-utils/dist/promiseAllObj.d.ts","../../../../node_modules/.pnpm/@types+ms@2.1.0/node_modules/@types/ms/index.d.ts","../../../common/common-utils/dist/retry.d.ts","../../../common/common-utils/dist/streamToString.d.ts","../../../common/common-utils/dist/throwError.d.ts","../../../common/common-utils/dist/timeout.d.ts","../../../common/common-utils/dist/index.d.ts","../../dependency-graph/dist/dependencyNode.d.ts","../../dependency-graph/dist/index.d.ts","./src/definitions.ts","./src/lzyringe.ts","../../dfs/dist/index.d.ts","./src/registrarBuilder.ts","./src/utils.ts","./src/index.ts","../../../../node_modules/.pnpm/@types+estree@1.0.8/node_modules/@types/estree/index.d.ts","../../../../node_modules/.pnpm/@types+json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts","../../../../node_modules/.pnpm/@types+eslint@9.6.1/node_modules/@types/eslint/use-at-your-own-risk.d.ts","../../../../node_modules/.pnpm/@types+eslint@9.6.1/node_modules/@types/eslint/index.d.ts","../../../../node_modules/.pnpm/@types+eslint-scope@3.7.7/node_modules/@types/eslint-scope/index.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/compatibility/disposable.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/compatibility/indexable.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/compatibility/iterators.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/compatibility/index.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/globals.typedarray.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/buffer.buffer.d.ts","../../../../node_modules/.pnpm/buffer@6.0.3/node_modules/buffer/index.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/header.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/readable.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/file.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/fetch.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/formdata.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/connector.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/client.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/errors.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/dispatcher.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/global-dispatcher.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/global-origin.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/pool-stats.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/pool.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/handlers.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/balanced-pool.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/agent.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/mock-interceptor.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/mock-agent.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/mock-client.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/mock-pool.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/mock-errors.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/proxy-agent.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/env-http-proxy-agent.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/retry-handler.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/retry-agent.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/api.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/interceptors.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/util.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/cookies.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/patch.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/websocket.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/eventsource.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/filereader.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/diagnostics-channel.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/content-type.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/cache.d.ts","../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/index.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/globals.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/assert.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/assert/strict.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/async_hooks.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/buffer.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/child_process.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/cluster.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/console.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/constants.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/crypto.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/dgram.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/diagnostics_channel.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/dns.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/dns/promises.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/domain.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/dom-events.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/events.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/fs.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/fs/promises.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/http.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/http2.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/https.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/inspector.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/module.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/net.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/os.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/path.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/perf_hooks.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/process.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/punycode.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/querystring.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/readline.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/readline/promises.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/repl.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/sea.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/sqlite.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/stream.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/stream/promises.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/stream/consumers.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/stream/web.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/string_decoder.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/test.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/timers.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/timers/promises.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/tls.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/trace_events.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/tty.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/url.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/util.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/v8.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/vm.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/wasi.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/worker_threads.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/zlib.d.ts","../../../../node_modules/.pnpm/@types+node@22.13.14/node_modules/@types/node/index.d.ts"],"fileIdsList":[[165,168,175,218],[165,166,167,175,218],[168,175,218],[175,218],[175,215,218],[175,217,218],[218],[175,218,223,253],[175,218,219,224,230,231,238,250,261],[175,218,219,220,230,238],[170,171,172,175,218],[175,218,221,262],[175,218,222,223,231,239],[175,218,223,250,258],[175,218,224,226,230,238],[175,217,218,225],[175,218,226,227],[175,218,230],[175,218,228,230],[175,217,218,230],[175,218,230,231,232,250,261],[175,218,230,231,232,245,250,253],[175,213,218,266],[175,213,218,226,230,233,238,250,261],[175,218,230,231,233,234,238,250,258,261],[175,218,233,235,250,258,261],[173,174,175,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267],[175,218,230,236],[175,218,237,261],[175,218,226,230,238,250],[175,218,239],[175,218,240],[175,217,218,241],[175,215,216,217,218,219,220,221,222,223,224,225,226,227,228,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267],[175,218,243],[175,218,244],[175,218,230,245,246],[175,218,245,247,262,264],[175,218,230,250,251,253],[175,218,252,253],[175,218,250,251],[175,218,253],[175,218,254],[175,215,218,250],[175,218,230,256,257],[175,218,256,257],[175,218,223,238,250,258],[175,218,259],[175,218,238,260],[175,218,233,244,261],[175,218,223,262],[175,218,250,263],[175,218,237,264],[175,218,265],[175,218,223,230,232,241,250,261,264,266],[175,218,250,267],[175,185,189,218,261],[175,185,218,250,261],[175,180,218],[175,182,185,218,258,261],[175,218,238,258],[175,218,268],[175,180,218,268],[175,182,185,218,238,261],[175,177,178,181,184,218,230,250,261],[175,185,192,218],[175,177,183,218],[175,185,206,207,218],[175,181,185,218,253,261,268],[175,206,218,268],[175,179,180,218,268],[175,185,218],[175,179,180,181,182,183,184,185,186,187,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,207,208,209,210,211,212,218],[175,185,200,218],[175,185,192,193,218],[175,183,185,193,194,218],[175,184,218],[175,177,180,185,218],[175,185,189,193,194,218],[175,189,218],[175,183,185,188,218,261],[175,177,182,185,192,218],[175,218,250],[175,180,185,206,218,266,268],[112,175,218],[112,115,175,218],[104,112,113,114,115,116,117,118,119,175,218],[120,175,218],[112,113,175,218],[112,114,175,218],[59,61,62,63,64,175,218],[59,61,63,64,175,218],[59,61,63,175,218],[59,61,62,64,175,218],[59,61,64,175,218],[59,60,61,62,63,64,65,66,104,105,106,107,108,109,110,175,218],[61,64,175,218],[58,59,60,62,63,64,175,218],[61,105,109,175,218],[61,62,63,64,175,218],[121,175,218],[63,175,218],[67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,175,218],[111,175,218],[122,175,218],[143,175,218],[124,125,126,127,144,145,146,147,148,149,150,152,153,154,155,175,218],[151,175,218],[123,143,156,158,175,218],[159,160,162,163,175,218],[158,161,175,218],[123,143,159,175,218],[157,175,218],[158,175,218],[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,175,218],[135,175,218],[129,175,218]],"fileInfos":[{"version":"69684132aeb9b5642cbcd9e22dff7818ff0ee1aa831728af0ecf97d3364d5546","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"b5ce7a470bc3628408429040c4e3a53a27755022a32fd05e2cb694e7015386c7","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"309ebd217636d68cf8784cbc3272c16fb94fb8e969e18b6fe88c35200340aef1","impliedFormat":1},{"version":"f6ce19b569f9b61fee554cf9defbcc46c1cb23127eeac01dec4db1cf76fc9d0a","impliedFormat":1},{"version":"ef9b6279acc69002a779d0172916ef22e8be5de2d2469ff2f4bb019a21e89de2","impliedFormat":1},{"version":"a83c5493df0e3bc4cb511b5fd47261b9d1ef0cda8671c384fcea47b8b8e3c1b8","affectsGlobalScope":true,"impliedFormat":1},{"version":"2b060d4870c5310da5674b70508f943f8fb0bb899397161d6745ebdff9e803ec","impliedFormat":1},{"version":"6c859096094c744d2dd7b733189293a5b2af535e15f7794e69a3b4288b70dcfc","impliedFormat":1},{"version":"915d51e1bcd9b06ab8c922360b3f74ffe70c2ab6264f759f2b3e5f4130df0149","impliedFormat":1},{"version":"716a022c6d311c8367d830d2839fe017699564de2d0f5446b4a6f3f022a5c0c6","impliedFormat":1},{"version":"c939cb12cb000b4ec9c3eca3fe7dee1fe373ccb801237631d9252bad10206d61","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"3b25e966fd93475d8ca2834194ea78321d741a21ca9d1f606b25ec99c1bbc29a","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"3b25e966fd93475d8ca2834194ea78321d741a21ca9d1f606b25ec99c1bbc29a","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"7ceb8bc679a90951354f89379bc37228e7cf87b753069cd7b62310d5cbbe1f11","impliedFormat":1},{"version":"e125ee5bd9c921ed2e27a13e89532c4c44ecad11711018916163f0e708faaf89","impliedFormat":1},{"version":"932dfc48e5dc36c289aeb7730324024202b27998c99cff293684495a490d7b94","impliedFormat":1},{"version":"80e653fbbec818eecfe95d182dc65a1d107b343d970159a71922ac4491caa0af","impliedFormat":1},{"version":"f978b1b63ad690ff2a8f16d6f784acaa0ba0f4bcfc64211d79a2704de34f5913","impliedFormat":1},{"version":"444bcf0bbbae1972a74458b8be75c7bc612c69226823cc0ef50297e6eea40896","impliedFormat":1},{"version":"02e75aceef20d8bfc6c625015a7c23a8a8ca3412bba55599f143057251b331a7","impliedFormat":1},{"version":"9048a2528d014161273178ece75386066d048ba4a56d9b7b4e8052ce4e3adb48","impliedFormat":1},{"version":"f5c8f2ef9603893e25ed86c7112cd2cc60d53e5387b9146c904bce3e707c55de","impliedFormat":1},{"version":"db3ea1212b188ff23aa4f32b63e459c9b55d34b44b57bcbdf401f291352483f0","impliedFormat":99},{"version":"dc01facbb7d88bc5e2eabb7c6eee80a0241538d50a5c3b210fb745683faa1dab","impliedFormat":1},{"version":"5c5197a46686814821229b28e4cfd601ef0a32f2d2d29b9a99050bac0ab03c99","impliedFormat":1},{"version":"73233f43c14afdb9ef5af3e46ab85a63ad8a9fe42bc3515ecacc3c79fd03f81c","impliedFormat":1},{"version":"2c6c3af3957e38e6a5190258a666a06893ba5a11e3501585243129afecefd037","impliedFormat":1},{"version":"13e5ea921d6f62171aab19f33a6690e3c6658eecd2e5672425e49ac30d4305e6","impliedFormat":1},{"version":"1e28020a23b28743d5bd708b9e4c7b75fdff606aa080fbaf5b8db3600d5c99cf","impliedFormat":1},{"version":"49e7f03e7e7288397725e823654fdfe61892bb5082f391057e61b9c4f1b54f16","impliedFormat":1},{"version":"b91f4919c0972651793b78baf5a06fa9a7a412d22af20122e011d0ec21506c41","impliedFormat":1},{"version":"d49030b9a324bab9bcf9f663a70298391b0f5a25328409174d86617512bf3037","impliedFormat":1},{"version":"a4b634bb8c97cc700dbf165f3bb0095ec669042da72eaf28a7c5e2ddd98169ce","impliedFormat":1},{"version":"a7578eb8461c2d07440749f89aba22881d5fca09a1d1cd46974628869fbadfa1","impliedFormat":99},"31efb808d93722336e66d37b845de30e59612dbd101e51143edbe924e9db7b70","b4a6e6399c09b326264d8a814bad155965c7e1997a09f6f479557d3ecdb2ded4","df4e0ab3a70d92f52963b1458761999337a642fef4aa9fc533bc24566eb789c3","2b3a5a45c91b2dc164a0ce06bbfc873b9da53aa165181c325fb689a465d7abad","984b13152fc368ee3b17e71baf97226dcc81b76891eedf4c0a64ca41064c258a","213925780d25d079f6798d59e75b05db7aa150a7f63270222b2b01d04ba84d45","414a88187af3315cb0e64e1e59f63a97c9590693a855c3ab07cc156fbeb49829","445a41455015aad3463a5fe3ddcf3ac8beba15d847ef236ed613aaf54ed53e86","de536c451d19649603e4447fbbcc9108a9fd34b0e0915c233ad5bcbd8f9518bd","7ecabfd526013bb2e1302070d40b206d6e26af16c3d1530616e4b55a2da3ced4","60d4678c4a03b999e1717499d9f2012326e8dff489f746e2469fc8e17ba6bdb6","ed7834b84212af1df8d8c2e047c9e1fce050e915e9f7d0d2f45e3049b52a3670","1386393623ad07ebdbd80a230a963e11f2dd426cb79f240ab7acd2308e47dbd9","e345beb53e318c5582d3cb3754df68e8fd927988bfd89bfa35737c95007d158d","0d86f6720fb165aa2abc7992cbb1355c7405596c2497c99d8201937a914deed9","c5899bdbe858591d3e925e87d8fa5ddada70f2171b110f15d552a86b5522ed79","7995102b7cd054735f26338dfb152826fe3215045cc211537607dea9f7854b73","ae6d51ed49adf4ea0614131bf1f2d768b5cb14538efcaf014c51fe722870a19b","d9cb380b3cdae8fc139273e0deb5060abde2e96aabc10e01b40ff81b41e711e3","756b1420052f597d9844248cf84263f1232aaab0539deb75d5154bcd70a85a8b","20bc934987449ec11ee1b58406ba8b2fa8a6079ba70394bf176df0b72b94cd0b","621fe32f04ccaa1a9f82787daa628a113b5d7d91b547470650961f8f007e2d05","4332ef5ef953c7c20b8124997ddc2ae39ae281c89e0ca02d8d484ca5af47414b","10e7f69d2dbfe0a02f4f5e49a282dda514591fed8887be6b92366b0f1d9b27fb","92dcb39936e81e97c61aeb7673d115c583db34409f25ac0f3d41282a749c64ca","c93d333b12bf4912e4c3dff7b91800155e621762757ac96fade0dd0c354772f1","dc7d19ca7fa238ea83807bc8b150733d3b7151da07a1860826ba13d958173e08",{"version":"fb893a0dfc3c9fb0f9ca93d0648694dd95f33cbad2c0f2c629f842981dfd4e2e","impliedFormat":1},"333324a8002e5d10350726a30b949306213b5cee07d29bdc4404720ffc8bfaf5","02d2123c3737bc018b226a9c2578b80cf5a2cf00105b47a4d53eb7820f9ceba2","c80fb853c59b0c90605bccd856f1ec83460553ced1fd25b79e561a106758dd2f","35c474f35c807913dcc5b6517beb19244a492afa0b37248c7ac9742a91fd277d","579d6fc6cc46187a32226e7fed0b14e4debfc4b501435548dc1766d18de4b70a","88aa5dfa843204cab8a31277867e171a519ed3aa4fdadc446e10ad00f48b4775","e36a4053c2f5591d14e21f362f84ebdb27b48256f399433f41b0b19a23d8d3be",{"version":"dd02bb34219b81340185ec3654992a6d7860ea84e63840da0abd681e3ed38ea5","signature":"e394c39f5e2f10bb7474f99b5c1c76af6e281b452085ad0bab8feca35eacad85"},{"version":"ab230dd5aa098f4284293fc8d627db9e4bcc7c9bb9f8ab0cce827936522761b9","signature":"f2146f71303a7669c45b45cac6f07906d407da381fa91413254cecf25bd36347"},"64e5e971dd504b2f222844345f837bed4da8317a60c4bfeb54487edc7bee0902",{"version":"6cc8ddd4758bd491fa1eb62384269471edfaef354389735e2cf2f7334fdaf830","signature":"5c6cb4b085636cf5ad95f3949ead9e2bbe7456d8358474a73bb53ccd4d79dc4d"},{"version":"e9bc7bbc3fc6fdbcb2f2dfed842b64fa6ebc5b194a2639c5f8601d5426657fa2","signature":"25e67b81a9848e3cbb5936662b6d56d1ae4627ff6b1d83343d94f37ad6a62634"},"9ed1002cdc8c4ca77ee2abaef014cdaba1de96a6898d4d0258d749706e31a1f8",{"version":"151ff381ef9ff8da2da9b9663ebf657eac35c4c9a19183420c05728f31a6761d","impliedFormat":1},{"version":"f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","impliedFormat":1},{"version":"a4a39b5714adfcadd3bbea6698ca2e942606d833bde62ad5fb6ec55f5e438ff8","impliedFormat":1},{"version":"bbc1d029093135d7d9bfa4b38cbf8761db505026cc458b5e9c8b74f4000e5e75","impliedFormat":1},{"version":"1f68ab0e055994eb337b67aa87d2a15e0200951e9664959b3866ee6f6b11a0fe","impliedFormat":1},{"version":"70521b6ab0dcba37539e5303104f29b721bfb2940b2776da4cc818c07e1fefc1","affectsGlobalScope":true,"impliedFormat":1},{"version":"030e350db2525514580ed054f712ffb22d273e6bc7eddc1bb7eda1e0ba5d395e","affectsGlobalScope":true,"impliedFormat":1},{"version":"d153a11543fd884b596587ccd97aebbeed950b26933ee000f94009f1ab142848","affectsGlobalScope":true,"impliedFormat":1},{"version":"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a","impliedFormat":1},{"version":"a79e62f1e20467e11a904399b8b18b18c0c6eea6b50c1168bf215356d5bebfaf","affectsGlobalScope":true,"impliedFormat":1},{"version":"8fa51737611c21ba3a5ac02c4e1535741d58bec67c9bdf94b1837a31c97a2263","affectsGlobalScope":true,"impliedFormat":1},{"version":"4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"24bd580b5743dc56402c440dc7f9a4f5d592ad7a419f25414d37a7bfe11e342b","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"6bdc71028db658243775263e93a7db2fd2abfce3ca569c3cca5aee6ed5eb186d","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"e61be3f894b41b7baa1fbd6a66893f2579bfad01d208b4ff61daef21493ef0a8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"615ba88d0128ed16bf83ef8ccbb6aff05c3ee2db1cc0f89ab50a4939bfc1943f","impliedFormat":1},{"version":"a4d551dbf8746780194d550c88f26cf937caf8d56f102969a110cfaed4b06656","impliedFormat":1},{"version":"8bd86b8e8f6a6aa6c49b71e14c4ffe1211a0e97c80f08d2c8cc98838006e4b88","impliedFormat":1},{"version":"317e63deeb21ac07f3992f5b50cdca8338f10acd4fbb7257ebf56735bf52ab00","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"d2bc987ae352271d0d615a420dcf98cc886aa16b87fb2b569358c1fe0ca0773d","affectsGlobalScope":true,"impliedFormat":1},{"version":"4f0539c58717cbc8b73acb29f9e992ab5ff20adba5f9b57130691c7f9b186a4d","impliedFormat":1},{"version":"7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","impliedFormat":1},{"version":"76103716ba397bbb61f9fa9c9090dca59f39f9047cb1352b2179c5d8e7f4e8d0","impliedFormat":1},{"version":"f9677e434b7a3b14f0a9367f9dfa1227dfe3ee661792d0085523c3191ae6a1a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"4314c7a11517e221f7296b46547dbc4df047115b182f544d072bdccffa57fc72","impliedFormat":1},{"version":"115971d64632ea4742b5b115fb64ed04bcaae2c3c342f13d9ba7e3f9ee39c4e7","impliedFormat":1},{"version":"c2510f124c0293ab80b1777c44d80f812b75612f297b9857406468c0f4dafe29","affectsGlobalScope":true,"impliedFormat":1},{"version":"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a","impliedFormat":1},{"version":"9057f224b79846e3a95baf6dad2c8103278de2b0c5eebda23fc8188171ad2398","affectsGlobalScope":true,"impliedFormat":1},{"version":"19d5f8d3930e9f99aa2c36258bf95abbe5adf7e889e6181872d1cdba7c9a7dd5","impliedFormat":1},{"version":"e6f5a38687bebe43a4cef426b69d34373ef68be9a6b1538ec0a371e69f309354","impliedFormat":1},{"version":"a6bf63d17324010ca1fbf0389cab83f93389bb0b9a01dc8a346d092f65b3605f","impliedFormat":1},{"version":"e009777bef4b023a999b2e5b9a136ff2cde37dc3f77c744a02840f05b18be8ff","impliedFormat":1},{"version":"1e0d1f8b0adfa0b0330e028c7941b5a98c08b600efe7f14d2d2a00854fb2f393","impliedFormat":1},{"version":"ee1ee365d88c4c6c0c0a5a5701d66ebc27ccd0bcfcfaa482c6e2e7fe7b98edf7","affectsGlobalScope":true,"impliedFormat":1},{"version":"88bc59b32d0d5b4e5d9632ac38edea23454057e643684c3c0b94511296f2998c","affectsGlobalScope":true,"impliedFormat":1},{"version":"8fb11e675f5cc648bc6c344e1311e36b8dfffea8bffe575bedc0e41af77eca99","impliedFormat":1},{"version":"1e289f30a48126935a5d408a91129a13a59c9b0f8c007a816f9f16ef821e144e","impliedFormat":1},{"version":"f96a023e442f02cf551b4cfe435805ccb0a7e13c81619d4da61ec835d03fe512","impliedFormat":1},{"version":"5135bdd72cc05a8192bd2e92f0914d7fc43ee077d1293dc622a049b7035a0afb","impliedFormat":1},{"version":"4f80de3a11c0d2f1329a72e92c7416b2f7eab14f67e92cac63bb4e8d01c6edc8","impliedFormat":1},{"version":"6d386bc0d7f3afa1d401afc3e00ed6b09205a354a9795196caed937494a713e6","impliedFormat":1},{"version":"f579f267a2f4c2278cca2ec84613e95059368b503ce96586972d304e5e40125b","affectsGlobalScope":true,"impliedFormat":1},{"version":"23459c1915878a7c1e86e8bdb9c187cddd3aea105b8b1dfce512f093c969bc7e","impliedFormat":1},{"version":"b1b6ee0d012aeebe11d776a155d8979730440082797695fc8e2a5c326285678f","impliedFormat":1},{"version":"45875bcae57270aeb3ebc73a5e3fb4c7b9d91d6b045f107c1d8513c28ece71c0","impliedFormat":1},{"version":"1dc73f8854e5c4506131c4d95b3a6c24d0c80336d3758e95110f4c7b5cb16397","affectsGlobalScope":true,"impliedFormat":1},{"version":"5f6f1d54779d0b9ed152b0516b0958cd34889764c1190434bbf18e7a8bb884cd","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f16a7e4deafa527ed9995a772bb380eb7d3c2c0fd4ae178c5263ed18394db2c","impliedFormat":1},{"version":"c6b4e0a02545304935ecbf7de7a8e056a31bb50939b5b321c9d50a405b5a0bba","impliedFormat":1},{"version":"fab29e6d649aa074a6b91e3bdf2bff484934a46067f6ee97a30fcd9762ae2213","impliedFormat":1},{"version":"8145e07aad6da5f23f2fcd8c8e4c5c13fb26ee986a79d03b0829b8fce152d8b2","impliedFormat":1},{"version":"e1120271ebbc9952fdc7b2dd3e145560e52e06956345e6fdf91d70ca4886464f","impliedFormat":1},{"version":"814118df420c4e38fe5ae1b9a3bafb6e9c2aa40838e528cde908381867be6466","impliedFormat":1},{"version":"f7b1df115dbd1b8522cba4f404a9f4fdcd5169e2137129187ffeee9d287e4fd1","impliedFormat":1},{"version":"c878f74b6d10b267f6075c51ac1d8becd15b4aa6a58f79c0cfe3b24908357f60","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"125d792ec6c0c0f657d758055c494301cc5fdb327d9d9d5960b3f129aff76093","impliedFormat":1},{"version":"fbf68fc8057932b1c30107ebc37420f8d8dc4bef1253c4c2f9e141886c0df5ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2754d8221d77c7b382096651925eb476f1066b3348da4b73fe71ced7801edada","impliedFormat":1},{"version":"993985beef40c7d113f6dd8f0ba26eed63028b691fbfeb6a5b63f26408dd2c6d","affectsGlobalScope":true,"impliedFormat":1},{"version":"bef91efa0baea5d0e0f0f27b574a8bc100ce62a6d7e70220a0d58af6acab5e89","affectsGlobalScope":true,"impliedFormat":1},{"version":"282fd2a1268a25345b830497b4b7bf5037a5e04f6a9c44c840cb605e19fea841","impliedFormat":1},{"version":"5360a27d3ebca11b224d7d3e38e3e2c63f8290cb1fcf6c3610401898f8e68bc3","impliedFormat":1},{"version":"66ba1b2c3e3a3644a1011cd530fb444a96b1b2dfe2f5e837a002d41a1a799e60","impliedFormat":1},{"version":"7e514f5b852fdbc166b539fdd1f4e9114f29911592a5eb10a94bb3a13ccac3c4","impliedFormat":1},{"version":"7d6ff413e198d25639f9f01f16673e7df4e4bd2875a42455afd4ecc02ef156da","affectsGlobalScope":true,"impliedFormat":1},{"version":"cb094bb347d7df3380299eb69836c2c8758626ecf45917577707c03cf816b6f4","affectsGlobalScope":true,"impliedFormat":1},{"version":"f689c4237b70ae6be5f0e4180e8833f34ace40529d1acc0676ab8fb8f70457d7","impliedFormat":1},{"version":"b02784111b3fc9c38590cd4339ff8718f9329a6f4d3fd66e9744a1dcd1d7e191","impliedFormat":1},{"version":"ac5ed35e649cdd8143131964336ab9076937fa91802ec760b3ea63b59175c10a","impliedFormat":1},{"version":"52a8e7e8a1454b6d1b5ad428efae3870ffc56f2c02d923467f2940c454aa9aec","affectsGlobalScope":true,"impliedFormat":1},{"version":"78dc0513cc4f1642906b74dda42146bcbd9df7401717d6e89ea6d72d12ecb539","impliedFormat":1},{"version":"ad90122e1cb599b3bc06a11710eb5489101be678f2920f2322b0ac3e195af78d","impliedFormat":1}],"root":[159,160,[162,164]],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"alwaysStrict":true,"checkJs":false,"composite":false,"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"emitDecoratorMetadata":true,"esModuleInterop":true,"experimentalDecorators":true,"inlineSources":false,"jsx":4,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitAny":true,"noImplicitThis":true,"noUnusedLocals":false,"noUnusedParameters":false,"outDir":"./dist","rootDir":"./src","skipLibCheck":true,"sourceMap":true,"strict":true,"strictNullChecks":true,"strictPropertyInitialization":false,"target":9,"useUnknownInCatchVariables":true},"referencedMap":[[169,1],[168,2],[167,3],[165,4],[166,4],[151,4],[215,5],[216,5],[217,6],[175,7],[218,8],[219,9],[220,10],[170,4],[173,11],[171,4],[172,4],[221,12],[222,13],[223,14],[224,15],[225,16],[226,17],[227,17],[229,18],[228,19],[230,20],[231,21],[232,22],[214,23],[174,4],[233,24],[234,25],[235,26],[268,27],[236,28],[237,29],[238,30],[239,31],[240,32],[241,33],[242,34],[243,35],[244,36],[245,37],[246,37],[247,38],[248,4],[249,4],[250,39],[252,40],[251,41],[253,42],[254,43],[255,44],[256,45],[257,46],[258,47],[259,48],[260,49],[261,50],[262,51],[263,52],[264,53],[265,54],[266,55],[267,56],[176,4],[56,4],[57,4],[11,4],[10,4],[2,4],[12,4],[13,4],[14,4],[15,4],[16,4],[17,4],[18,4],[19,4],[3,4],[20,4],[21,4],[4,4],[22,4],[26,4],[23,4],[24,4],[25,4],[27,4],[28,4],[29,4],[5,4],[30,4],[31,4],[32,4],[33,4],[6,4],[37,4],[34,4],[35,4],[36,4],[38,4],[7,4],[39,4],[44,4],[45,4],[40,4],[41,4],[42,4],[43,4],[8,4],[49,4],[46,4],[47,4],[48,4],[50,4],[9,4],[51,4],[52,4],[53,4],[55,4],[54,4],[1,4],[192,57],[202,58],[191,57],[212,59],[183,60],[182,61],[211,62],[205,63],[210,64],[185,65],[199,66],[184,67],[208,68],[180,69],[179,62],[209,70],[181,71],[186,72],[187,4],[190,72],[177,4],[213,73],[203,74],[194,75],[195,76],[197,77],[193,78],[196,79],[206,62],[188,80],[189,81],[198,82],[178,83],[201,74],[200,72],[204,4],[207,84],[116,85],[119,86],[117,86],[113,85],[120,87],[121,88],[118,86],[114,89],[115,90],[108,91],[62,92],[64,93],[106,4],[63,94],[107,95],[111,96],[109,4],[65,92],[66,4],[105,97],[61,98],[58,4],[110,99],[59,100],[60,4],[122,101],[67,102],[68,102],[69,102],[70,102],[71,102],[72,102],[73,102],[74,102],[75,102],[76,102],[78,102],[77,102],[79,102],[80,102],[81,102],[104,103],[82,102],[83,102],[84,102],[85,102],[86,102],[87,102],[88,102],[89,102],[90,102],[91,102],[92,102],[93,102],[94,102],[95,102],[96,102],[97,102],[98,102],[99,102],[100,102],[101,102],[102,102],[103,102],[112,104],[123,105],[124,4],[125,4],[126,4],[127,4],[144,106],[145,4],[146,4],[147,4],[156,107],[148,4],[149,4],[150,4],[152,108],[153,4],[154,4],[155,4],[159,109],[164,110],[160,4],[162,111],[163,112],[157,4],[158,113],[161,114],[128,4],[129,4],[130,4],[131,4],[132,4],[133,4],[143,115],[134,4],[136,116],[137,4],[138,4],[139,117],[140,117],[141,4],[135,4],[142,4]],"version":"5.8.2"}
|
package/dist/4FVZVXV2.cjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var QVJ3X3OI_cjs = require('./QVJ3X3OI.cjs');
|
|
4
|
-
var YJF4D23A_cjs = require('./YJF4D23A.cjs');
|
|
5
|
-
|
|
6
|
-
// src/utils.ts
|
|
7
|
-
var extractSchemaFromFactory = /* @__PURE__ */ YJF4D23A_cjs.__name((factoryDefinition, dimension) => {
|
|
8
|
-
const schema = (factoryDefinition.dimensionToSchemaMap.byDimension && Object.values(factoryDefinition.dimensionToSchemaMap.byDimension).find(([dim]) => QVJ3X3OI_cjs.serializeDimensions(dim) === QVJ3X3OI_cjs.serializeDimensions(dimension))?.[1]) ?? factoryDefinition.dimensionToSchemaMap.base;
|
|
9
|
-
if (!schema?.shape) {
|
|
10
|
-
throw new Error(`Couldn't resolve the schema of factory ${factoryDefinition.name} for dim ${JSON.stringify(dimension)}`);
|
|
11
|
-
}
|
|
12
|
-
return schema;
|
|
13
|
-
}, "extractSchemaFromFactory");
|
|
14
|
-
|
|
15
|
-
exports.extractSchemaFromFactory = extractSchemaFromFactory;
|
|
16
|
-
//# sourceMappingURL=4FVZVXV2.cjs.map
|
|
17
|
-
//# sourceMappingURL=4FVZVXV2.cjs.map
|
package/dist/4FVZVXV2.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils.ts"],"names":["extractSchemaFromFactory","__name","factoryDefinition","dimension","schema","dimensionToSchemaMap","byDimension","Object","values","find","dim","serializeDimensions","base","shape","Error","name","JSON","stringify"],"mappings":";;;;;;AAOO,IAAMA,wBAAAA,mBAA2BC,mBAAA,CAAA,CACpCC,iBAAAA,EACAC,SAAAA,KAAAA;AAEA,EAAA,MAAMC,MAAAA,GAAAA,CACDF,iBAAAA,CAAkBG,oBAAAA,CAAqBC,WAAAA,IACpCC,MAAAA,CAAOC,OACHN,iBAAAA,CAAkBG,oBAAAA,CAAqBC,WAAW,CAAA,CACpDG,IAAAA,CAAK,CAAC,CAACC,GAAAA,CAAAA,KAASC,gCAAAA,CAAoBD,GAAAA,CAAAA,KAASC,gCAAAA,CAAoBR,SAAAA,CAAAA,CAAAA,GAAc,CAAA,CAAA,KACrFD,iBAAAA,CAAkBG,oBAAAA,CAAqBO,IAAAA;AAC3C,EAAA,IAAI,CAACR,QAAQS,KAAAA,EAAO;AAChB,IAAA,MAAM,IAAIC,KAAAA,CACN,CAAA,uCAAA,EAA0CZ,iBAAAA,CAAkBa,IAAI,YAAYC,IAAAA,CAAKC,SAAAA,CAAUd,SAAAA,CAAAA,CAAAA,CAAY,CAAA;AAE/G,EAAA;AAEA,EAAA,OAAOC,MAAAA;AACX,CAAA,EAjBwC,0BAAA","file":"4FVZVXV2.cjs","sourcesContent":["import type z from 'zod/v4';\n\nimport type { AdvancedRecord } from '@layerzerolabs/typescript-utils';\n\nimport type { Factory } from './definitions';\nimport { type FactoryDefinition, serializeDimensions } from './definitions';\n\nexport const extractSchemaFromFactory = <Dim extends z.ZodObject>(\n factoryDefinition: FactoryDefinition<any, Dim, any, any> | Factory<any, any, any>,\n dimension: z.infer<Dim>,\n): z.ZodObject => {\n const schema =\n (factoryDefinition.dimensionToSchemaMap.byDimension &&\n Object.values(\n factoryDefinition.dimensionToSchemaMap.byDimension as AdvancedRecord,\n ).find(([dim]) => serializeDimensions(dim) === serializeDimensions(dimension))?.[1]) ??\n factoryDefinition.dimensionToSchemaMap.base;\n if (!schema?.shape) {\n throw new Error(\n `Couldn't resolve the schema of factory ${factoryDefinition.name} for dim ${JSON.stringify(dimension)}`,\n );\n }\n\n return schema;\n};\n"]}
|
package/dist/L7S4WI2G.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/definitions.ts"],"names":["FactoryDefinition","DependencyNode","dimensions","dimensionToSchemaMap","getFactory","args","ObjectDefinition","schema","serializeDimensions","dim","Object","keys","length","entries","sort","map","dimName","dimVal","join"],"mappings":";;;AA+EO,IAAMA,iBAAAA,GAAN,cAKGC,cAAAA,CAAAA;EAhFV;;;AAiFoBC,EAAAA,UAAAA;AACAC,EAAAA,oBAAAA;AACAC,EAAAA,UAAAA;AAChB,EAAA,WAAA,CAAY,EACRF,UAAAA,EACAC,oBAAAA,EACAC,UAAAA,EACA,GAAGC,MAAAA,EAKmE;AACtE,IAAA,KAAA,CAAMA,IAAAA,CAAAA;AACN,IAAA,IAAA,CAAKH,UAAAA,GAAaA,UAAAA;AAClB,IAAA,IAAA,CAAKC,oBAAAA,GAAuBA,oBAAAA;AAC5B,IAAA,IAAA,CAAKC,UAAAA,GAAaA,UAAAA;AACtB,EAAA;AACJ;AAYO,IAAeE,gBAAAA,GAAf,cAIGL,cAAAA,CAAAA;EAnHV;;;AAoHoBM,EAAAA,MAAAA;AAEhB,EAAA,WAAA,CAAY,EACRA,MAAAA,EACA,GAAGF,IAAAA,EAAAA,EAGmE;AACtE,IAAA,KAAA,CAAMA,IAAAA,CAAAA;AACN,IAAA,IAAA,CAAKE,MAAAA,GAASA,MAAAA;AAClB,EAAA;AACJ;AAsEO,IAAMC,mBAAAA,mBAAsB,MAAA,CAAA,CAACC,GAAAA,GAAc,EAAC,KAAC;AAChD,EAAA,OAAOC,MAAAA,CAAOC,IAAAA,CAAKF,GAAAA,CAAAA,CAAKG,MAAAA,GAClBF,MAAAA,CAAOG,OAAAA,CAAQJ,GAAAA,CAAAA,CACVK,IAAAA,EAAI,CACJC,GAAAA,CAAI,CAAC,CAACC,OAAAA,EAASC,MAAAA,CAAAA,KAAY,CAAA,EAAGD,OAAAA,CAAAA,CAAAA,EAAWC,MAAAA,CAAAA,CAAAA,EAAU,EAAA,CAAA,CACnDC,IAAAA,CAAK,GAAA,CAAA,GACV,OAAA;AACV,CAAA,EAPmC,qBAAA","file":"L7S4WI2G.js","sourcesContent":["import type { z } from 'zod/v4';\n\nimport type { FunctionPointer } from '@layerzerolabs/common-utils';\nimport type { Dependencies } from '@layerzerolabs/dependency-graph';\nimport { DependencyNode } from '@layerzerolabs/dependency-graph';\nimport type {\n AdvancedRecord,\n AdvancedRecordLookup,\n Merge,\n MethodNameOf,\n RemoveNever,\n UnionToIntersection,\n} from '@layerzerolabs/typescript-utils';\n\nexport type DimensionToSchemaMap<DimConstraint extends object = object> = {\n byDimension?: AdvancedRecord<DimConstraint, z.ZodType>;\n base: z.ZodType;\n};\n\nexport type GetModelFromSchema<DMap extends DimensionToSchemaMap, Dim> =\n AdvancedRecordLookup<DMap['byDimension'], Dim> extends never\n ? z.infer<DMap['base']>\n : Merge<z.infer<DMap['base']>, z.infer<AdvancedRecordLookup<DMap['byDimension'], Dim>>>;\n\nexport type GetSupersetOfModelsFromSchema<DMap extends DimensionToSchemaMap> = UnionToIntersection<\n {\n [Key in keyof DMap['byDimension']]: DMap['byDimension'][Key] extends [any, any]\n ? z.infer<DMap['byDimension'][Key][1]>\n : never;\n }[keyof DMap['byDimension']]\n> &\n z.infer<DMap['base']>;\n\ntype GetImplFunctionWithConditionalOptionalDim<Dim, Return> = {} extends Dim\n ? (dim?: Dim) => Return\n : (dim: Dim) => Return;\n\ntype GetImplOverloads<\n Dim extends z.ZodObject<any>,\n DMap extends DimensionToSchemaMap<z.infer<Dim>>,\n> = UnionToIntersection<\n | {\n [I in keyof DMap['byDimension']]: DMap['byDimension'][I] extends readonly [infer K, any]\n ? {\n getImpl: GetImplFunctionWithConditionalOptionalDim<\n K,\n GetModelFromSchema<DMap, K>\n >;\n }\n : never;\n }[keyof DMap['byDimension']]\n | { getImpl: GetImplFunctionWithConditionalOptionalDim<z.infer<Dim>, z.infer<DMap['base']>> }\n>;\n\nexport type Factory<\n _Dependencies extends Dependencies,\n Dim extends z.ZodObject<any>,\n DMap extends DimensionToSchemaMap<z.infer<Dim>>,\n> = { name: string; implKeys: string[]; dimensionToSchemaMap: DMap } & GetImplOverloads<Dim, DMap>;\n\nexport type GetFactory<\n _Dependencies extends Dependencies,\n Dim extends z.ZodObject<any>,\n DMap extends DimensionToSchemaMap<z.infer<Dim>>,\n> = () => Factory<_Dependencies, Dim, DMap> | Promise<Factory<_Dependencies, Dim, DMap>>;\n\n/**\n * Factory definitions are a type of dependency node that shall be resolved to a *factory*.\n * A factory is an object that provides a getImpl method which accepts some parameters *dim*,\n * and returns some object getImplMetadata.getModel(dim).\n * That is, a factory definition is given by the set of parameters it uses to get its implementations,\n * and a function defining the schema it will return for each set of parameters.\n * @param name inherited from {@link DependencyNode}\n * @param dependencies inherited from {@link DependencyNode}\n * @param dimensions a Zod schema for the parameters this factory operates on.\n * @param dimensionToSchemaMap A map from dimension objects to the Zod schema for the implementation.\n * @param getFactory a method that should return an object with a getImpl method that returns\n * entities adhering to the schema for the corresponding getModel call\n */\nexport class FactoryDefinition<\n Name extends string,\n Dim extends z.ZodObject<any>,\n DMap extends DimensionToSchemaMap<z.infer<Dim>>,\n _Dependencies extends Dependencies,\n> extends DependencyNode<Name, _Dependencies> {\n public readonly dimensions: Dim;\n public readonly dimensionToSchemaMap: DMap;\n public readonly getFactory: GetFactory<_Dependencies, Dim, DMap>;\n constructor({\n dimensions,\n dimensionToSchemaMap,\n getFactory,\n ...args\n }: {\n dimensions: Dim;\n dimensionToSchemaMap: DMap;\n getFactory: GetFactory<_Dependencies, Dim, DMap>;\n } & ConstructorParameters<typeof DependencyNode<Name, _Dependencies>>[0]) {\n super(args);\n this.dimensions = dimensions;\n this.dimensionToSchemaMap = dimensionToSchemaMap;\n this.getFactory = getFactory;\n }\n}\n\n/**\n * An object definition is a dependency node that refers to some entity\n * matching a given schema. That is, it may be resolved to any entity\n * that adheres to the {@link schema}.\n * The object definition is abstract, as it cannot be meaningfully resolved without\n * additional information. For an example of an object definition, see ReflexiveObjectDefinition or ContextDefinition\n * @param name inherited from {@link DependencyNode}\n * @param dependencies inherited from {@link DependencyNode}\n * @param schema a Zod schema defining the expected resolution for this definition\n */\nexport abstract class ObjectDefinition<\n Name extends string,\n Schema extends z.ZodSchema,\n _Dependencies extends Dependencies,\n> extends DependencyNode<Name, _Dependencies> {\n public readonly schema: Schema;\n\n constructor({\n schema,\n ...args\n }: {\n schema: Schema;\n } & ConstructorParameters<typeof DependencyNode<Name, _Dependencies>>[0]) {\n super(args);\n this.schema = schema;\n }\n}\n\nexport type Definition<Name extends string> =\n | FactoryDefinition<Name, any, any, any>\n | ObjectDefinition<Name, any, any>;\n\n/**\n * Infers the expected type of a definition once it has been resolved\n */\nexport type ResolvedDefinition<Definition extends DependencyNode<any, any>> =\n Definition extends ObjectDefinition<any, infer Schema, any>\n ? z.infer<Schema>\n : Definition extends FactoryDefinition<any, infer Dim, infer DMap, any>\n ? Factory<Definition['dependencies'], Dim, DMap>\n : Definition extends FactoryDefinition<any, any, any, any>\n ? Factory<\n Definition['dependencies'],\n Definition['dimensions'],\n Definition['dimensionToSchemaMap']\n >\n : unknown;\n\n/**\n * Given a record from string to definition, maps each definition T to ResolvedDefinition<T>\n */\nexport type ResolvedDefinitionMap<Deps extends Dependencies> = {\n [Key in keyof Deps]: ResolvedDefinition<Deps[Key]>;\n};\n\n/**\n * For some factory definition F and some dimension D s.t. D ⊇ F.dimensions, infers the expected return type of\n * ResolvedDefinition<F>.getImpl(D)\n */\nexport type ResolvedFactoryImplementation<Definition extends DependencyNode<any, any>, Dim> =\n Definition extends FactoryDefinition<any, any, any, any>\n ? GetModelFromSchema<Definition['dimensionToSchemaMap'], Dim>\n : never;\n\n/**\n * Given a record from string to definition and some dimension D, maps each definition T to ResolvedFactoryImplementation<T, D>\n */\nexport type ResolvedFactoryImplementationMap<Deps extends Dependencies, Dim> = RemoveNever<{\n [Key in keyof Deps]: ResolvedFactoryImplementation<Deps[Key], Dim>;\n}>;\n\ntype ActivityFactoryContext<\n _FactoryDefinition extends FactoryDefinition<any, any, any, any>,\n Dim,\n> = {\n getFunctionPointer: _FactoryDefinition extends FactoryDefinition<any, any, any, any>\n ? <MethodName extends MethodNameOf<ResolvedFactoryImplementation<_FactoryDefinition, Dim>>>(\n methodName: MethodName,\n ) => FunctionPointer<ResolvedFactoryImplementation<_FactoryDefinition, Dim>[MethodName]>\n : never;\n};\n\n/**\n * The parameters that shall be received by a factory's implementation getter\n */\nexport type Context<_FactoryDefinition extends FactoryDefinition<any, any, any, any>, Dim> = {\n name: _FactoryDefinition extends FactoryDefinition<infer Name, any, any, any> ? Name : never;\n dependencies: _FactoryDefinition extends FactoryDefinition<any, any, any, infer Deps>\n ? ResolvedDefinitionMap<Deps>\n : never;\n dim: Dim;\n impls: _FactoryDefinition extends FactoryDefinition<any, any, any, infer Deps>\n ? ResolvedFactoryImplementationMap<Deps, Dim>\n : never;\n} & ActivityFactoryContext<_FactoryDefinition, Dim>;\n\nexport const serializeDimensions = (dim: object = {}) => {\n return Object.keys(dim).length\n ? Object.entries(dim)\n .sort()\n .map(([dimName, dimVal]) => `${dimName}_${dimVal}`, '')\n .join('&')\n : '_base';\n};\n"]}
|
package/dist/QVJ3X3OI.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/definitions.ts"],"names":["FactoryDefinition","DependencyNode","dimensions","dimensionToSchemaMap","getFactory","args","ObjectDefinition","schema","serializeDimensions","__name","dim","Object","keys","length","entries","sort","map","dimName","dimVal","join"],"mappings":";;;;;AA+EO,IAAMA,iBAAAA,GAAN,cAKGC,8BAAAA,CAAAA;EAhFV;;;AAiFoBC,EAAAA,UAAAA;AACAC,EAAAA,oBAAAA;AACAC,EAAAA,UAAAA;AAChB,EAAA,WAAA,CAAY,EACRF,UAAAA,EACAC,oBAAAA,EACAC,UAAAA,EACA,GAAGC,MAAAA,EAKmE;AACtE,IAAA,KAAA,CAAMA,IAAAA,CAAAA;AACN,IAAA,IAAA,CAAKH,UAAAA,GAAaA,UAAAA;AAClB,IAAA,IAAA,CAAKC,oBAAAA,GAAuBA,oBAAAA;AAC5B,IAAA,IAAA,CAAKC,UAAAA,GAAaA,UAAAA;AACtB,EAAA;AACJ;AAYO,IAAeE,gBAAAA,GAAf,cAIGL,8BAAAA,CAAAA;EAnHV;;;AAoHoBM,EAAAA,MAAAA;AAEhB,EAAA,WAAA,CAAY,EACRA,MAAAA,EACA,GAAGF,IAAAA,EAAAA,EAGmE;AACtE,IAAA,KAAA,CAAMA,IAAAA,CAAAA;AACN,IAAA,IAAA,CAAKE,MAAAA,GAASA,MAAAA;AAClB,EAAA;AACJ;AAsEO,IAAMC,mBAAAA,mBAAsBC,mBAAA,CAAA,CAACC,GAAAA,GAAc,EAAC,KAAC;AAChD,EAAA,OAAOC,MAAAA,CAAOC,IAAAA,CAAKF,GAAAA,CAAAA,CAAKG,MAAAA,GAClBF,MAAAA,CAAOG,OAAAA,CAAQJ,GAAAA,CAAAA,CACVK,IAAAA,EAAI,CACJC,GAAAA,CAAI,CAAC,CAACC,OAAAA,EAASC,MAAAA,CAAAA,KAAY,CAAA,EAAGD,OAAAA,CAAAA,CAAAA,EAAWC,MAAAA,CAAAA,CAAAA,EAAU,EAAA,CAAA,CACnDC,IAAAA,CAAK,GAAA,CAAA,GACV,OAAA;AACV,CAAA,EAPmC,qBAAA","file":"QVJ3X3OI.cjs","sourcesContent":["import type { z } from 'zod/v4';\n\nimport type { FunctionPointer } from '@layerzerolabs/common-utils';\nimport type { Dependencies } from '@layerzerolabs/dependency-graph';\nimport { DependencyNode } from '@layerzerolabs/dependency-graph';\nimport type {\n AdvancedRecord,\n AdvancedRecordLookup,\n Merge,\n MethodNameOf,\n RemoveNever,\n UnionToIntersection,\n} from '@layerzerolabs/typescript-utils';\n\nexport type DimensionToSchemaMap<DimConstraint extends object = object> = {\n byDimension?: AdvancedRecord<DimConstraint, z.ZodType>;\n base: z.ZodType;\n};\n\nexport type GetModelFromSchema<DMap extends DimensionToSchemaMap, Dim> =\n AdvancedRecordLookup<DMap['byDimension'], Dim> extends never\n ? z.infer<DMap['base']>\n : Merge<z.infer<DMap['base']>, z.infer<AdvancedRecordLookup<DMap['byDimension'], Dim>>>;\n\nexport type GetSupersetOfModelsFromSchema<DMap extends DimensionToSchemaMap> = UnionToIntersection<\n {\n [Key in keyof DMap['byDimension']]: DMap['byDimension'][Key] extends [any, any]\n ? z.infer<DMap['byDimension'][Key][1]>\n : never;\n }[keyof DMap['byDimension']]\n> &\n z.infer<DMap['base']>;\n\ntype GetImplFunctionWithConditionalOptionalDim<Dim, Return> = {} extends Dim\n ? (dim?: Dim) => Return\n : (dim: Dim) => Return;\n\ntype GetImplOverloads<\n Dim extends z.ZodObject<any>,\n DMap extends DimensionToSchemaMap<z.infer<Dim>>,\n> = UnionToIntersection<\n | {\n [I in keyof DMap['byDimension']]: DMap['byDimension'][I] extends readonly [infer K, any]\n ? {\n getImpl: GetImplFunctionWithConditionalOptionalDim<\n K,\n GetModelFromSchema<DMap, K>\n >;\n }\n : never;\n }[keyof DMap['byDimension']]\n | { getImpl: GetImplFunctionWithConditionalOptionalDim<z.infer<Dim>, z.infer<DMap['base']>> }\n>;\n\nexport type Factory<\n _Dependencies extends Dependencies,\n Dim extends z.ZodObject<any>,\n DMap extends DimensionToSchemaMap<z.infer<Dim>>,\n> = { name: string; implKeys: string[]; dimensionToSchemaMap: DMap } & GetImplOverloads<Dim, DMap>;\n\nexport type GetFactory<\n _Dependencies extends Dependencies,\n Dim extends z.ZodObject<any>,\n DMap extends DimensionToSchemaMap<z.infer<Dim>>,\n> = () => Factory<_Dependencies, Dim, DMap> | Promise<Factory<_Dependencies, Dim, DMap>>;\n\n/**\n * Factory definitions are a type of dependency node that shall be resolved to a *factory*.\n * A factory is an object that provides a getImpl method which accepts some parameters *dim*,\n * and returns some object getImplMetadata.getModel(dim).\n * That is, a factory definition is given by the set of parameters it uses to get its implementations,\n * and a function defining the schema it will return for each set of parameters.\n * @param name inherited from {@link DependencyNode}\n * @param dependencies inherited from {@link DependencyNode}\n * @param dimensions a Zod schema for the parameters this factory operates on.\n * @param dimensionToSchemaMap A map from dimension objects to the Zod schema for the implementation.\n * @param getFactory a method that should return an object with a getImpl method that returns\n * entities adhering to the schema for the corresponding getModel call\n */\nexport class FactoryDefinition<\n Name extends string,\n Dim extends z.ZodObject<any>,\n DMap extends DimensionToSchemaMap<z.infer<Dim>>,\n _Dependencies extends Dependencies,\n> extends DependencyNode<Name, _Dependencies> {\n public readonly dimensions: Dim;\n public readonly dimensionToSchemaMap: DMap;\n public readonly getFactory: GetFactory<_Dependencies, Dim, DMap>;\n constructor({\n dimensions,\n dimensionToSchemaMap,\n getFactory,\n ...args\n }: {\n dimensions: Dim;\n dimensionToSchemaMap: DMap;\n getFactory: GetFactory<_Dependencies, Dim, DMap>;\n } & ConstructorParameters<typeof DependencyNode<Name, _Dependencies>>[0]) {\n super(args);\n this.dimensions = dimensions;\n this.dimensionToSchemaMap = dimensionToSchemaMap;\n this.getFactory = getFactory;\n }\n}\n\n/**\n * An object definition is a dependency node that refers to some entity\n * matching a given schema. That is, it may be resolved to any entity\n * that adheres to the {@link schema}.\n * The object definition is abstract, as it cannot be meaningfully resolved without\n * additional information. For an example of an object definition, see ReflexiveObjectDefinition or ContextDefinition\n * @param name inherited from {@link DependencyNode}\n * @param dependencies inherited from {@link DependencyNode}\n * @param schema a Zod schema defining the expected resolution for this definition\n */\nexport abstract class ObjectDefinition<\n Name extends string,\n Schema extends z.ZodSchema,\n _Dependencies extends Dependencies,\n> extends DependencyNode<Name, _Dependencies> {\n public readonly schema: Schema;\n\n constructor({\n schema,\n ...args\n }: {\n schema: Schema;\n } & ConstructorParameters<typeof DependencyNode<Name, _Dependencies>>[0]) {\n super(args);\n this.schema = schema;\n }\n}\n\nexport type Definition<Name extends string> =\n | FactoryDefinition<Name, any, any, any>\n | ObjectDefinition<Name, any, any>;\n\n/**\n * Infers the expected type of a definition once it has been resolved\n */\nexport type ResolvedDefinition<Definition extends DependencyNode<any, any>> =\n Definition extends ObjectDefinition<any, infer Schema, any>\n ? z.infer<Schema>\n : Definition extends FactoryDefinition<any, infer Dim, infer DMap, any>\n ? Factory<Definition['dependencies'], Dim, DMap>\n : Definition extends FactoryDefinition<any, any, any, any>\n ? Factory<\n Definition['dependencies'],\n Definition['dimensions'],\n Definition['dimensionToSchemaMap']\n >\n : unknown;\n\n/**\n * Given a record from string to definition, maps each definition T to ResolvedDefinition<T>\n */\nexport type ResolvedDefinitionMap<Deps extends Dependencies> = {\n [Key in keyof Deps]: ResolvedDefinition<Deps[Key]>;\n};\n\n/**\n * For some factory definition F and some dimension D s.t. D ⊇ F.dimensions, infers the expected return type of\n * ResolvedDefinition<F>.getImpl(D)\n */\nexport type ResolvedFactoryImplementation<Definition extends DependencyNode<any, any>, Dim> =\n Definition extends FactoryDefinition<any, any, any, any>\n ? GetModelFromSchema<Definition['dimensionToSchemaMap'], Dim>\n : never;\n\n/**\n * Given a record from string to definition and some dimension D, maps each definition T to ResolvedFactoryImplementation<T, D>\n */\nexport type ResolvedFactoryImplementationMap<Deps extends Dependencies, Dim> = RemoveNever<{\n [Key in keyof Deps]: ResolvedFactoryImplementation<Deps[Key], Dim>;\n}>;\n\ntype ActivityFactoryContext<\n _FactoryDefinition extends FactoryDefinition<any, any, any, any>,\n Dim,\n> = {\n getFunctionPointer: _FactoryDefinition extends FactoryDefinition<any, any, any, any>\n ? <MethodName extends MethodNameOf<ResolvedFactoryImplementation<_FactoryDefinition, Dim>>>(\n methodName: MethodName,\n ) => FunctionPointer<ResolvedFactoryImplementation<_FactoryDefinition, Dim>[MethodName]>\n : never;\n};\n\n/**\n * The parameters that shall be received by a factory's implementation getter\n */\nexport type Context<_FactoryDefinition extends FactoryDefinition<any, any, any, any>, Dim> = {\n name: _FactoryDefinition extends FactoryDefinition<infer Name, any, any, any> ? Name : never;\n dependencies: _FactoryDefinition extends FactoryDefinition<any, any, any, infer Deps>\n ? ResolvedDefinitionMap<Deps>\n : never;\n dim: Dim;\n impls: _FactoryDefinition extends FactoryDefinition<any, any, any, infer Deps>\n ? ResolvedFactoryImplementationMap<Deps, Dim>\n : never;\n} & ActivityFactoryContext<_FactoryDefinition, Dim>;\n\nexport const serializeDimensions = (dim: object = {}) => {\n return Object.keys(dim).length\n ? Object.entries(dim)\n .sort()\n .map(([dimName, dimVal]) => `${dimName}_${dimVal}`, '')\n .join('&')\n : '_base';\n};\n"]}
|
package/dist/RDR5ZF6L.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { serializeDimensions } from './L7S4WI2G.js';
|
|
2
|
-
import { __name } from './VUOMXK5T.js';
|
|
3
|
-
|
|
4
|
-
// src/utils.ts
|
|
5
|
-
var extractSchemaFromFactory = /* @__PURE__ */ __name((factoryDefinition, dimension) => {
|
|
6
|
-
const schema = (factoryDefinition.dimensionToSchemaMap.byDimension && Object.values(factoryDefinition.dimensionToSchemaMap.byDimension).find(([dim]) => serializeDimensions(dim) === serializeDimensions(dimension))?.[1]) ?? factoryDefinition.dimensionToSchemaMap.base;
|
|
7
|
-
if (!schema?.shape) {
|
|
8
|
-
throw new Error(`Couldn't resolve the schema of factory ${factoryDefinition.name} for dim ${JSON.stringify(dimension)}`);
|
|
9
|
-
}
|
|
10
|
-
return schema;
|
|
11
|
-
}, "extractSchemaFromFactory");
|
|
12
|
-
|
|
13
|
-
export { extractSchemaFromFactory };
|
|
14
|
-
//# sourceMappingURL=RDR5ZF6L.js.map
|
|
15
|
-
//# sourceMappingURL=RDR5ZF6L.js.map
|
package/dist/RDR5ZF6L.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils.ts"],"names":["extractSchemaFromFactory","factoryDefinition","dimension","schema","dimensionToSchemaMap","byDimension","Object","values","find","dim","serializeDimensions","base","shape","Error","name","JSON","stringify"],"mappings":";;;;AAOO,IAAMA,wBAAAA,mBAA2B,MAAA,CAAA,CACpCC,iBAAAA,EACAC,SAAAA,KAAAA;AAEA,EAAA,MAAMC,MAAAA,GAAAA,CACDF,iBAAAA,CAAkBG,oBAAAA,CAAqBC,WAAAA,IACpCC,MAAAA,CAAOC,OACHN,iBAAAA,CAAkBG,oBAAAA,CAAqBC,WAAW,CAAA,CACpDG,IAAAA,CAAK,CAAC,CAACC,GAAAA,CAAAA,KAASC,mBAAAA,CAAoBD,GAAAA,CAAAA,KAASC,mBAAAA,CAAoBR,SAAAA,CAAAA,CAAAA,GAAc,CAAA,CAAA,KACrFD,iBAAAA,CAAkBG,oBAAAA,CAAqBO,IAAAA;AAC3C,EAAA,IAAI,CAACR,QAAQS,KAAAA,EAAO;AAChB,IAAA,MAAM,IAAIC,KAAAA,CACN,CAAA,uCAAA,EAA0CZ,iBAAAA,CAAkBa,IAAI,YAAYC,IAAAA,CAAKC,SAAAA,CAAUd,SAAAA,CAAAA,CAAAA,CAAY,CAAA;AAE/G,EAAA;AAEA,EAAA,OAAOC,MAAAA;AACX,CAAA,EAjBwC,0BAAA","file":"RDR5ZF6L.js","sourcesContent":["import type z from 'zod/v4';\n\nimport type { AdvancedRecord } from '@layerzerolabs/typescript-utils';\n\nimport type { Factory } from './definitions';\nimport { type FactoryDefinition, serializeDimensions } from './definitions';\n\nexport const extractSchemaFromFactory = <Dim extends z.ZodObject>(\n factoryDefinition: FactoryDefinition<any, Dim, any, any> | Factory<any, any, any>,\n dimension: z.infer<Dim>,\n): z.ZodObject => {\n const schema =\n (factoryDefinition.dimensionToSchemaMap.byDimension &&\n Object.values(\n factoryDefinition.dimensionToSchemaMap.byDimension as AdvancedRecord,\n ).find(([dim]) => serializeDimensions(dim) === serializeDimensions(dimension))?.[1]) ??\n factoryDefinition.dimensionToSchemaMap.base;\n if (!schema?.shape) {\n throw new Error(\n `Couldn't resolve the schema of factory ${factoryDefinition.name} for dim ${JSON.stringify(dimension)}`,\n );\n }\n\n return schema;\n};\n"]}
|