@nxtedition/types 1.6.13 → 22.2.1

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.
@@ -17,20 +17,3 @@ export declare const randomMessage: () => Message;
17
17
  export declare const assertGuardMessage: __AssertionGuard<Message>;
18
18
  export declare const stringifyMessage: (input: Message) => string;
19
19
  export declare const assertStringifyMessage: (input: unknown) => string;
20
- export type RpcMethods = Record<string, RpcMethod>;
21
- export declare const isRpcMethods: (input: unknown) => input is RpcMethods;
22
- export declare const assertRpcMethods: (input: unknown) => RpcMethods;
23
- export declare const randomRpcMethods: () => RpcMethods;
24
- export declare const assertGuardRpcMethods: __AssertionGuard<RpcMethods>;
25
- export declare const stringifyRpcMethods: (input: RpcMethods) => string;
26
- export declare const assertStringifyRpcMethods: (input: unknown) => string;
27
- export interface RpcMethod {
28
- rpcId: string;
29
- rpcData: Record<string, unknown>;
30
- }
31
- export declare const isRpcMethod: (input: unknown) => input is RpcMethod;
32
- export declare const assertRpcMethod: (input: unknown) => RpcMethod;
33
- export declare const randomRpcMethod: () => RpcMethod;
34
- export declare const assertGuardRpcMethod: __AssertionGuard<RpcMethod>;
35
- export declare const stringifyRpcMethod: (input: RpcMethod) => string;
36
- export declare const assertStringifyRpcMethod: (input: unknown) => string;
@@ -120,450 +120,3 @@ export const assertStringifyMessage = (input, errorFactory) => { const assert =
120
120
  const $string = __typia.json.createAssertStringify.string;
121
121
  return `{"level":${input.level},"code":${$string(input.code)},"msg":${$string(input.msg)}}`;
122
122
  }; return stringify(assert(input, errorFactory)); };
