@nxtedition/types 1.4.0 → 1.6.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.
@@ -1,13 +1,37 @@
1
1
  import __typia from "typia";
2
- export const isPermissionRecord = input => {
3
- const $io0 = input => Array.isArray(input.permissions) && input.permissions.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem));
4
- const $io1 = input => (undefined === input.type || "string" === typeof input.type) && (undefined === input.method || "string" === typeof input.method) && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
2
+ export const isProvidedPermissionRecord = input => {
3
+ const $io0 = input => Array.isArray(input.permissions) && input.permissions.every(elem => "object" === typeof elem && null !== elem && $iu0(elem));
4
+ const $io1 = input => "tag" === input.type && (null !== input.method && undefined === input.method) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
5
+ const $io2 = input => "asset" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
6
+ const $io3 = input => "rpc" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
7
+ const $iu0 = input => (() => {
8
+ if ("rpc" === input.type)
9
+ return $io3(input);
10
+ else if ("asset" === input.type)
11
+ return $io2(input);
12
+ else if ("tag" === input.type)
13
+ return $io1(input);
14
+ else
15
+ return false;
16
+ })();
5
17
  return "object" === typeof input && null !== input && $io0(input);
6
18
  };
7
- export const assertPermissionRecord = (input, errorFactory) => {
19
+ export const assertProvidedPermissionRecord = (input, errorFactory) => {
8
20
  const __is = input => {
9
- const $io0 = input => Array.isArray(input.permissions) && input.permissions.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem));
10
- const $io1 = input => (undefined === input.type || "string" === typeof input.type) && (undefined === input.method || "string" === typeof input.method) && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
21
+ const $io0 = input => Array.isArray(input.permissions) && input.permissions.every(elem => "object" === typeof elem && null !== elem && $iu0(elem));
22
+ const $io1 = input => "tag" === input.type && (null !== input.method && undefined === input.method) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
23
+ const $io2 = input => "asset" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
24
+ const $io3 = input => "rpc" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
25
+ const $iu0 = input => (() => {
26
+ if ("rpc" === input.type)
27
+ return $io3(input);
28
+ else if ("asset" === input.type)
29
+ return $io2(input);
30
+ else if ("tag" === input.type)
31
+ return $io1(input);
32
+ else
33
+ return false;
34
+ })();
11
35
  return "object" === typeof input && null !== input && $io0(input);
12
36
  };
13
37
  if (false === __is(input))
@@ -17,30 +41,34 @@ export const assertPermissionRecord = (input, errorFactory) => {
17
41
  path: _path + ".permissions",
18
42
  expected: "Array<PermissionRecordPermisson>",
19
43
  value: input.permissions
20
- }, errorFactory)) && input.permissions.every((elem, _index1) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || $guard(_exceptionable, {
44
+ }, errorFactory)) && input.permissions.every((elem, _index1) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
21
45
  path: _path + ".permissions[" + _index1 + "]",
22
- expected: "PermissionRecordPermisson",
46
+ expected: "(AssetPermission | RpcPermission | TagPermission)",
23
47
  value: elem
24
- }, errorFactory)) && $ao1(elem, _path + ".permissions[" + _index1 + "]", true && _exceptionable) || $guard(_exceptionable, {
48
+ }, errorFactory)) && $au0(elem, _path + ".permissions[" + _index1 + "]", true && _exceptionable) || $guard(_exceptionable, {
25
49
  path: _path + ".permissions[" + _index1 + "]",
26
- expected: "PermissionRecordPermisson",
50
+ expected: "(AssetPermission | RpcPermission | TagPermission)",
27
51
  value: elem
28
52
  }, errorFactory)) || $guard(_exceptionable, {
29
53
  path: _path + ".permissions",
30
54
  expected: "Array<PermissionRecordPermisson>",
31
55
  value: input.permissions
32
56
  }, errorFactory);
33
- const $ao1 = (input, _path, _exceptionable = true) => (undefined === input.type || "string" === typeof input.type || $guard(_exceptionable, {
57
+ const $ao1 = (input, _path, _exceptionable = true) => ("tag" === input.type || $guard(_exceptionable, {
34
58
  path: _path + ".type",
35
- expected: "(string | undefined)",
59
+ expected: "\"tag\"",
36
60
  value: input.type
37
- }, errorFactory)) && (undefined === input.method || "string" === typeof input.method || $guard(_exceptionable, {
61
+ }, errorFactory)) && ((null !== input.method || $guard(_exceptionable, {
62
+ path: _path + ".method",
63
+ expected: "undefined",
64
+ value: input.method
65
+ }, errorFactory)) && (undefined === input.method || $guard(_exceptionable, {
38
66
  path: _path + ".method",
39
- expected: "(string | undefined)",
67
+ expected: "undefined",
40
68
  value: input.method
41
- }, errorFactory)) && (undefined === input.tags || (Array.isArray(input.tags) || $guard(_exceptionable, {
69
+ }, errorFactory))) && ((Array.isArray(input.tags) || $guard(_exceptionable, {
42
70
  path: _path + ".tags",
43
- expected: "(Array<string> | undefined)",
71
+ expected: "Array<string>",
44
72
  value: input.tags
45
73
  }, errorFactory)) && input.tags.every((elem, _index2) => "string" === typeof elem || $guard(_exceptionable, {
46
74
  path: _path + ".tags[" + _index2 + "]",
@@ -48,47 +76,112 @@ export const assertPermissionRecord = (input, errorFactory) => {
48
76
  value: elem
49
77
  }, errorFactory)) || $guard(_exceptionable, {
50
78
  path: _path + ".tags",
51
- expected: "(Array<string> | undefined)",
79
+ expected: "Array<string>",
52
80
  value: input.tags
53
81
  }, errorFactory));
82
+ const $ao2 = (input, _path, _exceptionable = true) => ("asset" === input.type || $guard(_exceptionable, {
83
+ path: _path + ".type",
84
+ expected: "\"asset\"",
85
+ value: input.type
86
+ }, errorFactory)) && ("string" === typeof input.method || $guard(_exceptionable, {
87
+ path: _path + ".method",
88
+ expected: "string",
89
+ value: input.method
90
+ }, errorFactory)) && ((null !== input.tags || $guard(_exceptionable, {
91
+ path: _path + ".tags",
92
+ expected: "undefined",
93
+ value: input.tags
94
+ }, errorFactory)) && (undefined === input.tags || $guard(_exceptionable, {
95
+ path: _path + ".tags",
96
+ expected: "undefined",
97
+ value: input.tags
98
+ }, errorFactory)));
99
+ const $ao3 = (input, _path, _exceptionable = true) => ("rpc" === input.type || $guard(_exceptionable, {
100
+ path: _path + ".type",
101
+ expected: "\"rpc\"",
102
+ value: input.type
103
+ }, errorFactory)) && ("string" === typeof input.method || $guard(_exceptionable, {
104
+ path: _path + ".method",
105
+ expected: "string",
106
+ value: input.method
107
+ }, errorFactory)) && ((null !== input.tags || $guard(_exceptionable, {
108
+ path: _path + ".tags",
109
+ expected: "undefined",
110
+ value: input.tags
111
+ }, errorFactory)) && (undefined === input.tags || $guard(_exceptionable, {
112
+ path: _path + ".tags",
113
+ expected: "undefined",
114
+ value: input.tags
115
+ }, errorFactory)));
116
+ const $au0 = (input, _path, _exceptionable = true) => (() => {
117
+ if ("rpc" === input.type)
118
+ return $ao3(input, _path, true && _exceptionable);
119
+ else if ("asset" === input.type)
120
+ return $ao2(input, _path, true && _exceptionable);
121
+ else if ("tag" === input.type)
122
+ return $ao1(input, _path, true && _exceptionable);
123
+ else
124
+ return $guard(_exceptionable, {
125
+ path: _path,
126
+ expected: "(RpcPermission | AssetPermission | TagPermission)",
127
+ value: input
128
+ }, errorFactory);
129
+ })();
54
130
  return ("object" === typeof input && null !== input || $guard(true, {
55
131
  path: _path + "",
56
- expected: "PermissionRecord",
132
+ expected: "ProvidedPermissionRecord",
57
133
  value: input
58
134
  }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
59
135
  path: _path + "",
60
- expected: "PermissionRecord",
136
+ expected: "ProvidedPermissionRecord",
61
137
  value: input
62
138
  }, errorFactory);
63
139
  })(input, "$input", true);
64
140
  return input;
65
141
  };
66
- export const randomPermissionRecord = generator => {
142
+ export const randomProvidedPermissionRecord = generator => {
67
143
  const $generator = __typia.createRandom.generator;
68
144
  const $pick = __typia.createRandom.pick;
69
145
  const $ro0 = (_recursive = false, _depth = 0) => ({
70
- permissions: (generator?.array ?? $generator.array)(() => $ro1(_recursive, _recursive ? 1 + _depth : _depth))
146
+ permissions: (generator?.array ?? $generator.array)(() => $pick([
147
+ () => $ro3(_recursive, _recursive ? 1 + _depth : _depth),
148
+ () => $ro2(_recursive, _recursive ? 1 + _depth : _depth),
149
+ () => $ro1(_recursive, _recursive ? 1 + _depth : _depth)
150
+ ])())
71
151
  });
72
152
  const $ro1 = (_recursive = false, _depth = 0) => ({
73
- type: $pick([
74
- () => undefined,
75
- () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
76
- ])(),
77
- method: $pick([
78
- () => undefined,
79
- () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
80
- ])(),
81
- tags: $pick([
82
- () => undefined,
83
- () => (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)())
84
- ])()
153
+ type: "tag",
154
+ method: undefined,
155
+ tags: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)())
156
+ });
157
+ const $ro2 = (_recursive = false, _depth = 0) => ({
158
+ type: "asset",
159
+ method: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
160
+ tags: undefined
161
+ });
162
+ const $ro3 = (_recursive = false, _depth = 0) => ({
163
+ type: "rpc",
164
+ method: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
165
+ tags: undefined
85
166
  });
86
167
  return $ro0();
87
168
  };
88
- export const assertGuardPermissionRecord = (input, errorFactory) => {
169
+ export const assertGuardProvidedPermissionRecord = (input, errorFactory) => {
89
170
  const __is = input => {
90
- const $io0 = input => Array.isArray(input.permissions) && input.permissions.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem));
91
- const $io1 = input => (undefined === input.type || "string" === typeof input.type) && (undefined === input.method || "string" === typeof input.method) && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
171
+ const $io0 = input => Array.isArray(input.permissions) && input.permissions.every(elem => "object" === typeof elem && null !== elem && $iu0(elem));
172
+ const $io1 = input => "tag" === input.type && (null !== input.method && undefined === input.method) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
173
+ const $io2 = input => "asset" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
174
+ const $io3 = input => "rpc" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
175
+ const $iu0 = input => (() => {
176
+ if ("rpc" === input.type)
177
+ return $io3(input);
178
+ else if ("asset" === input.type)
179
+ return $io2(input);
180
+ else if ("tag" === input.type)
181
+ return $io1(input);
182
+ else
183
+ return false;
184
+ })();
92
185
  return "object" === typeof input && null !== input && $io0(input);
93
186
  };
94
187
  if (false === __is(input))
@@ -98,30 +191,34 @@ export const assertGuardPermissionRecord = (input, errorFactory) => {
98
191
  path: _path + ".permissions",
99
192
  expected: "Array<PermissionRecordPermisson>",
100
193
  value: input.permissions
101
- }, errorFactory)) && input.permissions.every((elem, _index1) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || $guard(_exceptionable, {
194
+ }, errorFactory)) && input.permissions.every((elem, _index1) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
102
195
  path: _path + ".permissions[" + _index1 + "]",
103
- expected: "PermissionRecordPermisson",
196
+ expected: "(AssetPermission | RpcPermission | TagPermission)",
104
197
  value: elem
105
- }, errorFactory)) && $ao1(elem, _path + ".permissions[" + _index1 + "]", true && _exceptionable) || $guard(_exceptionable, {
198
+ }, errorFactory)) && $au0(elem, _path + ".permissions[" + _index1 + "]", true && _exceptionable) || $guard(_exceptionable, {
106
199
  path: _path + ".permissions[" + _index1 + "]",
107
- expected: "PermissionRecordPermisson",
200
+ expected: "(AssetPermission | RpcPermission | TagPermission)",
108
201
  value: elem
109
202
  }, errorFactory)) || $guard(_exceptionable, {
110
203
  path: _path + ".permissions",
111
204
  expected: "Array<PermissionRecordPermisson>",
112
205
  value: input.permissions
113
206
  }, errorFactory);
