@onereach/state-machine-json-schema-ajv 0.0.0-stage → 1.0.0-framework.14
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/README.md +97 -2
- package/dist/index.d.mts +26 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +45 -3
package/README.md
CHANGED
|
@@ -1,3 +1,98 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @onereach/state-machine-json-schema-ajv
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Optional AJV integration for compiling persisted JSON Schemas into synchronous,
|
|
4
|
+
non-transforming Standard Schema data validators. The engine-independent
|
|
5
|
+
validation package owns result consumption, preparation, caching, and targeted
|
|
6
|
+
errors; it does not import or configure AJV. Choose this compiler at the
|
|
7
|
+
composition root, or supply another `JsonSchemaValidatorCompiler`.
|
|
8
|
+
|
|
9
|
+
This package replaces `@onereach/state-machine-validation-ajv` without an alias.
|
|
10
|
+
Update imports to `@onereach/state-machine-json-schema-ajv`. Public compiler and
|
|
11
|
+
validator class names, safety checks, and persisted template formats are unchanged;
|
|
12
|
+
the Standard Schema vendor identifier follows the new package name.
|
|
13
|
+
|
|
14
|
+
When invoked by a framework template preparer, `schema.compile` traces the call
|
|
15
|
+
to this compiler, not proof of fresh AJV code generation. AJV's internal caches
|
|
16
|
+
and this compiler's schema-graph checks remain unchanged. Direct compiler calls
|
|
17
|
+
emit no framework preparation spans. See the
|
|
18
|
+
[preparation tracing guide](../state-machine-validation/README.md#preparation-tracing).
|
|
19
|
+
|
|
20
|
+
Compiled validators implement Standard Schema v1 directly. Call
|
|
21
|
+
`validator['~standard'].validate(value)` or pass the validator to a Standard Schema
|
|
22
|
+
consumer; no interoperability wrapper is required.
|
|
23
|
+
|
|
24
|
+
Runtime JSON Schema validation for state-machine templates, using AJV.
|
|
25
|
+
AOT contracts check the persisted format; this adapter prepares the
|
|
26
|
+
embedded state, function-input, and function-output schemas for execution.
|
|
27
|
+
It implements `JsonSchemaValidatorCompiler` from `@onereach/state-machine-validation`.
|
|
28
|
+
Compiled validators return synchronous `{ value }` or `{ issues }` results, not
|
|
29
|
+
booleans or mutable "last issues". Their vendor is `@onereach/state-machine-json-schema-ajv`.
|
|
30
|
+
Success preserves input identity; failures snapshot normalized issues, including
|
|
31
|
+
engine error parameters, so later calls cannot overwrite earlier diagnostics.
|
|
32
|
+
`SchemaValidationIssue` is exported by the validation package and preserves runtime
|
|
33
|
+
schema keyword/location details alongside required messages and decoded string
|
|
34
|
+
path segments; it is not the pointer-based `ContractIssue` representation.
|
|
35
|
+
|
|
36
|
+
Runtime execution can also accept independently supplied `SynchronousDataValidator`
|
|
37
|
+
values directly. Those validators need not originate from JSON Schema or AJV, but
|
|
38
|
+
must preserve successful input identity and support synchronous, non-transforming
|
|
39
|
+
validation. Standard Schema compatibility alone does not provide a compiler for
|
|
40
|
+
the JSON Schema objects stored in templates.
|
|
41
|
+
|
|
42
|
+
## Preparation guarantees
|
|
43
|
+
|
|
44
|
+
`AjvJsonSchemaValidatorCompiler.compile(schema)` validates the schema against the
|
|
45
|
+
active dialect's meta-schema before compiling it. It throws for:
|
|
46
|
+
|
|
47
|
+
- Invalid schema keyword values or unsupported keywords.
|
|
48
|
+
- An explicit `$schema` that does not match the engine's default dialect,
|
|
49
|
+
including declarations on nested schema resources and registered references.
|
|
50
|
+
- Unresolved local or external references (no implicit network loading).
|
|
51
|
+
- Async schemas, which cannot implement the synchronous validator interface.
|
|
52
|
+
|
|
53
|
+
Draft 7 is the default for schemas without `$schema`. To use another dialect,
|
|
54
|
+
provide a matching AJV engine, such as `Ajv2020` for Draft 2020-12. Even if another
|
|
55
|
+
meta-schema is registered, mixing dialects within one compiler is not supported.
|
|
56
|
+
Create a separate compiler with the appropriate engine instead.
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
import { Ajv2020 } from 'ajv/dist/2020.js';
|
|
60
|
+
import { AjvJsonSchemaValidatorCompiler } from '@onereach/state-machine-json-schema-ajv';
|
|
61
|
+
|
|
62
|
+
const ajv = new Ajv2020({ strict: true });
|
|
63
|
+
ajv.addSchema({ $id: 'https://example.com/id', type: 'integer', minimum: 1 });
|
|
64
|
+
const compiler = new AjvJsonSchemaValidatorCompiler({ ajv });
|
|
65
|
+
const validator = compiler.compile({ $ref: 'https://example.com/id' });
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Supplied engines must have a registered default dialect meta-schema and
|
|
69
|
+
`strictSchema: true`; `defaultMeta` cannot override the engine dialect. Schema
|
|
70
|
+
validation must not mutate data: engines with `coerceTypes`, `useDefaults`, or
|
|
71
|
+
`removeAdditional` enabled are rejected. Custom keyword implementations must also
|
|
72
|
+
remain non-mutating. Schema
|
|
73
|
+
meta-validation is explicit even if `validateSchema: false` is configured.
|
|
74
|
+
Register referenced schemas and custom keywords/formats on the engine before
|
|
75
|
+
constructing the compiler. Before compilation, the adapter checks the submitted
|
|
76
|
+
schema graph and **all registered application schemas**, even when automatic
|
|
77
|
+
validation was disabled while registering them. Application schemas must therefore
|
|
78
|
+
be valid even if a particular compilation does not reference them. Registered
|
|
79
|
+
meta-schemas are excluded from this application-dialect check.
|
|
80
|
+
|
|
81
|
+
Traversal follows standard schema-valued keywords, including `$defs`,
|
|
82
|
+
`definitions`, applicators, and schema-valued dependencies. It does not interpret
|
|
83
|
+
literal data in `const`, `enum`, `default`, `examples`, or property-dependency lists
|
|
84
|
+
as schemas. Cyclic JavaScript schema objects are rejected; recursive `$ref`
|
|
85
|
+
schemas are supported and references are still resolved by AJV, without fetching.
|
|
86
|
+
Newly registered schemas are checked on the next compilation. Successfully
|
|
87
|
+
prepared schema objects are cached by identity and must remain immutable, as
|
|
88
|
+
required by AJV's own compilation cache.
|
|
89
|
+
|
|
90
|
+
The caller is responsible for custom keyword/format implementations, including
|
|
91
|
+
any nonstandard schema-bearing positions introduced by an extension, and must not
|
|
92
|
+
subsequently loosen the engine's configuration. Formats require the appropriate implementation (for example
|
|
93
|
+
`ajv-formats`); unknown formats are rejected under the default strict settings.
|
|
94
|
+
|
|
95
|
+
`StateTemplatePreparer` / `CachedStateTemplatePreparer` from `@onereach/state-machine-validation` prepares
|
|
96
|
+
all embedded schemas and validates the initial state using this injected adapter.
|
|
97
|
+
The store performs this preparation before persistence, so a
|
|
98
|
+
template that passes the contracts' shape checks can still be rejected safely here.
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Ajv } from "ajv";
|
|
2
|
+
import { JsonSchema } from "@onereach/state-machine-contracts";
|
|
3
|
+
import { JsonSchemaValidatorCompiler, SchemaValidationIssue, SynchronousDataValidator } from "@onereach/state-machine-validation";
|
|
4
|
+
//#region src/compiler/types.d.ts
|
|
5
|
+
interface AjvJsonSchemaValidatorCompilerOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Optional dialect-specific engine (Draft 7 by default). Its default
|
|
8
|
+
* meta-schema must be registered and strictSchema must be true. Register
|
|
9
|
+
* external references before constructing the compiler. No network loading.
|
|
10
|
+
* All registered application schemas are meta-validated, not just the root.
|
|
11
|
+
* Prepared schema objects must remain immutable for the compiler's lifetime.
|
|
12
|
+
*/
|
|
13
|
+
ajv?: Ajv;
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/compiler/compiler.d.ts
|
|
17
|
+
declare class AjvJsonSchemaValidatorCompiler implements JsonSchemaValidatorCompiler {
|
|
18
|
+
private readonly ajv;
|
|
19
|
+
private readonly dialect;
|
|
20
|
+
private readonly validatedSchemas;
|
|
21
|
+
constructor(options?: AjvJsonSchemaValidatorCompilerOptions);
|
|
22
|
+
compile<T = unknown>(schema: JsonSchema): SynchronousDataValidator<T, SchemaValidationIssue>;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { AjvJsonSchemaValidatorCompiler, type AjvJsonSchemaValidatorCompilerOptions };
|
|
26
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/compiler/types.ts","../src/compiler/compiler.ts"],"mappings":";;;;UAEiB;;;;;;;;EAQf,MAAM;;;;cCGK,0CAA0C;mBACpC;mBACA;mBACA;EAEL,YAAA,UAAS;EA2Bd,QAAQ,aAAa,QAAQ,aAAa,yBAAyB,GAAG"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Ajv as e}from"ajv";var t=class{"~standard";constructor(e){this[`~standard`]={version:1,vendor:`@onereach/state-machine-json-schema-ajv`,validate(t){return e(t)?{value:t}:{issues:n(e.errors)}}}}};function n(e){return e?e.map(e=>({path:e.instancePath===``?[]:e.instancePath.slice(1).split(`/`).map(e=>e.replaceAll(`~1`,`/`).replaceAll(`~0`,`~`)),message:e.message??e.keyword??`Invalid value`,keyword:e.keyword,schemaPath:e.schemaPath,params:structuredClone(e.params)})):[]}const r=[`$defs`,`definitions`,`properties`,`patternProperties`,`dependentSchemas`],i=[`allOf`,`anyOf`,`oneOf`,`prefixItems`],a=[`additionalProperties`,`additionalItems`,`contains`,`propertyNames`,`not`,`if`,`then`,`else`,`unevaluatedProperties`,`unevaluatedItems`,`contentSchema`];function o(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function*s(e){for(let t of r){let n=e[t];if(n!==void 0){if(!o(n))throw Error(`Invalid JSON Schema: ${t} must be an object`);yield*Object.values(n)}}for(let t of i){let n=e[t];if(n!==void 0){if(!Array.isArray(n))throw Error(`Invalid JSON Schema: ${t} must be an array`);for(let e=0;e<n.length;e++)yield n[e]}}for(let t of a)e[t]!==void 0&&(yield e[t]);if(e.items!==void 0){if(Array.isArray(e.items))for(let t=0;t<e.items.length;t++)yield e.items[t];else yield e.items}let t=e.dependencies;if(t!==void 0){if(!o(t))throw Error(`Invalid JSON Schema: dependencies must be an object`);for(let e of Object.values(t))Array.isArray(e)||(yield e)}}function c(e,t,n,r){let i=[t],a=[...Object.values(e.schemas),...Object.values(e.refs)];for(let e of a)!e||typeof e==`string`||e.meta||e.root.meta||i.push(e.schema);let c=new WeakSet,l=new WeakSet,u=[];function d(e){if(typeof e==`boolean`)return;if(!o(e))throw Error(`Invalid JSON Schema: expected an object or boolean schema`);if(l.has(e))throw Error(`Invalid JSON Schema: cyclic schema objects must use $ref`);if(c.has(e)||r.has(e))return;let t=e.$schema;if(t!==void 0&&(typeof t!=`string`||t.replace(/#$/,``)!==n))throw Error(`Unsupported JSON Schema dialect: ${typeof t==`string`?t:`non-string (${typeof t})`}; expected ${n}`);if(e.$async===!0)throw Error(`Async JSON Schemas are not supported`);l.add(e);for(let t of s(e))d(t);l.delete(e),c.add(e),u.push(e)}for(let e of i)d(e);for(let t of u)if(e.validateSchema(t)!==!0)throw Error(`Invalid JSON Schema: ${e.errorsText()}`);return u}var l=class{ajv;dialect;validatedSchemas=new WeakSet;constructor(t={}){this.ajv=t.ajv??new e({allErrors:!0,strict:!0});let n=this.ajv.opts.defaultMeta,r=this.ajv.defaultMeta();if(typeof r!=`string`||!this.ajv.getSchema(r))throw Error(`AJV requires a registered default dialect meta-schema`);if(this.dialect=r.replace(/#$/,``),this.ajv.opts.strictSchema!==!0)throw Error(`AJV requires strictSchema: true to reject unsupported keywords`);if(this.ajv.opts.coerceTypes||this.ajv.opts.useDefaults||this.ajv.opts.removeAdditional)throw Error(`AJV validation must not coerce values, apply defaults, or remove properties`);if(n!==void 0&&(typeof n!=`string`||n.replace(/#$/,``)!==this.dialect))throw Error(`AJV defaultMeta must match the engine dialect`)}compile(e){let n=c(this.ajv,e,this.dialect,this.validatedSchemas),r=this.ajv.compile(e);if(`$async`in r&&r.$async===!0)throw Error(`Async JSON Schemas are not supported`);for(let e of n)this.validatedSchemas.add(e);return new t(r)}};export{l as AjvJsonSchemaValidatorCompiler};
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/validator/validator.ts","../src/compiler/schema-graph.ts","../src/compiler/compiler.ts"],"sourcesContent":["import type { SynchronousDataValidator, SchemaValidationIssue } from '@onereach/state-machine-validation';\nimport type { ErrorObject, ValidateFunction } from 'ajv';\n\nexport class AjvSchemaValidator<T = unknown> implements SynchronousDataValidator<T, SchemaValidationIssue> {\n readonly '~standard': SynchronousDataValidator<T, SchemaValidationIssue>['~standard'];\n\n constructor(validator: ValidateFunction<T>) {\n this['~standard'] = {\n version: 1,\n vendor: '@onereach/state-machine-json-schema-ajv',\n validate(value) {\n return validator(value) ? { value } : { issues: normalizeErrors(validator.errors) };\n },\n };\n }\n}\n\nfunction normalizeErrors(errors: ErrorObject[] | null | undefined): readonly SchemaValidationIssue[] {\n if (!errors) return [];\n\n return errors.map((error) => ({\n path:\n error.instancePath === ''\n ? []\n : error.instancePath\n .slice(1)\n .split('/')\n .map((part) => part.replaceAll('~1', '/').replaceAll('~0', '~')),\n message: error.message ?? error.keyword ?? 'Invalid value',\n keyword: error.keyword,\n schemaPath: error.schemaPath,\n params: structuredClone(error.params),\n }));\n}\n","import type { Ajv } from 'ajv';\n\nconst schemaMaps = ['$defs', 'definitions', 'properties', 'patternProperties', 'dependentSchemas'] as const;\nconst schemaArrays = ['allOf', 'anyOf', 'oneOf', 'prefixItems'] as const;\nconst singleSchemas = [\n 'additionalProperties',\n 'additionalItems',\n 'contains',\n 'propertyNames',\n 'not',\n 'if',\n 'then',\n 'else',\n 'unevaluatedProperties',\n 'unevaluatedItems',\n 'contentSchema',\n] as const;\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value);\n}\n\n/**\n * Traverse schema-valued keywords only; const/default/examples and other instance data are opaque.\n */\nfunction* children(schema: Record<string, unknown>): Generator<unknown> {\n for (const keyword of schemaMaps) {\n const map = schema[keyword];\n if (map === undefined) continue;\n if (!isRecord(map)) throw new Error(`Invalid JSON Schema: ${keyword} must be an object`);\n yield* Object.values(map);\n }\n for (const keyword of schemaArrays) {\n const array = schema[keyword];\n if (array === undefined) continue;\n if (!Array.isArray(array)) throw new Error(`Invalid JSON Schema: ${keyword} must be an array`);\n // eslint-disable-next-line unicorn/no-for-loop -- Schema arrays may have an input-owned iterator.\n for (let index = 0; index < array.length; index++) {\n const child: unknown = array[index];\n yield child;\n }\n }\n for (const keyword of singleSchemas) {\n if (schema[keyword] !== undefined) yield schema[keyword];\n }\n if (schema.items !== undefined) {\n if (Array.isArray(schema.items)) {\n for (let index = 0; index < schema.items.length; index++) {\n const child: unknown = schema.items[index];\n yield child;\n }\n } else yield schema.items;\n }\n const dependencies = schema.dependencies;\n if (dependencies !== undefined) {\n if (!isRecord(dependencies)) throw new Error('Invalid JSON Schema: dependencies must be an object');\n for (const dependency of Object.values(dependencies)) {\n if (!Array.isArray(dependency)) yield dependency;\n }\n }\n}\n\n/**\n * Validate inline resources and all registered application schemas without compiling or fetching references.\n */\nexport function validateSchemaGraph(\n ajv: Ajv,\n root: unknown,\n dialect: string,\n validated: WeakSet<object>,\n): readonly object[] {\n const roots: unknown[] = [root];\n // AJV exposes its registered schemas/aliases; do not call getSchema(), which could compile first.\n const environments = [...Object.values(ajv.schemas), ...Object.values(ajv.refs)];\n for (const environment of environments) {\n if (!environment || typeof environment === 'string' || environment.meta || environment.root.meta) continue;\n roots.push(environment.schema);\n }\n const visited = new WeakSet<object>();\n const active = new WeakSet<object>();\n const nodes: Record<string, unknown>[] = [];\n function visit(schema: unknown): void {\n if (typeof schema === 'boolean') return;\n if (!isRecord(schema)) throw new Error('Invalid JSON Schema: expected an object or boolean schema');\n if (active.has(schema)) throw new Error('Invalid JSON Schema: cyclic schema objects must use $ref');\n if (visited.has(schema) || validated.has(schema)) return;\n const requested = schema.$schema;\n if (requested !== undefined && (typeof requested !== 'string' || requested.replace(/#$/, '') !== dialect)) {\n const label = typeof requested === 'string' ? requested : `non-string (${typeof requested})`;\n throw new Error(`Unsupported JSON Schema dialect: ${label}; expected ${dialect}`);\n }\n if (schema.$async === true) throw new Error('Async JSON Schemas are not supported');\n active.add(schema);\n for (const child of children(schema)) visit(child);\n active.delete(schema);\n visited.add(schema);\n nodes.push(schema);\n }\n for (const schema of roots) visit(schema);\n for (const schema of nodes) {\n // Explicit even if an injected engine disabled automatic validation at addSchema/compile time.\n if (ajv.validateSchema(schema) !== true) throw new Error(`Invalid JSON Schema: ${ajv.errorsText()}`);\n }\n return nodes;\n}\n","import type { JsonSchema } from '@onereach/state-machine-contracts';\nimport type {\n SynchronousDataValidator,\n SchemaValidationIssue,\n JsonSchemaValidatorCompiler,\n} from '@onereach/state-machine-validation';\nimport { Ajv } from 'ajv';\n\nimport { AjvSchemaValidator } from '../validator/validator.ts';\n\nimport { validateSchemaGraph } from './schema-graph.ts';\nimport type { AjvJsonSchemaValidatorCompilerOptions } from './types.ts';\n\nexport class AjvJsonSchemaValidatorCompiler implements JsonSchemaValidatorCompiler {\n private readonly ajv: Ajv;\n private readonly dialect: string;\n private readonly validatedSchemas = new WeakSet<object>();\n\n constructor(options: AjvJsonSchemaValidatorCompilerOptions = {}) {\n this.ajv =\n options.ajv ??\n new Ajv({\n allErrors: true,\n strict: true,\n });\n const defaultMeta = this.ajv.opts.defaultMeta;\n const dialect = this.ajv.defaultMeta();\n if (typeof dialect !== 'string' || !this.ajv.getSchema(dialect)) {\n throw new Error('AJV requires a registered default dialect meta-schema');\n }\n this.dialect = dialect.replace(/#$/, '');\n if (this.ajv.opts.strictSchema !== true) {\n throw new Error('AJV requires strictSchema: true to reject unsupported keywords');\n }\n if (this.ajv.opts.coerceTypes || this.ajv.opts.useDefaults || this.ajv.opts.removeAdditional) {\n throw new Error('AJV validation must not coerce values, apply defaults, or remove properties');\n }\n if (\n defaultMeta !== undefined &&\n (typeof defaultMeta !== 'string' || defaultMeta.replace(/#$/, '') !== this.dialect)\n ) {\n throw new Error('AJV defaultMeta must match the engine dialect');\n }\n }\n\n public compile<T = unknown>(schema: JsonSchema): SynchronousDataValidator<T, SchemaValidationIssue> {\n const validated = validateSchemaGraph(this.ajv, schema, this.dialect, this.validatedSchemas);\n const validator = this.ajv.compile<T>(schema);\n if ('$async' in validator && validator.$async === true) throw new Error('Async JSON Schemas are not supported');\n // Commit the validation cache only after compilation succeeds; failed schemas may still be corrected.\n for (const node of validated) this.validatedSchemas.add(node);\n return new AjvSchemaValidator<T>(validator);\n }\n}\n"],"mappings":"0BAGA,IAAa,EAAb,KAA2G,CACzG,YAEA,YAAY,EAAgC,CAC1C,KAAK,aAAe,CAClB,QAAS,EACT,OAAQ,0CACR,SAAS,EAAO,CACd,OAAO,EAAU,CAAK,EAAI,CAAE,OAAM,EAAI,CAAE,OAAQ,EAAgB,EAAU,MAAM,CAAE,CACpF,CACF,CACF,CACF,EAEA,SAAS,EAAgB,EAA4E,CAGnG,OAFK,EAEE,EAAO,IAAK,IAAW,CAC5B,KACE,EAAM,eAAiB,GACnB,CAAC,EACD,EAAM,aACH,MAAM,CAAC,CAAC,CACR,MAAM,GAAG,CAAC,CACV,IAAK,GAAS,EAAK,WAAW,KAAM,GAAG,CAAC,CAAC,WAAW,KAAM,GAAG,CAAC,EACvE,QAAS,EAAM,SAAW,EAAM,SAAW,gBAC3C,QAAS,EAAM,QACf,WAAY,EAAM,WAClB,OAAQ,gBAAgB,EAAM,MAAM,CACtC,EAAE,EAdkB,CAAC,CAevB,CC/BA,MAAM,EAAa,CAAC,QAAS,cAAe,aAAc,oBAAqB,kBAAkB,EAC3F,EAAe,CAAC,QAAS,QAAS,QAAS,aAAa,EACxD,EAAgB,CACpB,uBACA,kBACA,WACA,gBACA,MACA,KACA,OACA,OACA,wBACA,mBACA,eACF,EAEA,SAAS,EAAS,EAAkD,CAClE,OAAyB,OAAO,GAAU,YAAnC,GAA+C,CAAC,MAAM,QAAQ,CAAK,CAC5E,CAKA,SAAU,EAAS,EAAqD,CACtE,IAAK,IAAM,KAAW,EAAY,CAChC,IAAM,EAAM,EAAO,GACf,OAAQ,IAAA,GACZ,IAAI,CA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GACE,IAAgB,IAAA,KACf,OAAO,GAAgB,UAAY,EAAY,QAAQ,KAAM,EAAE,IAAM,KAAK,SAE3E,MAAU,MAAM,+CAA+C,CAEnE,CAEA,QAA4B,EAAwE,CAClG,IAAM,EAAY,EAAoB,KAAK,IAAK,EAAQ,KAAK,QAAS,KAAK,gBAAgB,EACrF,EAAY,KAAK,IAAI,QAAW,CAAM,EAC5C,GAAI,WAAY,GAAa,EAAU,SAAW,GAAM,MAAU,MAAM,sCAAsC,EAE9G,IAAK,IAAM,KAAQ,EAAW,KAAK,iBAAiB,IAAI,CAAI,EAC5D,OAAO,IAAI,EAAsB,CAAS,CAC5C,CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,48 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onereach/state-machine-json-schema-ajv",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.0-framework.14",
|
|
4
|
+
"description": "AJV JSON Schema compilation for non-transforming Standard Schema data validation",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"onereach",
|
|
7
|
+
"toolkit",
|
|
8
|
+
"state-machine"
|
|
9
|
+
],
|
|
10
|
+
"author": "OneReach Development Team <dev.team@onereach.ai>",
|
|
11
|
+
"license": "Apache-2.0",
|
|
12
|
+
"type": "module",
|
|
13
|
+
"sideEffects": false,
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"access": "public"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"!dist/metafile*.json"
|
|
20
|
+
],
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@arethetypeswrong/core": "^0.18.5",
|
|
23
|
+
"publint": "^0.3.24",
|
|
24
|
+
"rollup-plugin-visualizer": "^7.1.1",
|
|
25
|
+
"tsdown": "^0.22.14",
|
|
26
|
+
"typescript": "^6.0.3"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@onereach/state-machine-contracts": "1.0.0-framework.13",
|
|
30
|
+
"@onereach/state-machine-validation": "1.0.0-framework.4",
|
|
31
|
+
"ajv": "^8.20.0"
|
|
32
|
+
},
|
|
33
|
+
"exports": {
|
|
34
|
+
".": "./dist/index.mjs",
|
|
35
|
+
"./package.json": "./package.json"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsdown --config tsdown.config.mts",
|
|
39
|
+
"build:visualize": "VISUALIZE=1 pnpm build",
|
|
40
|
+
"typecheck": "tsc --noEmit --incremental --tsBuildInfoFile .cache/typecheck/source.tsbuildinfo && tsc --noEmit -p test/tsconfig.json --incremental --tsBuildInfoFile .cache/typecheck/test.tsbuildinfo",
|
|
41
|
+
"preversion_": "pnpm build && pnpm test",
|
|
42
|
+
"publish:rc": "pnpm version prerelease --preid rc && pnpm publish --tag rc",
|
|
43
|
+
"test": "pnpm run unit",
|
|
44
|
+
"unit": "vitest run",
|
|
45
|
+
"unit:coverage": "vitest run --coverage",
|
|
46
|
+
"preversion": "pnpm build"
|
|
47
|
+
}
|
|
6
48
|
}
|