@nxtedition/types 1.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/README.md +62 -0
- package/dist/common/block.d.ts +25 -0
- package/dist/common/block.js +571 -0
- package/dist/common/index.d.ts +32 -0
- package/dist/common/index.js +565 -0
- package/dist/common/lock.d.ts +12 -0
- package/dist/common/lock.js +152 -0
- package/dist/common/settings.d.ts +150 -0
- package/dist/common/settings.js +2642 -0
- package/dist/domains/asset.d.ts +23 -0
- package/dist/domains/asset.js +225 -0
- package/dist/domains/connection.d.ts +62 -0
- package/dist/domains/connection.js +1167 -0
- package/dist/domains/event.d.ts +18 -0
- package/dist/domains/event.js +165 -0
- package/dist/domains/general.d.ts +23 -0
- package/dist/domains/general.js +225 -0
- package/dist/domains/index.d.ts +25 -0
- package/dist/domains/index.js +12 -0
- package/dist/domains/media.d.ts +32 -0
- package/dist/domains/media.js +465 -0
- package/dist/domains/permission.d.ts +24 -0
- package/dist/domains/permission.js +375 -0
- package/dist/domains/publish.d.ts +213 -0
- package/dist/domains/publish.js +9664 -0
- package/dist/domains/role.d.ts +13 -0
- package/dist/domains/role.js +119 -0
- package/dist/domains/script.d.ts +13 -0
- package/dist/domains/script.js +125 -0
- package/dist/domains/search.d.ts +13 -0
- package/dist/domains/search.js +119 -0
- package/dist/domains/settings.d.ts +13 -0
- package/dist/domains/settings.js +2765 -0
- package/dist/domains/template.d.ts +23 -0
- package/dist/domains/template.js +372 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +2 -0
- package/package.json +34 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type AssertionGuard as __AssertionGuard } from "typia";
|
|
2
|
+
export interface TemplateDomainRecords {
|
|
3
|
+
":template": TemplateRecord;
|
|
4
|
+
}
|
|
5
|
+
export interface TemplateRecord {
|
|
6
|
+
mixin?: string[];
|
|
7
|
+
properties?: Record<string, TemplateProperty>;
|
|
8
|
+
}
|
|
9
|
+
export declare const isTemplateRecord: (input: unknown) => input is TemplateRecord;
|
|
10
|
+
export declare const assertTemplateRecord: (input: unknown) => TemplateRecord;
|
|
11
|
+
export declare const randomTemplateRecord: () => TemplateRecord;
|
|
12
|
+
export declare const assertGuardTemplateRecord: __AssertionGuard<TemplateRecord>;
|
|
13
|
+
export declare const stringifyTemplateRecord: (input: TemplateRecord) => string;
|
|
14
|
+
export declare const assertStringifyTemplateRecord: (input: unknown) => string;
|
|
15
|
+
export interface TemplateProperty {
|
|
16
|
+
path?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const isTemplateProperty: (input: unknown) => input is TemplateProperty;
|
|
19
|
+
export declare const assertTemplateProperty: (input: unknown) => TemplateProperty;
|
|
20
|
+
export declare const randomTemplateProperty: () => TemplateProperty;
|
|
21
|
+
export declare const assertGuardTemplateProperty: __AssertionGuard<TemplateProperty>;
|
|
22
|
+
export declare const stringifyTemplateProperty: (input: TemplateProperty) => string;
|
|
23
|
+
export declare const assertStringifyTemplateProperty: (input: unknown) => string;
|
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
import __typia from "typia";
|
|
2
|
+
export const isTemplateRecord = input => {
|
|
3
|
+
const $io0 = input => (undefined === input.mixin || Array.isArray(input.mixin) && input.mixin.every(elem => "string" === typeof elem)) && (undefined === input.properties || "object" === typeof input.properties && null !== input.properties && false === Array.isArray(input.properties) && $io1(input.properties));
|
|
4
|
+
const $io1 = input => Object.keys(input).every(key => {
|
|
5
|
+
const value = input[key];
|
|
6
|
+
if (undefined === value)
|
|
7
|
+
return true;
|
|
8
|
+
return "object" === typeof value && null !== value && false === Array.isArray(value) && $io2(value);
|
|
9
|
+
});
|
|
10
|
+
const $io2 = input => undefined === input.path || "string" === typeof input.path;
|
|
11
|
+
return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
|
|
12
|
+
};
|
|
13
|
+
export const assertTemplateRecord = (input, errorFactory) => {
|
|
14
|
+
const __is = input => {
|
|
15
|
+
const $io0 = input => (undefined === input.mixin || Array.isArray(input.mixin) && input.mixin.every(elem => "string" === typeof elem)) && (undefined === input.properties || "object" === typeof input.properties && null !== input.properties && false === Array.isArray(input.properties) && $io1(input.properties));
|
|
16
|
+
const $io1 = input => Object.keys(input).every(key => {
|
|
17
|
+
const value = input[key];
|
|
18
|
+
if (undefined === value)
|
|
19
|
+
return true;
|
|
20
|
+
return "object" === typeof value && null !== value && false === Array.isArray(value) && $io2(value);
|
|
21
|
+
});
|
|
22
|
+
const $io2 = input => undefined === input.path || "string" === typeof input.path;
|
|
23
|
+
return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
|
|
24
|
+
};
|
|
25
|
+
if (false === __is(input))
|
|
26
|
+
((input, _path, _exceptionable = true) => {
|
|
27
|
+
const $guard = __typia.createAssert.guard;
|
|
28
|
+
const $join = __typia.createAssert.join;
|
|
29
|
+
const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.mixin || (Array.isArray(input.mixin) || $guard(_exceptionable, {
|
|
30
|
+
path: _path + ".mixin",
|
|
31
|
+
expected: "(Array<string> | undefined)",
|
|
32
|
+
value: input.mixin
|
|
33
|
+
}, errorFactory)) && input.mixin.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
|
|
34
|
+
path: _path + ".mixin[" + _index1 + "]",
|
|
35
|
+
expected: "string",
|
|
36
|
+
value: elem
|
|
37
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
38
|
+
path: _path + ".mixin",
|
|
39
|
+
expected: "(Array<string> | undefined)",
|
|
40
|
+
value: input.mixin
|
|
41
|
+
}, errorFactory)) && (undefined === input.properties || ("object" === typeof input.properties && null !== input.properties && false === Array.isArray(input.properties) || $guard(_exceptionable, {
|
|
42
|
+
path: _path + ".properties",
|
|
43
|
+
expected: "(Record<string, TemplateProperty> | undefined)",
|
|
44
|
+
value: input.properties
|
|
45
|
+
}, errorFactory)) && $ao1(input.properties, _path + ".properties", true && _exceptionable) || $guard(_exceptionable, {
|
|
46
|
+
path: _path + ".properties",
|
|
47
|
+
expected: "(Record<string, TemplateProperty> | undefined)",
|
|
48
|
+
value: input.properties
|
|
49
|
+
}, errorFactory));
|
|
50
|
+
const $ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
51
|
+
const value = input[key];
|
|
52
|
+
if (undefined === value)
|
|
53
|
+
return true;
|
|
54
|
+
return ("object" === typeof value && null !== value && false === Array.isArray(value) || $guard(_exceptionable, {
|
|
55
|
+
path: _path + $join(key),
|
|
56
|
+
expected: "TemplateProperty",
|
|
57
|
+
value: value
|
|
58
|
+
}, errorFactory)) && $ao2(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
|
|
59
|
+
path: _path + $join(key),
|
|
60
|
+
expected: "TemplateProperty",
|
|
61
|
+
value: value
|
|
62
|
+
}, errorFactory);
|
|
63
|
+
});
|
|
64
|
+
const $ao2 = (input, _path, _exceptionable = true) => undefined === input.path || "string" === typeof input.path || $guard(_exceptionable, {
|
|
65
|
+
path: _path + ".path",
|
|
66
|
+
expected: "(string | undefined)",
|
|
67
|
+
value: input.path
|
|
68
|
+
}, errorFactory);
|
|
69
|
+
return ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
70
|
+
path: _path + "",
|
|
71
|
+
expected: "TemplateRecord",
|
|
72
|
+
value: input
|
|
73
|
+
}, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
74
|
+
path: _path + "",
|
|
75
|
+
expected: "TemplateRecord",
|
|
76
|
+
value: input
|
|
77
|
+
}, errorFactory);
|
|
78
|
+
})(input, "$input", true);
|
|
79
|
+
return input;
|
|
80
|
+
};
|
|
81
|
+
export const randomTemplateRecord = generator => {
|
|
82
|
+
const $generator = __typia.createRandom.generator;
|
|
83
|
+
const $pick = __typia.createRandom.pick;
|
|
84
|
+
const $ro0 = (_recursive = false, _depth = 0) => ({
|
|
85
|
+
mixin: $pick([
|
|
86
|
+
() => undefined,
|
|
87
|
+
() => (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)())
|
|
88
|
+
])(),
|
|
89
|
+
properties: $pick([
|
|
90
|
+
() => undefined,
|
|
91
|
+
() => $ro1(_recursive, _recursive ? 1 + _depth : _depth)
|
|
92
|
+
])()
|
|
93
|
+
});
|
|
94
|
+
const $ro1 = (_recursive = false, _depth = 0) => {
|
|
95
|
+
const output = {};
|
|
96
|
+
(generator?.array ?? $generator.array)(() => output[(generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()] = $ro2(_recursive, _recursive ? 1 + _depth : _depth), (generator?.integer ?? $generator.integer)(0, 3));
|
|
97
|
+
return output;
|
|
98
|
+
};
|
|
99
|
+
const $ro2 = (_recursive = false, _depth = 0) => ({
|
|
100
|
+
path: $pick([
|
|
101
|
+
() => undefined,
|
|
102
|
+
() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
|
|
103
|
+
])()
|
|
104
|
+
});
|
|
105
|
+
return $ro0();
|
|
106
|
+
};
|
|
107
|
+
export const assertGuardTemplateRecord = (input, errorFactory) => {
|
|
108
|
+
const __is = input => {
|
|
109
|
+
const $io0 = input => (undefined === input.mixin || Array.isArray(input.mixin) && input.mixin.every(elem => "string" === typeof elem)) && (undefined === input.properties || "object" === typeof input.properties && null !== input.properties && false === Array.isArray(input.properties) && $io1(input.properties));
|
|
110
|
+
const $io1 = input => Object.keys(input).every(key => {
|
|
111
|
+
const value = input[key];
|
|
112
|
+
if (undefined === value)
|
|
113
|
+
return true;
|
|
114
|
+
return "object" === typeof value && null !== value && false === Array.isArray(value) && $io2(value);
|
|
115
|
+
});
|
|
116
|
+
const $io2 = input => undefined === input.path || "string" === typeof input.path;
|
|
117
|
+
return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
|
|
118
|
+
};
|
|
119
|
+
if (false === __is(input))
|
|
120
|
+
((input, _path, _exceptionable = true) => {
|
|
121
|
+
const $guard = __typia.createAssertGuard.guard;
|
|
122
|
+
const $join = __typia.createAssertGuard.join;
|
|
123
|
+
const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.mixin || (Array.isArray(input.mixin) || $guard(_exceptionable, {
|
|
124
|
+
path: _path + ".mixin",
|
|
125
|
+
expected: "(Array<string> | undefined)",
|
|
126
|
+
value: input.mixin
|
|
127
|
+
}, errorFactory)) && input.mixin.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
|
|
128
|
+
path: _path + ".mixin[" + _index1 + "]",
|
|
129
|
+
expected: "string",
|
|
130
|
+
value: elem
|
|
131
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
132
|
+
path: _path + ".mixin",
|
|
133
|
+
expected: "(Array<string> | undefined)",
|
|
134
|
+
value: input.mixin
|
|
135
|
+
}, errorFactory)) && (undefined === input.properties || ("object" === typeof input.properties && null !== input.properties && false === Array.isArray(input.properties) || $guard(_exceptionable, {
|
|
136
|
+
path: _path + ".properties",
|
|
137
|
+
expected: "(Record<string, TemplateProperty> | undefined)",
|
|
138
|
+
value: input.properties
|
|
139
|
+
}, errorFactory)) && $ao1(input.properties, _path + ".properties", true && _exceptionable) || $guard(_exceptionable, {
|
|
140
|
+
path: _path + ".properties",
|
|
141
|
+
expected: "(Record<string, TemplateProperty> | undefined)",
|
|
142
|
+
value: input.properties
|
|
143
|
+
}, errorFactory));
|
|
144
|
+
const $ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
145
|
+
const value = input[key];
|
|
146
|
+
if (undefined === value)
|
|
147
|
+
return true;
|
|
148
|
+
return ("object" === typeof value && null !== value && false === Array.isArray(value) || $guard(_exceptionable, {
|
|
149
|
+
path: _path + $join(key),
|
|
150
|
+
expected: "TemplateProperty",
|
|
151
|
+
value: value
|
|
152
|
+
}, errorFactory)) && $ao2(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
|
|
153
|
+
path: _path + $join(key),
|
|
154
|
+
expected: "TemplateProperty",
|
|
155
|
+
value: value
|
|
156
|
+
}, errorFactory);
|
|
157
|
+
});
|
|
158
|
+
const $ao2 = (input, _path, _exceptionable = true) => undefined === input.path || "string" === typeof input.path || $guard(_exceptionable, {
|
|
159
|
+
path: _path + ".path",
|
|
160
|
+
expected: "(string | undefined)",
|
|
161
|
+
value: input.path
|
|
162
|
+
}, errorFactory);
|
|
163
|
+
return ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
164
|
+
path: _path + "",
|
|
165
|
+
expected: "TemplateRecord",
|
|
166
|
+
value: input
|
|
167
|
+
}, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
168
|
+
path: _path + "",
|
|
169
|
+
expected: "TemplateRecord",
|
|
170
|
+
value: input
|
|
171
|
+
}, errorFactory);
|
|
172
|
+
})(input, "$input", true);
|
|
173
|
+
};
|
|
174
|
+
export const stringifyTemplateRecord = input => {
|
|
175
|
+
const $io1 = input => Object.keys(input).every(key => {
|
|
176
|
+
const value = input[key];
|
|
177
|
+
if (undefined === value)
|
|
178
|
+
return true;
|
|
179
|
+
return "object" === typeof value && null !== value && false === Array.isArray(value) && $io2(value);
|
|
180
|
+
});
|
|
181
|
+
const $io2 = input => undefined === input.path || "string" === typeof input.path;
|
|
182
|
+
const $string = __typia.json.createStringify.string;
|
|
183
|
+
const $tail = __typia.json.createStringify.tail;
|
|
184
|
+
const $so0 = input => `{${$tail(`${undefined === input.mixin ? "" : `"mixin":${undefined !== input.mixin ? `[${input.mixin.map(elem => $string(elem)).join(",")}]` : undefined},`}${undefined === input.properties ? "" : `"properties":${undefined !== input.properties ? $so1(input.properties) : undefined}`}`)}}`;
|
|
185
|
+
const $so1 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
|
|
186
|
+
return ""; return `${JSON.stringify(key)}:${$so2(value)}`; }).filter(str => "" !== str).join(",")}}`;
|
|
187
|
+
const $so2 = input => `{${$tail(`${undefined === input.path ? "" : `"path":${undefined !== input.path ? $string(input.path) : undefined}`}`)}}`;
|
|
188
|
+
return $so0(input);
|
|
189
|
+
};
|
|
190
|
+
export const assertStringifyTemplateRecord = (input, errorFactory) => { const assert = (input, errorFactory) => {
|
|
191
|
+
const __is = input => {
|
|
192
|
+
const $io0 = input => (undefined === input.mixin || Array.isArray(input.mixin) && input.mixin.every(elem => "string" === typeof elem)) && (undefined === input.properties || "object" === typeof input.properties && null !== input.properties && false === Array.isArray(input.properties) && $io1(input.properties));
|
|
193
|
+
const $io1 = input => Object.keys(input).every(key => {
|
|
194
|
+
const value = input[key];
|
|
195
|
+
if (undefined === value)
|
|
196
|
+
return true;
|
|
197
|
+
return "object" === typeof value && null !== value && false === Array.isArray(value) && $io2(value);
|
|
198
|
+
});
|
|
199
|
+
const $io2 = input => undefined === input.path || "string" === typeof input.path;
|
|
200
|
+
return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
|
|
201
|
+
};
|
|
202
|
+
if (false === __is(input))
|
|
203
|
+
((input, _path, _exceptionable = true) => {
|
|
204
|
+
const $guard = __typia.json.createAssertStringify.guard;
|
|
205
|
+
const $join = __typia.json.createAssertStringify.join;
|
|
206
|
+
const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.mixin || (Array.isArray(input.mixin) || $guard(_exceptionable, {
|
|
207
|
+
path: _path + ".mixin",
|
|
208
|
+
expected: "(Array<string> | undefined)",
|
|
209
|
+
value: input.mixin
|
|
210
|
+
}, errorFactory)) && input.mixin.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
|
|
211
|
+
path: _path + ".mixin[" + _index1 + "]",
|
|
212
|
+
expected: "string",
|
|
213
|
+
value: elem
|
|
214
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
215
|
+
path: _path + ".mixin",
|
|
216
|
+
expected: "(Array<string> | undefined)",
|
|
217
|
+
value: input.mixin
|
|
218
|
+
}, errorFactory)) && (undefined === input.properties || ("object" === typeof input.properties && null !== input.properties && false === Array.isArray(input.properties) || $guard(_exceptionable, {
|
|
219
|
+
path: _path + ".properties",
|
|
220
|
+
expected: "(Record<string, TemplateProperty> | undefined)",
|
|
221
|
+
value: input.properties
|
|
222
|
+
}, errorFactory)) && $ao1(input.properties, _path + ".properties", true && _exceptionable) || $guard(_exceptionable, {
|
|
223
|
+
path: _path + ".properties",
|
|
224
|
+
expected: "(Record<string, TemplateProperty> | undefined)",
|
|
225
|
+
value: input.properties
|
|
226
|
+
}, errorFactory));
|
|
227
|
+
const $ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
228
|
+
const value = input[key];
|
|
229
|
+
if (undefined === value)
|
|
230
|
+
return true;
|
|
231
|
+
return ("object" === typeof value && null !== value && false === Array.isArray(value) || $guard(_exceptionable, {
|
|
232
|
+
path: _path + $join(key),
|
|
233
|
+
expected: "TemplateProperty",
|
|
234
|
+
value: value
|
|
235
|
+
}, errorFactory)) && $ao2(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
|
|
236
|
+
path: _path + $join(key),
|
|
237
|
+
expected: "TemplateProperty",
|
|
238
|
+
value: value
|
|
239
|
+
}, errorFactory);
|
|
240
|
+
});
|
|
241
|
+
const $ao2 = (input, _path, _exceptionable = true) => undefined === input.path || "string" === typeof input.path || $guard(_exceptionable, {
|
|
242
|
+
path: _path + ".path",
|
|
243
|
+
expected: "(string | undefined)",
|
|
244
|
+
value: input.path
|
|
245
|
+
}, errorFactory);
|
|
246
|
+
return ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
247
|
+
path: _path + "",
|
|
248
|
+
expected: "TemplateRecord",
|
|
249
|
+
value: input
|
|
250
|
+
}, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
251
|
+
path: _path + "",
|
|
252
|
+
expected: "TemplateRecord",
|
|
253
|
+
value: input
|
|
254
|
+
}, errorFactory);
|
|
255
|
+
})(input, "$input", true);
|
|
256
|
+
return input;
|
|
257
|
+
}; const stringify = input => {
|
|
258
|
+
const $io1 = input => Object.keys(input).every(key => {
|
|
259
|
+
const value = input[key];
|
|
260
|
+
if (undefined === value)
|
|
261
|
+
return true;
|
|
262
|
+
return "object" === typeof value && null !== value && false === Array.isArray(value) && $io2(value);
|
|
263
|
+
});
|
|
264
|
+
const $io2 = input => undefined === input.path || "string" === typeof input.path;
|
|
265
|
+
const $string = __typia.json.createAssertStringify.string;
|
|
266
|
+
const $tail = __typia.json.createAssertStringify.tail;
|
|
267
|
+
const $so0 = input => `{${$tail(`${undefined === input.mixin ? "" : `"mixin":${undefined !== input.mixin ? `[${input.mixin.map(elem => $string(elem)).join(",")}]` : undefined},`}${undefined === input.properties ? "" : `"properties":${undefined !== input.properties ? $so1(input.properties) : undefined}`}`)}}`;
|
|
268
|
+
const $so1 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
|
|
269
|
+
return ""; return `${JSON.stringify(key)}:${$so2(value)}`; }).filter(str => "" !== str).join(",")}}`;
|
|
270
|
+
const $so2 = input => `{${$tail(`${undefined === input.path ? "" : `"path":${undefined !== input.path ? $string(input.path) : undefined}`}`)}}`;
|
|
271
|
+
return $so0(input);
|
|
272
|
+
}; return stringify(assert(input, errorFactory)); };
|
|
273
|
+
export const isTemplateProperty = input => {
|
|
274
|
+
const $io0 = input => undefined === input.path || "string" === typeof input.path;
|
|
275
|
+
return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
|
|
276
|
+
};
|
|
277
|
+
export const assertTemplateProperty = (input, errorFactory) => {
|
|
278
|
+
const __is = input => {
|
|
279
|
+
const $io0 = input => undefined === input.path || "string" === typeof input.path;
|
|
280
|
+
return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
|
|
281
|
+
};
|
|
282
|
+
if (false === __is(input))
|
|
283
|
+
((input, _path, _exceptionable = true) => {
|
|
284
|
+
const $guard = __typia.createAssert.guard;
|
|
285
|
+
const $ao0 = (input, _path, _exceptionable = true) => undefined === input.path || "string" === typeof input.path || $guard(_exceptionable, {
|
|
286
|
+
path: _path + ".path",
|
|
287
|
+
expected: "(string | undefined)",
|
|
288
|
+
value: input.path
|
|
289
|
+
}, errorFactory);
|
|
290
|
+
return ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
291
|
+
path: _path + "",
|
|
292
|
+
expected: "TemplateProperty",
|
|
293
|
+
value: input
|
|
294
|
+
}, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
295
|
+
path: _path + "",
|
|
296
|
+
expected: "TemplateProperty",
|
|
297
|
+
value: input
|
|
298
|
+
}, errorFactory);
|
|
299
|
+
})(input, "$input", true);
|
|
300
|
+
return input;
|
|
301
|
+
};
|
|
302
|
+
export const randomTemplateProperty = generator => {
|
|
303
|
+
const $generator = __typia.createRandom.generator;
|
|
304
|
+
const $pick = __typia.createRandom.pick;
|
|
305
|
+
const $ro0 = (_recursive = false, _depth = 0) => ({
|
|
306
|
+
path: $pick([
|
|
307
|
+
() => undefined,
|
|
308
|
+
() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
|
|
309
|
+
])()
|
|
310
|
+
});
|
|
311
|
+
return $ro0();
|
|
312
|
+
};
|
|
313
|
+
export const assertGuardTemplateProperty = (input, errorFactory) => {
|
|
314
|
+
const __is = input => {
|
|
315
|
+
const $io0 = input => undefined === input.path || "string" === typeof input.path;
|
|
316
|
+
return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
|
|
317
|
+
};
|
|
318
|
+
if (false === __is(input))
|
|
319
|
+
((input, _path, _exceptionable = true) => {
|
|
320
|
+
const $guard = __typia.createAssertGuard.guard;
|
|
321
|
+
const $ao0 = (input, _path, _exceptionable = true) => undefined === input.path || "string" === typeof input.path || $guard(_exceptionable, {
|
|
322
|
+
path: _path + ".path",
|
|
323
|
+
expected: "(string | undefined)",
|
|
324
|
+
value: input.path
|
|
325
|
+
}, errorFactory);
|
|
326
|
+
return ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
327
|
+
path: _path + "",
|
|
328
|
+
expected: "TemplateProperty",
|
|
329
|
+
value: input
|
|
330
|
+
}, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
331
|
+
path: _path + "",
|
|
332
|
+
expected: "TemplateProperty",
|
|
333
|
+
value: input
|
|
334
|
+
}, errorFactory);
|
|
335
|
+
})(input, "$input", true);
|
|
336
|
+
};
|
|
337
|
+
export const stringifyTemplateProperty = input => {
|
|
338
|
+
const $string = __typia.json.createStringify.string;
|
|
339
|
+
const $tail = __typia.json.createStringify.tail;
|
|
340
|
+
const $so0 = input => `{${$tail(`${undefined === input.path ? "" : `"path":${undefined !== input.path ? $string(input.path) : undefined}`}`)}}`;
|
|
341
|
+
return $so0(input);
|
|
342
|
+
};
|
|
343
|
+
export const assertStringifyTemplateProperty = (input, errorFactory) => { const assert = (input, errorFactory) => {
|
|
344
|
+
const __is = input => {
|
|
345
|
+
const $io0 = input => undefined === input.path || "string" === typeof input.path;
|
|
346
|
+
return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
|
|
347
|
+
};
|
|
348
|
+
if (false === __is(input))
|
|
349
|
+
((input, _path, _exceptionable = true) => {
|
|
350
|
+
const $guard = __typia.json.createAssertStringify.guard;
|
|
351
|
+
const $ao0 = (input, _path, _exceptionable = true) => undefined === input.path || "string" === typeof input.path || $guard(_exceptionable, {
|
|
352
|
+
path: _path + ".path",
|
|
353
|
+
expected: "(string | undefined)",
|
|
354
|
+
value: input.path
|
|
355
|
+
}, errorFactory);
|
|
356
|
+
return ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
357
|
+
path: _path + "",
|
|
358
|
+
expected: "TemplateProperty",
|
|
359
|
+
value: input
|
|
360
|
+
}, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
361
|
+
path: _path + "",
|
|
362
|
+
expected: "TemplateProperty",
|
|
363
|
+
value: input
|
|
364
|
+
}, errorFactory);
|
|
365
|
+
})(input, "$input", true);
|
|
366
|
+
return input;
|
|
367
|
+
}; const stringify = input => {
|
|
368
|
+
const $string = __typia.json.createAssertStringify.string;
|
|
369
|
+
const $tail = __typia.json.createAssertStringify.tail;
|
|
370
|
+
const $so0 = input => `{${$tail(`${undefined === input.path ? "" : `"path":${undefined !== input.path ? $string(input.path) : undefined}`}`)}}`;
|
|
371
|
+
return $so0(input);
|
|
372
|
+
}; return stringify(assert(input, errorFactory)); };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { DomainRecords } from './domains/index.js';
|
|
2
|
+
export * from './domains/index.js';
|
|
3
|
+
export * from './common/index.js';
|
|
4
|
+
export type Records = {
|
|
5
|
+
[Property in keyof DomainRecords as `${string}${Property}`]: DomainRecords[Property];
|
|
6
|
+
} & {
|
|
7
|
+
"media.subtitles?": {
|
|
8
|
+
languages: Record<string, string>;
|
|
9
|
+
};
|
|
10
|
+
"media.transcribe?": {
|
|
11
|
+
engines: Record<string, string>;
|
|
12
|
+
languages: Record<string, string>;
|
|
13
|
+
translate?: {
|
|
14
|
+
languages: Record<string, string>;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
"hub-transcribe:render-profile": {
|
|
18
|
+
format: string;
|
|
19
|
+
transcribe: {
|
|
20
|
+
engine: string;
|
|
21
|
+
};
|
|
22
|
+
pick: string[];
|
|
23
|
+
};
|
|
24
|
+
};
|
package/dist/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nxtedition/types",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"prepare": "ts-patch install && typia patch",
|
|
7
|
+
"prebuild": "rimraf dist",
|
|
8
|
+
"build": "tspc",
|
|
9
|
+
"lint": "npx eslint .",
|
|
10
|
+
"prepublishOnly": "yarn lint && yarn build && yarn test",
|
|
11
|
+
"test": "node --test ./__test__/*.test.mjs",
|
|
12
|
+
"benchmark": "node ./__test__/benchmark.mjs"
|
|
13
|
+
},
|
|
14
|
+
"exports": {
|
|
15
|
+
".": "./dist/index.js",
|
|
16
|
+
"./common/*": "./dist/common/*",
|
|
17
|
+
"./domains/*": "./dist/domains/*"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"type-fest": "^4.15.0",
|
|
24
|
+
"typia": "^6.0.4"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"fast-json-stringify": "^5.16.0",
|
|
28
|
+
"mitata": "^0.1.11",
|
|
29
|
+
"rimraf": "^5.0.7",
|
|
30
|
+
"ts-node": "^10.9.2",
|
|
31
|
+
"ts-patch": "^3.1.2",
|
|
32
|
+
"typescript": "^5.4.5"
|
|
33
|
+
}
|
|
34
|
+
}
|