114
- const $ao1 = (input, _path, _exceptionable = true) => (undefined === input.type || "string" === typeof input.type || $guard(_exceptionable, {
207
+ const $ao1 = (input, _path, _exceptionable = true) => ("tag" === input.type || $guard(_exceptionable, {
115
208
  path: _path + ".type",
116
- expected: "(string | undefined)",
209
+ expected: "\"tag\"",
117
210
  value: input.type
118
- }, errorFactory)) && (undefined === input.method || "string" === typeof input.method || $guard(_exceptionable, {
211
+ }, errorFactory)) && ((null !== input.method || $guard(_exceptionable, {
212
+ path: _path + ".method",
213
+ expected: "undefined",
214
+ value: input.method
215
+ }, errorFactory)) && (undefined === input.method || $guard(_exceptionable, {
119
216
  path: _path + ".method",
120
- expected: "(string | undefined)",
217
+ expected: "undefined",
121
218
  value: input.method
122
- }, errorFactory)) && (undefined === input.tags || (Array.isArray(input.tags) || $guard(_exceptionable, {
219
+ }, errorFactory))) && ((Array.isArray(input.tags) || $guard(_exceptionable, {
123
220
  path: _path + ".tags",
124
- expected: "(Array<string> | undefined)",
221
+ expected: "Array<string>",
125
222
  value: input.tags
126
223
  }, errorFactory)) && input.tags.every((elem, _index2) => "string" === typeof elem || $guard(_exceptionable, {
127
224
  path: _path + ".tags[" + _index2 + "]",
@@ -129,32 +226,146 @@ export const assertGuardPermissionRecord = (input, errorFactory) => {
129
226
  value: elem
130
227
  }, errorFactory)) || $guard(_exceptionable, {
131
228
  path: _path + ".tags",
132
- expected: "(Array<string> | undefined)",
229
+ expected: "Array<string>",
133
230
  value: input.tags
134
231
  }, errorFactory));
232
+ const $ao2 = (input, _path, _exceptionable = true) => ("asset" === input.type || $guard(_exceptionable, {
233
+ path: _path + ".type",
234
+ expected: "\"asset\"",
235
+ value: input.type
236
+ }, errorFactory)) && ("string" === typeof input.method || $guard(_exceptionable, {
237
+ path: _path + ".method",
238
+ expected: "string",
239
+ value: input.method
240
+ }, errorFactory)) && ((null !== input.tags || $guard(_exceptionable, {
241
+ path: _path + ".tags",
242
+ expected: "undefined",
243
+ value: input.tags
244
+ }, errorFactory)) && (undefined === input.tags || $guard(_exceptionable, {
245
+ path: _path + ".tags",
246
+ expected: "undefined",
247
+ value: input.tags
248
+ }, errorFactory)));
249
+ const $ao3 = (input, _path, _exceptionable = true) => ("rpc" === input.type || $guard(_exceptionable, {
250
+ path: _path + ".type",
251
+ expected: "\"rpc\"",
252
+ value: input.type
253
+ }, errorFactory)) && ("string" === typeof input.method || $guard(_exceptionable, {
254
+ path: _path + ".method",
255
+ expected: "string",
256
+ value: input.method
257
+ }, errorFactory)) && ((null !== input.tags || $guard(_exceptionable, {
258
+ path: _path + ".tags",
259
+ expected: "undefined",
260
+ value: input.tags
261
+ }, errorFactory)) && (undefined === input.tags || $guard(_exceptionable, {
262
+ path: _path + ".tags",
263
+ expected: "undefined",
264
+ value: input.tags
265
+ }, errorFactory)));
266
+ const $au0 = (input, _path, _exceptionable = true) => (() => {
267
+ if ("rpc" === input.type)
268
+ return $ao3(input, _path, true && _exceptionable);
269
+ else if ("asset" === input.type)
270
+ return $ao2(input, _path, true && _exceptionable);
271
+ else if ("tag" === input.type)
272
+ return $ao1(input, _path, true && _exceptionable);
273
+ else
274
+ return $guard(_exceptionable, {
275
+ path: _path,
276
+ expected: "(RpcPermission | AssetPermission | TagPermission)",
277
+ value: input
278
+ }, errorFactory);
279
+ })();
135
280
  return ("object" === typeof input && null !== input || $guard(true, {
136
281
  path: _path + "",
137
- expected: "PermissionRecord",
282
+ expected: "ProvidedPermissionRecord",
138
283
  value: input
139
284
  }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
140
285
  path: _path + "",
141
- expected: "PermissionRecord",
286
+ expected: "ProvidedPermissionRecord",
142
287
  value: input
143
288
  }, errorFactory);
144
289
  })(input, "$input", true);
145
290
  };
146
- export const stringifyPermissionRecord = input => {
147
- const $io1 = input => (undefined === input.type || "string" === typeof input.type) && (undefined === input.method || "string" === typeof input.method) && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
291
+ export const stringifyProvidedPermissionRecord = input => {
292
+ const $io1 = input => "tag" === input.type && (null !== input.method && undefined === input.method) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
293
+ const $io2 = input => "asset" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
294
+ const $io3 = input => "rpc" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
295
+ const $iu0 = input => (() => {
296
+ if ("rpc" === input.type)
297
+ return $io3(input);
298
+ else if ("asset" === input.type)
299
+ return $io2(input);
300
+ else if ("tag" === input.type)
301
+ return $io1(input);
302
+ else
303
+ return false;
304
+ })();
148
305
  const $string = __typia.json.createStringify.string;
149
- const $tail = __typia.json.createStringify.tail;
150
- const $so0 = input => `{"permissions":${`[${input.permissions.map(elem => $so1(elem)).join(",")}]`}}`;
151
- const $so1 = input => `{${$tail(`${undefined === input.type ? "" : `"type":${undefined !== input.type ? $string(input.type) : undefined},`}${undefined === input.method ? "" : `"method":${undefined !== input.method ? $string(input.method) : undefined},`}${undefined === input.tags ? "" : `"tags":${undefined !== input.tags ? `[${input.tags.map(elem => $string(elem)).join(",")}]` : undefined}`}`)}}`;
306
+ const $throws = __typia.json.createStringify.throws;
307
+ const $so0 = input => `{"permissions":${`[${input.permissions.map(elem => $su0(elem)).join(",")}]`}}`;
308
+ const $so1 = input => `{"type":${(() => {
309
+ if ("string" === typeof input.type)
310
+ return $string(input.type);
311
+ if ("string" === typeof input.type)
312
+ return "\"" + input.type + "\"";
313
+ $throws({
314
+ expected: "\"tag\"",
315
+ value: input.type
316
+ });
317
+ })()},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`}}`;
318
+ const $so2 = input => `{"type":${(() => {
319
+ if ("string" === typeof input.type)
320
+ return $string(input.type);
321
+ if ("string" === typeof input.type)
322
+ return "\"" + input.type + "\"";
323
+ $throws({
324
+ expected: "\"asset\"",
325
+ value: input.type
326
+ });
327
+ })()},"method":${$string(input.method)}}`;
328
+ const $so3 = input => `{"type":${(() => {
329
+ if ("string" === typeof input.type)
330
+ return $string(input.type);
331
+ if ("string" === typeof input.type)
332
+ return "\"" + input.type + "\"";
333
+ $throws({
334
+ expected: "\"rpc\"",
335
+ value: input.type
336
+ });
337
+ })()},"method":${$string(input.method)}}`;
338
+ const $su0 = input => (() => {
339
+ if ("rpc" === input.type)
340
+ return $so3(input);
341
+ else if ("asset" === input.type)
342
+ return $so2(input);
343
+ else if ("tag" === input.type)
344
+ return $so1(input);
345
+ else
346
+ $throws({
347
+ expected: "(RpcPermission | AssetPermission | TagPermission)",
348
+ value: input
349
+ });
350
+ })();
152
351
  return $so0(input);
153
352
  };
154
- export const assertStringifyPermissionRecord = (input, errorFactory) => { const assert = (input, errorFactory) => {
353
+ export const assertStringifyProvidedPermissionRecord = (input, errorFactory) => { const assert = (input, errorFactory) => {
155
354
  const __is = input => {
156
- const $io0 = input => Array.isArray(input.permissions) && input.permissions.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem));
157
- const $io1 = input => (undefined === input.type || "string" === typeof input.type) && (undefined === input.method || "string" === typeof input.method) && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
355
+ const $io0 = input => Array.isArray(input.permissions) && input.permissions.every(elem => "object" === typeof elem && null !== elem && $iu0(elem));
356
+ const $io1 = input => "tag" === input.type && (null !== input.method && undefined === input.method) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
357
+ const $io2 = input => "asset" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
358
+ const $io3 = input => "rpc" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
359
+ const $iu0 = input => (() => {
360
+ if ("rpc" === input.type)
361
+ return $io3(input);
362
+ else if ("asset" === input.type)
363
+ return $io2(input);
364
+ else if ("tag" === input.type)
365
+ return $io1(input);
366
+ else
367
+ return false;
368
+ })();
158
369
  return "object" === typeof input && null !== input && $io0(input);
159
370
  };
160
371
  if (false === __is(input))
@@ -164,30 +375,34 @@ export const assertStringifyPermissionRecord = (input, errorFactory) => { const
164
375
  path: _path + ".permissions",
165
376
  expected: "Array<PermissionRecordPermisson>",
166
377
  value: input.permissions
167
- }, errorFactory)) && input.permissions.every((elem, _index1) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || $guard(_exceptionable, {
378
+ }, errorFactory)) && input.permissions.every((elem, _index1) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
168
379
  path: _path + ".permissions[" + _index1 + "]",
169
- expected: "PermissionRecordPermisson",
380
+ expected: "(AssetPermission | RpcPermission | TagPermission)",
170
381
  value: elem
171
- }, errorFactory)) && $ao1(elem, _path + ".permissions[" + _index1 + "]", true && _exceptionable) || $guard(_exceptionable, {
382
+ }, errorFactory)) && $au0(elem, _path + ".permissions[" + _index1 + "]", true && _exceptionable) || $guard(_exceptionable, {
172
383
  path: _path + ".permissions[" + _index1 + "]",
173
- expected: "PermissionRecordPermisson",
384
+ expected: "(AssetPermission | RpcPermission | TagPermission)",
174
385
  value: elem
175
386
  }, errorFactory)) || $guard(_exceptionable, {
176
387
  path: _path + ".permissions",
177
388
  expected: "Array<PermissionRecordPermisson>",
178
389
  value: input.permissions
179
390
  }, errorFactory);
180
- const $ao1 = (input, _path, _exceptionable = true) => (undefined === input.type || "string" === typeof input.type || $guard(_exceptionable, {
391
+ const $ao1 = (input, _path, _exceptionable = true) => ("tag" === input.type || $guard(_exceptionable, {
181
392
  path: _path + ".type",
182
- expected: "(string | undefined)",
393
+ expected: "\"tag\"",
183
394
  value: input.type
184
- }, errorFactory)) && (undefined === input.method || "string" === typeof input.method || $guard(_exceptionable, {
395
+ }, errorFactory)) && ((null !== input.method || $guard(_exceptionable, {
396
+ path: _path + ".method",
397
+ expected: "undefined",
398
+ value: input.method
399
+ }, errorFactory)) && (undefined === input.method || $guard(_exceptionable, {
185
400
  path: _path + ".method",
186
- expected: "(string | undefined)",
401
+ expected: "undefined",
187
402
  value: input.method
188
- }, errorFactory)) && (undefined === input.tags || (Array.isArray(input.tags) || $guard(_exceptionable, {
403
+ }, errorFactory))) && ((Array.isArray(input.tags) || $guard(_exceptionable, {
189
404
  path: _path + ".tags",
190
- expected: "(Array<string> | undefined)",
405
+ expected: "Array<string>",
191
406
  value: input.tags
192
407
  }, errorFactory)) && input.tags.every((elem, _index2) => "string" === typeof elem || $guard(_exceptionable, {
193
408
  path: _path + ".tags[" + _index2 + "]",
@@ -195,51 +410,181 @@ export const assertStringifyPermissionRecord = (input, errorFactory) => { const
195
410
  value: elem
196
411
  }, errorFactory)) || $guard(_exceptionable, {
197
412
  path: _path + ".tags",
198
- expected: "(Array<string> | undefined)",
413
+ expected: "Array<string>",
199
414
  value: input.tags
200
415
  }, errorFactory));
416
+ const $ao2 = (input, _path, _exceptionable = true) => ("asset" === input.type || $guard(_exceptionable, {
417
+ path: _path + ".type",
418
+ expected: "\"asset\"",
419
+ value: input.type
420
+ }, errorFactory)) && ("string" === typeof input.method || $guard(_exceptionable, {
421
+ path: _path + ".method",
422
+ expected: "string",
423
+ value: input.method
424
+ }, errorFactory)) && ((null !== input.tags || $guard(_exceptionable, {
425
+ path: _path + ".tags",
426
+ expected: "undefined",
427
+ value: input.tags
428
+ }, errorFactory)) && (undefined === input.tags || $guard(_exceptionable, {
429
+ path: _path + ".tags",
430
+ expected: "undefined",
431
+ value: input.tags
432
+ }, errorFactory)));
433
+ const $ao3 = (input, _path, _exceptionable = true) => ("rpc" === input.type || $guard(_exceptionable, {
434
+ path: _path + ".type",
435
+ expected: "\"rpc\"",
436
+ value: input.type
437
+ }, errorFactory)) && ("string" === typeof input.method || $guard(_exceptionable, {
438
+ path: _path + ".method",
439
+ expected: "string",
440
+ value: input.method
441
+ }, errorFactory)) && ((null !== input.tags || $guard(_exceptionable, {
442
+ path: _path + ".tags",
443
+ expected: "undefined",
444
+ value: input.tags
445
+ }, errorFactory)) && (undefined === input.tags || $guard(_exceptionable, {
446
+ path: _path + ".tags",
447
+ expected: "undefined",
448
+ value: input.tags
449
+ }, errorFactory)));
450
+ const $au0 = (input, _path, _exceptionable = true) => (() => {
451
+ if ("rpc" === input.type)
452
+ return $ao3(input, _path, true && _exceptionable);
453
+ else if ("asset" === input.type)
454
+ return $ao2(input, _path, true && _exceptionable);
455
+ else if ("tag" === input.type)
456
+ return $ao1(input, _path, true && _exceptionable);
457
+ else
458
+ return $guard(_exceptionable, {
459
+ path: _path,
460
+ expected: "(RpcPermission | AssetPermission | TagPermission)",
461
+ value: input
462
+ }, errorFactory);
463
+ })();
201
464
  return ("object" === typeof input && null !== input || $guard(true, {
202
465
  path: _path + "",
203
- expected: "PermissionRecord",
466
+ expected: "ProvidedPermissionRecord",
204
467
  value: input
205
468
  }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
206
469
  path: _path + "",
207
- expected: "PermissionRecord",
470
+ expected: "ProvidedPermissionRecord",
208
471
  value: input
209
472
  }, errorFactory);
210
473
  })(input, "$input", true);
211
474
  return input;
212
475
  }; const stringify = input => {
213
- const $io1 = input => (undefined === input.type || "string" === typeof input.type) && (undefined === input.method || "string" === typeof input.method) && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
476
+ const $io1 = input => "tag" === input.type && (null !== input.method && undefined === input.method) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
477
+ const $io2 = input => "asset" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
478
+ const $io3 = input => "rpc" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
479
+ const $iu0 = input => (() => {
480
+ if ("rpc" === input.type)
481
+ return $io3(input);
482
+ else if ("asset" === input.type)
483
+ return $io2(input);
484
+ else if ("tag" === input.type)
485
+ return $io1(input);
486
+ else
487
+ return false;
488
+ })();
214
489
  const $string = __typia.json.createAssertStringify.string;
215
- const $tail = __typia.json.createAssertStringify.tail;
216
- const $so0 = input => `{"permissions":${`[${input.permissions.map(elem => $so1(elem)).join(",")}]`}}`;
217
- const $so1 = input => `{${$tail(`${undefined === input.type ? "" : `"type":${undefined !== input.type ? $string(input.type) : undefined},`}${undefined === input.method ? "" : `"method":${undefined !== input.method ? $string(input.method) : undefined},`}${undefined === input.tags ? "" : `"tags":${undefined !== input.tags ? `[${input.tags.map(elem => $string(elem)).join(",")}]` : undefined}`}`)}}`;
490
+ const $throws = __typia.json.createAssertStringify.throws;
491
+ const $so0 = input => `{"permissions":${`[${input.permissions.map(elem => $su0(elem)).join(",")}]`}}`;
492
+ const $so1 = input => `{"type":${(() => {
493
+ if ("string" === typeof input.type)
494
+ return $string(input.type);
495
+ if ("string" === typeof input.type)
496
+ return "\"" + input.type + "\"";
497
+ $throws({
498
+ expected: "\"tag\"",
499
+ value: input.type
500
+ });
501
+ })()},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`}}`;
502
+ const $so2 = input => `{"type":${(() => {
503
+ if ("string" === typeof input.type)
504
+ return $string(input.type);
505
+ if ("string" === typeof input.type)
506
+ return "\"" + input.type + "\"";
507
+ $throws({
508
+ expected: "\"asset\"",
509
+ value: input.type
510
+ });
511
+ })()},"method":${$string(input.method)}}`;
512
+ const $so3 = input => `{"type":${(() => {
513
+ if ("string" === typeof input.type)
514
+ return $string(input.type);
515
+ if ("string" === typeof input.type)
516
+ return "\"" + input.type + "\"";
517
+ $throws({
518
+ expected: "\"rpc\"",
519
+ value: input.type
520
+ });
521
+ })()},"method":${$string(input.method)}}`;
522
+ const $su0 = input => (() => {
523
+ if ("rpc" === input.type)
524
+ return $so3(input);
525
+ else if ("asset" === input.type)
526
+ return $so2(input);
527
+ else if ("tag" === input.type)
528
+ return $so1(input);
529
+ else
530
+ $throws({
531
+ expected: "(RpcPermission | AssetPermission | TagPermission)",
532
+ value: input
533
+ });
534
+ })();
218
535
  return $so0(input);
219
536
  }; return stringify(assert(input, errorFactory)); };
220
- export const isPermissionRecordPermisson = input => {
221
- const $io0 = input => (undefined === input.type || "string" === typeof input.type) && (undefined === input.method || "string" === typeof input.method) && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
222
- return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
537
+ export const isPermissionRecord = input => {
538
+ const $io0 = input => "tag" === input.type && (null !== input.method && undefined === input.method) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
539
+ const $io1 = input => "asset" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
540
+ const $io2 = input => "rpc" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
541
+ const $iu0 = input => (() => {
542
+ if ("rpc" === input.type)
543
+ return $io2(input);
544
+ else if ("asset" === input.type)
545
+ return $io1(input);
546
+ else if ("tag" === input.type)
547
+ return $io0(input);
548
+ else
549
+ return false;
550
+ })();
551
+ return "object" === typeof input && null !== input && $iu0(input);
223
552
  };
224
- export const assertPermissionRecordPermisson = (input, errorFactory) => {
553
+ export const assertPermissionRecord = (input, errorFactory) => {
225
554
  const __is = input => {
226
- const $io0 = input => (undefined === input.type || "string" === typeof input.type) && (undefined === input.method || "string" === typeof input.method) && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
227
- return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
555
+ const $io0 = input => "tag" === input.type && (null !== input.method && undefined === input.method) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
556
+ const $io1 = input => "asset" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
557
+ const $io2 = input => "rpc" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
558
+ const $iu0 = input => (() => {
559
+ if ("rpc" === input.type)
560
+ return $io2(input);
561
+ else if ("asset" === input.type)
562
+ return $io1(input);
563
+ else if ("tag" === input.type)
564
+ return $io0(input);
565
+ else
566
+ return false;
567
+ })();
568
+ return "object" === typeof input && null !== input && $iu0(input);
228
569
  };
229
570
  if (false === __is(input))
230
571
  ((input, _path, _exceptionable = true) => {
231
572
  const $guard = __typia.createAssert.guard;
232
- const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.type || "string" === typeof input.type || $guard(_exceptionable, {
573
+ const $ao0 = (input, _path, _exceptionable = true) => ("tag" === input.type || $guard(_exceptionable, {
233
574
  path: _path + ".type",
234
- expected: "(string | undefined)",
575
+ expected: "\"tag\"",
235
576
  value: input.type
236
- }, errorFactory)) && (undefined === input.method || "string" === typeof input.method || $guard(_exceptionable, {
577
+ }, errorFactory)) && ((null !== input.method || $guard(_exceptionable, {
578
+ path: _path + ".method",
579
+ expected: "undefined",
580
+ value: input.method
581
+ }, errorFactory)) && (undefined === input.method || $guard(_exceptionable, {
237
582
  path: _path + ".method",
238
- expected: "(string | undefined)",
583
+ expected: "undefined",
239
584
  value: input.method
240
- }, errorFactory)) && (undefined === input.tags || (Array.isArray(input.tags) || $guard(_exceptionable, {
585
+ }, errorFactory))) && ((Array.isArray(input.tags) || $guard(_exceptionable, {
241
586
  path: _path + ".tags",
242
- expected: "(Array<string> | undefined)",
587
+ expected: "Array<string>",
243
588
  value: input.tags
244
589
  }, errorFactory)) && input.tags.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
245
590
  path: _path + ".tags[" + _index1 + "]",
@@ -247,59 +592,128 @@ export const assertPermissionRecordPermisson = (input, errorFactory) => {
247
592
  value: elem
248
593
  }, errorFactory)) || $guard(_exceptionable, {
249
594
  path: _path + ".tags",
250
- expected: "(Array<string> | undefined)",
595
+ expected: "Array<string>",
251
596
  value: input.tags
252
597
  }, errorFactory));
253
- return ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
598
+ const $ao1 = (input, _path, _exceptionable = true) => ("asset" === input.type || $guard(_exceptionable, {
599
+ path: _path + ".type",
600
+ expected: "\"asset\"",
601
+ value: input.type
602
+ }, errorFactory)) && ("string" === typeof input.method || $guard(_exceptionable, {
603
+ path: _path + ".method",
604
+ expected: "string",
605
+ value: input.method
606
+ }, errorFactory)) && ((null !== input.tags || $guard(_exceptionable, {
607
+ path: _path + ".tags",
608
+ expected: "undefined",
609
+ value: input.tags
610
+ }, errorFactory)) && (undefined === input.tags || $guard(_exceptionable, {
611
+ path: _path + ".tags",
612
+ expected: "undefined",
613
+ value: input.tags
614
+ }, errorFactory)));
615
+ const $ao2 = (input, _path, _exceptionable = true) => ("rpc" === input.type || $guard(_exceptionable, {
616
+ path: _path + ".type",
617
+ expected: "\"rpc\"",
618
+ value: input.type
619
+ }, errorFactory)) && ("string" === typeof input.method || $guard(_exceptionable, {
620
+ path: _path + ".method",
621
+ expected: "string",
622
+ value: input.method
623
+ }, errorFactory)) && ((null !== input.tags || $guard(_exceptionable, {
624
+ path: _path + ".tags",
625
+ expected: "undefined",
626
+ value: input.tags
627
+ }, errorFactory)) && (undefined === input.tags || $guard(_exceptionable, {
628
+ path: _path + ".tags",
629
+ expected: "undefined",
630
+ value: input.tags
631
+ }, errorFactory)));
632
+ const $au0 = (input, _path, _exceptionable = true) => (() => {
633
+ if ("rpc" === input.type)
634
+ return $ao2(input, _path, true && _exceptionable);
635
+ else if ("asset" === input.type)
636
+ return $ao1(input, _path, true && _exceptionable);
637
+ else if ("tag" === input.type)
638
+ return $ao0(input, _path, true && _exceptionable);
639
+ else
640
+ return $guard(_exceptionable, {
641
+ path: _path,
642
+ expected: "(RpcPermission | AssetPermission | TagPermission)",
643
+ value: input
644
+ }, errorFactory);
645
+ })();
646
+ return ("object" === typeof input && null !== input || $guard(true, {
254
647
  path: _path + "",
255
- expected: "PermissionRecordPermisson",
648
+ expected: "(AssetPermission | RpcPermission | TagPermission)",
256
649
  value: input
257
- }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
650
+ }, errorFactory)) && $au0(input, _path + "", true) || $guard(true, {
258
651
  path: _path + "",
259
- expected: "PermissionRecordPermisson",
652
+ expected: "(AssetPermission | RpcPermission | TagPermission)",
260
653
  value: input
261
654
  }, errorFactory);
262
655
  })(input, "$input", true);
263
656
  return input;
264
657
  };
265
- export const randomPermissionRecordPermisson = generator => {
658
+ export const randomPermissionRecord = generator => {
266
659
  const $generator = __typia.createRandom.generator;
267
660
  const $pick = __typia.createRandom.pick;
268
661
  const $ro0 = (_recursive = false, _depth = 0) => ({
269
- type: $pick([
270
- () => undefined,
271
- () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
272
- ])(),
273
- method: $pick([
274
- () => undefined,
275
- () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
276
- ])(),
277
- tags: $pick([
278
- () => undefined,
279
- () => (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)())
280
- ])()
662
+ type: "tag",
663
+ method: undefined,
664
+ tags: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)())
281
665
  });
282
- return $ro0();
666
+ const $ro1 = (_recursive = false, _depth = 0) => ({
667
+ type: "asset",
668
+ method: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
669
+ tags: undefined
670
+ });
671
+ const $ro2 = (_recursive = false, _depth = 0) => ({
672
+ type: "rpc",
673
+ method: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
674
+ tags: undefined
675
+ });
676
+ return $pick([
677
+ () => $ro2(),
678
+ () => $ro1(),
679
+ () => $ro0()
680
+ ])();
283
681
  };
284
- export const assertGuardPermissionRecordPermisson = (input, errorFactory) => {
682
+ export const assertGuardPermissionRecord = (input, errorFactory) => {
285
683
  const __is = input => {
286
- const $io0 = input => (undefined === input.type || "string" === typeof input.type) && (undefined === input.method || "string" === typeof input.method) && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
287
- return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
684
+ const $io0 = input => "tag" === input.type && (null !== input.method && undefined === input.method) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
685
+ const $io1 = input => "asset" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
686
+ const $io2 = input => "rpc" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
687
+ const $iu0 = input => (() => {
688
+ if ("rpc" === input.type)
689
+ return $io2(input);
690
+ else if ("asset" === input.type)
691
+ return $io1(input);
692
+ else if ("tag" === input.type)
693
+ return $io0(input);
694
+ else
695
+ return false;
696
+ })();
697
+ return "object" === typeof input && null !== input && $iu0(input);
288
698
  };
289
699
  if (false === __is(input))
290
700
  ((input, _path, _exceptionable = true) => {
291
701
  const $guard = __typia.createAssertGuard.guard;
292
- const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.type || "string" === typeof input.type || $guard(_exceptionable, {
702
+ const $ao0 = (input, _path, _exceptionable = true) => ("tag" === input.type || $guard(_exceptionable, {
293
703
  path: _path + ".type",
294
- expected: "(string | undefined)",
704
+ expected: "\"tag\"",
295
705
  value: input.type
296
- }, errorFactory)) && (undefined === input.method || "string" === typeof input.method || $guard(_exceptionable, {
706
+ }, errorFactory)) && ((null !== input.method || $guard(_exceptionable, {
297
707
  path: _path + ".method",
298
- expected: "(string | undefined)",
708
+ expected: "undefined",
299
709
  value: input.method
300
- }, errorFactory)) && (undefined === input.tags || (Array.isArray(input.tags) || $guard(_exceptionable, {
710
+ }, errorFactory)) && (undefined === input.method || $guard(_exceptionable, {
711
+ path: _path + ".method",
712
+ expected: "undefined",
713
+ value: input.method
714
+ }, errorFactory))) && ((Array.isArray(input.tags) || $guard(_exceptionable, {
301
715
  path: _path + ".tags",
302
- expected: "(Array<string> | undefined)",
716
+ expected: "Array<string>",
303
717
  value: input.tags
304
718
  }, errorFactory)) && input.tags.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
305
719
  path: _path + ".tags[" + _index1 + "]",
@@ -307,45 +721,454 @@ export const assertGuardPermissionRecordPermisson = (input, errorFactory) => {
307
721
  value: elem
308
722
  }, errorFactory)) || $guard(_exceptionable, {
309
723
  path: _path + ".tags",
310
- expected: "(Array<string> | undefined)",
724
+ expected: "Array<string>",
311
725
  value: input.tags
312
726
  }, errorFactory));
313
- return ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
727
+ const $ao1 = (input, _path, _exceptionable = true) => ("asset" === input.type || $guard(_exceptionable, {
728
+ path: _path + ".type",
729
+ expected: "\"asset\"",
730
+ value: input.type
731
+ }, errorFactory)) && ("string" === typeof input.method || $guard(_exceptionable, {
732
+ path: _path + ".method",
733
+ expected: "string",
734
+ value: input.method
735
+ }, errorFactory)) && ((null !== input.tags || $guard(_exceptionable, {
736
+ path: _path + ".tags",
737
+ expected: "undefined",
738
+ value: input.tags
739
+ }, errorFactory)) && (undefined === input.tags || $guard(_exceptionable, {
740
+ path: _path + ".tags",
741
+ expected: "undefined",
742
+ value: input.tags
743
+ }, errorFactory)));
744
+ const $ao2 = (input, _path, _exceptionable = true) => ("rpc" === input.type || $guard(_exceptionable, {
745
+ path: _path + ".type",
746
+ expected: "\"rpc\"",
747
+ value: input.type
748
+ }, errorFactory)) && ("string" === typeof input.method || $guard(_exceptionable, {
749
+ path: _path + ".method",
750
+ expected: "string",
751
+ value: input.method
752
+ }, errorFactory)) && ((null !== input.tags || $guard(_exceptionable, {
753
+ path: _path + ".tags",
754
+ expected: "undefined",
755
+ value: input.tags
756
+ }, errorFactory)) && (undefined === input.tags || $guard(_exceptionable, {
757
+ path: _path + ".tags",
758
+ expected: "undefined",
759
+ value: input.tags
760
+ }, errorFactory)));
761
+ const $au0 = (input, _path, _exceptionable = true) => (() => {
762
+ if ("rpc" === input.type)
763
+ return $ao2(input, _path, true && _exceptionable);
764
+ else if ("asset" === input.type)
765
+ return $ao1(input, _path, true && _exceptionable);
766
+ else if ("tag" === input.type)
767
+ return $ao0(input, _path, true && _exceptionable);
768
+ else
769
+ return $guard(_exceptionable, {
770
+ path: _path,
771
+ expected: "(RpcPermission | AssetPermission | TagPermission)",
772
+ value: input
773
+ }, errorFactory);
774
+ })();
775
+ return ("object" === typeof input && null !== input || $guard(true, {
314
776
  path: _path + "",
315
- expected: "PermissionRecordPermisson",
777
+ expected: "(AssetPermission | RpcPermission | TagPermission)",
316
778
  value: input
317
- }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
779
+ }, errorFactory)) && $au0(input, _path + "", true) || $guard(true, {
318
780
  path: _path + "",
319
- expected: "PermissionRecordPermisson",
781
+ expected: "(AssetPermission | RpcPermission | TagPermission)",
320
782
  value: input
321
783
  }, errorFactory);
322
784
  })(input, "$input", true);
323
785
  };
324
- export const stringifyPermissionRecordPermisson = input => {
786
+ export const stringifyPermissionRecord = input => {
787
+ const $io0 = input => "tag" === input.type && (null !== input.method && undefined === input.method) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
788
+ const $io1 = input => "asset" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
789
+ const $io2 = input => "rpc" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
325
790
  const $string = __typia.json.createStringify.string;
326
- const $tail = __typia.json.createStringify.tail;
327
- const $so0 = input => `{${$tail(`${undefined === input.type ? "" : `"type":${undefined !== input.type ? $string(input.type) : undefined},`}${undefined === input.method ? "" : `"method":${undefined !== input.method ? $string(input.method) : undefined},`}${undefined === input.tags ? "" : `"tags":${undefined !== input.tags ? `[${input.tags.map(elem => $string(elem)).join(",")}]` : undefined}`}`)}}`;
328
- return $so0(input);
791
+ const $throws = __typia.json.createStringify.throws;
792
+ const $so0 = input => `{"type":${(() => {
793
+ if ("string" === typeof input.type)
794
+ return $string(input.type);
795
+ if ("string" === typeof input.type)
796
+ return "\"" + input.type + "\"";
797
+ $throws({
798
+ expected: "\"tag\"",
799
+ value: input.type
800
+ });
801
+ })()},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`}}`;
802
+ const $so1 = input => `{"type":${(() => {
803
+ if ("string" === typeof input.type)
804
+ return $string(input.type);
805
+ if ("string" === typeof input.type)
806
+ return "\"" + input.type + "\"";
807
+ $throws({
808
+ expected: "\"asset\"",
809
+ value: input.type
810
+ });
811
+ })()},"method":${$string(input.method)}}`;
812
+ const $so2 = input => `{"type":${(() => {
813
+ if ("string" === typeof input.type)
814
+ return $string(input.type);
815
+ if ("string" === typeof input.type)
816
+ return "\"" + input.type + "\"";
817
+ $throws({
818
+ expected: "\"rpc\"",
819
+ value: input.type
820
+ });
821
+ })()},"method":${$string(input.method)}}`;
822
+ const $su0 = input => (() => {
823
+ if ("rpc" === input.type)
824
+ return $so2(input);
825
+ else if ("asset" === input.type)
826
+ return $so1(input);
827
+ else if ("tag" === input.type)
828
+ return $so0(input);
829
+ else
830
+ $throws({
831
+ expected: "(RpcPermission | AssetPermission | TagPermission)",
832
+ value: input
833
+ });
834
+ })();
835
+ return $su0(input);
329
836
  };
330
- export const assertStringifyPermissionRecordPermisson = (input, errorFactory) => { const assert = (input, errorFactory) => {
837
+ export const assertStringifyPermissionRecord = (input, errorFactory) => { const assert = (input, errorFactory) => {
331
838
  const __is = input => {
332
- const $io0 = input => (undefined === input.type || "string" === typeof input.type) && (undefined === input.method || "string" === typeof input.method) && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
333
- return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
839
+ const $io0 = input => "tag" === input.type && (null !== input.method && undefined === input.method) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
840
+ const $io1 = input => "asset" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
841
+ const $io2 = input => "rpc" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
842
+ const $iu0 = input => (() => {
843
+ if ("rpc" === input.type)
844
+ return $io2(input);
845
+ else if ("asset" === input.type)
846
+ return $io1(input);
847
+ else if ("tag" === input.type)
848
+ return $io0(input);
849
+ else
850
+ return false;
851
+ })();
852
+ return "object" === typeof input && null !== input && $iu0(input);
334
853
  };
335
854
  if (false === __is(input))
336
855
  ((input, _path, _exceptionable = true) => {
337
856
  const $guard = __typia.json.createAssertStringify.guard;
338
- const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.type || "string" === typeof input.type || $guard(_exceptionable, {
857
+ const $ao0 = (input, _path, _exceptionable = true) => ("tag" === input.type || $guard(_exceptionable, {
858
+ path: _path + ".type",
859
+ expected: "\"tag\"",
860
+ value: input.type
861
+ }, errorFactory)) && ((null !== input.method || $guard(_exceptionable, {
862
+ path: _path + ".method",
863
+ expected: "undefined",
864
+ value: input.method
865
+ }, errorFactory)) && (undefined === input.method || $guard(_exceptionable, {
866
+ path: _path + ".method",
867
+ expected: "undefined",
868
+ value: input.method
869
+ }, errorFactory))) && ((Array.isArray(input.tags) || $guard(_exceptionable, {
870
+ path: _path + ".tags",
871
+ expected: "Array<string>",
872
+ value: input.tags
873
+ }, errorFactory)) && input.tags.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
874
+ path: _path + ".tags[" + _index1 + "]",
875
+ expected: "string",
876
+ value: elem
877
+ }, errorFactory)) || $guard(_exceptionable, {
878
+ path: _path + ".tags",
879
+ expected: "Array<string>",
880
+ value: input.tags
881
+ }, errorFactory));
882
+ const $ao1 = (input, _path, _exceptionable = true) => ("asset" === input.type || $guard(_exceptionable, {
883
+ path: _path + ".type",
884
+ expected: "\"asset\"",
885
+ value: input.type
886
+ }, errorFactory)) && ("string" === typeof input.method || $guard(_exceptionable, {
887
+ path: _path + ".method",
888
+ expected: "string",
889
+ value: input.method
890
+ }, errorFactory)) && ((null !== input.tags || $guard(_exceptionable, {
891
+ path: _path + ".tags",
892
+ expected: "undefined",
893
+ value: input.tags
894
+ }, errorFactory)) && (undefined === input.tags || $guard(_exceptionable, {
895
+ path: _path + ".tags",
896
+ expected: "undefined",
897
+ value: input.tags
898
+ }, errorFactory)));
899
+ const $ao2 = (input, _path, _exceptionable = true) => ("rpc" === input.type || $guard(_exceptionable, {
900
+ path: _path + ".type",
901
+ expected: "\"rpc\"",
902
+ value: input.type
903
+ }, errorFactory)) && ("string" === typeof input.method || $guard(_exceptionable, {
904
+ path: _path + ".method",
905
+ expected: "string",
906
+ value: input.method
907
+ }, errorFactory)) && ((null !== input.tags || $guard(_exceptionable, {
908
+ path: _path + ".tags",
909
+ expected: "undefined",
910
+ value: input.tags
911
+ }, errorFactory)) && (undefined === input.tags || $guard(_exceptionable, {
912
+ path: _path + ".tags",
913
+ expected: "undefined",
914
+ value: input.tags
915
+ }, errorFactory)));
916
+ const $au0 = (input, _path, _exceptionable = true) => (() => {
917
+ if ("rpc" === input.type)
918
+ return $ao2(input, _path, true && _exceptionable);
919
+ else if ("asset" === input.type)
920
+ return $ao1(input, _path, true && _exceptionable);
921
+ else if ("tag" === input.type)
922
+ return $ao0(input, _path, true && _exceptionable);
923
+ else
924
+ return $guard(_exceptionable, {
925
+ path: _path,
926
+ expected: "(RpcPermission | AssetPermission | TagPermission)",
927
+ value: input
928
+ }, errorFactory);
929
+ })();
930
+ return ("object" === typeof input && null !== input || $guard(true, {
931
+ path: _path + "",
932
+ expected: "(AssetPermission | RpcPermission | TagPermission)",
933
+ value: input
934
+ }, errorFactory)) && $au0(input, _path + "", true) || $guard(true, {
935
+ path: _path + "",
936
+ expected: "(AssetPermission | RpcPermission | TagPermission)",
937
+ value: input
938
+ }, errorFactory);
939
+ })(input, "$input", true);
940
+ return input;
941
+ }; const stringify = input => {
942
+ const $io0 = input => "tag" === input.type && (null !== input.method && undefined === input.method) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
943
+ const $io1 = input => "asset" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
944
+ const $io2 = input => "rpc" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
945
+ const $string = __typia.json.createAssertStringify.string;
946
+ const $throws = __typia.json.createAssertStringify.throws;
947
+ const $so0 = input => `{"type":${(() => {
948
+ if ("string" === typeof input.type)
949
+ return $string(input.type);
950
+ if ("string" === typeof input.type)
951
+ return "\"" + input.type + "\"";
952
+ $throws({
953
+ expected: "\"tag\"",
954
+ value: input.type
955
+ });
956
+ })()},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`}}`;
957
+ const $so1 = input => `{"type":${(() => {
958
+ if ("string" === typeof input.type)
959
+ return $string(input.type);
960
+ if ("string" === typeof input.type)
961
+ return "\"" + input.type + "\"";
962
+ $throws({
963
+ expected: "\"asset\"",
964
+ value: input.type
965
+ });
966
+ })()},"method":${$string(input.method)}}`;
967
+ const $so2 = input => `{"type":${(() => {
968
+ if ("string" === typeof input.type)
969
+ return $string(input.type);
970
+ if ("string" === typeof input.type)
971
+ return "\"" + input.type + "\"";
972
+ $throws({
973
+ expected: "\"rpc\"",
974
+ value: input.type
975
+ });
976
+ })()},"method":${$string(input.method)}}`;
977
+ const $su0 = input => (() => {
978
+ if ("rpc" === input.type)
979
+ return $so2(input);
980
+ else if ("asset" === input.type)
981
+ return $so1(input);
982
+ else if ("tag" === input.type)
983
+ return $so0(input);
984
+ else
985
+ $throws({
986
+ expected: "(RpcPermission | AssetPermission | TagPermission)",
987
+ value: input
988
+ });
989
+ })();
990
+ return $su0(input);
991
+ }; return stringify(assert(input, errorFactory)); };
992
+ export const isPermissionRecordPermisson = input => {
993
+ const $io0 = input => "tag" === input.type && (null !== input.method && undefined === input.method) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
994
+ const $io1 = input => "asset" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
995
+ const $io2 = input => "rpc" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
996
+ const $iu0 = input => (() => {
997
+ if ("rpc" === input.type)
998
+ return $io2(input);
999
+ else if ("asset" === input.type)
1000
+ return $io1(input);
1001
+ else if ("tag" === input.type)
1002
+ return $io0(input);
1003
+ else
1004
+ return false;
1005
+ })();
1006
+ return "object" === typeof input && null !== input && $iu0(input);
1007
+ };
1008
+ export const assertPermissionRecordPermisson = (input, errorFactory) => {
1009
+ const __is = input => {
1010
+ const $io0 = input => "tag" === input.type && (null !== input.method && undefined === input.method) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
1011
+ const $io1 = input => "asset" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
1012
+ const $io2 = input => "rpc" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
1013
+ const $iu0 = input => (() => {
1014
+ if ("rpc" === input.type)
1015
+ return $io2(input);
1016
+ else if ("asset" === input.type)
1017
+ return $io1(input);
1018
+ else if ("tag" === input.type)
1019
+ return $io0(input);
1020
+ else
1021
+ return false;
1022
+ })();
1023
+ return "object" === typeof input && null !== input && $iu0(input);
1024
+ };
1025
+ if (false === __is(input))
1026
+ ((input, _path, _exceptionable = true) => {
1027
+ const $guard = __typia.createAssert.guard;
1028
+ const $ao0 = (input, _path, _exceptionable = true) => ("tag" === input.type || $guard(_exceptionable, {
1029
+ path: _path + ".type",
1030
+ expected: "\"tag\"",
1031
+ value: input.type
1032
+ }, errorFactory)) && ((null !== input.method || $guard(_exceptionable, {
1033
+ path: _path + ".method",
1034
+ expected: "undefined",
1035
+ value: input.method
1036
+ }, errorFactory)) && (undefined === input.method || $guard(_exceptionable, {
1037
+ path: _path + ".method",
1038
+ expected: "undefined",
1039
+ value: input.method
1040
+ }, errorFactory))) && ((Array.isArray(input.tags) || $guard(_exceptionable, {
1041
+ path: _path + ".tags",
1042
+ expected: "Array<string>",
1043
+ value: input.tags
1044
+ }, errorFactory)) && input.tags.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
1045
+ path: _path + ".tags[" + _index1 + "]",
1046
+ expected: "string",
1047
+ value: elem
1048
+ }, errorFactory)) || $guard(_exceptionable, {
1049
+ path: _path + ".tags",
1050
+ expected: "Array<string>",
1051
+ value: input.tags
1052
+ }, errorFactory));
1053
+ const $ao1 = (input, _path, _exceptionable = true) => ("asset" === input.type || $guard(_exceptionable, {
1054
+ path: _path + ".type",
1055
+ expected: "\"asset\"",
1056
+ value: input.type
1057
+ }, errorFactory)) && ("string" === typeof input.method || $guard(_exceptionable, {
1058
+ path: _path + ".method",
1059
+ expected: "string",
1060
+ value: input.method
1061
+ }, errorFactory)) && ((null !== input.tags || $guard(_exceptionable, {
1062
+ path: _path + ".tags",
1063
+ expected: "undefined",
1064
+ value: input.tags
1065
+ }, errorFactory)) && (undefined === input.tags || $guard(_exceptionable, {
1066
+ path: _path + ".tags",
1067
+ expected: "undefined",
1068
+ value: input.tags
1069
+ }, errorFactory)));
1070
+ const $ao2 = (input, _path, _exceptionable = true) => ("rpc" === input.type || $guard(_exceptionable, {
1071
+ path: _path + ".type",
1072
+ expected: "\"rpc\"",
1073
+ value: input.type
1074
+ }, errorFactory)) && ("string" === typeof input.method || $guard(_exceptionable, {
1075
+ path: _path + ".method",
1076
+ expected: "string",
1077
+ value: input.method
1078
+ }, errorFactory)) && ((null !== input.tags || $guard(_exceptionable, {
1079
+ path: _path + ".tags",
1080
+ expected: "undefined",
1081
+ value: input.tags
1082
+ }, errorFactory)) && (undefined === input.tags || $guard(_exceptionable, {
1083
+ path: _path + ".tags",
1084
+ expected: "undefined",
1085
+ value: input.tags
1086
+ }, errorFactory)));
1087
+ const $au0 = (input, _path, _exceptionable = true) => (() => {
1088
+ if ("rpc" === input.type)
1089
+ return $ao2(input, _path, true && _exceptionable);
1090
+ else if ("asset" === input.type)
1091
+ return $ao1(input, _path, true && _exceptionable);
1092
+ else if ("tag" === input.type)
1093
+ return $ao0(input, _path, true && _exceptionable);
1094
+ else
1095
+ return $guard(_exceptionable, {
1096
+ path: _path,
1097
+ expected: "(RpcPermission | AssetPermission | TagPermission)",
1098
+ value: input
1099
+ }, errorFactory);
1100
+ })();
1101
+ return ("object" === typeof input && null !== input || $guard(true, {
1102
+ path: _path + "",
1103
+ expected: "(AssetPermission | RpcPermission | TagPermission)",
1104
+ value: input
1105
+ }, errorFactory)) && $au0(input, _path + "", true) || $guard(true, {
1106
+ path: _path + "",
1107
+ expected: "(AssetPermission | RpcPermission | TagPermission)",
1108
+ value: input
1109
+ }, errorFactory);
1110
+ })(input, "$input", true);
1111
+ return input;
1112
+ };
1113
+ export const randomPermissionRecordPermisson = generator => {
1114
+ const $generator = __typia.createRandom.generator;
1115
+ const $pick = __typia.createRandom.pick;
1116
+ const $ro0 = (_recursive = false, _depth = 0) => ({
1117
+ type: "tag",
1118
+ method: undefined,
1119
+ tags: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)())
1120
+ });
1121
+ const $ro1 = (_recursive = false, _depth = 0) => ({
1122
+ type: "asset",
1123
+ method: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
1124
+ tags: undefined
1125
+ });
1126
+ const $ro2 = (_recursive = false, _depth = 0) => ({
1127
+ type: "rpc",
1128
+ method: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
1129
+ tags: undefined
1130
+ });
1131
+ return $pick([
1132
+ () => $ro2(),
1133
+ () => $ro1(),
1134
+ () => $ro0()
1135
+ ])();
1136
+ };
1137
+ export const assertGuardPermissionRecordPermisson = (input, errorFactory) => {
1138
+ const __is = input => {
1139
+ const $io0 = input => "tag" === input.type && (null !== input.method && undefined === input.method) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
1140
+ const $io1 = input => "asset" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
1141
+ const $io2 = input => "rpc" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
1142
+ const $iu0 = input => (() => {
1143
+ if ("rpc" === input.type)
1144
+ return $io2(input);
1145
+ else if ("asset" === input.type)
1146
+ return $io1(input);
1147
+ else if ("tag" === input.type)
1148
+ return $io0(input);
1149
+ else
1150
+ return false;
1151
+ })();
1152
+ return "object" === typeof input && null !== input && $iu0(input);
1153
+ };
1154
+ if (false === __is(input))
1155
+ ((input, _path, _exceptionable = true) => {
1156
+ const $guard = __typia.createAssertGuard.guard;
1157
+ const $ao0 = (input, _path, _exceptionable = true) => ("tag" === input.type || $guard(_exceptionable, {
339
1158
  path: _path + ".type",
340
- expected: "(string | undefined)",
1159
+ expected: "\"tag\"",
341
1160
  value: input.type
342
- }, errorFactory)) && (undefined === input.method || "string" === typeof input.method || $guard(_exceptionable, {
1161
+ }, errorFactory)) && ((null !== input.method || $guard(_exceptionable, {
343
1162
  path: _path + ".method",
344
- expected: "(string | undefined)",
1163
+ expected: "undefined",
345
1164
  value: input.method
346
- }, errorFactory)) && (undefined === input.tags || (Array.isArray(input.tags) || $guard(_exceptionable, {
1165
+ }, errorFactory)) && (undefined === input.method || $guard(_exceptionable, {
1166
+ path: _path + ".method",
1167
+ expected: "undefined",
1168
+ value: input.method
1169
+ }, errorFactory))) && ((Array.isArray(input.tags) || $guard(_exceptionable, {
347
1170
  path: _path + ".tags",
348
- expected: "(Array<string> | undefined)",
1171
+ expected: "Array<string>",
349
1172
  value: input.tags
350
1173
  }, errorFactory)) && input.tags.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
351
1174
  path: _path + ".tags[" + _index1 + "]",
@@ -353,23 +1176,751 @@ export const assertStringifyPermissionRecordPermisson = (input, errorFactory) =>
353
1176
  value: elem
354
1177
  }, errorFactory)) || $guard(_exceptionable, {
355
1178
  path: _path + ".tags",
356
- expected: "(Array<string> | undefined)",
1179
+ expected: "Array<string>",
357
1180
  value: input.tags
358
1181
  }, errorFactory));
359
- return ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
1182
+ const $ao1 = (input, _path, _exceptionable = true) => ("asset" === input.type || $guard(_exceptionable, {
1183
+ path: _path + ".type",
1184
+ expected: "\"asset\"",
1185
+ value: input.type
1186
+ }, errorFactory)) && ("string" === typeof input.method || $guard(_exceptionable, {
1187
+ path: _path + ".method",
1188
+ expected: "string",
1189
+ value: input.method
1190
+ }, errorFactory)) && ((null !== input.tags || $guard(_exceptionable, {
1191
+ path: _path + ".tags",
1192
+ expected: "undefined",
1193
+ value: input.tags
1194
+ }, errorFactory)) && (undefined === input.tags || $guard(_exceptionable, {
1195
+ path: _path + ".tags",
1196
+ expected: "undefined",
1197
+ value: input.tags
1198
+ }, errorFactory)));
1199
+ const $ao2 = (input, _path, _exceptionable = true) => ("rpc" === input.type || $guard(_exceptionable, {
1200
+ path: _path + ".type",
1201
+ expected: "\"rpc\"",
1202
+ value: input.type
1203
+ }, errorFactory)) && ("string" === typeof input.method || $guard(_exceptionable, {
1204
+ path: _path + ".method",
1205
+ expected: "string",
1206
+ value: input.method
1207
+ }, errorFactory)) && ((null !== input.tags || $guard(_exceptionable, {
1208
+ path: _path + ".tags",
1209
+ expected: "undefined",
1210
+ value: input.tags
1211
+ }, errorFactory)) && (undefined === input.tags || $guard(_exceptionable, {
1212
+ path: _path + ".tags",
1213
+ expected: "undefined",
1214
+ value: input.tags
1215
+ }, errorFactory)));
1216
+ const $au0 = (input, _path, _exceptionable = true) => (() => {
1217
+ if ("rpc" === input.type)
1218
+ return $ao2(input, _path, true && _exceptionable);
1219
+ else if ("asset" === input.type)
1220
+ return $ao1(input, _path, true && _exceptionable);
1221
+ else if ("tag" === input.type)
1222
+ return $ao0(input, _path, true && _exceptionable);
1223
+ else
1224
+ return $guard(_exceptionable, {
1225
+ path: _path,
1226
+ expected: "(RpcPermission | AssetPermission | TagPermission)",
1227
+ value: input
1228
+ }, errorFactory);
1229
+ })();
1230
+ return ("object" === typeof input && null !== input || $guard(true, {
1231
+ path: _path + "",
1232
+ expected: "(AssetPermission | RpcPermission | TagPermission)",
1233
+ value: input
1234
+ }, errorFactory)) && $au0(input, _path + "", true) || $guard(true, {
1235
+ path: _path + "",
1236
+ expected: "(AssetPermission | RpcPermission | TagPermission)",
1237
+ value: input
1238
+ }, errorFactory);
1239
+ })(input, "$input", true);
1240
+ };
1241
+ export const stringifyPermissionRecordPermisson = input => {
1242
+ const $io0 = input => "tag" === input.type && (null !== input.method && undefined === input.method) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
1243
+ const $io1 = input => "asset" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
1244
+ const $io2 = input => "rpc" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
1245
+ const $string = __typia.json.createStringify.string;
1246
+ const $throws = __typia.json.createStringify.throws;
1247
+ const $so0 = input => `{"type":${(() => {
1248
+ if ("string" === typeof input.type)
1249
+ return $string(input.type);
1250
+ if ("string" === typeof input.type)
1251
+ return "\"" + input.type + "\"";
1252
+ $throws({
1253
+ expected: "\"tag\"",
1254
+ value: input.type
1255
+ });
1256
+ })()},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`}}`;
1257
+ const $so1 = input => `{"type":${(() => {
1258
+ if ("string" === typeof input.type)
1259
+ return $string(input.type);
1260
+ if ("string" === typeof input.type)
1261
+ return "\"" + input.type + "\"";
1262
+ $throws({
1263
+ expected: "\"asset\"",
1264
+ value: input.type
1265
+ });
1266
+ })()},"method":${$string(input.method)}}`;
1267
+ const $so2 = input => `{"type":${(() => {
1268
+ if ("string" === typeof input.type)
1269
+ return $string(input.type);
1270
+ if ("string" === typeof input.type)
1271
+ return "\"" + input.type + "\"";
1272
+ $throws({
1273
+ expected: "\"rpc\"",
1274
+ value: input.type
1275
+ });
1276
+ })()},"method":${$string(input.method)}}`;
1277
+ const $su0 = input => (() => {
1278
+ if ("rpc" === input.type)
1279
+ return $so2(input);
1280
+ else if ("asset" === input.type)
1281
+ return $so1(input);
1282
+ else if ("tag" === input.type)
1283
+ return $so0(input);
1284
+ else
1285
+ $throws({
1286
+ expected: "(RpcPermission | AssetPermission | TagPermission)",
1287
+ value: input
1288
+ });
1289
+ })();
1290
+ return $su0(input);
1291
+ };
1292
+ export const assertStringifyPermissionRecordPermisson = (input, errorFactory) => { const assert = (input, errorFactory) => {
1293
+ const __is = input => {
1294
+ const $io0 = input => "tag" === input.type && (null !== input.method && undefined === input.method) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
1295
+ const $io1 = input => "asset" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
1296
+ const $io2 = input => "rpc" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
1297
+ const $iu0 = input => (() => {
1298
+ if ("rpc" === input.type)
1299
+ return $io2(input);
1300
+ else if ("asset" === input.type)
1301
+ return $io1(input);
1302
+ else if ("tag" === input.type)
1303
+ return $io0(input);
1304
+ else
1305
+ return false;
1306
+ })();
1307
+ return "object" === typeof input && null !== input && $iu0(input);
1308
+ };
1309
+ if (false === __is(input))
1310
+ ((input, _path, _exceptionable = true) => {
1311
+ const $guard = __typia.json.createAssertStringify.guard;
1312
+ const $ao0 = (input, _path, _exceptionable = true) => ("tag" === input.type || $guard(_exceptionable, {
1313
+ path: _path + ".type",
1314
+ expected: "\"tag\"",
1315
+ value: input.type
1316
+ }, errorFactory)) && ((null !== input.method || $guard(_exceptionable, {
1317
+ path: _path + ".method",
1318
+ expected: "undefined",
1319
+ value: input.method
1320
+ }, errorFactory)) && (undefined === input.method || $guard(_exceptionable, {
1321
+ path: _path + ".method",
1322
+ expected: "undefined",
1323
+ value: input.method
1324
+ }, errorFactory))) && ((Array.isArray(input.tags) || $guard(_exceptionable, {
1325
+ path: _path + ".tags",
1326
+ expected: "Array<string>",
1327
+ value: input.tags
1328
+ }, errorFactory)) && input.tags.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
1329
+ path: _path + ".tags[" + _index1 + "]",
1330
+ expected: "string",
1331
+ value: elem
1332
+ }, errorFactory)) || $guard(_exceptionable, {
1333
+ path: _path + ".tags",
1334
+ expected: "Array<string>",
1335
+ value: input.tags
1336
+ }, errorFactory));
1337
+ const $ao1 = (input, _path, _exceptionable = true) => ("asset" === input.type || $guard(_exceptionable, {
1338
+ path: _path + ".type",
1339
+ expected: "\"asset\"",
1340
+ value: input.type
1341
+ }, errorFactory)) && ("string" === typeof input.method || $guard(_exceptionable, {
1342
+ path: _path + ".method",
1343
+ expected: "string",
1344
+ value: input.method
1345
+ }, errorFactory)) && ((null !== input.tags || $guard(_exceptionable, {
1346
+ path: _path + ".tags",
1347
+ expected: "undefined",
1348
+ value: input.tags
1349
+ }, errorFactory)) && (undefined === input.tags || $guard(_exceptionable, {
1350
+ path: _path + ".tags",
1351
+ expected: "undefined",
1352
+ value: input.tags
1353
+ }, errorFactory)));
1354
+ const $ao2 = (input, _path, _exceptionable = true) => ("rpc" === input.type || $guard(_exceptionable, {
1355
+ path: _path + ".type",
1356
+ expected: "\"rpc\"",
1357
+ value: input.type
1358
+ }, errorFactory)) && ("string" === typeof input.method || $guard(_exceptionable, {
1359
+ path: _path + ".method",
1360
+ expected: "string",
1361
+ value: input.method
1362
+ }, errorFactory)) && ((null !== input.tags || $guard(_exceptionable, {
1363
+ path: _path + ".tags",
1364
+ expected: "undefined",
1365
+ value: input.tags
1366
+ }, errorFactory)) && (undefined === input.tags || $guard(_exceptionable, {
1367
+ path: _path + ".tags",
1368
+ expected: "undefined",
1369
+ value: input.tags
1370
+ }, errorFactory)));
1371
+ const $au0 = (input, _path, _exceptionable = true) => (() => {
1372
+ if ("rpc" === input.type)
1373
+ return $ao2(input, _path, true && _exceptionable);
1374
+ else if ("asset" === input.type)
1375
+ return $ao1(input, _path, true && _exceptionable);
1376
+ else if ("tag" === input.type)
1377
+ return $ao0(input, _path, true && _exceptionable);
1378
+ else
1379
+ return $guard(_exceptionable, {
1380
+ path: _path,
1381
+ expected: "(RpcPermission | AssetPermission | TagPermission)",
1382
+ value: input
1383
+ }, errorFactory);
1384
+ })();
1385
+ return ("object" === typeof input && null !== input || $guard(true, {
1386
+ path: _path + "",
1387
+ expected: "(AssetPermission | RpcPermission | TagPermission)",
1388
+ value: input
1389
+ }, errorFactory)) && $au0(input, _path + "", true) || $guard(true, {
1390
+ path: _path + "",
1391
+ expected: "(AssetPermission | RpcPermission | TagPermission)",
1392
+ value: input
1393
+ }, errorFactory);
1394
+ })(input, "$input", true);
1395
+ return input;
1396
+ }; const stringify = input => {
1397
+ const $io0 = input => "tag" === input.type && (null !== input.method && undefined === input.method) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
1398
+ const $io1 = input => "asset" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
1399
+ const $io2 = input => "rpc" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
1400
+ const $string = __typia.json.createAssertStringify.string;
1401
+ const $throws = __typia.json.createAssertStringify.throws;
1402
+ const $so0 = input => `{"type":${(() => {
1403
+ if ("string" === typeof input.type)
1404
+ return $string(input.type);
1405
+ if ("string" === typeof input.type)
1406
+ return "\"" + input.type + "\"";
1407
+ $throws({
1408
+ expected: "\"tag\"",
1409
+ value: input.type
1410
+ });
1411
+ })()},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`}}`;
1412
+ const $so1 = input => `{"type":${(() => {
1413
+ if ("string" === typeof input.type)
1414
+ return $string(input.type);
1415
+ if ("string" === typeof input.type)
1416
+ return "\"" + input.type + "\"";
1417
+ $throws({
1418
+ expected: "\"asset\"",
1419
+ value: input.type
1420
+ });
1421
+ })()},"method":${$string(input.method)}}`;
1422
+ const $so2 = input => `{"type":${(() => {
1423
+ if ("string" === typeof input.type)
1424
+ return $string(input.type);
1425
+ if ("string" === typeof input.type)
1426
+ return "\"" + input.type + "\"";
1427
+ $throws({
1428
+ expected: "\"rpc\"",
1429
+ value: input.type
1430
+ });
1431
+ })()},"method":${$string(input.method)}}`;
1432
+ const $su0 = input => (() => {
1433
+ if ("rpc" === input.type)
1434
+ return $so2(input);
1435
+ else if ("asset" === input.type)
1436
+ return $so1(input);
1437
+ else if ("tag" === input.type)
1438
+ return $so0(input);
1439
+ else
1440
+ $throws({
1441
+ expected: "(RpcPermission | AssetPermission | TagPermission)",
1442
+ value: input
1443
+ });
1444
+ })();
1445
+ return $su0(input);
1446
+ }; return stringify(assert(input, errorFactory)); };
1447
+ export const isTagPermission = input => {
1448
+ const $io0 = input => "tag" === input.type && (null !== input.method && undefined === input.method) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
1449
+ return "object" === typeof input && null !== input && $io0(input);
1450
+ };
1451
+ export const assertTagPermission = (input, errorFactory) => {
1452
+ const __is = input => {
1453
+ const $io0 = input => "tag" === input.type && (null !== input.method && undefined === input.method) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
1454
+ return "object" === typeof input && null !== input && $io0(input);
1455
+ };
1456
+ if (false === __is(input))
1457
+ ((input, _path, _exceptionable = true) => {
1458
+ const $guard = __typia.createAssert.guard;
1459
+ const $ao0 = (input, _path, _exceptionable = true) => ("tag" === input.type || $guard(_exceptionable, {
1460
+ path: _path + ".type",
1461
+ expected: "\"tag\"",
1462
+ value: input.type
1463
+ }, errorFactory)) && ((null !== input.method || $guard(_exceptionable, {
1464
+ path: _path + ".method",
1465
+ expected: "undefined",
1466
+ value: input.method
1467
+ }, errorFactory)) && (undefined === input.method || $guard(_exceptionable, {
1468
+ path: _path + ".method",
1469
+ expected: "undefined",
1470
+ value: input.method
1471
+ }, errorFactory))) && ((Array.isArray(input.tags) || $guard(_exceptionable, {
1472
+ path: _path + ".tags",
1473
+ expected: "Array<string>",
1474
+ value: input.tags
1475
+ }, errorFactory)) && input.tags.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
1476
+ path: _path + ".tags[" + _index1 + "]",
1477
+ expected: "string",
1478
+ value: elem
1479
+ }, errorFactory)) || $guard(_exceptionable, {
1480
+ path: _path + ".tags",
1481
+ expected: "Array<string>",
1482
+ value: input.tags
1483
+ }, errorFactory));
1484
+ return ("object" === typeof input && null !== input || $guard(true, {
1485
+ path: _path + "",
1486
+ expected: "TagPermission",
1487
+ value: input
1488
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
1489
+ path: _path + "",
1490
+ expected: "TagPermission",
1491
+ value: input
1492
+ }, errorFactory);
1493
+ })(input, "$input", true);
1494
+ return input;
1495
+ };
1496
+ export const randomTagPermission = generator => {
1497
+ const $generator = __typia.createRandom.generator;
1498
+ const $ro0 = (_recursive = false, _depth = 0) => ({
1499
+ type: "tag",
1500
+ method: undefined,
1501
+ tags: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)())
1502
+ });
1503
+ return $ro0();
1504
+ };
1505
+ export const assertGuardTagPermission = (input, errorFactory) => {
1506
+ const __is = input => {
1507
+ const $io0 = input => "tag" === input.type && (null !== input.method && undefined === input.method) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
1508
+ return "object" === typeof input && null !== input && $io0(input);
1509
+ };
1510
+ if (false === __is(input))
1511
+ ((input, _path, _exceptionable = true) => {
1512
+ const $guard = __typia.createAssertGuard.guard;
1513
+ const $ao0 = (input, _path, _exceptionable = true) => ("tag" === input.type || $guard(_exceptionable, {
1514
+ path: _path + ".type",
1515
+ expected: "\"tag\"",
1516
+ value: input.type
1517
+ }, errorFactory)) && ((null !== input.method || $guard(_exceptionable, {
1518
+ path: _path + ".method",
1519
+ expected: "undefined",
1520
+ value: input.method
1521
+ }, errorFactory)) && (undefined === input.method || $guard(_exceptionable, {
1522
+ path: _path + ".method",
1523
+ expected: "undefined",
1524
+ value: input.method
1525
+ }, errorFactory))) && ((Array.isArray(input.tags) || $guard(_exceptionable, {
1526
+ path: _path + ".tags",
1527
+ expected: "Array<string>",
1528
+ value: input.tags
1529
+ }, errorFactory)) && input.tags.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
1530
+ path: _path + ".tags[" + _index1 + "]",
1531
+ expected: "string",
1532
+ value: elem
1533
+ }, errorFactory)) || $guard(_exceptionable, {
1534
+ path: _path + ".tags",
1535
+ expected: "Array<string>",
1536
+ value: input.tags
1537
+ }, errorFactory));
1538
+ return ("object" === typeof input && null !== input || $guard(true, {
1539
+ path: _path + "",
1540
+ expected: "TagPermission",
1541
+ value: input
1542
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
1543
+ path: _path + "",
1544
+ expected: "TagPermission",
1545
+ value: input
1546
+ }, errorFactory);
1547
+ })(input, "$input", true);
1548
+ };
1549
+ export const stringifyTagPermission = input => {
1550
+ const $string = __typia.json.createStringify.string;
1551
+ const $throws = __typia.json.createStringify.throws;
1552
+ const $so0 = input => `{"type":${(() => {
1553
+ if ("string" === typeof input.type)
1554
+ return $string(input.type);
1555
+ if ("string" === typeof input.type)
1556
+ return "\"" + input.type + "\"";
1557
+ $throws({
1558
+ expected: "\"tag\"",
1559
+ value: input.type
1560
+ });
1561
+ })()},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`}}`;
1562
+ return $so0(input);
1563
+ };
1564
+ export const assertStringifyTagPermission = (input, errorFactory) => { const assert = (input, errorFactory) => {
1565
+ const __is = input => {
1566
+ const $io0 = input => "tag" === input.type && (null !== input.method && undefined === input.method) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
1567
+ return "object" === typeof input && null !== input && $io0(input);
1568
+ };
1569
+ if (false === __is(input))
1570
+ ((input, _path, _exceptionable = true) => {
1571
+ const $guard = __typia.json.createAssertStringify.guard;
1572
+ const $ao0 = (input, _path, _exceptionable = true) => ("tag" === input.type || $guard(_exceptionable, {
1573
+ path: _path + ".type",
1574
+ expected: "\"tag\"",
1575
+ value: input.type
1576
+ }, errorFactory)) && ((null !== input.method || $guard(_exceptionable, {
1577
+ path: _path + ".method",
1578
+ expected: "undefined",
1579
+ value: input.method
1580
+ }, errorFactory)) && (undefined === input.method || $guard(_exceptionable, {
1581
+ path: _path + ".method",
1582
+ expected: "undefined",
1583
+ value: input.method
1584
+ }, errorFactory))) && ((Array.isArray(input.tags) || $guard(_exceptionable, {
1585
+ path: _path + ".tags",
1586
+ expected: "Array<string>",
1587
+ value: input.tags
1588
+ }, errorFactory)) && input.tags.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
1589
+ path: _path + ".tags[" + _index1 + "]",
1590
+ expected: "string",
1591
+ value: elem
1592
+ }, errorFactory)) || $guard(_exceptionable, {
1593
+ path: _path + ".tags",
1594
+ expected: "Array<string>",
1595
+ value: input.tags
1596
+ }, errorFactory));
1597
+ return ("object" === typeof input && null !== input || $guard(true, {
1598
+ path: _path + "",
1599
+ expected: "TagPermission",
1600
+ value: input
1601
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
1602
+ path: _path + "",
1603
+ expected: "TagPermission",
1604
+ value: input
1605
+ }, errorFactory);
1606
+ })(input, "$input", true);
1607
+ return input;
1608
+ }; const stringify = input => {
1609
+ const $string = __typia.json.createAssertStringify.string;
1610
+ const $throws = __typia.json.createAssertStringify.throws;
1611
+ const $so0 = input => `{"type":${(() => {
1612
+ if ("string" === typeof input.type)
1613
+ return $string(input.type);
1614
+ if ("string" === typeof input.type)
1615
+ return "\"" + input.type + "\"";
1616
+ $throws({
1617
+ expected: "\"tag\"",
1618
+ value: input.type
1619
+ });
1620
+ })()},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`}}`;
1621
+ return $so0(input);
1622
+ }; return stringify(assert(input, errorFactory)); };
1623
+ export const isAssetPermission = input => {
1624
+ const $io0 = input => "asset" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
1625
+ return "object" === typeof input && null !== input && $io0(input);
1626
+ };
1627
+ export const assertAssetPermission = (input, errorFactory) => {
1628
+ const __is = input => {
1629
+ const $io0 = input => "asset" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
1630
+ return "object" === typeof input && null !== input && $io0(input);
1631
+ };
1632
+ if (false === __is(input))
1633
+ ((input, _path, _exceptionable = true) => {
1634
+ const $guard = __typia.createAssert.guard;
1635
+ const $ao0 = (input, _path, _exceptionable = true) => ("asset" === input.type || $guard(_exceptionable, {
1636
+ path: _path + ".type",
1637
+ expected: "\"asset\"",
1638
+ value: input.type
1639
+ }, errorFactory)) && ("string" === typeof input.method || $guard(_exceptionable, {
1640
+ path: _path + ".method",
1641
+ expected: "string",
1642
+ value: input.method
1643
+ }, errorFactory)) && ((null !== input.tags || $guard(_exceptionable, {
1644
+ path: _path + ".tags",
1645
+ expected: "undefined",
1646
+ value: input.tags
1647
+ }, errorFactory)) && (undefined === input.tags || $guard(_exceptionable, {
1648
+ path: _path + ".tags",
1649
+ expected: "undefined",
1650
+ value: input.tags
1651
+ }, errorFactory)));
1652
+ return ("object" === typeof input && null !== input || $guard(true, {
1653
+ path: _path + "",
1654
+ expected: "AssetPermission",
1655
+ value: input
1656
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
1657
+ path: _path + "",
1658
+ expected: "AssetPermission",
1659
+ value: input
1660
+ }, errorFactory);
1661
+ })(input, "$input", true);
1662
+ return input;
1663
+ };
1664
+ export const randomAssetPermission = generator => {
1665
+ const $generator = __typia.createRandom.generator;
1666
+ const $ro0 = (_recursive = false, _depth = 0) => ({
1667
+ type: "asset",
1668
+ method: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
1669
+ tags: undefined
1670
+ });
1671
+ return $ro0();
1672
+ };
1673
+ export const assertGuardAssetPermission = (input, errorFactory) => {
1674
+ const __is = input => {
1675
+ const $io0 = input => "asset" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
1676
+ return "object" === typeof input && null !== input && $io0(input);
1677
+ };
1678
+ if (false === __is(input))
1679
+ ((input, _path, _exceptionable = true) => {
1680
+ const $guard = __typia.createAssertGuard.guard;
1681
+ const $ao0 = (input, _path, _exceptionable = true) => ("asset" === input.type || $guard(_exceptionable, {
1682
+ path: _path + ".type",
1683
+ expected: "\"asset\"",
1684
+ value: input.type
1685
+ }, errorFactory)) && ("string" === typeof input.method || $guard(_exceptionable, {
1686
+ path: _path + ".method",
1687
+ expected: "string",
1688
+ value: input.method
1689
+ }, errorFactory)) && ((null !== input.tags || $guard(_exceptionable, {
1690
+ path: _path + ".tags",
1691
+ expected: "undefined",
1692
+ value: input.tags
1693
+ }, errorFactory)) && (undefined === input.tags || $guard(_exceptionable, {
1694
+ path: _path + ".tags",
1695
+ expected: "undefined",
1696
+ value: input.tags
1697
+ }, errorFactory)));
1698
+ return ("object" === typeof input && null !== input || $guard(true, {
1699
+ path: _path + "",
1700
+ expected: "AssetPermission",
1701
+ value: input
1702
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
1703
+ path: _path + "",
1704
+ expected: "AssetPermission",
1705
+ value: input
1706
+ }, errorFactory);
1707
+ })(input, "$input", true);
1708
+ };
1709
+ export const stringifyAssetPermission = input => {
1710
+ const $string = __typia.json.createStringify.string;
1711
+ const $throws = __typia.json.createStringify.throws;
1712
+ const $so0 = input => `{"type":${(() => {
1713
+ if ("string" === typeof input.type)
1714
+ return $string(input.type);
1715
+ if ("string" === typeof input.type)
1716
+ return "\"" + input.type + "\"";
1717
+ $throws({
1718
+ expected: "\"asset\"",
1719
+ value: input.type
1720
+ });
1721
+ })()},"method":${$string(input.method)}}`;
1722
+ return $so0(input);
1723
+ };
1724
+ export const assertStringifyAssetPermission = (input, errorFactory) => { const assert = (input, errorFactory) => {
1725
+ const __is = input => {
1726
+ const $io0 = input => "asset" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
1727
+ return "object" === typeof input && null !== input && $io0(input);
1728
+ };
1729
+ if (false === __is(input))
1730
+ ((input, _path, _exceptionable = true) => {
1731
+ const $guard = __typia.json.createAssertStringify.guard;
1732
+ const $ao0 = (input, _path, _exceptionable = true) => ("asset" === input.type || $guard(_exceptionable, {
1733
+ path: _path + ".type",
1734
+ expected: "\"asset\"",
1735
+ value: input.type
1736
+ }, errorFactory)) && ("string" === typeof input.method || $guard(_exceptionable, {
1737
+ path: _path + ".method",
1738
+ expected: "string",
1739
+ value: input.method
1740
+ }, errorFactory)) && ((null !== input.tags || $guard(_exceptionable, {
1741
+ path: _path + ".tags",
1742
+ expected: "undefined",
1743
+ value: input.tags
1744
+ }, errorFactory)) && (undefined === input.tags || $guard(_exceptionable, {
1745
+ path: _path + ".tags",
1746
+ expected: "undefined",
1747
+ value: input.tags
1748
+ }, errorFactory)));
1749
+ return ("object" === typeof input && null !== input || $guard(true, {
1750
+ path: _path + "",
1751
+ expected: "AssetPermission",
1752
+ value: input
1753
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
1754
+ path: _path + "",
1755
+ expected: "AssetPermission",
1756
+ value: input
1757
+ }, errorFactory);
1758
+ })(input, "$input", true);
1759
+ return input;
1760
+ }; const stringify = input => {
1761
+ const $string = __typia.json.createAssertStringify.string;
1762
+ const $throws = __typia.json.createAssertStringify.throws;
1763
+ const $so0 = input => `{"type":${(() => {
1764
+ if ("string" === typeof input.type)
1765
+ return $string(input.type);
1766
+ if ("string" === typeof input.type)
1767
+ return "\"" + input.type + "\"";
1768
+ $throws({
1769
+ expected: "\"asset\"",
1770
+ value: input.type
1771
+ });
1772
+ })()},"method":${$string(input.method)}}`;
1773
+ return $so0(input);
1774
+ }; return stringify(assert(input, errorFactory)); };
1775
+ export const isRpcPermission = input => {
1776
+ const $io0 = input => "rpc" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
1777
+ return "object" === typeof input && null !== input && $io0(input);
1778
+ };
1779
+ export const assertRpcPermission = (input, errorFactory) => {
1780
+ const __is = input => {
1781
+ const $io0 = input => "rpc" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
1782
+ return "object" === typeof input && null !== input && $io0(input);
1783
+ };
1784
+ if (false === __is(input))
1785
+ ((input, _path, _exceptionable = true) => {
1786
+ const $guard = __typia.createAssert.guard;
1787
+ const $ao0 = (input, _path, _exceptionable = true) => ("rpc" === input.type || $guard(_exceptionable, {
1788
+ path: _path + ".type",
1789
+ expected: "\"rpc\"",
1790
+ value: input.type
1791
+ }, errorFactory)) && ("string" === typeof input.method || $guard(_exceptionable, {
1792
+ path: _path + ".method",
1793
+ expected: "string",
1794
+ value: input.method
1795
+ }, errorFactory)) && ((null !== input.tags || $guard(_exceptionable, {
1796
+ path: _path + ".tags",
1797
+ expected: "undefined",
1798
+ value: input.tags
1799
+ }, errorFactory)) && (undefined === input.tags || $guard(_exceptionable, {
1800
+ path: _path + ".tags",
1801
+ expected: "undefined",
1802
+ value: input.tags
1803
+ }, errorFactory)));
1804
+ return ("object" === typeof input && null !== input || $guard(true, {
1805
+ path: _path + "",
1806
+ expected: "RpcPermission",
1807
+ value: input
1808
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
1809
+ path: _path + "",
1810
+ expected: "RpcPermission",
1811
+ value: input
1812
+ }, errorFactory);
1813
+ })(input, "$input", true);
1814
+ return input;
1815
+ };
1816
+ export const randomRpcPermission = generator => {
1817
+ const $generator = __typia.createRandom.generator;
1818
+ const $ro0 = (_recursive = false, _depth = 0) => ({
1819
+ type: "rpc",
1820
+ method: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
1821
+ tags: undefined
1822
+ });
1823
+ return $ro0();
1824
+ };
1825
+ export const assertGuardRpcPermission = (input, errorFactory) => {
1826
+ const __is = input => {
1827
+ const $io0 = input => "rpc" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
1828
+ return "object" === typeof input && null !== input && $io0(input);
1829
+ };
1830
+ if (false === __is(input))
1831
+ ((input, _path, _exceptionable = true) => {
1832
+ const $guard = __typia.createAssertGuard.guard;
1833
+ const $ao0 = (input, _path, _exceptionable = true) => ("rpc" === input.type || $guard(_exceptionable, {
1834
+ path: _path + ".type",
1835
+ expected: "\"rpc\"",
1836
+ value: input.type
1837
+ }, errorFactory)) && ("string" === typeof input.method || $guard(_exceptionable, {
1838
+ path: _path + ".method",
1839
+ expected: "string",
1840
+ value: input.method
1841
+ }, errorFactory)) && ((null !== input.tags || $guard(_exceptionable, {
1842
+ path: _path + ".tags",
1843
+ expected: "undefined",
1844
+ value: input.tags
1845
+ }, errorFactory)) && (undefined === input.tags || $guard(_exceptionable, {
1846
+ path: _path + ".tags",
1847
+ expected: "undefined",
1848
+ value: input.tags
1849
+ }, errorFactory)));
1850
+ return ("object" === typeof input && null !== input || $guard(true, {
1851
+ path: _path + "",
1852
+ expected: "RpcPermission",
1853
+ value: input
1854
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
1855
+ path: _path + "",
1856
+ expected: "RpcPermission",
1857
+ value: input
1858
+ }, errorFactory);
1859
+ })(input, "$input", true);
1860
+ };
1861
+ export const stringifyRpcPermission = input => {
1862
+ const $string = __typia.json.createStringify.string;
1863
+ const $throws = __typia.json.createStringify.throws;
1864
+ const $so0 = input => `{"type":${(() => {
1865
+ if ("string" === typeof input.type)
1866
+ return $string(input.type);
1867
+ if ("string" === typeof input.type)
1868
+ return "\"" + input.type + "\"";
1869
+ $throws({
1870
+ expected: "\"rpc\"",
1871
+ value: input.type
1872
+ });
1873
+ })()},"method":${$string(input.method)}}`;
1874
+ return $so0(input);
1875
+ };
1876
+ export const assertStringifyRpcPermission = (input, errorFactory) => { const assert = (input, errorFactory) => {
1877
+ const __is = input => {
1878
+ const $io0 = input => "rpc" === input.type && "string" === typeof input.method && (null !== input.tags && undefined === input.tags);
1879
+ return "object" === typeof input && null !== input && $io0(input);
1880
+ };
1881
+ if (false === __is(input))
1882
+ ((input, _path, _exceptionable = true) => {
1883
+ const $guard = __typia.json.createAssertStringify.guard;
1884
+ const $ao0 = (input, _path, _exceptionable = true) => ("rpc" === input.type || $guard(_exceptionable, {
1885
+ path: _path + ".type",
1886
+ expected: "\"rpc\"",
1887
+ value: input.type
1888
+ }, errorFactory)) && ("string" === typeof input.method || $guard(_exceptionable, {
1889
+ path: _path + ".method",
1890
+ expected: "string",
1891
+ value: input.method
1892
+ }, errorFactory)) && ((null !== input.tags || $guard(_exceptionable, {
1893
+ path: _path + ".tags",
1894
+ expected: "undefined",
1895
+ value: input.tags
1896
+ }, errorFactory)) && (undefined === input.tags || $guard(_exceptionable, {
1897
+ path: _path + ".tags",
1898
+ expected: "undefined",
1899
+ value: input.tags
1900
+ }, errorFactory)));
1901
+ return ("object" === typeof input && null !== input || $guard(true, {
360
1902
  path: _path + "",
361
- expected: "PermissionRecordPermisson",
1903
+ expected: "RpcPermission",
362
1904
  value: input
363
1905
  }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
364
1906
  path: _path + "",
365
- expected: "PermissionRecordPermisson",
1907
+ expected: "RpcPermission",
366
1908
  value: input
367
1909
  }, errorFactory);
368
1910
  })(input, "$input", true);
369
1911
  return input;
370
1912
  }; const stringify = input => {
371
1913
  const $string = __typia.json.createAssertStringify.string;
372
- const $tail = __typia.json.createAssertStringify.tail;
373
- const $so0 = input => `{${$tail(`${undefined === input.type ? "" : `"type":${undefined !== input.type ? $string(input.type) : undefined},`}${undefined === input.method ? "" : `"method":${undefined !== input.method ? $string(input.method) : undefined},`}${undefined === input.tags ? "" : `"tags":${undefined !== input.tags ? `[${input.tags.map(elem => $string(elem)).join(",")}]` : undefined}`}`)}}`;
1914
+ const $throws = __typia.json.createAssertStringify.throws;
1915
+ const $so0 = input => `{"type":${(() => {
1916
+ if ("string" === typeof input.type)
1917
+ return $string(input.type);
1918
+ if ("string" === typeof input.type)
1919
+ return "\"" + input.type + "\"";
1920
+ $throws({
1921
+ expected: "\"rpc\"",
1922
+ value: input.type
1923
+ });
1924
+ })()},"method":${$string(input.method)}}`;
374
1925
  return $so0(input);
375
1926
  }; return stringify(assert(input, errorFactory)); };