@tsofist/schema-forge 5.2.3 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/schema-generator/forge.spec.js +111 -0
- package/lib/schema-generator/generate-drafts.d.ts +1 -0
- package/lib/schema-generator/generate-drafts.d.ts.map +1 -1
- package/lib/schema-generator/generate-drafts.js +9 -1
- package/lib/schema-generator/generate-schema.d.ts.map +1 -1
- package/lib/schema-generator/generate-schema.js +2 -0
- package/lib/schema-generator/types.d.ts +2 -2
- package/lib/schema-generator/types.d.ts.map +1 -1
- package/lib/schema-generator/types.js +2 -0
- package/lib/schema-registry/kw-common.d.ts +1 -1
- package/lib/schema-registry/kw-common.d.ts.map +1 -1
- package/lib/schema-registry/kw-common.js +90 -0
- package/lib/schema-registry/registry.d.ts.map +1 -1
- package/lib/schema-registry/registry.js +34 -11
- package/lib/schema-registry/types.d.ts +1 -2
- package/lib/schema-registry/types.d.ts.map +1 -1
- package/lib/types.d.ts +4 -0
- package/lib/types.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -14,6 +14,117 @@ const registry_1 = require("../schema-registry/registry");
|
|
|
14
14
|
const forge_1 = require("./forge");
|
|
15
15
|
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
16
16
|
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
17
|
+
describe('validator for a11', () => {
|
|
18
|
+
const outputSchemaFile = './a11.generated.schema.tmp.json';
|
|
19
|
+
const outputSchemaMetadataFile = './a11.generated.definitions.tmp.json';
|
|
20
|
+
let registry;
|
|
21
|
+
let loadedSchema;
|
|
22
|
+
beforeAll(async () => {
|
|
23
|
+
await (0, forge_1.forgeSchema)({
|
|
24
|
+
schemaId: 'test',
|
|
25
|
+
allowUseFallbackDescription: true,
|
|
26
|
+
tsconfigFrom: './tsconfig.build-test.json',
|
|
27
|
+
sourcesDirectoryPattern: 'test-sources/a11',
|
|
28
|
+
sourcesFilesPattern: ['service-api.ts', 'types.ts'],
|
|
29
|
+
outputSchemaFile,
|
|
30
|
+
outputSchemaMetadataFile,
|
|
31
|
+
expose: 'export',
|
|
32
|
+
explicitPublic: true,
|
|
33
|
+
extraTags: ['abstract', 'struct', 'flimsy'],
|
|
34
|
+
});
|
|
35
|
+
loadedSchema = await (0, loader_1.loadJSONSchema)([outputSchemaFile]);
|
|
36
|
+
registry = (0, registry_1.createSchemaForgeRegistry)({
|
|
37
|
+
engine: {
|
|
38
|
+
meta: true,
|
|
39
|
+
verbose: true,
|
|
40
|
+
strictSchema: true,
|
|
41
|
+
validateSchema: true,
|
|
42
|
+
strict: true,
|
|
43
|
+
strictTypes: true,
|
|
44
|
+
strictTuples: false,
|
|
45
|
+
allErrors: true,
|
|
46
|
+
allowUnionTypes: true,
|
|
47
|
+
schemas: [loadedSchema],
|
|
48
|
+
keywords: [
|
|
49
|
+
'abstract',
|
|
50
|
+
'struct',
|
|
51
|
+
{ keyword: 'flimsy', type: 'object', schemaType: 'boolean' },
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
registry.warmupCacheSync();
|
|
56
|
+
});
|
|
57
|
+
afterAll(async () => {
|
|
58
|
+
if (!artefacts_policy_1.KEEP_SPEC_ARTEFACTS) {
|
|
59
|
+
await (0, promises_1.unlink)(outputSchemaFile).catch(noop_1.noop);
|
|
60
|
+
await (0, promises_1.unlink)(outputSchemaMetadataFile).catch(noop_1.noop);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
it('extra tags: basic', () => {
|
|
64
|
+
const schema = registry.getRootSchema('test');
|
|
65
|
+
expect(schema).toMatchSnapshot();
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
describe('validator for a10', () => {
|
|
69
|
+
const outputSchemaFile = './a10.generated.schema.tmp.json';
|
|
70
|
+
const outputSchemaMetadataFile = './a10.generated.definitions.tmp.json';
|
|
71
|
+
let registry;
|
|
72
|
+
let loadedSchema;
|
|
73
|
+
beforeAll(async () => {
|
|
74
|
+
await (0, forge_1.forgeSchema)({
|
|
75
|
+
schemaId: 'test',
|
|
76
|
+
allowUseFallbackDescription: true,
|
|
77
|
+
tsconfigFrom: './tsconfig.build-test.json',
|
|
78
|
+
sourcesDirectoryPattern: 'test-sources/a10',
|
|
79
|
+
sourcesFilesPattern: ['service-api.ts', 'types.ts'],
|
|
80
|
+
outputSchemaFile,
|
|
81
|
+
outputSchemaMetadataFile,
|
|
82
|
+
expose: 'all',
|
|
83
|
+
explicitPublic: false,
|
|
84
|
+
});
|
|
85
|
+
registry = (0, registry_1.createSchemaForgeRegistry)({
|
|
86
|
+
engine: { meta: true, verbose: true },
|
|
87
|
+
});
|
|
88
|
+
loadedSchema = await (0, loader_1.loadJSONSchema)([outputSchemaFile]);
|
|
89
|
+
registry.addSchema(loadedSchema);
|
|
90
|
+
});
|
|
91
|
+
afterAll(async () => {
|
|
92
|
+
if (!artefacts_policy_1.KEEP_SPEC_ARTEFACTS) {
|
|
93
|
+
await (0, promises_1.unlink)(outputSchemaFile).catch(noop_1.noop);
|
|
94
|
+
await (0, promises_1.unlink)(outputSchemaMetadataFile).catch(noop_1.noop);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
it('basic', () => {
|
|
98
|
+
const schema = registry.getSchema('test#/definitions/ComplexTypeA');
|
|
99
|
+
const result = registry.validateBySchema('test#/definitions/ComplexTypeA', {
|
|
100
|
+
id: '123',
|
|
101
|
+
name: 'Test',
|
|
102
|
+
values: [1, 2, 3],
|
|
103
|
+
isActive: true,
|
|
104
|
+
details: {
|
|
105
|
+
status: 'inactive',
|
|
106
|
+
metadata: {
|
|
107
|
+
createdAt: new Date('2025-11-05T00:00:00Z'),
|
|
108
|
+
updatedAt: new Date('2025-11-05T00:00:00Z'),
|
|
109
|
+
tags: ['tag1', 'tag2'],
|
|
110
|
+
},
|
|
111
|
+
payload: {
|
|
112
|
+
data: { key: 'example', value: 42 },
|
|
113
|
+
checksum: 'abc123',
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
expect({
|
|
118
|
+
schema,
|
|
119
|
+
result,
|
|
120
|
+
}).toMatchSnapshot();
|
|
121
|
+
});
|
|
122
|
+
it('checks', () => {
|
|
123
|
+
expect(() => {
|
|
124
|
+
registry.getSchema('test#/definitions/ComplexTypeB');
|
|
125
|
+
}).toThrow(/Variant schema must require discriminator property/);
|
|
126
|
+
});
|
|
127
|
+
});
|
|
17
128
|
describe('validator for a9', () => {
|
|
18
129
|
const outputSchemaFile = './a9.generated.schema.tmp.json';
|
|
19
130
|
const outputSchemaMetadataFile = './a9.generated.definitions.tmp.json';
|
|
@@ -9,6 +9,7 @@ export declare function generateDraftTypeFiles(options: SFDTGOptions): Promise<{
|
|
|
9
9
|
sourcesTypesGeneratorConfig: CompletedConfig;
|
|
10
10
|
namesBySourceFile: Map<string, Set<string>>;
|
|
11
11
|
}>;
|
|
12
|
+
export declare function mergeConfigExtraTags(target: CompletedConfig, source: ForgeSchemaOptions): CompletedConfig;
|
|
12
13
|
interface SFDTGOptions extends ForgeSchemaOptions {
|
|
13
14
|
tsconfig: string;
|
|
14
15
|
sourcesPattern: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-drafts.d.ts","sourceRoot":"","sources":["../../src/schema-generator/generate-drafts.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,eAAe,EAAkB,MAAM,0CAA0C,CAAC;AAsChG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAWnD;;GAEG;AACH,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,YAAY;;;;;
|
|
1
|
+
{"version":3,"file":"generate-drafts.d.ts","sourceRoot":"","sources":["../../src/schema-generator/generate-drafts.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,eAAe,EAAkB,MAAM,0CAA0C,CAAC;AAsChG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAWnD;;GAEG;AACH,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,YAAY;;;;;GAoCjE;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,kBAAkB,mBAMvF;AA8YD,UAAU,YAAa,SAAQ,kBAAkB;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,EAAE,CAAC;CAC5B"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateDraftTypeFiles = generateDraftTypeFiles;
|
|
4
|
+
exports.mergeConfigExtraTags = mergeConfigExtraTags;
|
|
4
5
|
const promises_1 = require("node:fs/promises");
|
|
5
6
|
const node_path_1 = require("node:path");
|
|
6
7
|
const error_1 = require("@tsofist/stem/lib/error");
|
|
@@ -25,7 +26,7 @@ async function generateDraftTypeFiles(options) {
|
|
|
25
26
|
discriminatorType: Config_1.DEFAULT_CONFIG.discriminatorType,
|
|
26
27
|
...types_1.SFG_CONFIG_MANDATORY,
|
|
27
28
|
};
|
|
28
|
-
|
|
29
|
+
mergeConfigExtraTags(sourcesTypesGeneratorConfig, options);
|
|
29
30
|
const ctx = createContext(options, sourcesTypesGeneratorConfig);
|
|
30
31
|
let definitions = ctx.definitions;
|
|
31
32
|
for (const sourceFileName of ctx.fileNames) {
|
|
@@ -44,6 +45,13 @@ async function generateDraftTypeFiles(options) {
|
|
|
44
45
|
namesBySourceFile: ctx.namesBySourceFile,
|
|
45
46
|
};
|
|
46
47
|
}
|
|
48
|
+
function mergeConfigExtraTags(target, source) {
|
|
49
|
+
if (source.extraTags?.length) {
|
|
50
|
+
const tags = new Set([...target.extraTags, ...source.extraTags]);
|
|
51
|
+
target.extraTags = Array.from(tags);
|
|
52
|
+
}
|
|
53
|
+
return target;
|
|
54
|
+
}
|
|
47
55
|
async function processSourceFile(sourceFileName, context) {
|
|
48
56
|
const source = context.program.getSourceFile(sourceFileName);
|
|
49
57
|
if (!source)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-schema.d.ts","sourceRoot":"","sources":["../../src/schema-generator/generate-schema.ts"],"names":[],"mappings":"AAAA,OAAO,+BAA+B,CAAC;AAQvC,OAAO,EAIH,eAAe,EAqBlB,MAAM,0BAA0B,CAAC;AAelC,OAAO,EAAwB,YAAY,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"generate-schema.d.ts","sourceRoot":"","sources":["../../src/schema-generator/generate-schema.ts"],"names":[],"mappings":"AAAA,OAAO,+BAA+B,CAAC;AAQvC,OAAO,EAIH,eAAe,EAqBlB,MAAM,0BAA0B,CAAC;AAelC,OAAO,EAAwB,YAAY,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AASlF;;GAEG;AACH,wBAAsB,0BAA0B,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,YAAY,CAAC,CA0GhG;AA2MD,UAAU,eAAgB,SAAQ,kBAAkB;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,2BAA2B,EAAE,eAAe,CAAC;CAChD"}
|
|
@@ -11,6 +11,7 @@ const ajv_1 = require("ajv");
|
|
|
11
11
|
const jsonpath_plus_1 = require("jsonpath-plus");
|
|
12
12
|
const ts_json_schema_generator_1 = require("ts-json-schema-generator");
|
|
13
13
|
const typescript_1 = require("typescript");
|
|
14
|
+
const generate_drafts_1 = require("./generate-drafts");
|
|
14
15
|
const helpers_tsc_1 = require("./helpers-tsc");
|
|
15
16
|
const patch_enum_node_parser_1 = require("./patch-enum-node-parser");
|
|
16
17
|
const shrink_definition_name_1 = require("./shrink-definition-name");
|
|
@@ -31,6 +32,7 @@ async function generateSchemaByDraftTypes(options) {
|
|
|
31
32
|
discriminatorType: options.discriminatorType ?? ts_json_schema_generator_1.DEFAULT_CONFIG.discriminatorType,
|
|
32
33
|
...types_1.SFG_CONFIG_MANDATORY,
|
|
33
34
|
};
|
|
35
|
+
(0, generate_drafts_1.mergeConfigExtraTags)(generatorConfig, options);
|
|
34
36
|
const generatorProgram = (0, ts_json_schema_generator_1.createProgram)(generatorConfig);
|
|
35
37
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
36
38
|
const typeChecker = generatorProgram.getTypeChecker();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export declare const TMP_FILES_SUFFIX = ".schema-forge.temporary-generated.tmp";
|
|
2
|
-
export declare const SFG_EXTRA_TAGS: readonly ["interface", "property", "method", "member", "apiInterface", "apiProperty", "apiMethod", "apiMember", "dbFK", "dbEntity", "dbColumn", "dbIndex", "dbEnum", "enumAnnotation", "enumMember", "spec", "faker", "version", "hash", "repository", "package"];
|
|
2
|
+
export declare const SFG_EXTRA_TAGS: readonly ["interface", "property", "method", "member", "apiInterface", "apiProperty", "apiMethod", "apiMember", "dbFK", "dbEntity", "dbColumn", "dbIndex", "dbEnum", "enumAnnotation", "enumMember", "spec", "faker", "discriminateBy", "version", "hash", "repository", "package"];
|
|
3
3
|
export declare const SFG_CONFIG_DEFAULTS: {
|
|
4
4
|
readonly additionalProperties: false;
|
|
5
5
|
readonly discriminatorType: undefined;
|
|
6
6
|
readonly encodeRefs: false;
|
|
7
7
|
readonly expose: "export";
|
|
8
|
-
readonly extraTags: ("spec" | "hash" | "dbEntity" | "dbFK" | "dbColumn" | "dbIndex" | "dbEnum" | "enumAnnotation" | "enumMember" | "version" | "package" | "repository" | "interface" | "property" | "method" | "member" | "apiInterface" | "apiProperty" | "apiMethod" | "apiMember" | "faker")[];
|
|
8
|
+
readonly extraTags: ("spec" | "hash" | "dbEntity" | "dbFK" | "dbColumn" | "dbIndex" | "dbEnum" | "enumAnnotation" | "enumMember" | "version" | "package" | "repository" | "interface" | "property" | "method" | "member" | "apiInterface" | "apiProperty" | "apiMethod" | "apiMember" | "faker" | "discriminateBy")[];
|
|
9
9
|
readonly functions: "hide";
|
|
10
10
|
readonly markdownDescription: false;
|
|
11
11
|
readonly skipTypeCheck: false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/schema-generator/types.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,0CAA0C,CAAC;AAExE,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/schema-generator/types.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,0CAA0C,CAAC;AAExE,eAAO,MAAM,cAAc,qRA+BjB,CAAC;AAEX,eAAO,MAAM,mBAAmB;;;;;;;;;;;CAWL,CAAC;AAE5B,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtF,eAAO,MAAM,oBAAoB;;;CAGN,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kw-common.d.ts","sourceRoot":"","sources":["../../src/schema-registry/kw-common.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"kw-common.d.ts","sourceRoot":"","sources":["../../src/schema-registry/kw-common.ts"],"names":[],"mappings":"AAEA,OAAY,EAAE,iBAAiB,EAAyB,MAAM,KAAK,CAAC;AAQpE,eAAO,MAAM,iBAAiB,EAAE,SAAS,iBAAiB,EAmOtD,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SFRCommonKeywords = void 0;
|
|
4
|
+
const text_builder_1 = require("@tsofist/stem/lib/string/text-builder");
|
|
4
5
|
const FakerModulePattern = '^[a-zA-Z.]+$';
|
|
5
6
|
const NP_ENUM_KEY = '^[a-zA-Z0-9-\\._]+$';
|
|
6
7
|
exports.SFRCommonKeywords = [
|
|
@@ -112,4 +113,93 @@ exports.SFRCommonKeywords = [
|
|
|
112
113
|
],
|
|
113
114
|
},
|
|
114
115
|
},
|
|
116
|
+
{
|
|
117
|
+
keyword: 'discriminateBy',
|
|
118
|
+
metaSchema: { type: 'string' },
|
|
119
|
+
type: 'object',
|
|
120
|
+
schemaType: 'string',
|
|
121
|
+
compile(propertyName, targetSchema, ctx) {
|
|
122
|
+
const check = () => {
|
|
123
|
+
const fail = (message) => {
|
|
124
|
+
const t = (0, text_builder_1.txt)([message]);
|
|
125
|
+
t.at([
|
|
126
|
+
['Property:', propertyName],
|
|
127
|
+
['Schema path:', ctx.errSchemaPath],
|
|
128
|
+
]);
|
|
129
|
+
throw new Error(String(t));
|
|
130
|
+
};
|
|
131
|
+
const variants = (targetSchema.anyOf || targetSchema.oneOf);
|
|
132
|
+
if (!variants?.length) {
|
|
133
|
+
return fail(`Schema must have "oneOf" or "anyOf" keyword`);
|
|
134
|
+
}
|
|
135
|
+
const rootSchema = ctx.schemaEnv.root.schema;
|
|
136
|
+
const rootDefs = rootSchema.definitions || rootSchema.$defs || {};
|
|
137
|
+
const validators = new Map();
|
|
138
|
+
const deref = (schema) => {
|
|
139
|
+
if (!schema)
|
|
140
|
+
return undefined;
|
|
141
|
+
if (schema.$ref) {
|
|
142
|
+
if (typeof schema.$ref !== 'string' || !schema.$ref.startsWith('#/'))
|
|
143
|
+
return undefined;
|
|
144
|
+
const localRef = schema.$ref.slice(2).split('/').at(1);
|
|
145
|
+
if (!localRef)
|
|
146
|
+
return undefined;
|
|
147
|
+
const result = rootDefs[localRef];
|
|
148
|
+
if (result?.$ref)
|
|
149
|
+
return deref(result);
|
|
150
|
+
return result;
|
|
151
|
+
}
|
|
152
|
+
return schema;
|
|
153
|
+
};
|
|
154
|
+
for (const variant of variants) {
|
|
155
|
+
const val = deref(variant);
|
|
156
|
+
if (val) {
|
|
157
|
+
if (!val.properties ||
|
|
158
|
+
!val.required ||
|
|
159
|
+
!val.required.includes(propertyName)) {
|
|
160
|
+
return fail(`Variant schema must require discriminator property`);
|
|
161
|
+
}
|
|
162
|
+
const propSchema = deref(val.properties[propertyName]);
|
|
163
|
+
if (propSchema && 'const' in propSchema) {
|
|
164
|
+
validators.set(propSchema.const, ctx.self.compile({ ...val, definitions: rootDefs }));
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return validators;
|
|
169
|
+
};
|
|
170
|
+
const preparedValidators = check();
|
|
171
|
+
const validator = function ValidatorForDiscriminateBy(data, ctx) {
|
|
172
|
+
validator.errors = [];
|
|
173
|
+
if (!(propertyName in data)) {
|
|
174
|
+
validator.errors.push({
|
|
175
|
+
keyword: 'discriminateBy',
|
|
176
|
+
propertyName,
|
|
177
|
+
message: 'Discriminator property is missing',
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
const discriminationValue = data[propertyName];
|
|
182
|
+
const preparedValidator = preparedValidators.get(discriminationValue);
|
|
183
|
+
if (!preparedValidator) {
|
|
184
|
+
validator.errors.push({
|
|
185
|
+
keyword: 'discriminateBy',
|
|
186
|
+
propertyName,
|
|
187
|
+
message: `No matching schema for discriminator value: ${String(discriminationValue)}`,
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
preparedValidator(data, ctx);
|
|
192
|
+
if (preparedValidator.errors && preparedValidator.errors.length) {
|
|
193
|
+
validator.errors.push(...preparedValidator.errors.map((item) => {
|
|
194
|
+
delete item.parentSchema?.definitions;
|
|
195
|
+
return item;
|
|
196
|
+
}));
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return validator.errors.length === 0;
|
|
201
|
+
};
|
|
202
|
+
return validator;
|
|
203
|
+
},
|
|
204
|
+
},
|
|
115
205
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/schema-registry/registry.ts"],"names":[],"mappings":"AA8BA,OAAO,EACH,mBAAmB,EAEnB,0BAA0B,EAC7B,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/schema-registry/registry.ts"],"names":[],"mappings":"AA8BA,OAAO,EACH,mBAAmB,EAEnB,0BAA0B,EAC7B,MAAM,SAAS,CAAC;AAuBjB;;;;GAIG;AACH,wBAAgB,yBAAyB,CACrC,OAAO,CAAC,EAAE,0BAA0B,GACrC,mBAAmB,CA+OrB"}
|
|
@@ -17,23 +17,24 @@ const kw_api_1 = require("./kw-api");
|
|
|
17
17
|
const kw_common_1 = require("./kw-common");
|
|
18
18
|
const kw_dbml_1 = require("./kw-dbml");
|
|
19
19
|
const SFR_DEFAULT_OPTIONS = {
|
|
20
|
-
|
|
21
|
-
defaultMeta: 'http://json-schema.org/draft-07/schema',
|
|
20
|
+
addUsedSchema: false,
|
|
22
21
|
allErrors: true,
|
|
23
|
-
strict: true,
|
|
24
|
-
strictSchema: true,
|
|
25
|
-
strictTypes: false,
|
|
26
|
-
strictTuples: false,
|
|
27
22
|
allowUnionTypes: true,
|
|
23
|
+
code: { es5: false, esm: false, optimize: 2 },
|
|
28
24
|
coerceTypes: false,
|
|
25
|
+
defaultMeta: 'http://json-schema.org/draft-07/schema',
|
|
26
|
+
discriminator: false,
|
|
27
|
+
inlineRefs: true,
|
|
28
|
+
meta: true,
|
|
29
|
+
ownProperties: true,
|
|
29
30
|
removeAdditional: false,
|
|
31
|
+
strict: true,
|
|
32
|
+
strictSchema: true,
|
|
33
|
+
validateSchema: true,
|
|
34
|
+
strictTuples: false,
|
|
35
|
+
strictTypes: false,
|
|
30
36
|
unicodeRegExp: true,
|
|
31
37
|
useDefaults: false,
|
|
32
|
-
addUsedSchema: false,
|
|
33
|
-
inlineRefs: true,
|
|
34
|
-
ownProperties: true,
|
|
35
|
-
discriminator: false,
|
|
36
|
-
code: { es5: false, esm: false, optimize: 2 },
|
|
37
38
|
};
|
|
38
39
|
/**
|
|
39
40
|
* Create JSON schema data validation registry
|
|
@@ -230,6 +231,28 @@ function addJSDocKeywords(engine) {
|
|
|
230
231
|
...kw_api_1.SFRAPIDefinitionKeywords,
|
|
231
232
|
...kw_dbml_1.SFRDBMLKeywords,
|
|
232
233
|
]);
|
|
234
|
+
const oKeywords = engine.RULES.rules.find((value) => value.type === 'object');
|
|
235
|
+
if (oKeywords) {
|
|
236
|
+
const top = ['discriminateBy'];
|
|
237
|
+
oKeywords.rules.sort((a, b) => {
|
|
238
|
+
const ia = top.indexOf(a.keyword);
|
|
239
|
+
const ib = top.indexOf(b.keyword);
|
|
240
|
+
if (ia === -1 && ib === -1)
|
|
241
|
+
return 0;
|
|
242
|
+
if (ia === -1)
|
|
243
|
+
return 1;
|
|
244
|
+
if (ib === -1)
|
|
245
|
+
return -1;
|
|
246
|
+
return ia - ib;
|
|
247
|
+
});
|
|
248
|
+
const first = oKeywords.rules.at(0);
|
|
249
|
+
if (first && first.keyword === 'discriminateBy') {
|
|
250
|
+
engine.RULES.rules.unshift({
|
|
251
|
+
type: 'object',
|
|
252
|
+
rules: [first],
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
}
|
|
233
256
|
}
|
|
234
257
|
function checkIsSyncValidator(fn) {
|
|
235
258
|
if (typeof fn === 'function' && '$async' in fn) {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { ArrayMay, Nullable } from '@tsofist/stem';
|
|
2
2
|
import type { NonNegativeInt } from '@tsofist/stem/lib/number/integer/types';
|
|
3
3
|
import type { ErrorsTextOptions, Options } from 'ajv';
|
|
4
|
-
import type { Options as AjvOptions } from 'ajv/dist/core';
|
|
5
4
|
import type { JSONSchema7 } from 'json-schema';
|
|
6
5
|
import type { SchemaDefinitionInfo, SchemaDefinitionInfoKind } from '../definition-info/types';
|
|
7
6
|
import type { SchemaForgeValidationContextBase } from '../efc';
|
|
@@ -84,7 +83,7 @@ export interface SchemaForgeRegistryOptions {
|
|
|
84
83
|
* @see https://ajv.js.org/options.html Options reference
|
|
85
84
|
* @see https://ajv.js.org/json-schema.html Schema reference
|
|
86
85
|
*/
|
|
87
|
-
engine?:
|
|
86
|
+
engine?: Options;
|
|
88
87
|
/**
|
|
89
88
|
* Use additional formats via ajv-formats
|
|
90
89
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/schema-registry/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACtD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/schema-registry/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAC/F,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,QAAQ,CAAC;AAC/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,KAAK,EACR,wBAAwB,EACxB,6BAA6B,EAC7B,2BAA2B,EAC3B,2BAA2B,EAC9B,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,2CAA2C,GAAG,CACtD,IAAI,EAAE,oBAAoB,EAC1B,QAAQ,EAAE,WAAW,CAAC,qBAAqB,EAAE,OAAO,CAAC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,OAAO,CAAC,EAAE,GAAG,KACZ,IAAI,IAAI,CAAC,CAAC;IAEf;;OAEG;IACH,oBAAoB,EAAE,CAClB,MAAM,EAAE,QAAQ,CAAC,2BAA2B,CAAC,EAC7C,OAAO,CAAC,EAAE,iBAAiB,KAC1B,MAAM,CAAC;IAEZ;;OAEG;IACH,eAAe,EAAE,CAAC,CAAC,SAAS,oBAAoB,EAC5C,SAAS,CAAC,EAAE,2CAA2C,GAAG,wBAAwB,KACjF,CAAC,EAAE,CAAC;IACT;;;OAGG;IACH,WAAW,EAAE,CAAC,mBAAmB,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/E;;;OAGG;IACH,eAAe,EAAE,YAAY,CAAC;CACjC;AAED,MAAM,WAAW,0BAA0B;IACvC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B"}
|
package/lib/types.d.ts
CHANGED
|
@@ -140,6 +140,10 @@ export interface ForgeSchemaOptions {
|
|
|
140
140
|
* @default false
|
|
141
141
|
*/
|
|
142
142
|
readonly suppressMultipleDefinitionsErrors?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Extra JSDoc tags to be recognized by the generator and included in the schema definitions.
|
|
145
|
+
*/
|
|
146
|
+
readonly extraTags?: string[];
|
|
143
147
|
}
|
|
144
148
|
export type ForgedSchemaDefinitionShortName = `DSN${string}_H${string}`;
|
|
145
149
|
export interface SchemaForgeMetadata {
|
package/lib/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,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",
|
|
4
4
|
"description": "Generate JSON schema from TypeScript types",
|
|
5
5
|
"author": "Andrew Berdnikov <tsofistgudmen@gmail.com>",
|
|
6
6
|
"license": "LGPL-3.0",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@dbml/core": "~3.14.1",
|
|
24
24
|
"@faker-js/faker": "^9.9.0",
|
|
25
|
-
"@tsofist/stem": "^5.
|
|
25
|
+
"@tsofist/stem": "^5.11.0",
|
|
26
26
|
"@ungap/structured-clone": "^1.3.0",
|
|
27
27
|
"ajv": "^8.17.1",
|
|
28
28
|
"ajv-formats": "^3.0.1",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"jest": "~30.2.0",
|
|
42
42
|
"rimraf": "^6.0.1",
|
|
43
43
|
"supertest": "^7.1.4",
|
|
44
|
-
"ts-jest": "~29.4.
|
|
44
|
+
"ts-jest": "~29.4.5",
|
|
45
45
|
"typescript": "~5.9.3"
|
|
46
46
|
},
|
|
47
47
|
"publishConfig": {
|