ts-japi 1.12.1 → 1.12.2
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/.commitlintrc.ts +1 -1
- package/.github/workflows/ci.yml +32 -0
- package/.github/workflows/release-notes.yml +53 -0
- package/.github/workflows/{release-please.yaml → release-please.yml} +6 -7
- package/.github/workflows/release.yml +147 -0
- package/.node-version +1 -0
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +7 -0
- package/LICENSE +2 -1
- package/README.md +9 -7
- package/benchmarks/playground.benchmark.ts +12 -12
- package/benchmarks/serializer.benchmark.ts +10 -10
- package/biome.json +141 -0
- package/lefthook.yml +12 -0
- package/lib/classes/cache.d.ts +4 -4
- package/lib/classes/cache.d.ts.map +1 -1
- package/lib/classes/cache.js +7 -5
- package/lib/classes/cache.js.map +1 -1
- package/lib/classes/error-serializer.d.ts +3 -3
- package/lib/classes/error-serializer.d.ts.map +1 -1
- package/lib/classes/error-serializer.js +18 -15
- package/lib/classes/error-serializer.js.map +1 -1
- package/lib/classes/linker.d.ts +3 -3
- package/lib/classes/linker.d.ts.map +1 -1
- package/lib/classes/metaizer.d.ts +2 -2
- package/lib/classes/metaizer.d.ts.map +1 -1
- package/lib/classes/paginator.d.ts +5 -5
- package/lib/classes/paginator.d.ts.map +1 -1
- package/lib/classes/paginator.js +6 -5
- package/lib/classes/paginator.js.map +1 -1
- package/lib/classes/polymorphic-serialiser.d.ts +9 -10
- package/lib/classes/polymorphic-serialiser.d.ts.map +1 -1
- package/lib/classes/polymorphic-serialiser.js +15 -6
- package/lib/classes/polymorphic-serialiser.js.map +1 -1
- package/lib/classes/relator.d.ts +11 -11
- package/lib/classes/relator.d.ts.map +1 -1
- package/lib/classes/relator.js +15 -6
- package/lib/classes/relator.js.map +1 -1
- package/lib/classes/serializer.d.ts +9 -9
- package/lib/classes/serializer.d.ts.map +1 -1
- package/lib/classes/serializer.js +38 -27
- package/lib/classes/serializer.js.map +1 -1
- package/lib/index.d.ts +21 -21
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +9 -9
- package/lib/index.js.map +1 -1
- package/lib/interfaces/cache.interface.d.ts +1 -1
- package/lib/interfaces/cache.interface.d.ts.map +1 -1
- package/lib/interfaces/error-serializer.interface.d.ts +37 -37
- package/lib/interfaces/error-serializer.interface.d.ts.map +1 -1
- package/lib/interfaces/error.interface.d.ts +21 -21
- package/lib/interfaces/error.interface.d.ts.map +1 -1
- package/lib/interfaces/json-api.interface.d.ts +12 -12
- package/lib/interfaces/json-api.interface.d.ts.map +1 -1
- package/lib/interfaces/linker.interface.d.ts +1 -1
- package/lib/interfaces/linker.interface.d.ts.map +1 -1
- package/lib/interfaces/paginator.interface.d.ts +2 -2
- package/lib/interfaces/paginator.interface.d.ts.map +1 -1
- package/lib/interfaces/relator.interface.d.ts +3 -3
- package/lib/interfaces/relator.interface.d.ts.map +1 -1
- package/lib/interfaces/serializer.interface.d.ts +78 -78
- package/lib/interfaces/serializer.interface.d.ts.map +1 -1
- package/lib/models/error.model.d.ts +4 -4
- package/lib/models/error.model.d.ts.map +1 -1
- package/lib/models/error.model.js +29 -18
- package/lib/models/error.model.js.map +1 -1
- package/lib/models/link.model.d.ts +1 -1
- package/lib/models/link.model.d.ts.map +1 -1
- package/lib/models/relationship.model.d.ts +5 -5
- package/lib/models/relationship.model.d.ts.map +1 -1
- package/lib/models/relationship.model.js +8 -5
- package/lib/models/relationship.model.js.map +1 -1
- package/lib/models/resource-identifier.model.d.ts +1 -1
- package/lib/models/resource-identifier.model.d.ts.map +1 -1
- package/lib/models/resource-identifier.model.js +2 -1
- package/lib/models/resource-identifier.model.js.map +1 -1
- package/lib/models/resource.model.d.ts +5 -5
- package/lib/models/resource.model.d.ts.map +1 -1
- package/lib/models/resource.model.js +6 -3
- package/lib/models/resource.model.js.map +1 -1
- package/lib/types/global.types.d.ts +9 -9
- package/lib/types/global.types.d.ts.map +1 -1
- package/lib/utils/is-error-document.d.ts +1 -1
- package/lib/utils/is-error-document.d.ts.map +1 -1
- package/lib/utils/is-error-document.js +3 -4
- package/lib/utils/is-error-document.js.map +1 -1
- package/lib/utils/is-object.d.ts.map +1 -1
- package/lib/utils/is-object.js +3 -3
- package/lib/utils/is-object.js.map +1 -1
- package/lib/utils/is-plain-object.d.ts.map +1 -1
- package/lib/utils/is-plain-object.js +9 -6
- package/lib/utils/is-plain-object.js.map +1 -1
- package/lib/utils/merge.d.ts +1 -1
- package/lib/utils/merge.d.ts.map +1 -1
- package/lib/utils/merge.js +5 -3
- package/lib/utils/merge.js.map +1 -1
- package/lib/utils/serializer.utils.d.ts +4 -4
- package/lib/utils/serializer.utils.d.ts.map +1 -1
- package/lib/utils/serializer.utils.js +27 -22
- package/lib/utils/serializer.utils.js.map +1 -1
- package/package.json +53 -65
- package/release-please-config.json +8 -3
- package/tools/generate_docs.ts +7 -9
- package/tools/internal/custom_markdown_action.ts +3 -3
- package/tools/internal/custom_markdown_documenter.ts +348 -244
- package/tsconfig.json +4 -3
- package/.github/release-please.yml +0 -4
- package/.github/workflows/ci.yaml +0 -73
- package/.github/workflows/publish.yaml +0 -29
- package/.husky/pre-commit +0 -4
- package/.husky/pre-push +0 -4
- package/.prettierignore +0 -4
- package/.prettierrc +0 -10
package/lib/utils/merge.d.ts
CHANGED
package/lib/utils/merge.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../src/utils/merge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../src/utils/merge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG7E;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,KAAK,CAC3B,CAAC,SAAS,UAAU,CAAC,GAAG,CAAC,EACzB,CAAC,SAAS,UAAU,CAAC,GAAG,CAAC,EAAE,EAC3B,MAAM,EAAE,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC,GAAG,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAqB9D"}
|
package/lib/utils/merge.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = merge;
|
|
3
4
|
const is_plain_object_1 = require("./is-plain-object");
|
|
4
5
|
/**
|
|
5
6
|
* Deep merge two objects over their enumerable properties.
|
|
@@ -8,15 +9,17 @@ const is_plain_object_1 = require("./is-plain-object");
|
|
|
8
9
|
* @param source - The objects to use for merging
|
|
9
10
|
*/
|
|
10
11
|
function merge(target, ...sources) {
|
|
11
|
-
if (!sources.length)
|
|
12
|
+
if (!sources.length) {
|
|
12
13
|
return target;
|
|
14
|
+
}
|
|
13
15
|
const source = sources.shift();
|
|
14
16
|
if ((0, is_plain_object_1.isPlainObject)(target) && (0, is_plain_object_1.isPlainObject)(source)) {
|
|
15
17
|
for (const key of Object.keys(source)) {
|
|
16
18
|
const sourceItem = source[key];
|
|
17
19
|
if ((0, is_plain_object_1.isPlainObject)(sourceItem)) {
|
|
18
|
-
if (!target[key])
|
|
20
|
+
if (!target[key]) {
|
|
19
21
|
Object.assign(target, { [key]: {} });
|
|
22
|
+
}
|
|
20
23
|
merge(target[key], sourceItem);
|
|
21
24
|
}
|
|
22
25
|
else {
|
|
@@ -26,5 +29,4 @@ function merge(target, ...sources) {
|
|
|
26
29
|
}
|
|
27
30
|
return merge(target, ...sources);
|
|
28
31
|
}
|
|
29
|
-
exports.default = merge;
|
|
30
32
|
//# sourceMappingURL=merge.js.map
|
package/lib/utils/merge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge.js","sourceRoot":"","sources":["../../src/utils/merge.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"merge.js","sourceRoot":"","sources":["../../src/utils/merge.ts"],"names":[],"mappings":";;AASA,wBAwBC;AAhCD,uDAAkD;AAElD;;;;;GAKG;AACH,SAAwB,KAAK,CAG3B,MAAS,EAAE,GAAG,OAAU;IACxB,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QACpB,OAAO,MAA4C,CAAC;IACtD,CAAC;IACD,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAE/B,IAAI,IAAA,+BAAa,EAAC,MAAM,CAAC,IAAI,IAAA,+BAAa,EAAC,MAAM,CAAC,EAAE,CAAC;QACnD,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YACtC,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;YAC/B,IAAI,IAAA,+BAAa,EAAC,UAAU,CAAC,EAAE,CAAC;gBAC9B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;oBACjB,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;gBACvC,CAAC;gBACD,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC,CAAC;YACjC,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAChD,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import Relator from
|
|
2
|
-
import { SerializerOptions } from
|
|
3
|
-
import { Dictionary } from
|
|
1
|
+
import Relator from "../classes/relator";
|
|
2
|
+
import type { SerializerOptions } from "../interfaces/serializer.interface";
|
|
3
|
+
import type { Dictionary } from "../types/global.types";
|
|
4
4
|
export declare function recurseRelators(data: any[], relators: Record<string, Relator<any>>, include: number | string[] | undefined, keys: string[], relatorDataCache?: Map<Relator<any>, Dictionary<any>[]>): Promise<any[]>;
|
|
5
|
-
export declare function normalizeRelators<T extends Dictionary<any>>(relators: SerializerOptions<T>[
|
|
5
|
+
export declare function normalizeRelators<T extends Dictionary<any>>(relators: SerializerOptions<T>["relators"]): Record<string, Relator<T, any>> | undefined;
|
|
6
6
|
export declare class Helpers<PrimaryType extends Dictionary<any> = any> {
|
|
7
7
|
projectAttributes: (data: PrimaryType) => Partial<PrimaryType> | undefined;
|
|
8
8
|
relators: Record<string, Relator<PrimaryType, any>> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializer.utils.d.ts","sourceRoot":"","sources":["../../src/utils/serializer.utils.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"serializer.utils.d.ts","sourceRoot":"","sources":["../../src/utils/serializer.utils.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AA0DxD,wBAAsB,eAAe,CACnC,IAAI,EAAE,GAAG,EAAE,EACX,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,EACtC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,EACtC,IAAI,EAAE,MAAM,EAAE,EACd,gBAAgB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,kBAsGxD;AAED,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,UAAU,CAAC,GAAG,CAAC,EACzD,QAAQ,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,+CAiB3C;AAED,qBAAa,OAAO,CAAC,WAAW,SAAS,UAAU,CAAC,GAAG,CAAC,GAAG,GAAG;IACrD,iBAAiB,EAAE,CACxB,IAAI,EAAE,WAAW,KACd,OAAO,CAAC,WAAW,CAAC,GAAG,SAAS,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC;gBACpD,OAAO,EAAE,iBAAiB,CAAC,WAAW,CAAC;CA0C3D"}
|
|
@@ -3,7 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Helpers =
|
|
6
|
+
exports.Helpers = void 0;
|
|
7
|
+
exports.recurseRelators = recurseRelators;
|
|
8
|
+
exports.normalizeRelators = normalizeRelators;
|
|
7
9
|
const relator_1 = __importDefault(require("../classes/relator"));
|
|
8
10
|
async function recurseRelatorsDepth(data, relators, depth, keys, relatorDataCache) {
|
|
9
11
|
const included = [];
|
|
@@ -11,7 +13,7 @@ async function recurseRelatorsDepth(data, relators, depth, keys, relatorDataCach
|
|
|
11
13
|
// Required to support backwards compatability where the first dataCache may
|
|
12
14
|
// not be passed in. All subsequent iterations will contain a dataCache
|
|
13
15
|
if (!relatorDataCache && depth > 0) {
|
|
14
|
-
for (const name
|
|
16
|
+
for (const name of Object.keys(relators)) {
|
|
15
17
|
const cache = curRelatorDataCache.get(relators[name]) || [];
|
|
16
18
|
curRelatorDataCache.set(relators[name], cache);
|
|
17
19
|
for (const datum of data) {
|
|
@@ -22,11 +24,12 @@ async function recurseRelatorsDepth(data, relators, depth, keys, relatorDataCach
|
|
|
22
24
|
}
|
|
23
25
|
}
|
|
24
26
|
}
|
|
25
|
-
|
|
27
|
+
let remainingDepth = depth;
|
|
28
|
+
while (remainingDepth-- > 0 && curRelatorDataCache.size > 0) {
|
|
26
29
|
const newRelatorDataCache = new Map();
|
|
27
30
|
for (const [relator, cache] of curRelatorDataCache) {
|
|
28
|
-
for (
|
|
29
|
-
const resource = await relator.getRelatedResource(
|
|
31
|
+
for (const item of cache) {
|
|
32
|
+
const resource = await relator.getRelatedResource(item, undefined, undefined, newRelatorDataCache);
|
|
30
33
|
const key = resource.getKey();
|
|
31
34
|
if (!keys.includes(key)) {
|
|
32
35
|
keys.push(key);
|
|
@@ -39,7 +42,7 @@ async function recurseRelatorsDepth(data, relators, depth, keys, relatorDataCach
|
|
|
39
42
|
return included;
|
|
40
43
|
}
|
|
41
44
|
async function recurseRelators(data, relators, include, keys, relatorDataCache) {
|
|
42
|
-
if (include === undefined || typeof include ===
|
|
45
|
+
if (include === undefined || typeof include === "number") {
|
|
43
46
|
return recurseRelatorsDepth(data, relators, include ?? 0, keys, relatorDataCache);
|
|
44
47
|
}
|
|
45
48
|
const included = [];
|
|
@@ -47,7 +50,7 @@ async function recurseRelators(data, relators, include, keys, relatorDataCache)
|
|
|
47
50
|
// Required to support backwards compatability where the first dataCache may
|
|
48
51
|
// not be passed in. All subsequent iterations will contain a dataCache
|
|
49
52
|
if (!relatorDataCache && include.length > 0) {
|
|
50
|
-
for (const name
|
|
53
|
+
for (const name of Object.keys(relators)) {
|
|
51
54
|
const cache = curRelatorDataCache.get(relators[name]) || [];
|
|
52
55
|
curRelatorDataCache.set(relators[name], cache);
|
|
53
56
|
for (const datum of data) {
|
|
@@ -58,14 +61,17 @@ async function recurseRelators(data, relators, include, keys, relatorDataCache)
|
|
|
58
61
|
}
|
|
59
62
|
}
|
|
60
63
|
}
|
|
61
|
-
const maxDepth = Math.max(...include.map((i) => i.split(
|
|
64
|
+
const maxDepth = Math.max(...include.map((i) => i.split(".").length));
|
|
62
65
|
let currentDepth = 0;
|
|
63
66
|
while (currentDepth < maxDepth) {
|
|
64
67
|
const newRelatorDataCache = new Map();
|
|
65
68
|
const includeFields = include
|
|
66
|
-
.map((i) => i.split(
|
|
69
|
+
.map((i) => i.split("."))
|
|
67
70
|
.filter((i) => i[currentDepth])
|
|
68
|
-
.map((i) => ({
|
|
71
|
+
.map((i) => ({
|
|
72
|
+
field: i[currentDepth],
|
|
73
|
+
hasMore: i.length > currentDepth + 1,
|
|
74
|
+
}))
|
|
69
75
|
.reduce((acc, i) => {
|
|
70
76
|
const match = acc.find((j) => j.field === i.field);
|
|
71
77
|
if (match) {
|
|
@@ -78,17 +84,20 @@ async function recurseRelators(data, relators, include, keys, relatorDataCache)
|
|
|
78
84
|
}, []);
|
|
79
85
|
for (const [relator, cache] of curRelatorDataCache) {
|
|
80
86
|
const shouldBuildRelatedCache = (!includeFields ||
|
|
81
|
-
includeFields
|
|
87
|
+
includeFields
|
|
88
|
+
?.filter((i) => i.field === relator.relatedName)
|
|
89
|
+
?.some((i) => i.hasMore)) ??
|
|
82
90
|
false;
|
|
83
|
-
for (
|
|
91
|
+
for (const cacheItem of cache) {
|
|
84
92
|
// Include if,
|
|
85
93
|
// - includeFields !== undefined
|
|
86
94
|
// - includeFields has entry where field = relatedName
|
|
87
|
-
if (!includeFields ||
|
|
88
|
-
|
|
95
|
+
if (!includeFields ||
|
|
96
|
+
includeFields.map((i) => i.field).includes(relator.relatedName)) {
|
|
97
|
+
const key = `${relator.serializer.collectionName}:${cacheItem[relator.serializer.getIdKeyFieldName()]}`;
|
|
89
98
|
if (!keys.includes(key)) {
|
|
90
99
|
// const key = resource.getKey();
|
|
91
|
-
const resource = await relator.getRelatedResource(
|
|
100
|
+
const resource = await relator.getRelatedResource(cacheItem, undefined, undefined,
|
|
92
101
|
// Only build the cache for the next iteration if needed.
|
|
93
102
|
shouldBuildRelatedCache ? newRelatorDataCache : undefined);
|
|
94
103
|
keys.push(key);
|
|
@@ -102,7 +111,6 @@ async function recurseRelators(data, relators, include, keys, relatorDataCache)
|
|
|
102
111
|
}
|
|
103
112
|
return included;
|
|
104
113
|
}
|
|
105
|
-
exports.recurseRelators = recurseRelators;
|
|
106
114
|
function normalizeRelators(relators) {
|
|
107
115
|
const normalizedRelators = {};
|
|
108
116
|
if (relators) {
|
|
@@ -110,19 +118,16 @@ function normalizeRelators(relators) {
|
|
|
110
118
|
normalizedRelators[relators.relatedName] = relators;
|
|
111
119
|
return normalizedRelators;
|
|
112
120
|
}
|
|
113
|
-
|
|
121
|
+
if (Array.isArray(relators)) {
|
|
114
122
|
for (const relator of relators) {
|
|
115
123
|
normalizedRelators[relator.relatedName] = relator;
|
|
116
124
|
}
|
|
117
125
|
return normalizedRelators;
|
|
118
126
|
}
|
|
119
|
-
|
|
120
|
-
return relators;
|
|
121
|
-
}
|
|
127
|
+
return relators;
|
|
122
128
|
}
|
|
123
129
|
return undefined;
|
|
124
130
|
}
|
|
125
|
-
exports.normalizeRelators = normalizeRelators;
|
|
126
131
|
class Helpers {
|
|
127
132
|
projectAttributes;
|
|
128
133
|
relators;
|
|
@@ -135,7 +140,7 @@ class Helpers {
|
|
|
135
140
|
}
|
|
136
141
|
else if (options.projection === null) {
|
|
137
142
|
this.projectAttributes = (data) => {
|
|
138
|
-
const attributes =
|
|
143
|
+
const attributes = { ...data };
|
|
139
144
|
delete attributes[options.idKey];
|
|
140
145
|
return attributes;
|
|
141
146
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializer.utils.js","sourceRoot":"","sources":["../../src/utils/serializer.utils.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"serializer.utils.js","sourceRoot":"","sources":["../../src/utils/serializer.utils.ts"],"names":[],"mappings":";;;;;;AA4DA,0CA2GC;AAED,8CAkBC;AA3LD,iEAAyC;AAIzC,KAAK,UAAU,oBAAoB,CACjC,IAAW,EACX,QAAsC,EAC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EAAE,EAAE,CAAC;wBAChD,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;oBACtC,CAAC;oBACD,OAAO,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;oBACjC,OAAO,UAAU,CAAC;gBACpB,CAAC,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF;AA/CD,0BA+CC"}
|
package/package.json
CHANGED
|
@@ -1,87 +1,61 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-japi",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.2",
|
|
4
4
|
"description": "A highly-modular (typescript-friendly)-framework agnostic library for serializing data to the JSON:API specification",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"api-extractor": "api-extractor run",
|
|
8
|
-
"benchmark": "ts-node ./benchmarks/serializer.benchmark",
|
|
9
|
-
"build": "tsc",
|
|
10
|
-
"clean": "make clean",
|
|
11
|
-
"commitlint": "commitlint --from=HEAD~1",
|
|
12
|
-
"docs": "npm run api-extractor && ts-node tools/generate_docs.ts",
|
|
13
|
-
"format": "run-s format:*",
|
|
14
|
-
"format:prettier": "prettier --write .",
|
|
15
|
-
"format:eslint": "eslint --fix .",
|
|
16
|
-
"examples": "ts-node ./examples/",
|
|
17
|
-
"lint": "run-s lint:*",
|
|
18
|
-
"lint:prettier": "prettier --check .",
|
|
19
|
-
"lint:eslint": "eslint .",
|
|
20
|
-
"playground": "ts-node ./benchmarks/playground.benchmark",
|
|
21
|
-
"prepare": "husky install",
|
|
22
|
-
"test": "jest --runInBand --verbose --coverage",
|
|
23
|
-
"test:watch": "jest --runInBand --verbose --watch"
|
|
24
|
-
},
|
|
25
6
|
"publishConfig": {
|
|
26
7
|
"access": "public",
|
|
27
8
|
"registry": "https://registry.npmjs.org/"
|
|
28
9
|
},
|
|
29
|
-
"author": "
|
|
30
|
-
"license": "
|
|
10
|
+
"author": "Mathematic Inc",
|
|
11
|
+
"license": "Apache-2.0",
|
|
31
12
|
"keywords": [
|
|
32
|
-
"json",
|
|
33
|
-
"api",
|
|
34
|
-
"json-api",
|
|
35
13
|
"json:api",
|
|
14
|
+
"json-api",
|
|
36
15
|
"serializer",
|
|
37
16
|
"normalizer",
|
|
38
|
-
"
|
|
39
|
-
"typescript",
|
|
40
|
-
"ts",
|
|
41
|
-
"backend",
|
|
42
|
-
"front-end"
|
|
17
|
+
"typescript"
|
|
43
18
|
],
|
|
44
|
-
"repository":
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/mathematic-inc/ts-japi.git"
|
|
22
|
+
},
|
|
45
23
|
"engines": {
|
|
46
24
|
"node": ">=10"
|
|
47
25
|
},
|
|
48
26
|
"devDependencies": {
|
|
49
|
-
"@babel/cli": "^7.
|
|
50
|
-
"@babel/core": "^7.
|
|
27
|
+
"@babel/cli": "^7.28.6",
|
|
28
|
+
"@babel/core": "^7.29.0",
|
|
51
29
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
52
|
-
"@babel/plugin-proposal-export-namespace-from": "^7.18.
|
|
53
|
-
"@babel/plugin-proposal-object-rest-spread": "^7.
|
|
54
|
-
"@babel/preset-env": "^7.
|
|
55
|
-
"@babel/preset-typescript": "^7.
|
|
56
|
-
"@
|
|
57
|
-
"@
|
|
58
|
-
"@commitlint/
|
|
59
|
-
"@
|
|
60
|
-
"@microsoft/api-
|
|
61
|
-
"@
|
|
62
|
-
"@types/
|
|
63
|
-
"@types/
|
|
64
|
-
"@types/
|
|
65
|
-
"@
|
|
66
|
-
"@
|
|
67
|
-
"babel-jest": "^
|
|
30
|
+
"@babel/plugin-proposal-export-namespace-from": "^7.18.9",
|
|
31
|
+
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
|
|
32
|
+
"@babel/preset-env": "^7.29.0",
|
|
33
|
+
"@babel/preset-typescript": "^7.28.5",
|
|
34
|
+
"@biomejs/biome": "^2.4.6",
|
|
35
|
+
"@changesets/cli": "^2.30.0",
|
|
36
|
+
"@commitlint/cli": "^20.4.3",
|
|
37
|
+
"@commitlint/config-conventional": "^20.4.3",
|
|
38
|
+
"@microsoft/api-documenter": "^7.29.7",
|
|
39
|
+
"@microsoft/api-extractor": "^7.57.7",
|
|
40
|
+
"@types/benchmark": "^2.1.5",
|
|
41
|
+
"@types/jest": "^30.0.0",
|
|
42
|
+
"@types/lodash": "^4.17.24",
|
|
43
|
+
"@types/node": "^25.4.0",
|
|
44
|
+
"@types/uuid": "^11.0.0",
|
|
45
|
+
"babel-jest": "^30.3.0",
|
|
68
46
|
"benchmark": "^2.1.4",
|
|
69
|
-
"core-js": "^3.
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"eslint-plugin-tsdoc": "^0.2.16",
|
|
74
|
-
"husky": "^8.0.1",
|
|
75
|
-
"jest": "^28.1.2",
|
|
76
|
-
"lodash": "^4.17.21",
|
|
47
|
+
"core-js": "^3.48.0",
|
|
48
|
+
"jest": "^30.3.0",
|
|
49
|
+
"lefthook": "^2.1.3",
|
|
50
|
+
"lodash": "^4.17.23",
|
|
77
51
|
"npm-run-all": "^4.1.5",
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"typedoc": "^
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"uuid": "^
|
|
52
|
+
"regenerator-runtime": "^0.14.1",
|
|
53
|
+
"ts-node": "^10.9.2",
|
|
54
|
+
"typedoc": "^0.28.17",
|
|
55
|
+
"typedoc-plugin-markdown": "^4.10.0",
|
|
56
|
+
"typescript": "^5.9.3",
|
|
57
|
+
"ultracite": "^7.2.5",
|
|
58
|
+
"uuid": "^13.0.0"
|
|
85
59
|
},
|
|
86
60
|
"babel": {
|
|
87
61
|
"presets": [
|
|
@@ -105,5 +79,19 @@
|
|
|
105
79
|
"./test/setup/per-test.ts"
|
|
106
80
|
],
|
|
107
81
|
"testEnvironment": "node"
|
|
82
|
+
},
|
|
83
|
+
"scripts": {
|
|
84
|
+
"api-extractor": "api-extractor run",
|
|
85
|
+
"benchmark": "ts-node ./benchmarks/serializer.benchmark",
|
|
86
|
+
"build": "tsc",
|
|
87
|
+
"clean": "make clean",
|
|
88
|
+
"commitlint": "commitlint --from=HEAD~1",
|
|
89
|
+
"docs": "npm run api-extractor && ts-node tools/generate_docs.ts",
|
|
90
|
+
"format": "ultracite fix",
|
|
91
|
+
"examples": "ts-node ./examples/",
|
|
92
|
+
"lint": "ultracite check",
|
|
93
|
+
"playground": "ts-node ./benchmarks/playground.benchmark",
|
|
94
|
+
"test": "jest --runInBand --verbose --coverage",
|
|
95
|
+
"test:watch": "jest --runInBand --verbose --watch"
|
|
108
96
|
}
|
|
109
|
-
}
|
|
97
|
+
}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
|
|
3
|
+
"bump-minor-pre-major": true,
|
|
4
|
+
"bump-patch-for-minor-pre-major": true,
|
|
5
|
+
"initial-version": "0.1.0",
|
|
2
6
|
"packages": {
|
|
3
7
|
".": {
|
|
4
|
-
"
|
|
5
|
-
"
|
|
8
|
+
"include-component-in-tag": false,
|
|
9
|
+
"release-type": "node"
|
|
6
10
|
}
|
|
7
|
-
}
|
|
11
|
+
},
|
|
12
|
+
"plugins": ["sentence-case"]
|
|
8
13
|
}
|
package/tools/generate_docs.ts
CHANGED
|
@@ -14,20 +14,18 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { copyFileSync } from
|
|
18
|
-
import { join } from
|
|
19
|
-
import { chdir } from
|
|
17
|
+
import { copyFileSync } from "node:fs";
|
|
18
|
+
import { join } from "node:path";
|
|
19
|
+
import { chdir } from "node:process";
|
|
20
20
|
|
|
21
21
|
// eslint-disable-next-line import/extensions
|
|
22
|
-
import { generateDocs } from
|
|
22
|
+
import { generateDocs } from "./internal/custom_markdown_action";
|
|
23
23
|
|
|
24
24
|
// Change to root directory
|
|
25
|
-
chdir(join(
|
|
25
|
+
chdir(join(import.meta.dirname, ".."));
|
|
26
26
|
|
|
27
27
|
// README
|
|
28
|
-
|
|
29
|
-
copyFileSync('README.md', 'docs/index.md');
|
|
30
|
-
}
|
|
28
|
+
copyFileSync("README.md", "docs/index.md");
|
|
31
29
|
|
|
32
30
|
// Generate documentation
|
|
33
|
-
generateDocs(
|
|
31
|
+
generateDocs("docs/ts-japi.api.json", "docs/api");
|
|
@@ -14,17 +14,17 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { ApiModel } from
|
|
17
|
+
import { ApiModel } from "@microsoft/api-extractor-model";
|
|
18
18
|
|
|
19
19
|
// eslint-disable-next-line import/extensions
|
|
20
|
-
import { MarkdownDocumenter } from
|
|
20
|
+
import { MarkdownDocumenter } from "./custom_markdown_documenter";
|
|
21
21
|
|
|
22
22
|
export const generateDocs = (jsonPath: string, outputDir: string): void => {
|
|
23
23
|
const apiModel = new ApiModel();
|
|
24
24
|
apiModel.loadPackage(jsonPath);
|
|
25
25
|
|
|
26
26
|
const markdownDocumenter: MarkdownDocumenter = new MarkdownDocumenter({
|
|
27
|
-
apiModel
|
|
27
|
+
apiModel,
|
|
28
28
|
documenterConfig: undefined,
|
|
29
29
|
outputFolder: outputDir,
|
|
30
30
|
});
|