@nxtedition/types 23.0.1 → 23.0.3
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/dist/app.d.ts +1 -12
- package/dist/asset.d.ts +10 -0
- package/dist/asset.js +1 -0
- package/dist/common/block.d.ts +1 -1
- package/dist/common/clone.d.ts +32 -0
- package/dist/common/clone.js +602 -0
- package/dist/common/index.d.ts +3 -0
- package/dist/common/index.js +3 -0
- package/dist/common/nxtpression.d.ts +19 -0
- package/dist/common/nxtpression.js +240 -0
- package/dist/common/search.d.ts +69 -0
- package/dist/common/search.js +1591 -0
- package/dist/common/settings.d.ts +6 -5
- package/dist/common/settings.js +89 -36
- package/dist/domains/asset.d.ts +22 -0
- package/dist/domains/asset.js +232 -0
- package/dist/domains/clone.d.ts +14 -0
- package/dist/domains/clone.js +192 -0
- package/dist/domains/connection.d.ts +39 -15
- package/dist/domains/connection.js +621 -174
- package/dist/domains/design.d.ts +24 -0
- package/dist/domains/design.js +303 -0
- package/dist/domains/file.d.ts +17 -0
- package/dist/domains/file.js +233 -0
- package/dist/domains/index.d.ts +11 -1
- package/dist/domains/index.js +5 -0
- package/dist/domains/media.d.ts +28 -0
- package/dist/domains/media.js +346 -0
- package/dist/domains/published.d.ts +18 -0
- package/dist/domains/published.js +164 -0
- package/dist/domains/revs.d.ts +13 -0
- package/dist/domains/revs.js +125 -0
- package/dist/domains/search.d.ts +3 -0
- package/dist/domains/search.js +62 -13
- package/dist/domains/settings.js +70 -26
- package/dist/domains/user.d.ts +14 -0
- package/dist/domains/user.js +141 -0
- package/dist/index.d.ts +20 -6
- package/dist/index.js +135 -0
- package/dist/rpc.d.ts +48 -13
- package/dist/rpc.js +505 -1
- package/dist/schema.json +3014 -0
- package/package.json +7 -3
|
@@ -0,0 +1,602 @@
|
|
|
1
|
+
import __typia from "typia";
|
|
2
|
+
export const isCloneSource = input => {
|
|
3
|
+
const $io0 = input => "string" === typeof input.id && (undefined === input.patches || "object" === typeof input.patches && null !== input.patches && false === Array.isArray(input.patches) && $io1(input.patches));
|
|
4
|
+
const $io1 = input => Object.keys(input).every(key => {
|
|
5
|
+
const value = input[key];
|
|
6
|
+
if (undefined === value)
|
|
7
|
+
return true;
|
|
8
|
+
return true;
|
|
9
|
+
});
|
|
10
|
+
return null !== input && undefined !== input && ("string" === typeof input || "object" === typeof input && null !== input && $io0(input));
|
|
11
|
+
};
|
|
12
|
+
export const assertCloneSource = (input, errorFactory) => {
|
|
13
|
+
const __is = input => {
|
|
14
|
+
const $io0 = input => "string" === typeof input.id && (undefined === input.patches || "object" === typeof input.patches && null !== input.patches && false === Array.isArray(input.patches) && $io1(input.patches));
|
|
15
|
+
const $io1 = input => Object.keys(input).every(key => {
|
|
16
|
+
const value = input[key];
|
|
17
|
+
if (undefined === value)
|
|
18
|
+
return true;
|
|
19
|
+
return true;
|
|
20
|
+
});
|
|
21
|
+
return null !== input && undefined !== input && ("string" === typeof input || "object" === typeof input && null !== input && $io0(input));
|
|
22
|
+
};
|
|
23
|
+
if (false === __is(input))
|
|
24
|
+
((input, _path, _exceptionable = true) => {
|
|
25
|
+
const $guard = __typia.createAssert.guard;
|
|
26
|
+
const $join = __typia.createAssert.join;
|
|
27
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id || $guard(_exceptionable, {
|
|
28
|
+
path: _path + ".id",
|
|
29
|
+
expected: "string",
|
|
30
|
+
value: input.id
|
|
31
|
+
}, errorFactory)) && (undefined === input.patches || ("object" === typeof input.patches && null !== input.patches && false === Array.isArray(input.patches) || $guard(_exceptionable, {
|
|
32
|
+
path: _path + ".patches",
|
|
33
|
+
expected: "(Record<string, unknown> | undefined)",
|
|
34
|
+
value: input.patches
|
|
35
|
+
}, errorFactory)) && $ao1(input.patches, _path + ".patches", true && _exceptionable) || $guard(_exceptionable, {
|
|
36
|
+
path: _path + ".patches",
|
|
37
|
+
expected: "(Record<string, unknown> | undefined)",
|
|
38
|
+
value: input.patches
|
|
39
|
+
}, errorFactory));
|
|
40
|
+
const $ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
41
|
+
const value = input[key];
|
|
42
|
+
if (undefined === value)
|
|
43
|
+
return true;
|
|
44
|
+
return true;
|
|
45
|
+
});
|
|
46
|
+
return (null !== input || $guard(true, {
|
|
47
|
+
path: _path + "",
|
|
48
|
+
expected: "(__type | string)",
|
|
49
|
+
value: input
|
|
50
|
+
}, errorFactory)) && (undefined !== input || $guard(true, {
|
|
51
|
+
path: _path + "",
|
|
52
|
+
expected: "(__type | string)",
|
|
53
|
+
value: input
|
|
54
|
+
}, errorFactory)) && ("string" === typeof input || ("object" === typeof input && null !== input || $guard(true, {
|
|
55
|
+
path: _path + "",
|
|
56
|
+
expected: "(__type | string)",
|
|
57
|
+
value: input
|
|
58
|
+
}, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
59
|
+
path: _path + "",
|
|
60
|
+
expected: "(__type | string)",
|
|
61
|
+
value: input
|
|
62
|
+
}, errorFactory));
|
|
63
|
+
})(input, "$input", true);
|
|
64
|
+
return input;
|
|
65
|
+
};
|
|
66
|
+
export const randomCloneSource = generator => {
|
|
67
|
+
const $generator = __typia.createRandom.generator;
|
|
68
|
+
const $pick = __typia.createRandom.pick;
|
|
69
|
+
const $ro0 = (_recursive = false, _depth = 0) => ({
|
|
70
|
+
id: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
|
|
71
|
+
patches: $pick([
|
|
72
|
+
() => undefined,
|
|
73
|
+
() => $ro1(_recursive, _recursive ? 1 + _depth : _depth)
|
|
74
|
+
])()
|
|
75
|
+
});
|
|
76
|
+
const $ro1 = (_recursive = false, _depth = 0) => {
|
|
77
|
+
const output = {};
|
|
78
|
+
(generator?.array ?? $generator.array)(() => output[(generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()] = "any type used...", (generator?.integer ?? $generator.integer)(0, 3));
|
|
79
|
+
return output;
|
|
80
|
+
};
|
|
81
|
+
return $pick([
|
|
82
|
+
() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
|
|
83
|
+
() => $ro0()
|
|
84
|
+
])();
|
|
85
|
+
};
|
|
86
|
+
export const assertGuardCloneSource = (input, errorFactory) => {
|
|
87
|
+
const __is = input => {
|
|
88
|
+
const $io0 = input => "string" === typeof input.id && (undefined === input.patches || "object" === typeof input.patches && null !== input.patches && false === Array.isArray(input.patches) && $io1(input.patches));
|
|
89
|
+
const $io1 = input => Object.keys(input).every(key => {
|
|
90
|
+
const value = input[key];
|
|
91
|
+
if (undefined === value)
|
|
92
|
+
return true;
|
|
93
|
+
return true;
|
|
94
|
+
});
|
|
95
|
+
return null !== input && undefined !== input && ("string" === typeof input || "object" === typeof input && null !== input && $io0(input));
|
|
96
|
+
};
|
|
97
|
+
if (false === __is(input))
|
|
98
|
+
((input, _path, _exceptionable = true) => {
|
|
99
|
+
const $guard = __typia.createAssertGuard.guard;
|
|
100
|
+
const $join = __typia.createAssertGuard.join;
|
|
101
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id || $guard(_exceptionable, {
|
|
102
|
+
path: _path + ".id",
|
|
103
|
+
expected: "string",
|
|
104
|
+
value: input.id
|
|
105
|
+
}, errorFactory)) && (undefined === input.patches || ("object" === typeof input.patches && null !== input.patches && false === Array.isArray(input.patches) || $guard(_exceptionable, {
|
|
106
|
+
path: _path + ".patches",
|
|
107
|
+
expected: "(Record<string, unknown> | undefined)",
|
|
108
|
+
value: input.patches
|
|
109
|
+
}, errorFactory)) && $ao1(input.patches, _path + ".patches", true && _exceptionable) || $guard(_exceptionable, {
|
|
110
|
+
path: _path + ".patches",
|
|
111
|
+
expected: "(Record<string, unknown> | undefined)",
|
|
112
|
+
value: input.patches
|
|
113
|
+
}, errorFactory));
|
|
114
|
+
const $ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
115
|
+
const value = input[key];
|
|
116
|
+
if (undefined === value)
|
|
117
|
+
return true;
|
|
118
|
+
return true;
|
|
119
|
+
});
|
|
120
|
+
return (null !== input || $guard(true, {
|
|
121
|
+
path: _path + "",
|
|
122
|
+
expected: "(__type | string)",
|
|
123
|
+
value: input
|
|
124
|
+
}, errorFactory)) && (undefined !== input || $guard(true, {
|
|
125
|
+
path: _path + "",
|
|
126
|
+
expected: "(__type | string)",
|
|
127
|
+
value: input
|
|
128
|
+
}, errorFactory)) && ("string" === typeof input || ("object" === typeof input && null !== input || $guard(true, {
|
|
129
|
+
path: _path + "",
|
|
130
|
+
expected: "(__type | string)",
|
|
131
|
+
value: input
|
|
132
|
+
}, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
133
|
+
path: _path + "",
|
|
134
|
+
expected: "(__type | string)",
|
|
135
|
+
value: input
|
|
136
|
+
}, errorFactory));
|
|
137
|
+
})(input, "$input", true);
|
|
138
|
+
};
|
|
139
|
+
export const stringifyCloneSource = input => {
|
|
140
|
+
const $io1 = input => Object.keys(input).every(key => {
|
|
141
|
+
const value = input[key];
|
|
142
|
+
if (undefined === value)
|
|
143
|
+
return true;
|
|
144
|
+
return true;
|
|
145
|
+
});
|
|
146
|
+
const $string = __typia.json.createStringify.string;
|
|
147
|
+
const $throws = __typia.json.createStringify.throws;
|
|
148
|
+
const $so0 = input => `{${undefined === input.patches ? "" : `"patches":${undefined !== input.patches ? $so1(input.patches) : undefined},`}"id":${$string(input.id)}}`;
|
|
149
|
+
const $so1 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
|
|
150
|
+
return ""; return `${JSON.stringify(key)}:${undefined !== value ? JSON.stringify(value) : undefined}`; }).filter(str => "" !== str).join(",")}}`;
|
|
151
|
+
return (() => {
|
|
152
|
+
if ("string" === typeof input)
|
|
153
|
+
return $string(input);
|
|
154
|
+
if ("object" === typeof input && null !== input)
|
|
155
|
+
return $so0(input);
|
|
156
|
+
$throws({
|
|
157
|
+
expected: "(__type | string)",
|
|
158
|
+
value: input
|
|
159
|
+
});
|
|
160
|
+
})();
|
|
161
|
+
};
|
|
162
|
+
export const assertStringifyCloneSource = (input, errorFactory) => { const assert = (input, errorFactory) => {
|
|
163
|
+
const __is = input => {
|
|
164
|
+
const $io0 = input => "string" === typeof input.id && (undefined === input.patches || "object" === typeof input.patches && null !== input.patches && false === Array.isArray(input.patches) && $io1(input.patches));
|
|
165
|
+
const $io1 = input => Object.keys(input).every(key => {
|
|
166
|
+
const value = input[key];
|
|
167
|
+
if (undefined === value)
|
|
168
|
+
return true;
|
|
169
|
+
return true;
|
|
170
|
+
});
|
|
171
|
+
return null !== input && undefined !== input && ("string" === typeof input || "object" === typeof input && null !== input && $io0(input));
|
|
172
|
+
};
|
|
173
|
+
if (false === __is(input))
|
|
174
|
+
((input, _path, _exceptionable = true) => {
|
|
175
|
+
const $guard = __typia.json.createAssertStringify.guard;
|
|
176
|
+
const $join = __typia.json.createAssertStringify.join;
|
|
177
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id || $guard(_exceptionable, {
|
|
178
|
+
path: _path + ".id",
|
|
179
|
+
expected: "string",
|
|
180
|
+
value: input.id
|
|
181
|
+
}, errorFactory)) && (undefined === input.patches || ("object" === typeof input.patches && null !== input.patches && false === Array.isArray(input.patches) || $guard(_exceptionable, {
|
|
182
|
+
path: _path + ".patches",
|
|
183
|
+
expected: "(Record<string, unknown> | undefined)",
|
|
184
|
+
value: input.patches
|
|
185
|
+
}, errorFactory)) && $ao1(input.patches, _path + ".patches", true && _exceptionable) || $guard(_exceptionable, {
|
|
186
|
+
path: _path + ".patches",
|
|
187
|
+
expected: "(Record<string, unknown> | undefined)",
|
|
188
|
+
value: input.patches
|
|
189
|
+
}, errorFactory));
|
|
190
|
+
const $ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
191
|
+
const value = input[key];
|
|
192
|
+
if (undefined === value)
|
|
193
|
+
return true;
|
|
194
|
+
return true;
|
|
195
|
+
});
|
|
196
|
+
return (null !== input || $guard(true, {
|
|
197
|
+
path: _path + "",
|
|
198
|
+
expected: "(__type | string)",
|
|
199
|
+
value: input
|
|
200
|
+
}, errorFactory)) && (undefined !== input || $guard(true, {
|
|
201
|
+
path: _path + "",
|
|
202
|
+
expected: "(__type | string)",
|
|
203
|
+
value: input
|
|
204
|
+
}, errorFactory)) && ("string" === typeof input || ("object" === typeof input && null !== input || $guard(true, {
|
|
205
|
+
path: _path + "",
|
|
206
|
+
expected: "(__type | string)",
|
|
207
|
+
value: input
|
|
208
|
+
}, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
209
|
+
path: _path + "",
|
|
210
|
+
expected: "(__type | string)",
|
|
211
|
+
value: input
|
|
212
|
+
}, errorFactory));
|
|
213
|
+
})(input, "$input", true);
|
|
214
|
+
return input;
|
|
215
|
+
}; const stringify = input => {
|
|
216
|
+
const $io1 = input => Object.keys(input).every(key => {
|
|
217
|
+
const value = input[key];
|
|
218
|
+
if (undefined === value)
|
|
219
|
+
return true;
|
|
220
|
+
return true;
|
|
221
|
+
});
|
|
222
|
+
const $string = __typia.json.createAssertStringify.string;
|
|
223
|
+
const $throws = __typia.json.createAssertStringify.throws;
|
|
224
|
+
const $so0 = input => `{${undefined === input.patches ? "" : `"patches":${undefined !== input.patches ? $so1(input.patches) : undefined},`}"id":${$string(input.id)}}`;
|
|
225
|
+
const $so1 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
|
|
226
|
+
return ""; return `${JSON.stringify(key)}:${undefined !== value ? JSON.stringify(value) : undefined}`; }).filter(str => "" !== str).join(",")}}`;
|
|
227
|
+
return (() => {
|
|
228
|
+
if ("string" === typeof input)
|
|
229
|
+
return $string(input);
|
|
230
|
+
if ("object" === typeof input && null !== input)
|
|
231
|
+
return $so0(input);
|
|
232
|
+
$throws({
|
|
233
|
+
expected: "(__type | string)",
|
|
234
|
+
value: input
|
|
235
|
+
});
|
|
236
|
+
})();
|
|
237
|
+
}; return stringify(assert(input, errorFactory)); };
|
|
238
|
+
export const isCloneTarget = input => {
|
|
239
|
+
const $io0 = input => "string" === typeof input.id && (undefined === input.patches || "object" === typeof input.patches && null !== input.patches && false === Array.isArray(input.patches) && $io1(input.patches));
|
|
240
|
+
const $io1 = input => Object.keys(input).every(key => {
|
|
241
|
+
const value = input[key];
|
|
242
|
+
if (undefined === value)
|
|
243
|
+
return true;
|
|
244
|
+
return true;
|
|
245
|
+
});
|
|
246
|
+
return null !== input && undefined !== input && ("string" === typeof input || "object" === typeof input && null !== input && $io0(input));
|
|
247
|
+
};
|
|
248
|
+
export const assertCloneTarget = (input, errorFactory) => {
|
|
249
|
+
const __is = input => {
|
|
250
|
+
const $io0 = input => "string" === typeof input.id && (undefined === input.patches || "object" === typeof input.patches && null !== input.patches && false === Array.isArray(input.patches) && $io1(input.patches));
|
|
251
|
+
const $io1 = input => Object.keys(input).every(key => {
|
|
252
|
+
const value = input[key];
|
|
253
|
+
if (undefined === value)
|
|
254
|
+
return true;
|
|
255
|
+
return true;
|
|
256
|
+
});
|
|
257
|
+
return null !== input && undefined !== input && ("string" === typeof input || "object" === typeof input && null !== input && $io0(input));
|
|
258
|
+
};
|
|
259
|
+
if (false === __is(input))
|
|
260
|
+
((input, _path, _exceptionable = true) => {
|
|
261
|
+
const $guard = __typia.createAssert.guard;
|
|
262
|
+
const $join = __typia.createAssert.join;
|
|
263
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id || $guard(_exceptionable, {
|
|
264
|
+
path: _path + ".id",
|
|
265
|
+
expected: "string",
|
|
266
|
+
value: input.id
|
|
267
|
+
}, errorFactory)) && (undefined === input.patches || ("object" === typeof input.patches && null !== input.patches && false === Array.isArray(input.patches) || $guard(_exceptionable, {
|
|
268
|
+
path: _path + ".patches",
|
|
269
|
+
expected: "(Record<string, unknown> | undefined)",
|
|
270
|
+
value: input.patches
|
|
271
|
+
}, errorFactory)) && $ao1(input.patches, _path + ".patches", true && _exceptionable) || $guard(_exceptionable, {
|
|
272
|
+
path: _path + ".patches",
|
|
273
|
+
expected: "(Record<string, unknown> | undefined)",
|
|
274
|
+
value: input.patches
|
|
275
|
+
}, errorFactory));
|
|
276
|
+
const $ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
277
|
+
const value = input[key];
|
|
278
|
+
if (undefined === value)
|
|
279
|
+
return true;
|
|
280
|
+
return true;
|
|
281
|
+
});
|
|
282
|
+
return (null !== input || $guard(true, {
|
|
283
|
+
path: _path + "",
|
|
284
|
+
expected: "(__type | string)",
|
|
285
|
+
value: input
|
|
286
|
+
}, errorFactory)) && (undefined !== input || $guard(true, {
|
|
287
|
+
path: _path + "",
|
|
288
|
+
expected: "(__type | string)",
|
|
289
|
+
value: input
|
|
290
|
+
}, errorFactory)) && ("string" === typeof input || ("object" === typeof input && null !== input || $guard(true, {
|
|
291
|
+
path: _path + "",
|
|
292
|
+
expected: "(__type | string)",
|
|
293
|
+
value: input
|
|
294
|
+
}, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
295
|
+
path: _path + "",
|
|
296
|
+
expected: "(__type | string)",
|
|
297
|
+
value: input
|
|
298
|
+
}, errorFactory));
|
|
299
|
+
})(input, "$input", true);
|
|
300
|
+
return input;
|
|
301
|
+
};
|
|
302
|
+
export const randomCloneTarget = generator => {
|
|
303
|
+
const $generator = __typia.createRandom.generator;
|
|
304
|
+
const $pick = __typia.createRandom.pick;
|
|
305
|
+
const $ro0 = (_recursive = false, _depth = 0) => ({
|
|
306
|
+
id: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
|
|
307
|
+
patches: $pick([
|
|
308
|
+
() => undefined,
|
|
309
|
+
() => $ro1(_recursive, _recursive ? 1 + _depth : _depth)
|
|
310
|
+
])()
|
|
311
|
+
});
|
|
312
|
+
const $ro1 = (_recursive = false, _depth = 0) => {
|
|
313
|
+
const output = {};
|
|
314
|
+
(generator?.array ?? $generator.array)(() => output[(generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()] = "any type used...", (generator?.integer ?? $generator.integer)(0, 3));
|
|
315
|
+
return output;
|
|
316
|
+
};
|
|
317
|
+
return $pick([
|
|
318
|
+
() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
|
|
319
|
+
() => $ro0()
|
|
320
|
+
])();
|
|
321
|
+
};
|
|
322
|
+
export const assertGuardCloneTarget = (input, errorFactory) => {
|
|
323
|
+
const __is = input => {
|
|
324
|
+
const $io0 = input => "string" === typeof input.id && (undefined === input.patches || "object" === typeof input.patches && null !== input.patches && false === Array.isArray(input.patches) && $io1(input.patches));
|
|
325
|
+
const $io1 = input => Object.keys(input).every(key => {
|
|
326
|
+
const value = input[key];
|
|
327
|
+
if (undefined === value)
|
|
328
|
+
return true;
|
|
329
|
+
return true;
|
|
330
|
+
});
|
|
331
|
+
return null !== input && undefined !== input && ("string" === typeof input || "object" === typeof input && null !== input && $io0(input));
|
|
332
|
+
};
|
|
333
|
+
if (false === __is(input))
|
|
334
|
+
((input, _path, _exceptionable = true) => {
|
|
335
|
+
const $guard = __typia.createAssertGuard.guard;
|
|
336
|
+
const $join = __typia.createAssertGuard.join;
|
|
337
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id || $guard(_exceptionable, {
|
|
338
|
+
path: _path + ".id",
|
|
339
|
+
expected: "string",
|
|
340
|
+
value: input.id
|
|
341
|
+
}, errorFactory)) && (undefined === input.patches || ("object" === typeof input.patches && null !== input.patches && false === Array.isArray(input.patches) || $guard(_exceptionable, {
|
|
342
|
+
path: _path + ".patches",
|
|
343
|
+
expected: "(Record<string, unknown> | undefined)",
|
|
344
|
+
value: input.patches
|
|
345
|
+
}, errorFactory)) && $ao1(input.patches, _path + ".patches", true && _exceptionable) || $guard(_exceptionable, {
|
|
346
|
+
path: _path + ".patches",
|
|
347
|
+
expected: "(Record<string, unknown> | undefined)",
|
|
348
|
+
value: input.patches
|
|
349
|
+
}, errorFactory));
|
|
350
|
+
const $ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
351
|
+
const value = input[key];
|
|
352
|
+
if (undefined === value)
|
|
353
|
+
return true;
|
|
354
|
+
return true;
|
|
355
|
+
});
|
|
356
|
+
return (null !== input || $guard(true, {
|
|
357
|
+
path: _path + "",
|
|
358
|
+
expected: "(__type | string)",
|
|
359
|
+
value: input
|
|
360
|
+
}, errorFactory)) && (undefined !== input || $guard(true, {
|
|
361
|
+
path: _path + "",
|
|
362
|
+
expected: "(__type | string)",
|
|
363
|
+
value: input
|
|
364
|
+
}, errorFactory)) && ("string" === typeof input || ("object" === typeof input && null !== input || $guard(true, {
|
|
365
|
+
path: _path + "",
|
|
366
|
+
expected: "(__type | string)",
|
|
367
|
+
value: input
|
|
368
|
+
}, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
369
|
+
path: _path + "",
|
|
370
|
+
expected: "(__type | string)",
|
|
371
|
+
value: input
|
|
372
|
+
}, errorFactory));
|
|
373
|
+
})(input, "$input", true);
|
|
374
|
+
};
|
|
375
|
+
export const stringifyCloneTarget = input => {
|
|
376
|
+
const $io1 = input => Object.keys(input).every(key => {
|
|
377
|
+
const value = input[key];
|
|
378
|
+
if (undefined === value)
|
|
379
|
+
return true;
|
|
380
|
+
return true;
|
|
381
|
+
});
|
|
382
|
+
const $string = __typia.json.createStringify.string;
|
|
383
|
+
const $throws = __typia.json.createStringify.throws;
|
|
384
|
+
const $so0 = input => `{${undefined === input.patches ? "" : `"patches":${undefined !== input.patches ? $so1(input.patches) : undefined},`}"id":${$string(input.id)}}`;
|
|
385
|
+
const $so1 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
|
|
386
|
+
return ""; return `${JSON.stringify(key)}:${undefined !== value ? JSON.stringify(value) : undefined}`; }).filter(str => "" !== str).join(",")}}`;
|
|
387
|
+
return (() => {
|
|
388
|
+
if ("string" === typeof input)
|
|
389
|
+
return $string(input);
|
|
390
|
+
if ("object" === typeof input && null !== input)
|
|
391
|
+
return $so0(input);
|
|
392
|
+
$throws({
|
|
393
|
+
expected: "(__type | string)",
|
|
394
|
+
value: input
|
|
395
|
+
});
|
|
396
|
+
})();
|
|
397
|
+
};
|
|
398
|
+
export const assertStringifyCloneTarget = (input, errorFactory) => { const assert = (input, errorFactory) => {
|
|
399
|
+
const __is = input => {
|
|
400
|
+
const $io0 = input => "string" === typeof input.id && (undefined === input.patches || "object" === typeof input.patches && null !== input.patches && false === Array.isArray(input.patches) && $io1(input.patches));
|
|
401
|
+
const $io1 = input => Object.keys(input).every(key => {
|
|
402
|
+
const value = input[key];
|
|
403
|
+
if (undefined === value)
|
|
404
|
+
return true;
|
|
405
|
+
return true;
|
|
406
|
+
});
|
|
407
|
+
return null !== input && undefined !== input && ("string" === typeof input || "object" === typeof input && null !== input && $io0(input));
|
|
408
|
+
};
|
|
409
|
+
if (false === __is(input))
|
|
410
|
+
((input, _path, _exceptionable = true) => {
|
|
411
|
+
const $guard = __typia.json.createAssertStringify.guard;
|
|
412
|
+
const $join = __typia.json.createAssertStringify.join;
|
|
413
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id || $guard(_exceptionable, {
|
|
414
|
+
path: _path + ".id",
|
|
415
|
+
expected: "string",
|
|
416
|
+
value: input.id
|
|
417
|
+
}, errorFactory)) && (undefined === input.patches || ("object" === typeof input.patches && null !== input.patches && false === Array.isArray(input.patches) || $guard(_exceptionable, {
|
|
418
|
+
path: _path + ".patches",
|
|
419
|
+
expected: "(Record<string, unknown> | undefined)",
|
|
420
|
+
value: input.patches
|
|
421
|
+
}, errorFactory)) && $ao1(input.patches, _path + ".patches", true && _exceptionable) || $guard(_exceptionable, {
|
|
422
|
+
path: _path + ".patches",
|
|
423
|
+
expected: "(Record<string, unknown> | undefined)",
|
|
424
|
+
value: input.patches
|
|
425
|
+
}, errorFactory));
|
|
426
|
+
const $ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
427
|
+
const value = input[key];
|
|
428
|
+
if (undefined === value)
|
|
429
|
+
return true;
|
|
430
|
+
return true;
|
|
431
|
+
});
|
|
432
|
+
return (null !== input || $guard(true, {
|
|
433
|
+
path: _path + "",
|
|
434
|
+
expected: "(__type | string)",
|
|
435
|
+
value: input
|
|
436
|
+
}, errorFactory)) && (undefined !== input || $guard(true, {
|
|
437
|
+
path: _path + "",
|
|
438
|
+
expected: "(__type | string)",
|
|
439
|
+
value: input
|
|
440
|
+
}, errorFactory)) && ("string" === typeof input || ("object" === typeof input && null !== input || $guard(true, {
|
|
441
|
+
path: _path + "",
|
|
442
|
+
expected: "(__type | string)",
|
|
443
|
+
value: input
|
|
444
|
+
}, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
445
|
+
path: _path + "",
|
|
446
|
+
expected: "(__type | string)",
|
|
447
|
+
value: input
|
|
448
|
+
}, errorFactory));
|
|
449
|
+
})(input, "$input", true);
|
|
450
|
+
return input;
|
|
451
|
+
}; const stringify = input => {
|
|
452
|
+
const $io1 = input => Object.keys(input).every(key => {
|
|
453
|
+
const value = input[key];
|
|
454
|
+
if (undefined === value)
|
|
455
|
+
return true;
|
|
456
|
+
return true;
|
|
457
|
+
});
|
|
458
|
+
const $string = __typia.json.createAssertStringify.string;
|
|
459
|
+
const $throws = __typia.json.createAssertStringify.throws;
|
|
460
|
+
const $so0 = input => `{${undefined === input.patches ? "" : `"patches":${undefined !== input.patches ? $so1(input.patches) : undefined},`}"id":${$string(input.id)}}`;
|
|
461
|
+
const $so1 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
|
|
462
|
+
return ""; return `${JSON.stringify(key)}:${undefined !== value ? JSON.stringify(value) : undefined}`; }).filter(str => "" !== str).join(",")}}`;
|
|
463
|
+
return (() => {
|
|
464
|
+
if ("string" === typeof input)
|
|
465
|
+
return $string(input);
|
|
466
|
+
if ("object" === typeof input && null !== input)
|
|
467
|
+
return $so0(input);
|
|
468
|
+
$throws({
|
|
469
|
+
expected: "(__type | string)",
|
|
470
|
+
value: input
|
|
471
|
+
});
|
|
472
|
+
})();
|
|
473
|
+
}; return stringify(assert(input, errorFactory)); };
|
|
474
|
+
export const isCloneRule = input => {
|
|
475
|
+
const $io0 = input => "string" === typeof input.domain && (null === input.path || undefined === input.path || "string" === typeof input.path) && (null === input.template || undefined === input.template || "string" === typeof input.template);
|
|
476
|
+
return "object" === typeof input && null !== input && $io0(input);
|
|
477
|
+
};
|
|
478
|
+
export const assertCloneRule = (input, errorFactory) => {
|
|
479
|
+
const __is = input => {
|
|
480
|
+
const $io0 = input => "string" === typeof input.domain && (null === input.path || undefined === input.path || "string" === typeof input.path) && (null === input.template || undefined === input.template || "string" === typeof input.template);
|
|
481
|
+
return "object" === typeof input && null !== input && $io0(input);
|
|
482
|
+
};
|
|
483
|
+
if (false === __is(input))
|
|
484
|
+
((input, _path, _exceptionable = true) => {
|
|
485
|
+
const $guard = __typia.createAssert.guard;
|
|
486
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.domain || $guard(_exceptionable, {
|
|
487
|
+
path: _path + ".domain",
|
|
488
|
+
expected: "string",
|
|
489
|
+
value: input.domain
|
|
490
|
+
}, errorFactory)) && (null === input.path || undefined === input.path || "string" === typeof input.path || $guard(_exceptionable, {
|
|
491
|
+
path: _path + ".path",
|
|
492
|
+
expected: "(null | string | undefined)",
|
|
493
|
+
value: input.path
|
|
494
|
+
}, errorFactory)) && (null === input.template || undefined === input.template || "string" === typeof input.template || $guard(_exceptionable, {
|
|
495
|
+
path: _path + ".template",
|
|
496
|
+
expected: "(null | string | undefined)",
|
|
497
|
+
value: input.template
|
|
498
|
+
}, errorFactory));
|
|
499
|
+
return ("object" === typeof input && null !== input || $guard(true, {
|
|
500
|
+
path: _path + "",
|
|
501
|
+
expected: "CloneRule",
|
|
502
|
+
value: input
|
|
503
|
+
}, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
504
|
+
path: _path + "",
|
|
505
|
+
expected: "CloneRule",
|
|
506
|
+
value: input
|
|
507
|
+
}, errorFactory);
|
|
508
|
+
})(input, "$input", true);
|
|
509
|
+
return input;
|
|
510
|
+
};
|
|
511
|
+
export const randomCloneRule = generator => {
|
|
512
|
+
const $generator = __typia.createRandom.generator;
|
|
513
|
+
const $pick = __typia.createRandom.pick;
|
|
514
|
+
const $ro0 = (_recursive = false, _depth = 0) => ({
|
|
515
|
+
domain: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
|
|
516
|
+
path: $pick([
|
|
517
|
+
() => undefined,
|
|
518
|
+
() => null,
|
|
519
|
+
() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
|
|
520
|
+
])(),
|
|
521
|
+
template: $pick([
|
|
522
|
+
() => undefined,
|
|
523
|
+
() => null,
|
|
524
|
+
() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
|
|
525
|
+
])()
|
|
526
|
+
});
|
|
527
|
+
return $ro0();
|
|
528
|
+
};
|
|
529
|
+
export const assertGuardCloneRule = (input, errorFactory) => {
|
|
530
|
+
const __is = input => {
|
|
531
|
+
const $io0 = input => "string" === typeof input.domain && (null === input.path || undefined === input.path || "string" === typeof input.path) && (null === input.template || undefined === input.template || "string" === typeof input.template);
|
|
532
|
+
return "object" === typeof input && null !== input && $io0(input);
|
|
533
|
+
};
|
|
534
|
+
if (false === __is(input))
|
|
535
|
+
((input, _path, _exceptionable = true) => {
|
|
536
|
+
const $guard = __typia.createAssertGuard.guard;
|
|
537
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.domain || $guard(_exceptionable, {
|
|
538
|
+
path: _path + ".domain",
|
|
539
|
+
expected: "string",
|
|
540
|
+
value: input.domain
|
|
541
|
+
}, errorFactory)) && (null === input.path || undefined === input.path || "string" === typeof input.path || $guard(_exceptionable, {
|
|
542
|
+
path: _path + ".path",
|
|
543
|
+
expected: "(null | string | undefined)",
|
|
544
|
+
value: input.path
|
|
545
|
+
}, errorFactory)) && (null === input.template || undefined === input.template || "string" === typeof input.template || $guard(_exceptionable, {
|
|
546
|
+
path: _path + ".template",
|
|
547
|
+
expected: "(null | string | undefined)",
|
|
548
|
+
value: input.template
|
|
549
|
+
}, errorFactory));
|
|
550
|
+
return ("object" === typeof input && null !== input || $guard(true, {
|
|
551
|
+
path: _path + "",
|
|
552
|
+
expected: "CloneRule",
|
|
553
|
+
value: input
|
|
554
|
+
}, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
555
|
+
path: _path + "",
|
|
556
|
+
expected: "CloneRule",
|
|
557
|
+
value: input
|
|
558
|
+
}, errorFactory);
|
|
559
|
+
})(input, "$input", true);
|
|
560
|
+
};
|
|
561
|
+
export const stringifyCloneRule = input => {
|
|
562
|
+
const $string = __typia.json.createStringify.string;
|
|
563
|
+
const $so0 = input => `{${undefined === input.path ? "" : `"path":${undefined !== input.path ? null !== input.path ? $string(input.path) : "null" : undefined},`}${undefined === input.template ? "" : `"template":${undefined !== input.template ? null !== input.template ? $string(input.template) : "null" : undefined},`}"domain":${$string(input.domain)}}`;
|
|
564
|
+
return $so0(input);
|
|
565
|
+
};
|
|
566
|
+
export const assertStringifyCloneRule = (input, errorFactory) => { const assert = (input, errorFactory) => {
|
|
567
|
+
const __is = input => {
|
|
568
|
+
const $io0 = input => "string" === typeof input.domain && (null === input.path || undefined === input.path || "string" === typeof input.path) && (null === input.template || undefined === input.template || "string" === typeof input.template);
|
|
569
|
+
return "object" === typeof input && null !== input && $io0(input);
|
|
570
|
+
};
|
|
571
|
+
if (false === __is(input))
|
|
572
|
+
((input, _path, _exceptionable = true) => {
|
|
573
|
+
const $guard = __typia.json.createAssertStringify.guard;
|
|
574
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.domain || $guard(_exceptionable, {
|
|
575
|
+
path: _path + ".domain",
|
|
576
|
+
expected: "string",
|
|
577
|
+
value: input.domain
|
|
578
|
+
}, errorFactory)) && (null === input.path || undefined === input.path || "string" === typeof input.path || $guard(_exceptionable, {
|
|
579
|
+
path: _path + ".path",
|
|
580
|
+
expected: "(null | string | undefined)",
|
|
581
|
+
value: input.path
|
|
582
|
+
}, errorFactory)) && (null === input.template || undefined === input.template || "string" === typeof input.template || $guard(_exceptionable, {
|
|
583
|
+
path: _path + ".template",
|
|
584
|
+
expected: "(null | string | undefined)",
|
|
585
|
+
value: input.template
|
|
586
|
+
}, errorFactory));
|
|
587
|
+
return ("object" === typeof input && null !== input || $guard(true, {
|
|
588
|
+
path: _path + "",
|
|
589
|
+
expected: "CloneRule",
|
|
590
|
+
value: input
|
|
591
|
+
}, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
592
|
+
path: _path + "",
|
|
593
|
+
expected: "CloneRule",
|
|
594
|
+
value: input
|
|
595
|
+
}, errorFactory);
|
|
596
|
+
})(input, "$input", true);
|
|
597
|
+
return input;
|
|
598
|
+
}; const stringify = input => {
|
|
599
|
+
const $string = __typia.json.createAssertStringify.string;
|
|
600
|
+
const $so0 = input => `{${undefined === input.path ? "" : `"path":${undefined !== input.path ? null !== input.path ? $string(input.path) : "null" : undefined},`}${undefined === input.template ? "" : `"template":${undefined !== input.template ? null !== input.template ? $string(input.template) : "null" : undefined},`}"domain":${$string(input.domain)}}`;
|
|
601
|
+
return $so0(input);
|
|
602
|
+
}; return stringify(assert(input, errorFactory)); };
|
package/dist/common/index.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { type AssertionGuard as __AssertionGuard } from "typia";
|
|
2
2
|
export * from './block.js';
|
|
3
|
+
export * from './clone.js';
|
|
3
4
|
export * from './file.js';
|
|
4
5
|
export * from './location.js';
|
|
6
|
+
export * from './nxtpression.js';
|
|
5
7
|
export * from './lock.js';
|
|
6
8
|
export * from './rule.js';
|
|
9
|
+
export * from './search.js';
|
|
7
10
|
export * from './settings.js';
|
|
8
11
|
export * from './error.js';
|
|
9
12
|
export interface Message {
|
package/dist/common/index.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import __typia from "typia";
|
|
2
2
|
export * from './block.js';
|
|
3
|
+
export * from './clone.js';
|
|
3
4
|
export * from './file.js';
|
|
4
5
|
export * from './location.js';
|
|
6
|
+
export * from './nxtpression.js';
|
|
5
7
|
export * from './lock.js';
|
|
6
8
|
export * from './rule.js';
|
|
9
|
+
export * from './search.js';
|
|
7
10
|
export * from './settings.js';
|
|
8
11
|
export * from './error.js';
|
|
9
12
|
export const isMessage = input => {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type AssertionGuard as __AssertionGuard } from "typia";
|
|
2
|
+
export type Nxtpression<ReturnValue = string, Context extends object = object> = String & {
|
|
3
|
+
/**
|
|
4
|
+
* TS-HACK: this property doesn't really exist on the nxtpression string,
|
|
5
|
+
* it is only here to make sure the generic Context won't get stripped.
|
|
6
|
+
*/
|
|
7
|
+
__context?: Context;
|
|
8
|
+
/**
|
|
9
|
+
* TS-HACK: this property doesn't really exist on the nxtpression string,
|
|
10
|
+
* it is only here to make sure the generic Context won't get stripped.
|
|
11
|
+
*/
|
|
12
|
+
__returnValue?: ReturnValue;
|
|
13
|
+
};
|
|
14
|
+
export declare const isNxtpression: (input: unknown) => input is Nxtpression<string, object>;
|
|
15
|
+
export declare const assertNxtpression: (input: unknown) => Nxtpression<string, object>;
|
|
16
|
+
export declare const randomNxtpression: () => string;
|
|
17
|
+
export declare const assertGuardNxtpression: __AssertionGuard<Nxtpression>;
|
|
18
|
+
export declare const stringifyNxtpression: (input: Nxtpression<string, object>) => string;
|
|
19
|
+
export declare const assertStringifyNxtpression: (input: unknown) => string;
|