123
- export const isRpcMethods = input => {
124
- const $io0 = input => Object.keys(input).every(key => {
125
- const value = input[key];
126
- if (undefined === value)
127
- return true;
128
- return "object" === typeof value && null !== value && $io1(value);
129
- });
130
- const $io1 = input => "string" === typeof input.rpcId && ("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) && $io2(input.rpcData));
131
- const $io2 = input => Object.keys(input).every(key => {
132
- const value = input[key];
133
- if (undefined === value)
134
- return true;
135
- return true;
136
- });
137
- return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
138
- };
139
- export const assertRpcMethods = (input, errorFactory) => {
140
- const __is = input => {
141
- const $io0 = input => Object.keys(input).every(key => {
142
- const value = input[key];
143
- if (undefined === value)
144
- return true;
145
- return "object" === typeof value && null !== value && $io1(value);
146
- });
147
- const $io1 = input => "string" === typeof input.rpcId && ("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) && $io2(input.rpcData));
148
- const $io2 = input => Object.keys(input).every(key => {
149
- const value = input[key];
150
- if (undefined === value)
151
- return true;
152
- return true;
153
- });
154
- return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
155
- };
156
- if (false === __is(input))
157
- ((input, _path, _exceptionable = true) => {
158
- const $guard = __typia.createAssert.guard;
159
- const $join = __typia.createAssert.join;
160
- const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
161
- const value = input[key];
162
- if (undefined === value)
163
- return true;
164
- return ("object" === typeof value && null !== value || $guard(_exceptionable, {
165
- path: _path + $join(key),
166
- expected: "RpcMethod",
167
- value: value
168
- }, errorFactory)) && $ao1(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
169
- path: _path + $join(key),
170
- expected: "RpcMethod",
171
- value: value
172
- }, errorFactory);
173
- });
174
- const $ao1 = (input, _path, _exceptionable = true) => ("string" === typeof input.rpcId || $guard(_exceptionable, {
175
- path: _path + ".rpcId",
176
- expected: "string",
177
- value: input.rpcId
178
- }, errorFactory)) && (("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) || $guard(_exceptionable, {
179
- path: _path + ".rpcData",
180
- expected: "Record<string, unknown>",
181
- value: input.rpcData
182
- }, errorFactory)) && $ao2(input.rpcData, _path + ".rpcData", true && _exceptionable) || $guard(_exceptionable, {
183
- path: _path + ".rpcData",
184
- expected: "Record<string, unknown>",
185
- value: input.rpcData
186
- }, errorFactory));
187
- const $ao2 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
188
- const value = input[key];
189
- if (undefined === value)
190
- return true;
191
- return true;
192
- });
193
- return ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
194
- path: _path + "",
195
- expected: "RpcMethods",
196
- value: input
197
- }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
198
- path: _path + "",
199
- expected: "RpcMethods",
200
- value: input
201
- }, errorFactory);
202
- })(input, "$input", true);
203
- return input;
204
- };
205
- export const randomRpcMethods = generator => {
206
- const $generator = __typia.createRandom.generator;
207
- const $ro0 = (_recursive = false, _depth = 0) => {
208
- const output = {};
209
- (generator?.array ?? $generator.array)(() => output[(generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()] = $ro1(_recursive, _recursive ? 1 + _depth : _depth), (generator?.integer ?? $generator.integer)(0, 3));
210
- return output;
211
- };
212
- const $ro1 = (_recursive = false, _depth = 0) => ({
213
- rpcId: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
214
- rpcData: $ro2(_recursive, _recursive ? 1 + _depth : _depth)
215
- });
216
- const $ro2 = (_recursive = false, _depth = 0) => {
217
- const output = {};
218
- (generator?.array ?? $generator.array)(() => output[(generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()] = "any type used...", (generator?.integer ?? $generator.integer)(0, 3));
219
- return output;
220
- };
221
- return $ro0();
222
- };
223
- export const assertGuardRpcMethods = (input, errorFactory) => {
224
- const __is = input => {
225
- const $io0 = input => Object.keys(input).every(key => {
226
- const value = input[key];
227
- if (undefined === value)
228
- return true;
229
- return "object" === typeof value && null !== value && $io1(value);
230
- });
231
- const $io1 = input => "string" === typeof input.rpcId && ("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) && $io2(input.rpcData));
232
- const $io2 = input => Object.keys(input).every(key => {
233
- const value = input[key];
234
- if (undefined === value)
235
- return true;
236
- return true;
237
- });
238
- return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
239
- };
240
- if (false === __is(input))
241
- ((input, _path, _exceptionable = true) => {
242
- const $guard = __typia.createAssertGuard.guard;
243
- const $join = __typia.createAssertGuard.join;
244
- const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
245
- const value = input[key];
246
- if (undefined === value)
247
- return true;
248
- return ("object" === typeof value && null !== value || $guard(_exceptionable, {
249
- path: _path + $join(key),
250
- expected: "RpcMethod",
251
- value: value
252
- }, errorFactory)) && $ao1(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
253
- path: _path + $join(key),
254
- expected: "RpcMethod",
255
- value: value
256
- }, errorFactory);
257
- });
258
- const $ao1 = (input, _path, _exceptionable = true) => ("string" === typeof input.rpcId || $guard(_exceptionable, {
259
- path: _path + ".rpcId",
260
- expected: "string",
261
- value: input.rpcId
262
- }, errorFactory)) && (("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) || $guard(_exceptionable, {
263
- path: _path + ".rpcData",
264
- expected: "Record<string, unknown>",
265
- value: input.rpcData
266
- }, errorFactory)) && $ao2(input.rpcData, _path + ".rpcData", true && _exceptionable) || $guard(_exceptionable, {
267
- path: _path + ".rpcData",
268
- expected: "Record<string, unknown>",
269
- value: input.rpcData
270
- }, errorFactory));
271
- const $ao2 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
272
- const value = input[key];
273
- if (undefined === value)
274
- return true;
275
- return true;
276
- });
277
- return ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
278
- path: _path + "",
279
- expected: "RpcMethods",
280
- value: input
281
- }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
282
- path: _path + "",
283
- expected: "RpcMethods",
284
- value: input
285
- }, errorFactory);
286
- })(input, "$input", true);
287
- };
288
- export const stringifyRpcMethods = input => {
289
- const $io1 = input => "string" === typeof input.rpcId && ("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) && $io2(input.rpcData));
290
- const $io2 = input => Object.keys(input).every(key => {
291
- const value = input[key];
292
- if (undefined === value)
293
- return true;
294
- return true;
295
- });
296
- const $string = __typia.json.createStringify.string;
297
- const $so0 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
298
- return ""; return `${JSON.stringify(key)}:${$so1(value)}`; }).filter(str => "" !== str).join(",")}}`;
299
- const $so1 = input => `{"rpcId":${$string(input.rpcId)},"rpcData":${$so2(input.rpcData)}}`;
300
- const $so2 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
301
- return ""; return `${JSON.stringify(key)}:${undefined !== value ? JSON.stringify(value) : undefined}`; }).filter(str => "" !== str).join(",")}}`;
302
- return $so0(input);
303
- };
304
- export const assertStringifyRpcMethods = (input, errorFactory) => { const assert = (input, errorFactory) => {
305
- const __is = input => {
306
- const $io0 = input => Object.keys(input).every(key => {
307
- const value = input[key];
308
- if (undefined === value)
309
- return true;
310
- return "object" === typeof value && null !== value && $io1(value);
311
- });
312
- const $io1 = input => "string" === typeof input.rpcId && ("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) && $io2(input.rpcData));
313
- const $io2 = input => Object.keys(input).every(key => {
314
- const value = input[key];
315
- if (undefined === value)
316
- return true;
317
- return true;
318
- });
319
- return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
320
- };
321
- if (false === __is(input))
322
- ((input, _path, _exceptionable = true) => {
323
- const $guard = __typia.json.createAssertStringify.guard;
324
- const $join = __typia.json.createAssertStringify.join;
325
- const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
326
- const value = input[key];
327
- if (undefined === value)
328
- return true;
329
- return ("object" === typeof value && null !== value || $guard(_exceptionable, {
330
- path: _path + $join(key),
331
- expected: "RpcMethod",
332
- value: value
333
- }, errorFactory)) && $ao1(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
334
- path: _path + $join(key),
335
- expected: "RpcMethod",
336
- value: value
337
- }, errorFactory);
338
- });
339
- const $ao1 = (input, _path, _exceptionable = true) => ("string" === typeof input.rpcId || $guard(_exceptionable, {
340
- path: _path + ".rpcId",
341
- expected: "string",
342
- value: input.rpcId
343
- }, errorFactory)) && (("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) || $guard(_exceptionable, {
344
- path: _path + ".rpcData",
345
- expected: "Record<string, unknown>",
346
- value: input.rpcData
347
- }, errorFactory)) && $ao2(input.rpcData, _path + ".rpcData", true && _exceptionable) || $guard(_exceptionable, {
348
- path: _path + ".rpcData",
349
- expected: "Record<string, unknown>",
350
- value: input.rpcData
351
- }, errorFactory));
352
- const $ao2 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
353
- const value = input[key];
354
- if (undefined === value)
355
- return true;
356
- return true;
357
- });
358
- return ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
359
- path: _path + "",
360
- expected: "RpcMethods",
361
- value: input
362
- }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
363
- path: _path + "",
364
- expected: "RpcMethods",
365
- value: input
366
- }, errorFactory);
367
- })(input, "$input", true);
368
- return input;
369
- }; const stringify = input => {
370
- const $io1 = input => "string" === typeof input.rpcId && ("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) && $io2(input.rpcData));
371
- const $io2 = input => Object.keys(input).every(key => {
372
- const value = input[key];
373
- if (undefined === value)
374
- return true;
375
- return true;
376
- });
377
- const $string = __typia.json.createAssertStringify.string;
378
- const $so0 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
379
- return ""; return `${JSON.stringify(key)}:${$so1(value)}`; }).filter(str => "" !== str).join(",")}}`;
380
- const $so1 = input => `{"rpcId":${$string(input.rpcId)},"rpcData":${$so2(input.rpcData)}}`;
381
- const $so2 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
382
- return ""; return `${JSON.stringify(key)}:${undefined !== value ? JSON.stringify(value) : undefined}`; }).filter(str => "" !== str).join(",")}}`;
383
- return $so0(input);
384
- }; return stringify(assert(input, errorFactory)); };
385
- export const isRpcMethod = input => {
386
- const $io0 = input => "string" === typeof input.rpcId && ("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) && $io1(input.rpcData));
387
- const $io1 = input => Object.keys(input).every(key => {
388
- const value = input[key];
389
- if (undefined === value)
390
- return true;
391
- return true;
392
- });
393
- return "object" === typeof input && null !== input && $io0(input);
394
- };
395
- export const assertRpcMethod = (input, errorFactory) => {
396
- const __is = input => {
397
- const $io0 = input => "string" === typeof input.rpcId && ("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) && $io1(input.rpcData));
398
- const $io1 = input => Object.keys(input).every(key => {
399
- const value = input[key];
400
- if (undefined === value)
401
- return true;
402
- return true;
403
- });
404
- return "object" === typeof input && null !== input && $io0(input);
405
- };
406
- if (false === __is(input))
407
- ((input, _path, _exceptionable = true) => {
408
- const $guard = __typia.createAssert.guard;
409
- const $join = __typia.createAssert.join;
410
- const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.rpcId || $guard(_exceptionable, {
411
- path: _path + ".rpcId",
412
- expected: "string",
413
- value: input.rpcId
414
- }, errorFactory)) && (("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) || $guard(_exceptionable, {
415
- path: _path + ".rpcData",
416
- expected: "Record<string, unknown>",
417
- value: input.rpcData
418
- }, errorFactory)) && $ao1(input.rpcData, _path + ".rpcData", true && _exceptionable) || $guard(_exceptionable, {
419
- path: _path + ".rpcData",
420
- expected: "Record<string, unknown>",
421
- value: input.rpcData
422
- }, errorFactory));
423
- const $ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
424
- const value = input[key];
425
- if (undefined === value)
426
- return true;
427
- return true;
428
- });
429
- return ("object" === typeof input && null !== input || $guard(true, {
430
- path: _path + "",
431
- expected: "RpcMethod",
432
- value: input
433
- }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
434
- path: _path + "",
435
- expected: "RpcMethod",
436
- value: input
437
- }, errorFactory);
438
- })(input, "$input", true);
439
- return input;
440
- };
441
- export const randomRpcMethod = generator => {
442
- const $generator = __typia.createRandom.generator;
443
- const $ro0 = (_recursive = false, _depth = 0) => ({
444
- rpcId: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
445
- rpcData: $ro1(_recursive, _recursive ? 1 + _depth : _depth)
446
- });
447
- const $ro1 = (_recursive = false, _depth = 0) => {
448
- const output = {};
449
- (generator?.array ?? $generator.array)(() => output[(generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()] = "any type used...", (generator?.integer ?? $generator.integer)(0, 3));
450
- return output;
451
- };
452
- return $ro0();
453
- };
454
- export const assertGuardRpcMethod = (input, errorFactory) => {
455
- const __is = input => {
456
- const $io0 = input => "string" === typeof input.rpcId && ("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) && $io1(input.rpcData));
457
- const $io1 = input => Object.keys(input).every(key => {
458
- const value = input[key];
459
- if (undefined === value)
460
- return true;
461
- return true;
462
- });
463
- return "object" === typeof input && null !== input && $io0(input);
464
- };
465
- if (false === __is(input))
466
- ((input, _path, _exceptionable = true) => {
467
- const $guard = __typia.createAssertGuard.guard;
468
- const $join = __typia.createAssertGuard.join;
469
- const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.rpcId || $guard(_exceptionable, {
470
- path: _path + ".rpcId",
471
- expected: "string",
472
- value: input.rpcId
473
- }, errorFactory)) && (("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) || $guard(_exceptionable, {
474
- path: _path + ".rpcData",
475
- expected: "Record<string, unknown>",
476
- value: input.rpcData
477
- }, errorFactory)) && $ao1(input.rpcData, _path + ".rpcData", true && _exceptionable) || $guard(_exceptionable, {
478
- path: _path + ".rpcData",
479
- expected: "Record<string, unknown>",
480
- value: input.rpcData
481
- }, errorFactory));
482
- const $ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
483
- const value = input[key];
484
- if (undefined === value)
485
- return true;
486
- return true;
487
- });
488
- return ("object" === typeof input && null !== input || $guard(true, {
489
- path: _path + "",
490
- expected: "RpcMethod",
491
- value: input
492
- }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
493
- path: _path + "",
494
- expected: "RpcMethod",
495
- value: input
496
- }, errorFactory);
497
- })(input, "$input", true);
498
- };
499
- export const stringifyRpcMethod = input => {
500
- const $io1 = input => Object.keys(input).every(key => {
501
- const value = input[key];
502
- if (undefined === value)
503
- return true;
504
- return true;
505
- });
506
- const $string = __typia.json.createStringify.string;
507
- const $so0 = input => `{"rpcId":${$string(input.rpcId)},"rpcData":${$so1(input.rpcData)}}`;
508
- const $so1 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
509
- return ""; return `${JSON.stringify(key)}:${undefined !== value ? JSON.stringify(value) : undefined}`; }).filter(str => "" !== str).join(",")}}`;
510
- return $so0(input);
511
- };
512
- export const assertStringifyRpcMethod = (input, errorFactory) => { const assert = (input, errorFactory) => {
513
- const __is = input => {
514
- const $io0 = input => "string" === typeof input.rpcId && ("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) && $io1(input.rpcData));
515
- const $io1 = input => Object.keys(input).every(key => {
516
- const value = input[key];
517
- if (undefined === value)
518
- return true;
519
- return true;
520
- });
521
- return "object" === typeof input && null !== input && $io0(input);
522
- };
523
- if (false === __is(input))
524
- ((input, _path, _exceptionable = true) => {
525
- const $guard = __typia.json.createAssertStringify.guard;
526
- const $join = __typia.json.createAssertStringify.join;
527
- const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.rpcId || $guard(_exceptionable, {
528
- path: _path + ".rpcId",
529
- expected: "string",
530
- value: input.rpcId
531
- }, errorFactory)) && (("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) || $guard(_exceptionable, {
532
- path: _path + ".rpcData",
533
- expected: "Record<string, unknown>",
534
- value: input.rpcData
535
- }, errorFactory)) && $ao1(input.rpcData, _path + ".rpcData", true && _exceptionable) || $guard(_exceptionable, {
536
- path: _path + ".rpcData",
537
- expected: "Record<string, unknown>",
538
- value: input.rpcData
539
- }, errorFactory));
540
- const $ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
541
- const value = input[key];
542
- if (undefined === value)
543
- return true;
544
- return true;
545
- });
546
- return ("object" === typeof input && null !== input || $guard(true, {
547
- path: _path + "",
548
- expected: "RpcMethod",
549
- value: input
550
- }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
551
- path: _path + "",
552
- expected: "RpcMethod",
553
- value: input
554
- }, errorFactory);
555
- })(input, "$input", true);
556
- return input;
557
- }; const stringify = input => {
558
- const $io1 = input => Object.keys(input).every(key => {
559
- const value = input[key];
560
- if (undefined === value)
561
- return true;
562
- return true;
563
- });
564
- const $string = __typia.json.createAssertStringify.string;
565
- const $so0 = input => `{"rpcId":${$string(input.rpcId)},"rpcData":${$so1(input.rpcData)}}`;
566
- const $so1 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
567
- return ""; return `${JSON.stringify(key)}:${undefined !== value ? JSON.stringify(value) : undefined}`; }).filter(str => "" !== str).join(",")}}`;
568
- return $so0(input);
569
- }; return stringify(assert(input, errorFactory)); };
@@ -2,8 +2,7 @@ import { type AssertionGuard as __AssertionGuard } from "typia";
2
2
  import { tags } from 'typia';
3
3
  export interface Lock {
4
4
  time: number & tags.ExclusiveMinimum<0>;
5
- locations: Array<string & tags.MinLength<1>>;
6
- zone: string & tags.MinLength<1>;
5
+ locations: Array<string & tags.MinLength<1>> | null;
7
6
  replicas: number & tags.ExclusiveMinimum<0>;
8
7
  }
9
8
  export declare const isLock: (input: unknown) => input is Lock;