@vaadin/hilla-generator-plugin-model 24.7.0-alpha9 → 24.7.0-beta3

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/index.js CHANGED
@@ -1,35 +1,30 @@
1
- import Plugin from "@vaadin/hilla-generator-core/Plugin.js";
2
- import { EntityModelProcessor } from "./EntityModelProcessor.js";
3
- var ModelPluginSourceType = /* @__PURE__ */ ((ModelPluginSourceType2) => {
4
- ModelPluginSourceType2["Model"] = "model";
5
- return ModelPluginSourceType2;
6
- })(ModelPluginSourceType || {});
7
- class ModelPlugin extends Plugin {
8
- static MODEL_PLUGIN_FILE_TAGS = "MODEL_PLUGIN_FILE_TAGS";
9
- #tags = /* @__PURE__ */ new WeakMap();
10
- get path() {
11
- return import.meta.url;
12
- }
13
- // eslint-disable-next-line @typescript-eslint/require-await
14
- async execute(storage) {
15
- const files = this.#processEntities(storage.api.components?.schemas);
16
- files.forEach((file) => this.#tags.set(file, "model" /* Model */));
17
- storage.sources.push(...files);
18
- storage.pluginStorage.set(this.constructor.MODEL_PLUGIN_FILE_TAGS, this.#tags);
19
- }
20
- #processEntities(schemas) {
21
- this.logger.debug("Processing entities");
22
- if (!schemas) {
23
- return [];
1
+ import Plugin from '@vaadin/hilla-generator-core/Plugin.js';
2
+ import { EntityModelProcessor } from './EntityModelProcessor.js';
3
+ export var ModelPluginSourceType;
4
+ (function (ModelPluginSourceType) {
5
+ ModelPluginSourceType["Model"] = "model";
6
+ })(ModelPluginSourceType || (ModelPluginSourceType = {}));
7
+ export default class ModelPlugin extends Plugin {
8
+ static MODEL_PLUGIN_FILE_TAGS = 'MODEL_PLUGIN_FILE_TAGS';
9
+ #tags = new WeakMap();
10
+ get path() {
11
+ return import.meta.url;
12
+ }
13
+ async execute(storage) {
14
+ const files = this.#processEntities(storage.api.components?.schemas);
15
+ files.forEach((file) => this.#tags.set(file, ModelPluginSourceType.Model));
16
+ storage.sources.push(...files);
17
+ storage.pluginStorage.set(this.constructor.MODEL_PLUGIN_FILE_TAGS, this.#tags);
18
+ }
19
+ #processEntities(schemas) {
20
+ this.logger.debug('Processing entities');
21
+ if (!schemas) {
22
+ return [];
23
+ }
24
+ const ctx = {
25
+ owner: this,
26
+ };
27
+ return Object.entries(schemas).map(([name, component]) => EntityModelProcessor.process(name, component, ctx));
24
28
  }
25
- const ctx = {
26
- owner: this
27
- };
28
- return Object.entries(schemas).map(([name, component]) => EntityModelProcessor.process(name, component, ctx));
29
- }
30
29
  }
31
- export {
32
- ModelPluginSourceType,
33
- ModelPlugin as default
34
- };
35
- //# sourceMappingURL=index.js.map
30
+ //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["src/index.ts"],
4
- "sourcesContent": ["import Plugin from '@vaadin/hilla-generator-core/Plugin.js';\nimport type SharedStorage from '@vaadin/hilla-generator-core/SharedStorage.js';\nimport type { OpenAPIV3 } from 'openapi-types';\nimport type { ReadonlyDeep } from 'type-fest';\nimport type { SourceFile } from 'typescript';\nimport { EntityModelProcessor } from './EntityModelProcessor.js';\nimport type { Context } from './utils.js';\n\nexport enum ModelPluginSourceType {\n Model = 'model',\n}\n\nexport default class ModelPlugin extends Plugin {\n static readonly MODEL_PLUGIN_FILE_TAGS = 'MODEL_PLUGIN_FILE_TAGS';\n declare ['constructor']: typeof ModelPlugin;\n readonly #tags = new WeakMap<SourceFile, ModelPluginSourceType>();\n\n override get path(): string {\n return import.meta.url;\n }\n\n // eslint-disable-next-line @typescript-eslint/require-await\n override async execute(storage: SharedStorage): Promise<void> {\n const files = this.#processEntities(storage.api.components?.schemas);\n files.forEach((file) => this.#tags.set(file, ModelPluginSourceType.Model));\n storage.sources.push(...files);\n storage.pluginStorage.set(this.constructor.MODEL_PLUGIN_FILE_TAGS, this.#tags);\n }\n\n #processEntities(schemas: ReadonlyDeep<OpenAPIV3.ComponentsObject>['schemas'] | undefined): readonly SourceFile[] {\n this.logger.debug('Processing entities');\n\n if (!schemas) {\n return [];\n }\n\n const ctx: Context = {\n owner: this,\n };\n\n return Object.entries(schemas).map(([name, component]) => EntityModelProcessor.process(name, component, ctx));\n }\n}\n"],
5
- "mappings": "AAAA,OAAO,YAAY;AAKnB,SAAS,4BAA4B;AAG9B,IAAK,wBAAL,kBAAKA,2BAAL;AACL,EAAAA,uBAAA,WAAQ;AADE,SAAAA;AAAA,GAAA;AAIZ,MAAO,oBAAkC,OAAO;AAAA,EAC9C,OAAgB,yBAAyB;AAAA,EAEhC,QAAQ,oBAAI,QAA2C;AAAA,EAEhE,IAAa,OAAe;AAC1B,WAAO,YAAY;AAAA,EACrB;AAAA;AAAA,EAGA,MAAe,QAAQ,SAAuC;AAC5D,UAAM,QAAQ,KAAK,iBAAiB,QAAQ,IAAI,YAAY,OAAO;AACnE,UAAM,QAAQ,CAAC,SAAS,KAAK,MAAM,IAAI,MAAM,mBAA2B,CAAC;AACzE,YAAQ,QAAQ,KAAK,GAAG,KAAK;AAC7B,YAAQ,cAAc,IAAI,KAAK,YAAY,wBAAwB,KAAK,KAAK;AAAA,EAC/E;AAAA,EAEA,iBAAiB,SAAiG;AAChH,SAAK,OAAO,MAAM,qBAAqB;AAEvC,QAAI,CAAC,SAAS;AACZ,aAAO,CAAC;AAAA,IACV;AAEA,UAAM,MAAe;AAAA,MACnB,OAAO;AAAA,IACT;AAEA,WAAO,OAAO,QAAQ,OAAO,EAAE,IAAI,CAAC,CAAC,MAAM,SAAS,MAAM,qBAAqB,QAAQ,MAAM,WAAW,GAAG,CAAC;AAAA,EAC9G;AACF;",
6
- "names": ["ModelPluginSourceType"]
7
- }
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,wCAAwC,CAAC;AAI5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAGjE,MAAM,CAAN,IAAY,qBAEX;AAFD,WAAY,qBAAqB;IAC/B,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';\nimport type { SharedStorage } from '@vaadin/hilla-generator-core/SharedStorage.js';\nimport type { OpenAPIV3 } from 'openapi-types';\nimport type { SourceFile } from 'typescript';\nimport { EntityModelProcessor } from './EntityModelProcessor.js';\nimport type { Context } from './utils.js';\n\nexport enum ModelPluginSourceType {\n Model = 'model',\n}\n\nexport default class ModelPlugin extends Plugin {\n static readonly MODEL_PLUGIN_FILE_TAGS = 'MODEL_PLUGIN_FILE_TAGS';\n declare ['constructor']: typeof ModelPlugin;\n readonly #tags = new WeakMap<SourceFile, ModelPluginSourceType>();\n\n override get path(): string {\n return import.meta.url;\n }\n\n // eslint-disable-next-line @typescript-eslint/require-await\n override async execute(storage: SharedStorage): Promise<void> {\n const files = this.#processEntities(storage.api.components?.schemas);\n files.forEach((file) => this.#tags.set(file, ModelPluginSourceType.Model));\n storage.sources.push(...files);\n storage.pluginStorage.set(this.constructor.MODEL_PLUGIN_FILE_TAGS, this.#tags);\n }\n\n #processEntities(schemas: OpenAPIV3.ComponentsObject['schemas'] | undefined): readonly SourceFile[] {\n this.logger.debug('Processing entities');\n\n if (!schemas) {\n return [];\n }\n\n const ctx: Context = {\n owner: this,\n };\n\n return Object.entries(schemas).map(([name, component]) => EntityModelProcessor.process(name, component, ctx));\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/hilla-generator-plugin-model",
3
- "version": "24.7.0-alpha9",
3
+ "version": "24.7.0-beta3",
4
4
  "description": "A Hilla TypeScript Generator plugin to generate form models",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -9,15 +9,13 @@
9
9
  },
10
10
  "scripts": {
11
11
  "clean:build": "git clean -fx . -e .vite -e node_modules",
12
- "build": "concurrently npm:build:*",
13
- "build:esbuild": "tsx ../../../scripts/build.ts",
14
- "build:dts": "tsc --isolatedModules -p tsconfig.build.json",
15
- "build:copy": "cd src && copyfiles **/*.d.ts ..",
12
+ "build": "tsx ../../../scripts/build.ts",
16
13
  "lint": "eslint src test",
17
14
  "lint:fix": "eslint src test --fix",
18
- "test": "mocha test/**/*.spec.ts --config ../../../.mocharc.cjs",
19
- "test:update": "npm run test -- --update",
20
- "test:coverage": "c8 --experimental-monocart -c ../../../.c8rc.json npm test",
15
+ "test": "vitest --run",
16
+ "test:coverage": "vitest --run --coverage",
17
+ "test:update": "vitest --run --update",
18
+ "test:watch": "vitest",
21
19
  "typecheck": "tsc --noEmit"
22
20
  },
23
21
  "exports": {
@@ -51,31 +49,12 @@
51
49
  "access": "public"
52
50
  },
53
51
  "dependencies": {
54
- "@vaadin/hilla-generator-core": "24.7.0-alpha9",
55
- "@vaadin/hilla-generator-plugin-backbone": "24.7.0-alpha9",
56
- "@vaadin/hilla-generator-utils": "24.7.0-alpha9",
57
- "@vaadin/hilla-lit-form": "24.7.0-alpha9",
58
- "fast-deep-equal": "^3.1.3",
59
- "openapi-types": "^12.1.3",
52
+ "@vaadin/hilla-generator-core": "24.7.0-beta3",
53
+ "@vaadin/hilla-generator-plugin-backbone": "24.7.0-beta3",
54
+ "@vaadin/hilla-generator-utils": "24.7.0-beta3",
55
+ "@vaadin/hilla-lit-form": "24.7.0-beta3",
56
+ "fast-deep-equal": "3.1.3",
57
+ "openapi-types": "12.1.3",
60
58
  "typescript": "5.7.3"
61
- },
62
- "devDependencies": {
63
- "@types/chai": "^4.3.20",
64
- "@types/mocha": "^10.0.10",
65
- "@types/node": "^20.17.12",
66
- "@types/sinon": "^10.0.20",
67
- "@types/sinon-chai": "^3.2.12",
68
- "@vaadin/hilla-generator-core": "24.7.0-alpha9",
69
- "@vaadin/hilla-generator-plugin-client": "24.7.0-alpha9",
70
- "c8": "^10.1.3",
71
- "chai": "^4.5.0",
72
- "concurrently": "^9.1.2",
73
- "copyfiles": "^2.4.1",
74
- "mocha": "^11.1.0",
75
- "monocart-coverage-reports": "^2.11.5",
76
- "pino": "^9.6.0",
77
- "sinon": "^16.1.3",
78
- "sinon-chai": "^3.7.0",
79
- "type-fest": "^4.32.0"
80
59
  }
81
60
  }
package/utils.d.ts CHANGED
@@ -8,4 +8,3 @@ export declare const defaultMediaType = "application/json";
8
8
  export declare function importBuiltInFormModel(specifier: string, { imports, paths }: DependencyManager): Identifier;
9
9
  export declare function createModelBuildingCallback(name: Identifier, args: readonly Expression[]): ArrowFunction;
10
10
  export declare function createEmptyValueMaker(maker: Identifier, model: Identifier): PropertyDeclaration;
11
- //# sourceMappingURL=utils.d.ts.map
package/utils.js CHANGED
@@ -1,33 +1,14 @@
1
- import ts, {} from "typescript";
2
- const defaultMediaType = "application/json";
3
- function importBuiltInFormModel(specifier, { imports, paths }) {
4
- const modelPath = paths.createBareModulePath("@vaadin/hilla-lit-form", false);
5
- return imports.named.getIdentifier(modelPath, specifier) ?? imports.named.add(modelPath, specifier);
1
+ import ts, {} from 'typescript';
2
+ export const defaultMediaType = 'application/json';
3
+ export function importBuiltInFormModel(specifier, { imports, paths }) {
4
+ const modelPath = paths.createBareModulePath('@vaadin/hilla-lit-form', false);
5
+ return imports.named.getIdentifier(modelPath, specifier) ?? imports.named.add(modelPath, specifier);
6
6
  }
7
- function createModelBuildingCallback(name, args) {
8
- const defaults = [ts.factory.createIdentifier("parent"), ts.factory.createIdentifier("key")];
9
- return ts.factory.createArrowFunction(
10
- void 0,
11
- void 0,
12
- defaults.map((arg) => ts.factory.createParameterDeclaration(void 0, void 0, arg)),
13
- void 0,
14
- ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken),
15
- ts.factory.createNewExpression(name, void 0, [...defaults, ...args])
16
- );
7
+ export function createModelBuildingCallback(name, args) {
8
+ const defaults = [ts.factory.createIdentifier('parent'), ts.factory.createIdentifier('key')];
9
+ return ts.factory.createArrowFunction(undefined, undefined, defaults.map((arg) => ts.factory.createParameterDeclaration(undefined, undefined, arg)), undefined, ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken), ts.factory.createNewExpression(name, undefined, [...defaults, ...args]));
17
10
  }
18
- function createEmptyValueMaker(maker, model) {
19
- return ts.factory.createPropertyDeclaration(
20
- [ts.factory.createModifier(ts.SyntaxKind.StaticKeyword), ts.factory.createModifier(ts.SyntaxKind.OverrideKeyword)],
21
- "createEmptyValue",
22
- void 0,
23
- void 0,
24
- ts.factory.createCallExpression(maker, void 0, [model])
25
- );
11
+ export function createEmptyValueMaker(maker, model) {
12
+ return ts.factory.createPropertyDeclaration([ts.factory.createModifier(ts.SyntaxKind.StaticKeyword), ts.factory.createModifier(ts.SyntaxKind.OverrideKeyword)], 'createEmptyValue', undefined, undefined, ts.factory.createCallExpression(maker, undefined, [model]));
26
13
  }
27
- export {
28
- createEmptyValueMaker,
29
- createModelBuildingCallback,
30
- defaultMediaType,
31
- importBuiltInFormModel
32
- };
33
- //# sourceMappingURL=utils.js.map
14
+ //# sourceMappingURL=utils.js.map
package/utils.js.map CHANGED
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["src/utils.ts"],
4
- "sourcesContent": ["import type Plugin from '@vaadin/hilla-generator-core/Plugin.js';\nimport type DependencyManager from '@vaadin/hilla-generator-utils/dependencies/DependencyManager.js';\nimport ts, { type ArrowFunction, type Expression, type Identifier, type PropertyDeclaration } from 'typescript';\n\nexport type Context = Readonly<{\n owner: Plugin;\n}>;\n\nexport const defaultMediaType = 'application/json';\n\nexport function importBuiltInFormModel(specifier: string, { imports, paths }: DependencyManager): Identifier {\n const modelPath = paths.createBareModulePath('@vaadin/hilla-lit-form', false);\n return imports.named.getIdentifier(modelPath, specifier) ?? imports.named.add(modelPath, specifier);\n}\n\nexport function createModelBuildingCallback(name: Identifier, args: readonly Expression[]): ArrowFunction {\n const defaults = [ts.factory.createIdentifier('parent'), ts.factory.createIdentifier('key')];\n\n return ts.factory.createArrowFunction(\n undefined,\n undefined,\n defaults.map((arg) => ts.factory.createParameterDeclaration(undefined, undefined, arg)),\n undefined,\n ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken),\n ts.factory.createNewExpression(name, undefined, [...defaults, ...args]),\n );\n}\n\nexport function createEmptyValueMaker(maker: Identifier, model: Identifier): PropertyDeclaration {\n return ts.factory.createPropertyDeclaration(\n [ts.factory.createModifier(ts.SyntaxKind.StaticKeyword), ts.factory.createModifier(ts.SyntaxKind.OverrideKeyword)],\n 'createEmptyValue',\n undefined,\n undefined,\n ts.factory.createCallExpression(maker, undefined, [model]),\n );\n}\n"],
5
- "mappings": "AAEA,OAAO,YAA4F;AAM5F,MAAM,mBAAmB;AAEzB,SAAS,uBAAuB,WAAmB,EAAE,SAAS,MAAM,GAAkC;AAC3G,QAAM,YAAY,MAAM,qBAAqB,0BAA0B,KAAK;AAC5E,SAAO,QAAQ,MAAM,cAAc,WAAW,SAAS,KAAK,QAAQ,MAAM,IAAI,WAAW,SAAS;AACpG;AAEO,SAAS,4BAA4B,MAAkB,MAA4C;AACxG,QAAM,WAAW,CAAC,GAAG,QAAQ,iBAAiB,QAAQ,GAAG,GAAG,QAAQ,iBAAiB,KAAK,CAAC;AAE3F,SAAO,GAAG,QAAQ;AAAA,IAChB;AAAA,IACA;AAAA,IACA,SAAS,IAAI,CAAC,QAAQ,GAAG,QAAQ,2BAA2B,QAAW,QAAW,GAAG,CAAC;AAAA,IACtF;AAAA,IACA,GAAG,QAAQ,YAAY,GAAG,WAAW,sBAAsB;AAAA,IAC3D,GAAG,QAAQ,oBAAoB,MAAM,QAAW,CAAC,GAAG,UAAU,GAAG,IAAI,CAAC;AAAA,EACxE;AACF;AAEO,SAAS,sBAAsB,OAAmB,OAAwC;AAC/F,SAAO,GAAG,QAAQ;AAAA,IAChB,CAAC,GAAG,QAAQ,eAAe,GAAG,WAAW,aAAa,GAAG,GAAG,QAAQ,eAAe,GAAG,WAAW,eAAe,CAAC;AAAA,IACjH;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG,QAAQ,qBAAqB,OAAO,QAAW,CAAC,KAAK,CAAC;AAAA,EAC3D;AACF;",
6
- "names": []
7
- }
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["src/utils.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EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC,EAClH,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,EAAE,CAAC,OAAO,CAAC,oBAAoB,CAAC,KAAK,EAAE,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,CAC3D,CAAC;AACJ,CAAC","sourcesContent":["import type Plugin from '@vaadin/hilla-generator-core/Plugin.js';\nimport type DependencyManager from '@vaadin/hilla-generator-utils/dependencies/DependencyManager.js';\nimport ts, { type ArrowFunction, type Expression, type Identifier, type PropertyDeclaration } from 'typescript';\n\nexport type Context = Readonly<{\n owner: Plugin;\n}>;\n\nexport const defaultMediaType = 'application/json';\n\nexport function importBuiltInFormModel(specifier: string, { imports, paths }: DependencyManager): Identifier {\n const modelPath = paths.createBareModulePath('@vaadin/hilla-lit-form', false);\n return imports.named.getIdentifier(modelPath, specifier) ?? imports.named.add(modelPath, specifier);\n}\n\nexport function createModelBuildingCallback(name: Identifier, args: readonly Expression[]): ArrowFunction {\n const defaults = [ts.factory.createIdentifier('parent'), ts.factory.createIdentifier('key')];\n\n return ts.factory.createArrowFunction(\n undefined,\n undefined,\n defaults.map((arg) => ts.factory.createParameterDeclaration(undefined, undefined, arg)),\n undefined,\n ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken),\n ts.factory.createNewExpression(name, undefined, [...defaults, ...args]),\n );\n}\n\nexport function createEmptyValueMaker(maker: Identifier, model: Identifier): PropertyDeclaration {\n return ts.factory.createPropertyDeclaration(\n [ts.factory.createModifier(ts.SyntaxKind.StaticKeyword), ts.factory.createModifier(ts.SyntaxKind.OverrideKeyword)],\n 'createEmptyValue',\n undefined,\n undefined,\n ts.factory.createCallExpression(maker, undefined, [model]),\n );\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"EntityModelProcessor.d.ts","sourceRoot":"","sources":["src/EntityModelProcess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AS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;IAc7D,SAAS,CAAC,CAAC,mBAAmB,CAAC,IAAI,gBAAgB,GAAG,SAAS;CAyGhE;AAED,qBAAa,wBAAyB,SAAQ,oBAAoB;gBACpD,IAAI,EAAE,MAAM;IAIxB,SAAS,CAAC,CAAC,mBAAmB,CAAC,IAAI,gBAAgB;CA+BpD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"MetadataProcessor.d.ts","sourceRoot":"","sources":["src/MetadataProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wCAAwC,CAAC;AACrE,OAAW,EAAE,KAAK,uBAAuB,EAA2B,MAAM,YAAY,CAAC;AAEvF,UAAU,UAAU;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG;IACxC,eAAe,CAAC,EAAE,UAAU,EAAE,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AA8BF,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,uBAAuB,GAAG,IAAI,CAYtE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModelSchemaProcessor.d.ts","sourceRoot":"","sources":["src/ModelSchemaProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,aAAa,EAIlB,KAAK,aAAa,EAUlB,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,MAAM,EACX,KAAK,YAAY,EAClB,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,iBAAiB,MAAM,iEAAiE,CAAC;AACrG,OAAO,EAAE,EAAE,EACT,KAAK,UAAU,EAIf,KAAK,iBAAiB,EACvB,MAAM,YAAY,CAAC;AAKpB,QAAA,MAAM,aAAa,e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YAAY,GAAG,SAAS,UAAU,EAAE;cAIxD,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,UAAU,EAAE;CAmBvE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ValidationConstraintProcessor.d.ts","sourceRoot":"","sources":["src/ValidationConstraintProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM,wCAAwC,CAAC;AAE/F,OAAW,EAET,KAAK,UAAU,EACf,KAAK,aAAa,EAGnB,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,2BAA2B,GAAG,wBAAwB,GAChE,QAAQ,CAAC;IAAE,0BAA0B,EAAE,SAAS,oBAAoB,EAAE,CAAA;CAAE,CAAC,CAAC;AAE5E,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,2BAA2B,CAK9F;AAED,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED,MAAM,MAAM,4BAA4B,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,UAAU,CAAC;AAQxE,qBAAa,6BAA6B;;gBAG5B,QAAQ,EAAE,4BAA4B;IAIlD,OAAO,CAAC,UAAU,EAAE,oBAAoB,GAAG,aAAa;CAoBzD"}
package/index.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,wCAAwC,CAAC;AAC5D,OAAO,KAAK,aAAa,MAAM,+CAA+C,CAAC;AAO/E,oBAAY,qBAAqB;IAC/B,KAAK,UAAU;CAChB;AAED,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,MAAM;;IAC7C,MAAM,CAAC,QAAQ,CAAC,sBAAsB,4BAA4B;IAC1D,CAAC,aAAa,CAAC,EAAE,OAAO,WAAW,CAAC;IAG5C,IAAa,IAAI,IAAI,MAAM,CAE1B;IAGc,OAAO,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;CAoB9D"}
package/utils.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,wCAAwC,CAAC;AACjE,OAAO,KAAK,iBAAiB,MAAM,iEAAiE,CAAC;AACrG,OAAW,EAAE,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEhH,MAAM,MAAM,OAAO,GAAG,QAAQ,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC,CAAC;AAEH,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AAEnD,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,iBAAiB,GAAG,UAAU,CAG3G;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,UAAU,EAAE,GAAG,aAAa,CAWxG;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,GAAG,mBAAmB,CAQ/F"}