@tsofist/schema-forge 3.7.0 → 4.0.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/dbml-generator/generator.spec.js +13 -2
- package/lib/dbml-generator/types.d.ts +7 -1
- package/lib/dbml-generator/types.d.ts.map +1 -1
- package/lib/definition-info/guards.d.ts +7 -1
- package/lib/definition-info/guards.d.ts.map +1 -1
- package/lib/definition-info/guards.js +20 -0
- package/lib/definition-info/parser.d.ts +1 -1
- package/lib/definition-info/parser.d.ts.map +1 -1
- package/lib/definition-info/parser.js +10 -10
- package/lib/fake-generator/generator-host.d.ts.map +1 -1
- package/lib/fake-generator/generator-host.js +2 -1
- package/lib/schema-dereference/dereference.d.ts.map +1 -1
- package/lib/schema-dereference/dereference.js +7 -2
- package/lib/schema-dereference/types.d.ts +13 -0
- package/lib/schema-dereference/types.d.ts.map +1 -1
- package/lib/schema-generator/extended-annotations-reader.js +3 -1
- package/lib/schema-generator/forge.spec.js +96 -7
- package/lib/schema-generator/generate-drafts.d.ts.map +1 -1
- package/lib/schema-generator/generate-drafts.js +1 -0
- package/lib/schema-generator/generate-schema.d.ts +1 -1
- package/lib/schema-generator/generate-schema.d.ts.map +1 -1
- package/lib/schema-generator/generate-schema.js +65 -5
- package/lib/schema-generator/helpers-tsc.d.ts +2 -0
- package/lib/schema-generator/helpers-tsc.d.ts.map +1 -1
- package/lib/schema-generator/helpers-tsc.js +18 -1
- package/lib/schema-generator/patch-enum-node-parser.d.ts +12 -0
- package/lib/schema-generator/patch-enum-node-parser.d.ts.map +1 -0
- package/lib/schema-generator/patch-enum-node-parser.js +54 -0
- package/lib/schema-generator/shrink-definition-name.d.ts +2 -2
- package/lib/schema-generator/shrink-definition-name.d.ts.map +1 -1
- package/lib/schema-generator/shrink-definition-name.js +2 -2
- package/lib/schema-generator/types.d.ts +8 -7
- package/lib/schema-generator/types.d.ts.map +1 -1
- package/lib/schema-generator/types.js +31 -21
- package/lib/schema-registry/kw-api.d.ts.map +1 -1
- package/lib/schema-registry/kw-api.js +4 -4
- package/lib/schema-registry/kw-common.d.ts.map +1 -1
- package/lib/schema-registry/kw-common.js +44 -0
- package/lib/schema-registry/kw-dbml.d.ts +1 -1
- package/lib/schema-registry/kw-dbml.d.ts.map +1 -1
- package/lib/schema-registry/kw-dbml.js +6 -2
- package/lib/schema-registry/registry.d.ts.map +1 -1
- package/lib/schema-registry/registry.js +5 -2
- package/lib/schema-registry/types.d.ts +3 -3
- package/lib/schema-registry/types.d.ts.map +1 -1
- package/lib/types.d.ts +25 -15
- package/lib/types.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers-tsc.d.ts","sourceRoot":"","sources":["../../src/schema-generator/helpers-tsc.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,YAAY,EACjB,KAAK,eAAe,EAGpB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,IAAI,EACT,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAUhC,MAAM,YAAY,CAAC;AAEpB,wBAAgB,kBAAkB,CAC9B,MAAM,EAAE,eAAe,GAAG,iBAAiB,GAAG,wBAAwB,GACvE,MAAM,GAAG,SAAS,CAapB;AAED,wBAAgB,oBAAoB,CAChC,IAAI,EAAE,IAAI,EACV,2BAA2B,EAAE,OAAO,GAAG,SAAS,EAChD,qCAAqC,UAAO,GAC7C,MAAM,GAAG,SAAS,CAsCpB;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"helpers-tsc.d.ts","sourceRoot":"","sources":["../../src/schema-generator/helpers-tsc.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,YAAY,EACjB,KAAK,eAAe,EAGpB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,IAAI,EACT,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAUhC,MAAM,YAAY,CAAC;AAEpB,wBAAgB,kBAAkB,CAC9B,MAAM,EAAE,eAAe,GAAG,iBAAiB,GAAG,wBAAwB,GACvE,MAAM,GAAG,SAAS,CAapB;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAcjF;AAED,wBAAgB,oBAAoB,CAChC,IAAI,EAAE,IAAI,EACV,2BAA2B,EAAE,OAAO,GAAG,SAAS,EAChD,qCAAqC,UAAO,GAC7C,MAAM,GAAG,SAAS,CAsCpB;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAAC;AAC7D,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,SAAS,CAAC;AAQ7D,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAKvE;AAED,wBAAgB,WAAW,CAAC,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAM3D;AAED,wBAAgB,qBAAqB,CACjC,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,EAClB,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,GAC3B,MAAM,GAAG,SAAS,CAQpB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.readMemberTypeName = readMemberTypeName;
|
|
4
|
+
exports.readJSDocTagValue = readJSDocTagValue;
|
|
4
5
|
exports.readJSDocDescription = readJSDocDescription;
|
|
5
6
|
exports.readNodeName = readNodeName;
|
|
6
7
|
exports.readInterfaceGenericText = readInterfaceGenericText;
|
|
@@ -20,6 +21,19 @@ function readMemberTypeName(member) {
|
|
|
20
21
|
}
|
|
21
22
|
return type?.getText();
|
|
22
23
|
}
|
|
24
|
+
function readJSDocTagValue(node, tagName) {
|
|
25
|
+
let value = undefined;
|
|
26
|
+
{
|
|
27
|
+
const isTag = (tag) => {
|
|
28
|
+
if (tag.tagName.escapedText === tagName) {
|
|
29
|
+
value = (0, typescript_1.getTextOfJSDocComment)(tag.comment);
|
|
30
|
+
}
|
|
31
|
+
return value !== undefined;
|
|
32
|
+
};
|
|
33
|
+
(0, typescript_1.getAllJSDocTags)(node, isTag);
|
|
34
|
+
}
|
|
35
|
+
return value;
|
|
36
|
+
}
|
|
23
37
|
function readJSDocDescription(node, allowUseFallbackDescription, allowUseFallbackDescriptionFromParent = true) {
|
|
24
38
|
let value = undefined;
|
|
25
39
|
let fallback = undefined;
|
|
@@ -51,7 +65,10 @@ function readJSDocDescription(node, allowUseFallbackDescription, allowUseFallbac
|
|
|
51
65
|
return value;
|
|
52
66
|
}
|
|
53
67
|
function readNodeName(node) {
|
|
54
|
-
|
|
68
|
+
if ('name' in node && !!node.name) {
|
|
69
|
+
return node.name.escapedText + '';
|
|
70
|
+
}
|
|
71
|
+
return undefined;
|
|
55
72
|
}
|
|
56
73
|
function readInterfaceGenericText(node) {
|
|
57
74
|
if ((0, typescript_1.isInterfaceDeclaration)(node) && node.typeParameters?.length) {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NodeParser } from 'ts-json-schema-generator';
|
|
2
|
+
import { TypeChecker } from 'typescript';
|
|
3
|
+
export declare function patchEnumNodeParser(root: NodeParser, checker: TypeChecker, meta: SFEnumMetadataMap, allowUseFallbackDescription: boolean | undefined): undefined;
|
|
4
|
+
export type SFEnumMetadata = {
|
|
5
|
+
typeName: string;
|
|
6
|
+
title: string;
|
|
7
|
+
value: string | number;
|
|
8
|
+
description: string | undefined;
|
|
9
|
+
comment: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
export type SFEnumMetadataMap = Map<string, SFEnumMetadata>;
|
|
12
|
+
//# sourceMappingURL=patch-enum-node-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patch-enum-node-parser.d.ts","sourceRoot":"","sources":["../../src/schema-generator/patch-enum-node-parser.ts"],"names":[],"mappings":"AACA,OAAO,EAKH,UAAU,EAEb,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAA6C,WAAW,EAAE,MAAM,YAAY,CAAC;AAGpF,wBAAgB,mBAAmB,CAC/B,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,iBAAiB,EACvB,2BAA2B,EAAE,OAAO,GAAG,SAAS,aAwEnD;AAED,MAAM,MAAM,cAAc,GAAG;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.patchEnumNodeParser = patchEnumNodeParser;
|
|
4
|
+
const error_1 = require("@tsofist/stem/lib/error");
|
|
5
|
+
const ts_json_schema_generator_1 = require("ts-json-schema-generator");
|
|
6
|
+
const typescript_1 = require("typescript");
|
|
7
|
+
const helpers_tsc_1 = require("./helpers-tsc");
|
|
8
|
+
function patchEnumNodeParser(root, checker, meta, allowUseFallbackDescription) {
|
|
9
|
+
const stack = root.childNodeParser.nodeParsers;
|
|
10
|
+
const enumNodeParser = stack.find((parser) => {
|
|
11
|
+
return (
|
|
12
|
+
//
|
|
13
|
+
parser instanceof ts_json_schema_generator_1.ExposeNodeParser &&
|
|
14
|
+
// @ts-expect-error It's a access-hack
|
|
15
|
+
parser.subNodeParser instanceof ts_json_schema_generator_1.AnnotatedNodeParser &&
|
|
16
|
+
// @ts-expect-error It's a access-hack
|
|
17
|
+
parser.subNodeParser.childNodeParser instanceof ts_json_schema_generator_1.EnumNodeParser);
|
|
18
|
+
});
|
|
19
|
+
if (!enumNodeParser) {
|
|
20
|
+
return (0, error_1.raise)(`Failed to patch EnumNodeParser, not found in stack`);
|
|
21
|
+
}
|
|
22
|
+
const originalCreateType = enumNodeParser.subNodeParser.childNodeParser.createType.bind(enumNodeParser.subNodeParser.childNodeParser);
|
|
23
|
+
enumNodeParser.subNodeParser.childNodeParser.createType = function PatchedCreateType() {
|
|
24
|
+
// eslint-disable-next-line prefer-rest-params
|
|
25
|
+
const node = arguments[0];
|
|
26
|
+
const typeName = (0, helpers_tsc_1.readNodeName)(node);
|
|
27
|
+
const result = originalCreateType.apply(this,
|
|
28
|
+
// @ts-expect-error It's a access-hack
|
|
29
|
+
// eslint-disable-next-line prefer-rest-params
|
|
30
|
+
arguments);
|
|
31
|
+
const resultId = result.getId();
|
|
32
|
+
if ((0, typescript_1.isEnumMember)(node)) {
|
|
33
|
+
// todo EnumMember!
|
|
34
|
+
return result;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
for (const member of node.members) {
|
|
38
|
+
const memberValue = checker.getConstantValue(member);
|
|
39
|
+
const memberName = (0, helpers_tsc_1.readNodeName)(member);
|
|
40
|
+
const description = (0, helpers_tsc_1.readJSDocDescription)(member, allowUseFallbackDescription);
|
|
41
|
+
const comment = (0, helpers_tsc_1.readJSDocTagValue)(member, 'comment');
|
|
42
|
+
const metaKey = `${resultId}.${String(memberValue)}`;
|
|
43
|
+
meta.set(metaKey, {
|
|
44
|
+
typeName,
|
|
45
|
+
title: memberName,
|
|
46
|
+
value: memberValue,
|
|
47
|
+
description,
|
|
48
|
+
comment,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ForgedSchemaDefinitionShortName } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* Shrink definition name by removing generic type parameters
|
|
4
4
|
* and appending a digest of the removed part.
|
|
5
5
|
*/
|
|
6
|
-
export declare function shrinkDefinitionName(definitionName: string, suffixLength?: number):
|
|
6
|
+
export declare function shrinkDefinitionName(definitionName: string, suffixLength?: number): ForgedSchemaDefinitionShortName | undefined;
|
|
7
7
|
//# sourceMappingURL=shrink-definition-name.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shrink-definition-name.d.ts","sourceRoot":"","sources":["../../src/schema-generator/shrink-definition-name.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"shrink-definition-name.d.ts","sourceRoot":"","sources":["../../src/schema-generator/shrink-definition-name.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,UAAU,CAAC;AAEhE;;;GAGG;AACH,wBAAgB,oBAAoB,CAChC,cAAc,EAAE,MAAM,EACtB,YAAY,SAAI,GACjB,+BAA+B,GAAG,SAAS,CAc7C"}
|
|
@@ -6,7 +6,7 @@ const node_crypto_1 = require("node:crypto");
|
|
|
6
6
|
* Shrink definition name by removing generic type parameters
|
|
7
7
|
* and appending a digest of the removed part.
|
|
8
8
|
*/
|
|
9
|
-
function shrinkDefinitionName(definitionName, suffixLength =
|
|
9
|
+
function shrinkDefinitionName(definitionName, suffixLength = 6) {
|
|
10
10
|
const startPos = definitionName.indexOf('<');
|
|
11
11
|
if (startPos >= 0) {
|
|
12
12
|
const hashSource = definitionName.substring(startPos);
|
|
@@ -15,7 +15,7 @@ function shrinkDefinitionName(definitionName, suffixLength = 8) {
|
|
|
15
15
|
.update(hashSource)
|
|
16
16
|
.digest('hex')
|
|
17
17
|
.substring(0, suffixLength);
|
|
18
|
-
return
|
|
18
|
+
return `DSN${prefix}_H${digest}`;
|
|
19
19
|
}
|
|
20
20
|
return undefined;
|
|
21
21
|
}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
export declare const TMP_FILES_SUFFIX = ".schema-forge.temporary-generated.tmp";
|
|
2
|
+
export declare const SFG_EXTRA_TAGS: readonly ["apiInterface", "apiProperty", "apiMethod", "apiMember", "dbFK", "dbEntity", "dbColumn", "dbIndex", "dbEnum", "enumAnnotation", "enumMember", "spec", "faker", "version", "hash"];
|
|
2
3
|
export declare const SFG_CONFIG_DEFAULTS: {
|
|
3
|
-
readonly sortProps: true;
|
|
4
4
|
readonly additionalProperties: false;
|
|
5
|
-
readonly expose: "export";
|
|
6
|
-
readonly strictTuples: true;
|
|
7
|
-
readonly extraTags: ["apiMember", "apiMethod", "apiInterface", "apiProperty", "dbColumn", "dbIndex", "dbEntity", "dbFK", "faker"];
|
|
8
|
-
readonly encodeRefs: false;
|
|
9
|
-
readonly markdownDescription: false;
|
|
10
5
|
readonly discriminatorType: undefined;
|
|
6
|
+
readonly encodeRefs: false;
|
|
7
|
+
readonly expose: "export";
|
|
8
|
+
readonly extraTags: ("spec" | "hash" | "dbEntity" | "dbFK" | "dbColumn" | "dbIndex" | "dbEnum" | "enumAnnotation" | "version" | "apiInterface" | "apiProperty" | "apiMethod" | "apiMember" | "enumMember" | "faker")[];
|
|
11
9
|
readonly functions: "hide";
|
|
10
|
+
readonly markdownDescription: false;
|
|
11
|
+
readonly skipTypeCheck: false;
|
|
12
|
+
readonly sortProps: true;
|
|
13
|
+
readonly strictTuples: true;
|
|
12
14
|
};
|
|
13
15
|
export type SF_EXTRA_JSS_TAG_NAME = (typeof SFG_CONFIG_DEFAULTS)['extraTags'][number];
|
|
14
16
|
export declare const SFG_CONFIG_MANDATORY: {
|
|
15
17
|
readonly jsDoc: "extended";
|
|
16
18
|
readonly topRef: true;
|
|
17
|
-
readonly skipTypeCheck: false;
|
|
18
19
|
};
|
|
19
20
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -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,mBAAmB
|
|
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,6LAsBjB,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,33 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SFG_CONFIG_MANDATORY = exports.SFG_CONFIG_DEFAULTS = exports.TMP_FILES_SUFFIX = void 0;
|
|
3
|
+
exports.SFG_CONFIG_MANDATORY = exports.SFG_CONFIG_DEFAULTS = exports.SFG_EXTRA_TAGS = exports.TMP_FILES_SUFFIX = void 0;
|
|
4
4
|
exports.TMP_FILES_SUFFIX = '.schema-forge.temporary-generated.tmp';
|
|
5
|
+
exports.SFG_EXTRA_TAGS = [
|
|
6
|
+
//
|
|
7
|
+
'apiInterface',
|
|
8
|
+
'apiProperty',
|
|
9
|
+
'apiMethod',
|
|
10
|
+
'apiMember',
|
|
11
|
+
//
|
|
12
|
+
'dbFK',
|
|
13
|
+
'dbEntity',
|
|
14
|
+
'dbColumn',
|
|
15
|
+
'dbIndex',
|
|
16
|
+
'dbEnum',
|
|
17
|
+
//
|
|
18
|
+
'enumAnnotation',
|
|
19
|
+
'enumMember',
|
|
20
|
+
// 'see',
|
|
21
|
+
'spec',
|
|
22
|
+
//
|
|
23
|
+
'faker',
|
|
24
|
+
//
|
|
25
|
+
'version',
|
|
26
|
+
'hash',
|
|
27
|
+
];
|
|
5
28
|
exports.SFG_CONFIG_DEFAULTS = {
|
|
6
|
-
sortProps: true,
|
|
7
29
|
additionalProperties: false,
|
|
8
|
-
expose: 'export',
|
|
9
|
-
strictTuples: true,
|
|
10
|
-
extraTags: [
|
|
11
|
-
//
|
|
12
|
-
'apiMember',
|
|
13
|
-
'apiMethod',
|
|
14
|
-
'apiInterface',
|
|
15
|
-
'apiProperty',
|
|
16
|
-
//
|
|
17
|
-
'dbColumn',
|
|
18
|
-
'dbIndex',
|
|
19
|
-
'dbEntity',
|
|
20
|
-
'dbFK',
|
|
21
|
-
//
|
|
22
|
-
'faker',
|
|
23
|
-
],
|
|
24
|
-
encodeRefs: false,
|
|
25
|
-
markdownDescription: false,
|
|
26
30
|
discriminatorType: undefined,
|
|
31
|
+
encodeRefs: false,
|
|
32
|
+
expose: 'export',
|
|
33
|
+
extraTags: Array.from(exports.SFG_EXTRA_TAGS),
|
|
27
34
|
functions: 'hide',
|
|
35
|
+
markdownDescription: false,
|
|
36
|
+
skipTypeCheck: false,
|
|
37
|
+
sortProps: true,
|
|
38
|
+
strictTuples: true,
|
|
28
39
|
};
|
|
29
40
|
exports.SFG_CONFIG_MANDATORY = {
|
|
30
41
|
jsDoc: 'extended',
|
|
31
42
|
topRef: true,
|
|
32
|
-
skipTypeCheck: false,
|
|
33
43
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kw-api.d.ts","sourceRoot":"","sources":["../../src/schema-registry/kw-api.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"kw-api.d.ts","sourceRoot":"","sources":["../../src/schema-registry/kw-api.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,KAAK,CAAC;AAQ7C,eAAO,MAAM,wBAAwB,EAAE,SAAS,iBAAiB,EAmB7D,CAAC"}
|
|
@@ -7,19 +7,19 @@ const NP_API_METHOD = NP_API_PROP;
|
|
|
7
7
|
const NP_API_MEMBER = `${NP_API_INTERFACE.substring(0, NP_API_INTERFACE.length - 1)}#${NP_API_PROP.substring(1)}`;
|
|
8
8
|
exports.SFRAPIDefinitionKeywords = [
|
|
9
9
|
{
|
|
10
|
-
keyword:
|
|
10
|
+
keyword: 'apiInterface',
|
|
11
11
|
metaSchema: { type: 'string', pattern: NP_API_INTERFACE },
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
|
-
keyword:
|
|
14
|
+
keyword: 'apiProperty',
|
|
15
15
|
metaSchema: { type: 'string', pattern: NP_API_PROP },
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
|
-
keyword:
|
|
18
|
+
keyword: 'apiMethod',
|
|
19
19
|
metaSchema: { type: 'string', pattern: NP_API_METHOD },
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
|
-
keyword:
|
|
22
|
+
keyword: 'apiMember',
|
|
23
23
|
metaSchema: { type: 'string', pattern: NP_API_MEMBER },
|
|
24
24
|
},
|
|
25
25
|
];
|
|
@@ -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":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,KAAK,CAAC;AAQ7C,eAAO,MAAM,iBAAiB,EAAE,SAAS,iBAAiB,EAsFtD,CAAC"}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SFRCommonKeywords = void 0;
|
|
4
4
|
const FakerModulePattern = '^[a-zA-Z.]+$';
|
|
5
|
+
const NP_ENUM_KEY = '^[a-zA-Z0-9-\\._]+$';
|
|
6
|
+
const NP_ENUM_VALUE = '^[a-zA-Z0-9-\\._:]+$';
|
|
5
7
|
exports.SFRCommonKeywords = [
|
|
6
8
|
{
|
|
7
9
|
keyword: 'version',
|
|
@@ -13,6 +15,48 @@ exports.SFRCommonKeywords = [
|
|
|
13
15
|
dependencies: ['$id', '$schema'],
|
|
14
16
|
metaSchema: { type: 'string' },
|
|
15
17
|
},
|
|
18
|
+
// {
|
|
19
|
+
// keyword: 'see',
|
|
20
|
+
// metaSchema: {
|
|
21
|
+
// additionalProperties: false,
|
|
22
|
+
// type: ['string', 'array'],
|
|
23
|
+
// items: {
|
|
24
|
+
// anyOf: [
|
|
25
|
+
// { type: 'string', format: 'uri' },
|
|
26
|
+
// {
|
|
27
|
+
// type: 'array',
|
|
28
|
+
// items: [{ type: 'string', format: 'uri' }, { type: 'string' }],
|
|
29
|
+
// minItems: 2,
|
|
30
|
+
// },
|
|
31
|
+
// ],
|
|
32
|
+
// },
|
|
33
|
+
// },
|
|
34
|
+
// },
|
|
35
|
+
{
|
|
36
|
+
keyword: 'spec',
|
|
37
|
+
metaSchema: {
|
|
38
|
+
type: 'array',
|
|
39
|
+
items: { type: 'string' },
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
keyword: 'enumAnnotation',
|
|
44
|
+
dependencies: ['enum'],
|
|
45
|
+
metaSchema: {
|
|
46
|
+
type: 'object',
|
|
47
|
+
propertyNames: { type: 'string', pattern: NP_ENUM_KEY },
|
|
48
|
+
additionalProperties: {
|
|
49
|
+
type: 'array',
|
|
50
|
+
minItems: 1,
|
|
51
|
+
maxItems: 3,
|
|
52
|
+
items: [
|
|
53
|
+
{ title: 'value', type: ['string', 'number'], pattern: NP_ENUM_VALUE },
|
|
54
|
+
{ title: 'note', type: 'string' },
|
|
55
|
+
{ title: 'comment', type: 'string' },
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
16
60
|
{
|
|
17
61
|
keyword: 'faker',
|
|
18
62
|
metaSchema: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kw-dbml.d.ts","sourceRoot":"","sources":["../../src/schema-registry/kw-dbml.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"kw-dbml.d.ts","sourceRoot":"","sources":["../../src/schema-registry/kw-dbml.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,KAAK,CAAC;AAkD7C,eAAO,MAAM,eAAe,EAAE,SAAS,iBAAiB,EAoDpD,CAAC"}
|
|
@@ -4,7 +4,7 @@ exports.SFRDBMLKeywords = void 0;
|
|
|
4
4
|
const types_1 = require("../dbml-generator/types");
|
|
5
5
|
const NP_IX = '^ix_[a-z][a-zA-Z0-9_]+$';
|
|
6
6
|
const NP_ENTITY = '^([a-zA-Z_][a-z0-9_]*\\.)?[a-z_][a-z0-9_]*$';
|
|
7
|
-
const NP_NESTED_PROP = '^[a-z][a-zA-Z0-9
|
|
7
|
+
const NP_NESTED_PROP = '^[a-z][a-zA-Z0-9-\\._]+$';
|
|
8
8
|
const DBMLIndexOptionsProperties = {
|
|
9
9
|
name: { type: 'string', pattern: NP_IX },
|
|
10
10
|
unique: { type: 'boolean' },
|
|
@@ -38,6 +38,10 @@ DBMLIndexSchema.items = {
|
|
|
38
38
|
type: ['string', 'boolean', 'object'],
|
|
39
39
|
};
|
|
40
40
|
exports.SFRDBMLKeywords = [
|
|
41
|
+
{
|
|
42
|
+
keyword: 'dbEnum',
|
|
43
|
+
metaSchema: { type: ['boolean', 'string'], pattern: NP_NESTED_PROP },
|
|
44
|
+
},
|
|
41
45
|
{
|
|
42
46
|
keyword: 'dbFK',
|
|
43
47
|
metaSchema: DBMLForeignKeySchema,
|
|
@@ -69,7 +73,7 @@ exports.SFRDBMLKeywords = [
|
|
|
69
73
|
indexes: {
|
|
70
74
|
type: 'object',
|
|
71
75
|
additionalProperties: DBMLIndexSchema,
|
|
72
|
-
propertyNames: { pattern: NP_NESTED_PROP },
|
|
76
|
+
propertyNames: { type: 'string', pattern: NP_NESTED_PROP },
|
|
73
77
|
},
|
|
74
78
|
note: { type: 'string' },
|
|
75
79
|
comment: { type: 'string' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/schema-registry/registry.ts"],"names":[],"mappings":"
|
|
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;AAsBjB;;;;GAIG;AACH,wBAAgB,yBAAyB,CACrC,OAAO,CAAC,EAAE,0BAA0B,GACrC,mBAAmB,CA+OrB"}
|
|
@@ -154,7 +154,7 @@ function createSchemaForgeRegistry(options) {
|
|
|
154
154
|
}
|
|
155
155
|
function readSchemaKeywords(schema) {
|
|
156
156
|
const result = new Map();
|
|
157
|
-
for (const tag of types_1.
|
|
157
|
+
for (const tag of types_1.SFG_EXTRA_TAGS) {
|
|
158
158
|
if (tag in schema) {
|
|
159
159
|
result.set(tag,
|
|
160
160
|
// @ts-expect-error It's OK
|
|
@@ -165,9 +165,12 @@ function createSchemaForgeRegistry(options) {
|
|
|
165
165
|
}
|
|
166
166
|
function listDefinitions(predicate) {
|
|
167
167
|
const result = [];
|
|
168
|
+
const filter = typeof predicate === 'number'
|
|
169
|
+
? (info) => info.kind === predicate
|
|
170
|
+
: predicate;
|
|
168
171
|
mapDefinitions((name, schemaId, schema) => {
|
|
169
172
|
const info = (0, parser_1.parseSchemaDefinitionInfo)(name, schemaId, legacy);
|
|
170
|
-
if (
|
|
173
|
+
if (filter === undefined || filter(info, readSchemaKeywords(schema))) {
|
|
171
174
|
result.push(info);
|
|
172
175
|
}
|
|
173
176
|
});
|
|
@@ -3,7 +3,7 @@ import type { NonNegativeInt } from '@tsofist/stem/lib/number/integer/types';
|
|
|
3
3
|
import type { ErrorsTextOptions, Options } from 'ajv';
|
|
4
4
|
import type { Options as AjvOptions } from 'ajv/dist/core';
|
|
5
5
|
import type { JSONSchema7 } from 'json-schema';
|
|
6
|
-
import type { SchemaDefinitionInfo } from '../definition-info/types';
|
|
6
|
+
import type { SchemaDefinitionInfo, SchemaDefinitionInfoKind } from '../definition-info/types';
|
|
7
7
|
import type { SchemaForgeValidationContextBase } from '../efc';
|
|
8
8
|
import type { SF_EXTRA_JSS_TAG_NAME } from '../schema-generator/types';
|
|
9
9
|
import type { SchemaForgeDefinitionRef, SchemaForgeValidationFunction, SchemaForgeValidationReport, SchemaForgeValidationResult } from '../types';
|
|
@@ -63,9 +63,9 @@ export interface SchemaForgeRegistry {
|
|
|
63
63
|
*/
|
|
64
64
|
validationErrorsText: (errors: Nullable<SchemaForgeValidationReport>, options?: ErrorsTextOptions) => string;
|
|
65
65
|
/**
|
|
66
|
-
* List
|
|
66
|
+
* List definitions of all schemas in registry.
|
|
67
67
|
*/
|
|
68
|
-
listDefinitions: (predicate?: SchemaForgeRegistryListDefinitionsPredicate) =>
|
|
68
|
+
listDefinitions: <T extends SchemaDefinitionInfo>(predicate?: SchemaForgeRegistryListDefinitionsPredicate | SchemaDefinitionInfoKind) => T[];
|
|
69
69
|
/**
|
|
70
70
|
* Asynchronously warm up schemaRegistry cache.
|
|
71
71
|
* This action is useful to pre-compile all schemas and their definitions
|
|
@@ -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,OAAO,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,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M,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,UAAU,CAAC;IACpB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B"}
|
package/lib/types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Nullable, PRec, Rec, Reintroduce } from '@tsofist/stem';
|
|
2
2
|
import type { ErrorObject, ErrorsTextOptions, ValidateFunction } from 'ajv';
|
|
3
3
|
import type { JSONSchema7 as Schema } from 'json-schema';
|
|
4
4
|
import type { Config } from 'ts-json-schema-generator';
|
|
5
|
-
import
|
|
5
|
+
import { DBMLColumnOptions, DBMLEntityOptionsDef, DBMLEnumAnnotationOptions, DBMLEnumOptionsDef, DBMLForeignKeyOptions, DBMLIndexOptionsDef } from './dbml-generator/types';
|
|
6
6
|
export interface ForgeSchemaOptions {
|
|
7
7
|
/**
|
|
8
8
|
* Generate schema definitions for public types only
|
|
@@ -99,13 +99,21 @@ export interface ForgeSchemaOptions {
|
|
|
99
99
|
*
|
|
100
100
|
* @see shrinkDefinitionName
|
|
101
101
|
*/
|
|
102
|
-
readonly shrinkDefinitionNames?: boolean | ((definitionName: string) => undefined |
|
|
102
|
+
readonly shrinkDefinitionNames?: boolean | ((definitionName: string) => undefined | ForgedSchemaDefinitionShortName);
|
|
103
103
|
/**
|
|
104
104
|
* @deprecated
|
|
105
105
|
* @default false
|
|
106
106
|
*/
|
|
107
107
|
readonly legacyDefinitions?: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Skip type checking.
|
|
110
|
+
* This may help with some complex projects, but can lead to incorrect schema generation.
|
|
111
|
+
*
|
|
112
|
+
* @default false
|
|
113
|
+
*/
|
|
114
|
+
readonly skipTypeCheck?: boolean;
|
|
108
115
|
}
|
|
116
|
+
export type ForgedSchemaDefinitionShortName = `DSN${string}_H${string}`;
|
|
109
117
|
export interface SchemaForgeMetadata {
|
|
110
118
|
$id: string;
|
|
111
119
|
title?: string;
|
|
@@ -119,25 +127,27 @@ export interface SchemaForgeMetadata {
|
|
|
119
127
|
serviceNames: PRec<SchemaForgeDefinitionRef>;
|
|
120
128
|
}
|
|
121
129
|
declare const ForgedSchemaDraft7Id = "http://json-schema.org/draft-07/schema#";
|
|
122
|
-
export type ForgedSchema = Reintroduce<Schema, {
|
|
130
|
+
export type ForgedSchema = Reintroduce<Schema, Pick<ForgedSchemaDefinition, 'see' | 'spec'> & {
|
|
123
131
|
$schema: typeof ForgedSchemaDraft7Id;
|
|
124
|
-
$id?: string;
|
|
125
|
-
$comment?: string;
|
|
126
132
|
hash?: string;
|
|
127
|
-
title?: string;
|
|
128
|
-
description?: string;
|
|
129
133
|
version?: string;
|
|
130
|
-
$defs?:
|
|
131
|
-
definitions?:
|
|
134
|
+
$defs?: Rec<ForgedSchemaDefinition>;
|
|
135
|
+
definitions?: Rec<ForgedSchemaDefinition>;
|
|
132
136
|
}>;
|
|
133
|
-
export type ForgedEntitySchema = Schema & {
|
|
134
|
-
|
|
135
|
-
properties?: PRec<ForgedEntitySchema>;
|
|
137
|
+
export type ForgedEntitySchema = Schema & Pick<ForgedSchemaDefinition, 'see' | 'spec' | 'dbEntity'> & {
|
|
138
|
+
properties?: Rec<ForgedEntitySchema>;
|
|
136
139
|
};
|
|
137
|
-
export type ForgedPropertySchema = Schema &
|
|
140
|
+
export type ForgedPropertySchema = Schema & Pick<ForgedSchemaDefinition, 'dbFK' | 'dbColumn' | 'dbIndex' | 'dbEnum' | 'enumAnnotation'>;
|
|
141
|
+
export type ForgedSchemaDefinition = Schema & {
|
|
142
|
+
see?: (string | [ref: string, title: string])[];
|
|
143
|
+
spec?: string;
|
|
138
144
|
dbFK?: DBMLForeignKeyOptions;
|
|
139
|
-
dbIndex?: DBMLIndexOptionsDef;
|
|
140
145
|
dbColumn?: DBMLColumnOptions;
|
|
146
|
+
dbIndex?: DBMLIndexOptionsDef;
|
|
147
|
+
dbEnum?: DBMLEnumOptionsDef;
|
|
148
|
+
enumAnnotation?: DBMLEnumAnnotationOptions;
|
|
149
|
+
dbEntity?: DBMLEntityOptionsDef;
|
|
150
|
+
properties?: PRec<ForgedEntitySchema>;
|
|
141
151
|
};
|
|
142
152
|
export interface ForgeSchemaResult {
|
|
143
153
|
schema: ForgedSchema;
|
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,
|
|
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,MAAM,eAAe,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAC5E,OAAO,KAAK,EAAE,WAAW,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EACH,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACtB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,WAAW,kBAAkB;IAC/B;;;OAGG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC;;;OAGG;IACH,QAAQ,CAAC,2BAA2B,CAAC,EAAE,OAAO,CAAC;IAC/C;;;OAGG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IACvD;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AK,iBAAiB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsofist/schema-forge",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Generate JSON schema from TypeScript types",
|
|
5
5
|
"author": "Andrew Berdnikov <tsofistgudmen@gmail.com>",
|
|
6
6
|
"license": "LGPL-3.0",
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"@types/node": "^20.19.0",
|
|
39
39
|
"@types/supertest": "^6.0.3",
|
|
40
40
|
"@types/ungap__structured-clone": "^1.2.0",
|
|
41
|
-
"jest": "~30.
|
|
41
|
+
"jest": "~30.1.2",
|
|
42
42
|
"rimraf": "^6.0.1",
|
|
43
43
|
"supertest": "^7.1.4",
|
|
44
|
-
"ts-jest": "~29.4.
|
|
45
|
-
"typescript": "~5.
|
|
44
|
+
"ts-jest": "~29.4.1",
|
|
45
|
+
"typescript": "~5.9.2"
|
|
46
46
|
},
|
|
47
47
|
"publishConfig": {
|
|
48
48
|
"registry": "https://registry.npmjs.org/",
|