@nxtedition/types 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1167 @@
1
+ import __typia from "typia";
2
+ export const isConnectionRecord = input => {
3
+ const $io0 = input => "file" === input.type && "string" === typeof input.protocol && (undefined === input.host || "string" === typeof input.host) && (undefined === input.port || "number" === typeof input.port) && (undefined === input.ignoreMissing || "boolean" === typeof input.ignoreMissing) && (undefined === input.concurrency || "number" === typeof input.concurrency);
4
+ const $io1 = input => "reuters" === input.type && (undefined === input.clientId || "string" === typeof input.clientId) && (undefined === input.clientSecret || "string" === typeof input.clientSecret) && (undefined === input.audience || "string" === typeof input.audience);
5
+ const $io2 = input => "facebook" === input.type && (undefined === input.grantedScopes || Array.isArray(input.grantedScopes) && input.grantedScopes.every(elem => "string" === typeof elem));
6
+ const $iu0 = input => (() => {
7
+ if ("file" === input.type)
8
+ return $io0(input);
9
+ else if ("reuters" === input.type)
10
+ return $io1(input);
11
+ else if ("facebook" === input.type)
12
+ return $io2(input);
13
+ else
14
+ return false;
15
+ })();
16
+ return "object" === typeof input && null !== input && $iu0(input);
17
+ };
18
+ export const assertConnectionRecord = (input, errorFactory) => {
19
+ const __is = input => {
20
+ const $io0 = input => "file" === input.type && "string" === typeof input.protocol && (undefined === input.host || "string" === typeof input.host) && (undefined === input.port || "number" === typeof input.port) && (undefined === input.ignoreMissing || "boolean" === typeof input.ignoreMissing) && (undefined === input.concurrency || "number" === typeof input.concurrency);
21
+ const $io1 = input => "reuters" === input.type && (undefined === input.clientId || "string" === typeof input.clientId) && (undefined === input.clientSecret || "string" === typeof input.clientSecret) && (undefined === input.audience || "string" === typeof input.audience);
22
+ const $io2 = input => "facebook" === input.type && (undefined === input.grantedScopes || Array.isArray(input.grantedScopes) && input.grantedScopes.every(elem => "string" === typeof elem));
23
+ const $iu0 = input => (() => {
24
+ if ("file" === input.type)
25
+ return $io0(input);
26
+ else if ("reuters" === input.type)
27
+ return $io1(input);
28
+ else if ("facebook" === input.type)
29
+ return $io2(input);
30
+ else
31
+ return false;
32
+ })();
33
+ return "object" === typeof input && null !== input && $iu0(input);
34
+ };
35
+ if (false === __is(input))
36
+ ((input, _path, _exceptionable = true) => {
37
+ const $guard = __typia.createAssert.guard;
38
+ const $ao0 = (input, _path, _exceptionable = true) => ("file" === input.type || $guard(_exceptionable, {
39
+ path: _path + ".type",
40
+ expected: "\"file\"",
41
+ value: input.type
42
+ }, errorFactory)) && ("string" === typeof input.protocol || $guard(_exceptionable, {
43
+ path: _path + ".protocol",
44
+ expected: "string",
45
+ value: input.protocol
46
+ }, errorFactory)) && (undefined === input.host || "string" === typeof input.host || $guard(_exceptionable, {
47
+ path: _path + ".host",
48
+ expected: "(string | undefined)",
49
+ value: input.host
50
+ }, errorFactory)) && (undefined === input.port || "number" === typeof input.port || $guard(_exceptionable, {
51
+ path: _path + ".port",
52
+ expected: "(number | undefined)",
53
+ value: input.port
54
+ }, errorFactory)) && (undefined === input.ignoreMissing || "boolean" === typeof input.ignoreMissing || $guard(_exceptionable, {
55
+ path: _path + ".ignoreMissing",
56
+ expected: "(boolean | undefined)",
57
+ value: input.ignoreMissing
58
+ }, errorFactory)) && (undefined === input.concurrency || "number" === typeof input.concurrency || $guard(_exceptionable, {
59
+ path: _path + ".concurrency",
60
+ expected: "(number | undefined)",
61
+ value: input.concurrency
62
+ }, errorFactory));
63
+ const $ao1 = (input, _path, _exceptionable = true) => ("reuters" === input.type || $guard(_exceptionable, {
64
+ path: _path + ".type",
65
+ expected: "\"reuters\"",
66
+ value: input.type
67
+ }, errorFactory)) && (undefined === input.clientId || "string" === typeof input.clientId || $guard(_exceptionable, {
68
+ path: _path + ".clientId",
69
+ expected: "(string | undefined)",
70
+ value: input.clientId
71
+ }, errorFactory)) && (undefined === input.clientSecret || "string" === typeof input.clientSecret || $guard(_exceptionable, {
72
+ path: _path + ".clientSecret",
73
+ expected: "(string | undefined)",
74
+ value: input.clientSecret
75
+ }, errorFactory)) && (undefined === input.audience || "string" === typeof input.audience || $guard(_exceptionable, {
76
+ path: _path + ".audience",
77
+ expected: "(string | undefined)",
78
+ value: input.audience
79
+ }, errorFactory));
80
+ const $ao2 = (input, _path, _exceptionable = true) => ("facebook" === input.type || $guard(_exceptionable, {
81
+ path: _path + ".type",
82
+ expected: "\"facebook\"",
83
+ value: input.type
84
+ }, errorFactory)) && (undefined === input.grantedScopes || (Array.isArray(input.grantedScopes) || $guard(_exceptionable, {
85
+ path: _path + ".grantedScopes",
86
+ expected: "(Array<string> | undefined)",
87
+ value: input.grantedScopes
88
+ }, errorFactory)) && input.grantedScopes.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
89
+ path: _path + ".grantedScopes[" + _index1 + "]",
90
+ expected: "string",
91
+ value: elem
92
+ }, errorFactory)) || $guard(_exceptionable, {
93
+ path: _path + ".grantedScopes",
94
+ expected: "(Array<string> | undefined)",
95
+ value: input.grantedScopes
96
+ }, errorFactory));
97
+ const $au0 = (input, _path, _exceptionable = true) => (() => {
98
+ if ("file" === input.type)
99
+ return $ao0(input, _path, true && _exceptionable);
100
+ else if ("reuters" === input.type)
101
+ return $ao1(input, _path, true && _exceptionable);
102
+ else if ("facebook" === input.type)
103
+ return $ao2(input, _path, true && _exceptionable);
104
+ else
105
+ return $guard(_exceptionable, {
106
+ path: _path,
107
+ expected: "(FilePublishConnectionRecord | ReutersConnectionRecord | FacebookConnectionRecord)",
108
+ value: input
109
+ }, errorFactory);
110
+ })();
111
+ return ("object" === typeof input && null !== input || $guard(true, {
112
+ path: _path + "",
113
+ expected: "(FacebookConnectionRecord | FilePublishConnectionRecord | ReutersConnectionRecord)",
114
+ value: input
115
+ }, errorFactory)) && $au0(input, _path + "", true) || $guard(true, {
116
+ path: _path + "",
117
+ expected: "(FacebookConnectionRecord | FilePublishConnectionRecord | ReutersConnectionRecord)",
118
+ value: input
119
+ }, errorFactory);
120
+ })(input, "$input", true);
121
+ return input;
122
+ };
123
+ export const randomConnectionRecord = generator => {
124
+ const $generator = __typia.createRandom.generator;
125
+ const $pick = __typia.createRandom.pick;
126
+ const $ro0 = (_recursive = false, _depth = 0) => ({
127
+ type: "file",
128
+ protocol: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
129
+ host: $pick([
130
+ () => undefined,
131
+ () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
132
+ ])(),
133
+ port: $pick([
134
+ () => undefined,
135
+ () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
136
+ ])(),
137
+ ignoreMissing: $pick([
138
+ () => undefined,
139
+ () => (generator?.boolean ?? $generator.boolean)()
140
+ ])(),
141
+ concurrency: $pick([
142
+ () => undefined,
143
+ () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
144
+ ])()
145
+ });
146
+ const $ro1 = (_recursive = false, _depth = 0) => ({
147
+ type: "reuters",
148
+ clientId: $pick([
149
+ () => undefined,
150
+ () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
151
+ ])(),
152
+ clientSecret: $pick([
153
+ () => undefined,
154
+ () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
155
+ ])(),
156
+ audience: $pick([
157
+ () => undefined,
158
+ () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
159
+ ])()
160
+ });
161
+ const $ro2 = (_recursive = false, _depth = 0) => ({
162
+ type: "facebook",
163
+ grantedScopes: $pick([
164
+ () => undefined,
165
+ () => (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)())
166
+ ])()
167
+ });
168
+ return $pick([
169
+ () => $ro0(),
170
+ () => $ro1(),
171
+ () => $ro2()
172
+ ])();
173
+ };
174
+ export const assertGuardConnectionRecord = (input, errorFactory) => {
175
+ const __is = input => {
176
+ const $io0 = input => "file" === input.type && "string" === typeof input.protocol && (undefined === input.host || "string" === typeof input.host) && (undefined === input.port || "number" === typeof input.port) && (undefined === input.ignoreMissing || "boolean" === typeof input.ignoreMissing) && (undefined === input.concurrency || "number" === typeof input.concurrency);
177
+ const $io1 = input => "reuters" === input.type && (undefined === input.clientId || "string" === typeof input.clientId) && (undefined === input.clientSecret || "string" === typeof input.clientSecret) && (undefined === input.audience || "string" === typeof input.audience);
178
+ const $io2 = input => "facebook" === input.type && (undefined === input.grantedScopes || Array.isArray(input.grantedScopes) && input.grantedScopes.every(elem => "string" === typeof elem));
179
+ const $iu0 = input => (() => {
180
+ if ("file" === input.type)
181
+ return $io0(input);
182
+ else if ("reuters" === input.type)
183
+ return $io1(input);
184
+ else if ("facebook" === input.type)
185
+ return $io2(input);
186
+ else
187
+ return false;
188
+ })();
189
+ return "object" === typeof input && null !== input && $iu0(input);
190
+ };
191
+ if (false === __is(input))
192
+ ((input, _path, _exceptionable = true) => {
193
+ const $guard = __typia.createAssertGuard.guard;
194
+ const $ao0 = (input, _path, _exceptionable = true) => ("file" === input.type || $guard(_exceptionable, {
195
+ path: _path + ".type",
196
+ expected: "\"file\"",
197
+ value: input.type
198
+ }, errorFactory)) && ("string" === typeof input.protocol || $guard(_exceptionable, {
199
+ path: _path + ".protocol",
200
+ expected: "string",
201
+ value: input.protocol
202
+ }, errorFactory)) && (undefined === input.host || "string" === typeof input.host || $guard(_exceptionable, {
203
+ path: _path + ".host",
204
+ expected: "(string | undefined)",
205
+ value: input.host
206
+ }, errorFactory)) && (undefined === input.port || "number" === typeof input.port || $guard(_exceptionable, {
207
+ path: _path + ".port",
208
+ expected: "(number | undefined)",
209
+ value: input.port
210
+ }, errorFactory)) && (undefined === input.ignoreMissing || "boolean" === typeof input.ignoreMissing || $guard(_exceptionable, {
211
+ path: _path + ".ignoreMissing",
212
+ expected: "(boolean | undefined)",
213
+ value: input.ignoreMissing
214
+ }, errorFactory)) && (undefined === input.concurrency || "number" === typeof input.concurrency || $guard(_exceptionable, {
215
+ path: _path + ".concurrency",
216
+ expected: "(number | undefined)",
217
+ value: input.concurrency
218
+ }, errorFactory));
219
+ const $ao1 = (input, _path, _exceptionable = true) => ("reuters" === input.type || $guard(_exceptionable, {
220
+ path: _path + ".type",
221
+ expected: "\"reuters\"",
222
+ value: input.type
223
+ }, errorFactory)) && (undefined === input.clientId || "string" === typeof input.clientId || $guard(_exceptionable, {
224
+ path: _path + ".clientId",
225
+ expected: "(string | undefined)",
226
+ value: input.clientId
227
+ }, errorFactory)) && (undefined === input.clientSecret || "string" === typeof input.clientSecret || $guard(_exceptionable, {
228
+ path: _path + ".clientSecret",
229
+ expected: "(string | undefined)",
230
+ value: input.clientSecret
231
+ }, errorFactory)) && (undefined === input.audience || "string" === typeof input.audience || $guard(_exceptionable, {
232
+ path: _path + ".audience",
233
+ expected: "(string | undefined)",
234
+ value: input.audience
235
+ }, errorFactory));
236
+ const $ao2 = (input, _path, _exceptionable = true) => ("facebook" === input.type || $guard(_exceptionable, {
237
+ path: _path + ".type",
238
+ expected: "\"facebook\"",
239
+ value: input.type
240
+ }, errorFactory)) && (undefined === input.grantedScopes || (Array.isArray(input.grantedScopes) || $guard(_exceptionable, {
241
+ path: _path + ".grantedScopes",
242
+ expected: "(Array<string> | undefined)",
243
+ value: input.grantedScopes
244
+ }, errorFactory)) && input.grantedScopes.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
245
+ path: _path + ".grantedScopes[" + _index1 + "]",
246
+ expected: "string",
247
+ value: elem
248
+ }, errorFactory)) || $guard(_exceptionable, {
249
+ path: _path + ".grantedScopes",
250
+ expected: "(Array<string> | undefined)",
251
+ value: input.grantedScopes
252
+ }, errorFactory));
253
+ const $au0 = (input, _path, _exceptionable = true) => (() => {
254
+ if ("file" === input.type)
255
+ return $ao0(input, _path, true && _exceptionable);
256
+ else if ("reuters" === input.type)
257
+ return $ao1(input, _path, true && _exceptionable);
258
+ else if ("facebook" === input.type)
259
+ return $ao2(input, _path, true && _exceptionable);
260
+ else
261
+ return $guard(_exceptionable, {
262
+ path: _path,
263
+ expected: "(FilePublishConnectionRecord | ReutersConnectionRecord | FacebookConnectionRecord)",
264
+ value: input
265
+ }, errorFactory);
266
+ })();
267
+ return ("object" === typeof input && null !== input || $guard(true, {
268
+ path: _path + "",
269
+ expected: "(FacebookConnectionRecord | FilePublishConnectionRecord | ReutersConnectionRecord)",
270
+ value: input
271
+ }, errorFactory)) && $au0(input, _path + "", true) || $guard(true, {
272
+ path: _path + "",
273
+ expected: "(FacebookConnectionRecord | FilePublishConnectionRecord | ReutersConnectionRecord)",
274
+ value: input
275
+ }, errorFactory);
276
+ })(input, "$input", true);
277
+ };
278
+ export const stringifyConnectionRecord = input => {
279
+ const $io0 = input => "file" === input.type && "string" === typeof input.protocol && (undefined === input.host || "string" === typeof input.host) && (undefined === input.port || "number" === typeof input.port) && (undefined === input.ignoreMissing || "boolean" === typeof input.ignoreMissing) && (undefined === input.concurrency || "number" === typeof input.concurrency);
280
+ const $io1 = input => "reuters" === input.type && (undefined === input.clientId || "string" === typeof input.clientId) && (undefined === input.clientSecret || "string" === typeof input.clientSecret) && (undefined === input.audience || "string" === typeof input.audience);
281
+ const $io2 = input => "facebook" === input.type && (undefined === input.grantedScopes || Array.isArray(input.grantedScopes) && input.grantedScopes.every(elem => "string" === typeof elem));
282
+ const $string = __typia.json.createStringify.string;
283
+ const $throws = __typia.json.createStringify.throws;
284
+ const $so0 = input => `{${undefined === input.host ? "" : `"host":${undefined !== input.host ? $string(input.host) : undefined},`}${undefined === input.port ? "" : `"port":${undefined !== input.port ? input.port : undefined},`}${undefined === input.ignoreMissing ? "" : `"ignoreMissing":${undefined !== input.ignoreMissing ? input.ignoreMissing : undefined},`}${undefined === input.concurrency ? "" : `"concurrency":${undefined !== input.concurrency ? input.concurrency : undefined},`}"type":${(() => {
285
+ if ("string" === typeof input.type)
286
+ return $string(input.type);
287
+ if ("string" === typeof input.type)
288
+ return "\"" + input.type + "\"";
289
+ $throws({
290
+ expected: "\"file\"",
291
+ value: input.type
292
+ });
293
+ })()},"protocol":${$string(input.protocol)}}`;
294
+ const $so1 = input => `{${undefined === input.clientId ? "" : `"clientId":${undefined !== input.clientId ? $string(input.clientId) : undefined},`}${undefined === input.clientSecret ? "" : `"clientSecret":${undefined !== input.clientSecret ? $string(input.clientSecret) : undefined},`}${undefined === input.audience ? "" : `"audience":${undefined !== input.audience ? $string(input.audience) : undefined},`}"type":${(() => {
295
+ if ("string" === typeof input.type)
296
+ return $string(input.type);
297
+ if ("string" === typeof input.type)
298
+ return "\"" + input.type + "\"";
299
+ $throws({
300
+ expected: "\"reuters\"",
301
+ value: input.type
302
+ });
303
+ })()}}`;
304
+ const $so2 = input => `{${undefined === input.grantedScopes ? "" : `"grantedScopes":${undefined !== input.grantedScopes ? `[${input.grantedScopes.map(elem => $string(elem)).join(",")}]` : undefined},`}"type":${(() => {
305
+ if ("string" === typeof input.type)
306
+ return $string(input.type);
307
+ if ("string" === typeof input.type)
308
+ return "\"" + input.type + "\"";
309
+ $throws({
310
+ expected: "\"facebook\"",
311
+ value: input.type
312
+ });
313
+ })()}}`;
314
+ const $su0 = input => (() => {
315
+ if ("file" === input.type)
316
+ return $so0(input);
317
+ else if ("reuters" === input.type)
318
+ return $so1(input);
319
+ else if ("facebook" === input.type)
320
+ return $so2(input);
321
+ else
322
+ $throws({
323
+ expected: "(FilePublishConnectionRecord | ReutersConnectionRecord | FacebookConnectionRecord)",
324
+ value: input
325
+ });
326
+ })();
327
+ return $su0(input);
328
+ };
329
+ export const assertStringifyConnectionRecord = (input, errorFactory) => { const assert = (input, errorFactory) => {
330
+ const __is = input => {
331
+ const $io0 = input => "file" === input.type && "string" === typeof input.protocol && (undefined === input.host || "string" === typeof input.host) && (undefined === input.port || "number" === typeof input.port && !Number.isNaN(input.port)) && (undefined === input.ignoreMissing || "boolean" === typeof input.ignoreMissing) && (undefined === input.concurrency || "number" === typeof input.concurrency && !Number.isNaN(input.concurrency));
332
+ const $io1 = input => "reuters" === input.type && (undefined === input.clientId || "string" === typeof input.clientId) && (undefined === input.clientSecret || "string" === typeof input.clientSecret) && (undefined === input.audience || "string" === typeof input.audience);
333
+ const $io2 = input => "facebook" === input.type && (undefined === input.grantedScopes || Array.isArray(input.grantedScopes) && input.grantedScopes.every(elem => "string" === typeof elem));
334
+ const $iu0 = input => (() => {
335
+ if ("file" === input.type)
336
+ return $io0(input);
337
+ else if ("reuters" === input.type)
338
+ return $io1(input);
339
+ else if ("facebook" === input.type)
340
+ return $io2(input);
341
+ else
342
+ return false;
343
+ })();
344
+ return "object" === typeof input && null !== input && $iu0(input);
345
+ };
346
+ if (false === __is(input))
347
+ ((input, _path, _exceptionable = true) => {
348
+ const $guard = __typia.json.createAssertStringify.guard;
349
+ const $ao0 = (input, _path, _exceptionable = true) => ("file" === input.type || $guard(_exceptionable, {
350
+ path: _path + ".type",
351
+ expected: "\"file\"",
352
+ value: input.type
353
+ }, errorFactory)) && ("string" === typeof input.protocol || $guard(_exceptionable, {
354
+ path: _path + ".protocol",
355
+ expected: "string",
356
+ value: input.protocol
357
+ }, errorFactory)) && (undefined === input.host || "string" === typeof input.host || $guard(_exceptionable, {
358
+ path: _path + ".host",
359
+ expected: "(string | undefined)",
360
+ value: input.host
361
+ }, errorFactory)) && (undefined === input.port || "number" === typeof input.port && !Number.isNaN(input.port) || $guard(_exceptionable, {
362
+ path: _path + ".port",
363
+ expected: "(number | undefined)",
364
+ value: input.port
365
+ }, errorFactory)) && (undefined === input.ignoreMissing || "boolean" === typeof input.ignoreMissing || $guard(_exceptionable, {
366
+ path: _path + ".ignoreMissing",
367
+ expected: "(boolean | undefined)",
368
+ value: input.ignoreMissing
369
+ }, errorFactory)) && (undefined === input.concurrency || "number" === typeof input.concurrency && !Number.isNaN(input.concurrency) || $guard(_exceptionable, {
370
+ path: _path + ".concurrency",
371
+ expected: "(number | undefined)",
372
+ value: input.concurrency
373
+ }, errorFactory));
374
+ const $ao1 = (input, _path, _exceptionable = true) => ("reuters" === input.type || $guard(_exceptionable, {
375
+ path: _path + ".type",
376
+ expected: "\"reuters\"",
377
+ value: input.type
378
+ }, errorFactory)) && (undefined === input.clientId || "string" === typeof input.clientId || $guard(_exceptionable, {
379
+ path: _path + ".clientId",
380
+ expected: "(string | undefined)",
381
+ value: input.clientId
382
+ }, errorFactory)) && (undefined === input.clientSecret || "string" === typeof input.clientSecret || $guard(_exceptionable, {
383
+ path: _path + ".clientSecret",
384
+ expected: "(string | undefined)",
385
+ value: input.clientSecret
386
+ }, errorFactory)) && (undefined === input.audience || "string" === typeof input.audience || $guard(_exceptionable, {
387
+ path: _path + ".audience",
388
+ expected: "(string | undefined)",
389
+ value: input.audience
390
+ }, errorFactory));
391
+ const $ao2 = (input, _path, _exceptionable = true) => ("facebook" === input.type || $guard(_exceptionable, {
392
+ path: _path + ".type",
393
+ expected: "\"facebook\"",
394
+ value: input.type
395
+ }, errorFactory)) && (undefined === input.grantedScopes || (Array.isArray(input.grantedScopes) || $guard(_exceptionable, {
396
+ path: _path + ".grantedScopes",
397
+ expected: "(Array<string> | undefined)",
398
+ value: input.grantedScopes
399
+ }, errorFactory)) && input.grantedScopes.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
400
+ path: _path + ".grantedScopes[" + _index1 + "]",
401
+ expected: "string",
402
+ value: elem
403
+ }, errorFactory)) || $guard(_exceptionable, {
404
+ path: _path + ".grantedScopes",
405
+ expected: "(Array<string> | undefined)",
406
+ value: input.grantedScopes
407
+ }, errorFactory));
408
+ const $au0 = (input, _path, _exceptionable = true) => (() => {
409
+ if ("file" === input.type)
410
+ return $ao0(input, _path, true && _exceptionable);
411
+ else if ("reuters" === input.type)
412
+ return $ao1(input, _path, true && _exceptionable);
413
+ else if ("facebook" === input.type)
414
+ return $ao2(input, _path, true && _exceptionable);
415
+ else
416
+ return $guard(_exceptionable, {
417
+ path: _path,
418
+ expected: "(FilePublishConnectionRecord | ReutersConnectionRecord | FacebookConnectionRecord)",
419
+ value: input
420
+ }, errorFactory);
421
+ })();
422
+ return ("object" === typeof input && null !== input || $guard(true, {
423
+ path: _path + "",
424
+ expected: "(FacebookConnectionRecord | FilePublishConnectionRecord | ReutersConnectionRecord)",
425
+ value: input
426
+ }, errorFactory)) && $au0(input, _path + "", true) || $guard(true, {
427
+ path: _path + "",
428
+ expected: "(FacebookConnectionRecord | FilePublishConnectionRecord | ReutersConnectionRecord)",
429
+ value: input
430
+ }, errorFactory);
431
+ })(input, "$input", true);
432
+ return input;
433
+ }; const stringify = input => {
434
+ const $io0 = input => "file" === input.type && "string" === typeof input.protocol && (undefined === input.host || "string" === typeof input.host) && (undefined === input.port || "number" === typeof input.port) && (undefined === input.ignoreMissing || "boolean" === typeof input.ignoreMissing) && (undefined === input.concurrency || "number" === typeof input.concurrency);
435
+ const $io1 = input => "reuters" === input.type && (undefined === input.clientId || "string" === typeof input.clientId) && (undefined === input.clientSecret || "string" === typeof input.clientSecret) && (undefined === input.audience || "string" === typeof input.audience);
436
+ const $io2 = input => "facebook" === input.type && (undefined === input.grantedScopes || Array.isArray(input.grantedScopes) && input.grantedScopes.every(elem => "string" === typeof elem));
437
+ const $string = __typia.json.createAssertStringify.string;
438
+ const $throws = __typia.json.createAssertStringify.throws;
439
+ const $so0 = input => `{${undefined === input.host ? "" : `"host":${undefined !== input.host ? $string(input.host) : undefined},`}${undefined === input.port ? "" : `"port":${undefined !== input.port ? input.port : undefined},`}${undefined === input.ignoreMissing ? "" : `"ignoreMissing":${undefined !== input.ignoreMissing ? input.ignoreMissing : undefined},`}${undefined === input.concurrency ? "" : `"concurrency":${undefined !== input.concurrency ? input.concurrency : undefined},`}"type":${(() => {
440
+ if ("string" === typeof input.type)
441
+ return $string(input.type);
442
+ if ("string" === typeof input.type)
443
+ return "\"" + input.type + "\"";
444
+ $throws({
445
+ expected: "\"file\"",
446
+ value: input.type
447
+ });
448
+ })()},"protocol":${$string(input.protocol)}}`;
449
+ const $so1 = input => `{${undefined === input.clientId ? "" : `"clientId":${undefined !== input.clientId ? $string(input.clientId) : undefined},`}${undefined === input.clientSecret ? "" : `"clientSecret":${undefined !== input.clientSecret ? $string(input.clientSecret) : undefined},`}${undefined === input.audience ? "" : `"audience":${undefined !== input.audience ? $string(input.audience) : undefined},`}"type":${(() => {
450
+ if ("string" === typeof input.type)
451
+ return $string(input.type);
452
+ if ("string" === typeof input.type)
453
+ return "\"" + input.type + "\"";
454
+ $throws({
455
+ expected: "\"reuters\"",
456
+ value: input.type
457
+ });
458
+ })()}}`;
459
+ const $so2 = input => `{${undefined === input.grantedScopes ? "" : `"grantedScopes":${undefined !== input.grantedScopes ? `[${input.grantedScopes.map(elem => $string(elem)).join(",")}]` : undefined},`}"type":${(() => {
460
+ if ("string" === typeof input.type)
461
+ return $string(input.type);
462
+ if ("string" === typeof input.type)
463
+ return "\"" + input.type + "\"";
464
+ $throws({
465
+ expected: "\"facebook\"",
466
+ value: input.type
467
+ });
468
+ })()}}`;
469
+ const $su0 = input => (() => {
470
+ if ("file" === input.type)
471
+ return $so0(input);
472
+ else if ("reuters" === input.type)
473
+ return $so1(input);
474
+ else if ("facebook" === input.type)
475
+ return $so2(input);
476
+ else
477
+ $throws({
478
+ expected: "(FilePublishConnectionRecord | ReutersConnectionRecord | FacebookConnectionRecord)",
479
+ value: input
480
+ });
481
+ })();
482
+ return $su0(input);
483
+ }; return stringify(assert(input, errorFactory)); };
484
+ export const isConnectionStatsRecord = input => {
485
+ const $io0 = input => "string" === typeof input.status && "string" === typeof input.substatus && (undefined === input.pages || Array.isArray(input.pages) && input.pages.every(elem => "object" === typeof elem && null !== elem && $io1(elem)));
486
+ const $io1 = input => true;
487
+ return "object" === typeof input && null !== input && $io0(input);
488
+ };
489
+ export const assertConnectionStatsRecord = (input, errorFactory) => {
490
+ const __is = input => {
491
+ const $io0 = input => "string" === typeof input.status && "string" === typeof input.substatus && (undefined === input.pages || Array.isArray(input.pages) && input.pages.every(elem => "object" === typeof elem && null !== elem && $io1(elem)));
492
+ const $io1 = input => true;
493
+ return "object" === typeof input && null !== input && $io0(input);
494
+ };
495
+ if (false === __is(input))
496
+ ((input, _path, _exceptionable = true) => {
497
+ const $guard = __typia.createAssert.guard;
498
+ const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.status || $guard(_exceptionable, {
499
+ path: _path + ".status",
500
+ expected: "string",
501
+ value: input.status
502
+ }, errorFactory)) && ("string" === typeof input.substatus || $guard(_exceptionable, {
503
+ path: _path + ".substatus",
504
+ expected: "string",
505
+ value: input.substatus
506
+ }, errorFactory)) && (undefined === input.pages || (Array.isArray(input.pages) || $guard(_exceptionable, {
507
+ path: _path + ".pages",
508
+ expected: "(Array<__type> | undefined)",
509
+ value: input.pages
510
+ }, errorFactory)) && input.pages.every((elem, _index1) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
511
+ path: _path + ".pages[" + _index1 + "]",
512
+ expected: "__type",
513
+ value: elem
514
+ }, errorFactory)) && $ao1(elem, _path + ".pages[" + _index1 + "]", true && _exceptionable) || $guard(_exceptionable, {
515
+ path: _path + ".pages[" + _index1 + "]",
516
+ expected: "__type",
517
+ value: elem
518
+ }, errorFactory)) || $guard(_exceptionable, {
519
+ path: _path + ".pages",
520
+ expected: "(Array<__type> | undefined)",
521
+ value: input.pages
522
+ }, errorFactory));
523
+ const $ao1 = (input, _path, _exceptionable = true) => true;
524
+ return ("object" === typeof input && null !== input || $guard(true, {
525
+ path: _path + "",
526
+ expected: "ConnectionStatsRecord",
527
+ value: input
528
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
529
+ path: _path + "",
530
+ expected: "ConnectionStatsRecord",
531
+ value: input
532
+ }, errorFactory);
533
+ })(input, "$input", true);
534
+ return input;
535
+ };
536
+ export const randomConnectionStatsRecord = generator => {
537
+ const $generator = __typia.createRandom.generator;
538
+ const $pick = __typia.createRandom.pick;
539
+ const $ro0 = (_recursive = false, _depth = 0) => ({
540
+ status: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
541
+ substatus: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
542
+ pages: $pick([
543
+ () => undefined,
544
+ () => (generator?.array ?? $generator.array)(() => $ro1(_recursive, _recursive ? 1 + _depth : _depth))
545
+ ])()
546
+ });
547
+ const $ro1 = (_recursive = false, _depth = 0) => ({
548
+ id: "any type used..."
549
+ });
550
+ return $ro0();
551
+ };
552
+ export const assertGuardConnectionStatsRecord = (input, errorFactory) => {
553
+ const __is = input => {
554
+ const $io0 = input => "string" === typeof input.status && "string" === typeof input.substatus && (undefined === input.pages || Array.isArray(input.pages) && input.pages.every(elem => "object" === typeof elem && null !== elem && $io1(elem)));
555
+ const $io1 = input => true;
556
+ return "object" === typeof input && null !== input && $io0(input);
557
+ };
558
+ if (false === __is(input))
559
+ ((input, _path, _exceptionable = true) => {
560
+ const $guard = __typia.createAssertGuard.guard;
561
+ const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.status || $guard(_exceptionable, {
562
+ path: _path + ".status",
563
+ expected: "string",
564
+ value: input.status
565
+ }, errorFactory)) && ("string" === typeof input.substatus || $guard(_exceptionable, {
566
+ path: _path + ".substatus",
567
+ expected: "string",
568
+ value: input.substatus
569
+ }, errorFactory)) && (undefined === input.pages || (Array.isArray(input.pages) || $guard(_exceptionable, {
570
+ path: _path + ".pages",
571
+ expected: "(Array<__type> | undefined)",
572
+ value: input.pages
573
+ }, errorFactory)) && input.pages.every((elem, _index1) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
574
+ path: _path + ".pages[" + _index1 + "]",
575
+ expected: "__type",
576
+ value: elem
577
+ }, errorFactory)) && $ao1(elem, _path + ".pages[" + _index1 + "]", true && _exceptionable) || $guard(_exceptionable, {
578
+ path: _path + ".pages[" + _index1 + "]",
579
+ expected: "__type",
580
+ value: elem
581
+ }, errorFactory)) || $guard(_exceptionable, {
582
+ path: _path + ".pages",
583
+ expected: "(Array<__type> | undefined)",
584
+ value: input.pages
585
+ }, errorFactory));
586
+ const $ao1 = (input, _path, _exceptionable = true) => true;
587
+ return ("object" === typeof input && null !== input || $guard(true, {
588
+ path: _path + "",
589
+ expected: "ConnectionStatsRecord",
590
+ value: input
591
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
592
+ path: _path + "",
593
+ expected: "ConnectionStatsRecord",
594
+ value: input
595
+ }, errorFactory);
596
+ })(input, "$input", true);
597
+ };
598
+ export const stringifyConnectionStatsRecord = input => {
599
+ const $io1 = input => true;
600
+ const $string = __typia.json.createStringify.string;
601
+ const $so0 = input => `{${undefined === input.pages ? "" : `"pages":${undefined !== input.pages ? `[${input.pages.map(elem => $so1(elem)).join(",")}]` : undefined},`}"status":${$string(input.status)},"substatus":${$string(input.substatus)}}`;
602
+ const $so1 = input => `{${undefined === input.id || "function" === typeof input.id ? "" : `"id":${undefined !== input.id ? JSON.stringify(input.id) : undefined}`}}`;
603
+ return $so0(input);
604
+ };
605
+ export const assertStringifyConnectionStatsRecord = (input, errorFactory) => { const assert = (input, errorFactory) => {
606
+ const __is = input => {
607
+ const $io0 = input => "string" === typeof input.status && "string" === typeof input.substatus && (undefined === input.pages || Array.isArray(input.pages) && input.pages.every(elem => "object" === typeof elem && null !== elem && $io1(elem)));
608
+ const $io1 = input => true;
609
+ return "object" === typeof input && null !== input && $io0(input);
610
+ };
611
+ if (false === __is(input))
612
+ ((input, _path, _exceptionable = true) => {
613
+ const $guard = __typia.json.createAssertStringify.guard;
614
+ const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.status || $guard(_exceptionable, {
615
+ path: _path + ".status",
616
+ expected: "string",
617
+ value: input.status
618
+ }, errorFactory)) && ("string" === typeof input.substatus || $guard(_exceptionable, {
619
+ path: _path + ".substatus",
620
+ expected: "string",
621
+ value: input.substatus
622
+ }, errorFactory)) && (undefined === input.pages || (Array.isArray(input.pages) || $guard(_exceptionable, {
623
+ path: _path + ".pages",
624
+ expected: "(Array<__type> | undefined)",
625
+ value: input.pages
626
+ }, errorFactory)) && input.pages.every((elem, _index1) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
627
+ path: _path + ".pages[" + _index1 + "]",
628
+ expected: "__type",
629
+ value: elem
630
+ }, errorFactory)) && $ao1(elem, _path + ".pages[" + _index1 + "]", true && _exceptionable) || $guard(_exceptionable, {
631
+ path: _path + ".pages[" + _index1 + "]",
632
+ expected: "__type",
633
+ value: elem
634
+ }, errorFactory)) || $guard(_exceptionable, {
635
+ path: _path + ".pages",
636
+ expected: "(Array<__type> | undefined)",
637
+ value: input.pages
638
+ }, errorFactory));
639
+ const $ao1 = (input, _path, _exceptionable = true) => true;
640
+ return ("object" === typeof input && null !== input || $guard(true, {
641
+ path: _path + "",
642
+ expected: "ConnectionStatsRecord",
643
+ value: input
644
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
645
+ path: _path + "",
646
+ expected: "ConnectionStatsRecord",
647
+ value: input
648
+ }, errorFactory);
649
+ })(input, "$input", true);
650
+ return input;
651
+ }; const stringify = input => {
652
+ const $io1 = input => true;
653
+ const $string = __typia.json.createAssertStringify.string;
654
+ const $so0 = input => `{${undefined === input.pages ? "" : `"pages":${undefined !== input.pages ? `[${input.pages.map(elem => $so1(elem)).join(",")}]` : undefined},`}"status":${$string(input.status)},"substatus":${$string(input.substatus)}}`;
655
+ const $so1 = input => `{${undefined === input.id || "function" === typeof input.id ? "" : `"id":${undefined !== input.id ? JSON.stringify(input.id) : undefined}`}}`;
656
+ return $so0(input);
657
+ }; return stringify(assert(input, errorFactory)); };
658
+ export const isReutersConnectionRecord = input => {
659
+ const $io0 = input => "reuters" === input.type && (undefined === input.clientId || "string" === typeof input.clientId) && (undefined === input.clientSecret || "string" === typeof input.clientSecret) && (undefined === input.audience || "string" === typeof input.audience);
660
+ return "object" === typeof input && null !== input && $io0(input);
661
+ };
662
+ export const assertReutersConnectionRecord = (input, errorFactory) => {
663
+ const __is = input => {
664
+ const $io0 = input => "reuters" === input.type && (undefined === input.clientId || "string" === typeof input.clientId) && (undefined === input.clientSecret || "string" === typeof input.clientSecret) && (undefined === input.audience || "string" === typeof input.audience);
665
+ return "object" === typeof input && null !== input && $io0(input);
666
+ };
667
+ if (false === __is(input))
668
+ ((input, _path, _exceptionable = true) => {
669
+ const $guard = __typia.createAssert.guard;
670
+ const $ao0 = (input, _path, _exceptionable = true) => ("reuters" === input.type || $guard(_exceptionable, {
671
+ path: _path + ".type",
672
+ expected: "\"reuters\"",
673
+ value: input.type
674
+ }, errorFactory)) && (undefined === input.clientId || "string" === typeof input.clientId || $guard(_exceptionable, {
675
+ path: _path + ".clientId",
676
+ expected: "(string | undefined)",
677
+ value: input.clientId
678
+ }, errorFactory)) && (undefined === input.clientSecret || "string" === typeof input.clientSecret || $guard(_exceptionable, {
679
+ path: _path + ".clientSecret",
680
+ expected: "(string | undefined)",
681
+ value: input.clientSecret
682
+ }, errorFactory)) && (undefined === input.audience || "string" === typeof input.audience || $guard(_exceptionable, {
683
+ path: _path + ".audience",
684
+ expected: "(string | undefined)",
685
+ value: input.audience
686
+ }, errorFactory));
687
+ return ("object" === typeof input && null !== input || $guard(true, {
688
+ path: _path + "",
689
+ expected: "ReutersConnectionRecord",
690
+ value: input
691
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
692
+ path: _path + "",
693
+ expected: "ReutersConnectionRecord",
694
+ value: input
695
+ }, errorFactory);
696
+ })(input, "$input", true);
697
+ return input;
698
+ };
699
+ export const randomReutersConnectionRecord = generator => {
700
+ const $generator = __typia.createRandom.generator;
701
+ const $pick = __typia.createRandom.pick;
702
+ const $ro0 = (_recursive = false, _depth = 0) => ({
703
+ type: "reuters",
704
+ clientId: $pick([
705
+ () => undefined,
706
+ () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
707
+ ])(),
708
+ clientSecret: $pick([
709
+ () => undefined,
710
+ () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
711
+ ])(),
712
+ audience: $pick([
713
+ () => undefined,
714
+ () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
715
+ ])()
716
+ });
717
+ return $ro0();
718
+ };
719
+ export const assertGuardReutersConnectionRecord = (input, errorFactory) => {
720
+ const __is = input => {
721
+ const $io0 = input => "reuters" === input.type && (undefined === input.clientId || "string" === typeof input.clientId) && (undefined === input.clientSecret || "string" === typeof input.clientSecret) && (undefined === input.audience || "string" === typeof input.audience);
722
+ return "object" === typeof input && null !== input && $io0(input);
723
+ };
724
+ if (false === __is(input))
725
+ ((input, _path, _exceptionable = true) => {
726
+ const $guard = __typia.createAssertGuard.guard;
727
+ const $ao0 = (input, _path, _exceptionable = true) => ("reuters" === input.type || $guard(_exceptionable, {
728
+ path: _path + ".type",
729
+ expected: "\"reuters\"",
730
+ value: input.type
731
+ }, errorFactory)) && (undefined === input.clientId || "string" === typeof input.clientId || $guard(_exceptionable, {
732
+ path: _path + ".clientId",
733
+ expected: "(string | undefined)",
734
+ value: input.clientId
735
+ }, errorFactory)) && (undefined === input.clientSecret || "string" === typeof input.clientSecret || $guard(_exceptionable, {
736
+ path: _path + ".clientSecret",
737
+ expected: "(string | undefined)",
738
+ value: input.clientSecret
739
+ }, errorFactory)) && (undefined === input.audience || "string" === typeof input.audience || $guard(_exceptionable, {
740
+ path: _path + ".audience",
741
+ expected: "(string | undefined)",
742
+ value: input.audience
743
+ }, errorFactory));
744
+ return ("object" === typeof input && null !== input || $guard(true, {
745
+ path: _path + "",
746
+ expected: "ReutersConnectionRecord",
747
+ value: input
748
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
749
+ path: _path + "",
750
+ expected: "ReutersConnectionRecord",
751
+ value: input
752
+ }, errorFactory);
753
+ })(input, "$input", true);
754
+ };
755
+ export const stringifyReutersConnectionRecord = input => {
756
+ const $string = __typia.json.createStringify.string;
757
+ const $throws = __typia.json.createStringify.throws;
758
+ const $so0 = input => `{${undefined === input.clientId ? "" : `"clientId":${undefined !== input.clientId ? $string(input.clientId) : undefined},`}${undefined === input.clientSecret ? "" : `"clientSecret":${undefined !== input.clientSecret ? $string(input.clientSecret) : undefined},`}${undefined === input.audience ? "" : `"audience":${undefined !== input.audience ? $string(input.audience) : undefined},`}"type":${(() => {
759
+ if ("string" === typeof input.type)
760
+ return $string(input.type);
761
+ if ("string" === typeof input.type)
762
+ return "\"" + input.type + "\"";
763
+ $throws({
764
+ expected: "\"reuters\"",
765
+ value: input.type
766
+ });
767
+ })()}}`;
768
+ return $so0(input);
769
+ };
770
+ export const assertStringifyReutersConnectionRecord = (input, errorFactory) => { const assert = (input, errorFactory) => {
771
+ const __is = input => {
772
+ const $io0 = input => "reuters" === input.type && (undefined === input.clientId || "string" === typeof input.clientId) && (undefined === input.clientSecret || "string" === typeof input.clientSecret) && (undefined === input.audience || "string" === typeof input.audience);
773
+ return "object" === typeof input && null !== input && $io0(input);
774
+ };
775
+ if (false === __is(input))
776
+ ((input, _path, _exceptionable = true) => {
777
+ const $guard = __typia.json.createAssertStringify.guard;
778
+ const $ao0 = (input, _path, _exceptionable = true) => ("reuters" === input.type || $guard(_exceptionable, {
779
+ path: _path + ".type",
780
+ expected: "\"reuters\"",
781
+ value: input.type
782
+ }, errorFactory)) && (undefined === input.clientId || "string" === typeof input.clientId || $guard(_exceptionable, {
783
+ path: _path + ".clientId",
784
+ expected: "(string | undefined)",
785
+ value: input.clientId
786
+ }, errorFactory)) && (undefined === input.clientSecret || "string" === typeof input.clientSecret || $guard(_exceptionable, {
787
+ path: _path + ".clientSecret",
788
+ expected: "(string | undefined)",
789
+ value: input.clientSecret
790
+ }, errorFactory)) && (undefined === input.audience || "string" === typeof input.audience || $guard(_exceptionable, {
791
+ path: _path + ".audience",
792
+ expected: "(string | undefined)",
793
+ value: input.audience
794
+ }, errorFactory));
795
+ return ("object" === typeof input && null !== input || $guard(true, {
796
+ path: _path + "",
797
+ expected: "ReutersConnectionRecord",
798
+ value: input
799
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
800
+ path: _path + "",
801
+ expected: "ReutersConnectionRecord",
802
+ value: input
803
+ }, errorFactory);
804
+ })(input, "$input", true);
805
+ return input;
806
+ }; const stringify = input => {
807
+ const $string = __typia.json.createAssertStringify.string;
808
+ const $throws = __typia.json.createAssertStringify.throws;
809
+ const $so0 = input => `{${undefined === input.clientId ? "" : `"clientId":${undefined !== input.clientId ? $string(input.clientId) : undefined},`}${undefined === input.clientSecret ? "" : `"clientSecret":${undefined !== input.clientSecret ? $string(input.clientSecret) : undefined},`}${undefined === input.audience ? "" : `"audience":${undefined !== input.audience ? $string(input.audience) : undefined},`}"type":${(() => {
810
+ if ("string" === typeof input.type)
811
+ return $string(input.type);
812
+ if ("string" === typeof input.type)
813
+ return "\"" + input.type + "\"";
814
+ $throws({
815
+ expected: "\"reuters\"",
816
+ value: input.type
817
+ });
818
+ })()}}`;
819
+ return $so0(input);
820
+ }; return stringify(assert(input, errorFactory)); };
821
+ export const isFacebookConnectionRecord = input => {
822
+ const $io0 = input => "facebook" === input.type && (undefined === input.grantedScopes || Array.isArray(input.grantedScopes) && input.grantedScopes.every(elem => "string" === typeof elem));
823
+ return "object" === typeof input && null !== input && $io0(input);
824
+ };
825
+ export const assertFacebookConnectionRecord = (input, errorFactory) => {
826
+ const __is = input => {
827
+ const $io0 = input => "facebook" === input.type && (undefined === input.grantedScopes || Array.isArray(input.grantedScopes) && input.grantedScopes.every(elem => "string" === typeof elem));
828
+ return "object" === typeof input && null !== input && $io0(input);
829
+ };
830
+ if (false === __is(input))
831
+ ((input, _path, _exceptionable = true) => {
832
+ const $guard = __typia.createAssert.guard;
833
+ const $ao0 = (input, _path, _exceptionable = true) => ("facebook" === input.type || $guard(_exceptionable, {
834
+ path: _path + ".type",
835
+ expected: "\"facebook\"",
836
+ value: input.type
837
+ }, errorFactory)) && (undefined === input.grantedScopes || (Array.isArray(input.grantedScopes) || $guard(_exceptionable, {
838
+ path: _path + ".grantedScopes",
839
+ expected: "(Array<string> | undefined)",
840
+ value: input.grantedScopes
841
+ }, errorFactory)) && input.grantedScopes.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
842
+ path: _path + ".grantedScopes[" + _index1 + "]",
843
+ expected: "string",
844
+ value: elem
845
+ }, errorFactory)) || $guard(_exceptionable, {
846
+ path: _path + ".grantedScopes",
847
+ expected: "(Array<string> | undefined)",
848
+ value: input.grantedScopes
849
+ }, errorFactory));
850
+ return ("object" === typeof input && null !== input || $guard(true, {
851
+ path: _path + "",
852
+ expected: "FacebookConnectionRecord",
853
+ value: input
854
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
855
+ path: _path + "",
856
+ expected: "FacebookConnectionRecord",
857
+ value: input
858
+ }, errorFactory);
859
+ })(input, "$input", true);
860
+ return input;
861
+ };
862
+ export const randomFacebookConnectionRecord = generator => {
863
+ const $generator = __typia.createRandom.generator;
864
+ const $pick = __typia.createRandom.pick;
865
+ const $ro0 = (_recursive = false, _depth = 0) => ({
866
+ type: "facebook",
867
+ grantedScopes: $pick([
868
+ () => undefined,
869
+ () => (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)())
870
+ ])()
871
+ });
872
+ return $ro0();
873
+ };
874
+ export const assertGuardFacebookConnectionRecord = (input, errorFactory) => {
875
+ const __is = input => {
876
+ const $io0 = input => "facebook" === input.type && (undefined === input.grantedScopes || Array.isArray(input.grantedScopes) && input.grantedScopes.every(elem => "string" === typeof elem));
877
+ return "object" === typeof input && null !== input && $io0(input);
878
+ };
879
+ if (false === __is(input))
880
+ ((input, _path, _exceptionable = true) => {
881
+ const $guard = __typia.createAssertGuard.guard;
882
+ const $ao0 = (input, _path, _exceptionable = true) => ("facebook" === input.type || $guard(_exceptionable, {
883
+ path: _path + ".type",
884
+ expected: "\"facebook\"",
885
+ value: input.type
886
+ }, errorFactory)) && (undefined === input.grantedScopes || (Array.isArray(input.grantedScopes) || $guard(_exceptionable, {
887
+ path: _path + ".grantedScopes",
888
+ expected: "(Array<string> | undefined)",
889
+ value: input.grantedScopes
890
+ }, errorFactory)) && input.grantedScopes.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
891
+ path: _path + ".grantedScopes[" + _index1 + "]",
892
+ expected: "string",
893
+ value: elem
894
+ }, errorFactory)) || $guard(_exceptionable, {
895
+ path: _path + ".grantedScopes",
896
+ expected: "(Array<string> | undefined)",
897
+ value: input.grantedScopes
898
+ }, errorFactory));
899
+ return ("object" === typeof input && null !== input || $guard(true, {
900
+ path: _path + "",
901
+ expected: "FacebookConnectionRecord",
902
+ value: input
903
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
904
+ path: _path + "",
905
+ expected: "FacebookConnectionRecord",
906
+ value: input
907
+ }, errorFactory);
908
+ })(input, "$input", true);
909
+ };
910
+ export const stringifyFacebookConnectionRecord = input => {
911
+ const $string = __typia.json.createStringify.string;
912
+ const $throws = __typia.json.createStringify.throws;
913
+ const $so0 = input => `{${undefined === input.grantedScopes ? "" : `"grantedScopes":${undefined !== input.grantedScopes ? `[${input.grantedScopes.map(elem => $string(elem)).join(",")}]` : undefined},`}"type":${(() => {
914
+ if ("string" === typeof input.type)
915
+ return $string(input.type);
916
+ if ("string" === typeof input.type)
917
+ return "\"" + input.type + "\"";
918
+ $throws({
919
+ expected: "\"facebook\"",
920
+ value: input.type
921
+ });
922
+ })()}}`;
923
+ return $so0(input);
924
+ };
925
+ export const assertStringifyFacebookConnectionRecord = (input, errorFactory) => { const assert = (input, errorFactory) => {
926
+ const __is = input => {
927
+ const $io0 = input => "facebook" === input.type && (undefined === input.grantedScopes || Array.isArray(input.grantedScopes) && input.grantedScopes.every(elem => "string" === typeof elem));
928
+ return "object" === typeof input && null !== input && $io0(input);
929
+ };
930
+ if (false === __is(input))
931
+ ((input, _path, _exceptionable = true) => {
932
+ const $guard = __typia.json.createAssertStringify.guard;
933
+ const $ao0 = (input, _path, _exceptionable = true) => ("facebook" === input.type || $guard(_exceptionable, {
934
+ path: _path + ".type",
935
+ expected: "\"facebook\"",
936
+ value: input.type
937
+ }, errorFactory)) && (undefined === input.grantedScopes || (Array.isArray(input.grantedScopes) || $guard(_exceptionable, {
938
+ path: _path + ".grantedScopes",
939
+ expected: "(Array<string> | undefined)",
940
+ value: input.grantedScopes
941
+ }, errorFactory)) && input.grantedScopes.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
942
+ path: _path + ".grantedScopes[" + _index1 + "]",
943
+ expected: "string",
944
+ value: elem
945
+ }, errorFactory)) || $guard(_exceptionable, {
946
+ path: _path + ".grantedScopes",
947
+ expected: "(Array<string> | undefined)",
948
+ value: input.grantedScopes
949
+ }, errorFactory));
950
+ return ("object" === typeof input && null !== input || $guard(true, {
951
+ path: _path + "",
952
+ expected: "FacebookConnectionRecord",
953
+ value: input
954
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
955
+ path: _path + "",
956
+ expected: "FacebookConnectionRecord",
957
+ value: input
958
+ }, errorFactory);
959
+ })(input, "$input", true);
960
+ return input;
961
+ }; const stringify = input => {
962
+ const $string = __typia.json.createAssertStringify.string;
963
+ const $throws = __typia.json.createAssertStringify.throws;
964
+ const $so0 = input => `{${undefined === input.grantedScopes ? "" : `"grantedScopes":${undefined !== input.grantedScopes ? `[${input.grantedScopes.map(elem => $string(elem)).join(",")}]` : undefined},`}"type":${(() => {
965
+ if ("string" === typeof input.type)
966
+ return $string(input.type);
967
+ if ("string" === typeof input.type)
968
+ return "\"" + input.type + "\"";
969
+ $throws({
970
+ expected: "\"facebook\"",
971
+ value: input.type
972
+ });
973
+ })()}}`;
974
+ return $so0(input);
975
+ }; return stringify(assert(input, errorFactory)); };
976
+ export const isFilePublishConnectionRecord = input => {
977
+ const $io0 = input => "file" === input.type && "string" === typeof input.protocol && (undefined === input.host || "string" === typeof input.host) && (undefined === input.port || "number" === typeof input.port) && (undefined === input.ignoreMissing || "boolean" === typeof input.ignoreMissing) && (undefined === input.concurrency || "number" === typeof input.concurrency);
978
+ return "object" === typeof input && null !== input && $io0(input);
979
+ };
980
+ export const assertFilePublishConnectionRecord = (input, errorFactory) => {
981
+ const __is = input => {
982
+ const $io0 = input => "file" === input.type && "string" === typeof input.protocol && (undefined === input.host || "string" === typeof input.host) && (undefined === input.port || "number" === typeof input.port) && (undefined === input.ignoreMissing || "boolean" === typeof input.ignoreMissing) && (undefined === input.concurrency || "number" === typeof input.concurrency);
983
+ return "object" === typeof input && null !== input && $io0(input);
984
+ };
985
+ if (false === __is(input))
986
+ ((input, _path, _exceptionable = true) => {
987
+ const $guard = __typia.createAssert.guard;
988
+ const $ao0 = (input, _path, _exceptionable = true) => ("file" === input.type || $guard(_exceptionable, {
989
+ path: _path + ".type",
990
+ expected: "\"file\"",
991
+ value: input.type
992
+ }, errorFactory)) && ("string" === typeof input.protocol || $guard(_exceptionable, {
993
+ path: _path + ".protocol",
994
+ expected: "string",
995
+ value: input.protocol
996
+ }, errorFactory)) && (undefined === input.host || "string" === typeof input.host || $guard(_exceptionable, {
997
+ path: _path + ".host",
998
+ expected: "(string | undefined)",
999
+ value: input.host
1000
+ }, errorFactory)) && (undefined === input.port || "number" === typeof input.port || $guard(_exceptionable, {
1001
+ path: _path + ".port",
1002
+ expected: "(number | undefined)",
1003
+ value: input.port
1004
+ }, errorFactory)) && (undefined === input.ignoreMissing || "boolean" === typeof input.ignoreMissing || $guard(_exceptionable, {
1005
+ path: _path + ".ignoreMissing",
1006
+ expected: "(boolean | undefined)",
1007
+ value: input.ignoreMissing
1008
+ }, errorFactory)) && (undefined === input.concurrency || "number" === typeof input.concurrency || $guard(_exceptionable, {
1009
+ path: _path + ".concurrency",
1010
+ expected: "(number | undefined)",
1011
+ value: input.concurrency
1012
+ }, errorFactory));
1013
+ return ("object" === typeof input && null !== input || $guard(true, {
1014
+ path: _path + "",
1015
+ expected: "FilePublishConnectionRecord",
1016
+ value: input
1017
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
1018
+ path: _path + "",
1019
+ expected: "FilePublishConnectionRecord",
1020
+ value: input
1021
+ }, errorFactory);
1022
+ })(input, "$input", true);
1023
+ return input;
1024
+ };
1025
+ export const randomFilePublishConnectionRecord = generator => {
1026
+ const $generator = __typia.createRandom.generator;
1027
+ const $pick = __typia.createRandom.pick;
1028
+ const $ro0 = (_recursive = false, _depth = 0) => ({
1029
+ type: "file",
1030
+ protocol: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
1031
+ host: $pick([
1032
+ () => undefined,
1033
+ () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
1034
+ ])(),
1035
+ port: $pick([
1036
+ () => undefined,
1037
+ () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
1038
+ ])(),
1039
+ ignoreMissing: $pick([
1040
+ () => undefined,
1041
+ () => (generator?.boolean ?? $generator.boolean)()
1042
+ ])(),
1043
+ concurrency: $pick([
1044
+ () => undefined,
1045
+ () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
1046
+ ])()
1047
+ });
1048
+ return $ro0();
1049
+ };
1050
+ export const assertGuardFilePublishConnectionRecord = (input, errorFactory) => {
1051
+ const __is = input => {
1052
+ const $io0 = input => "file" === input.type && "string" === typeof input.protocol && (undefined === input.host || "string" === typeof input.host) && (undefined === input.port || "number" === typeof input.port) && (undefined === input.ignoreMissing || "boolean" === typeof input.ignoreMissing) && (undefined === input.concurrency || "number" === typeof input.concurrency);
1053
+ return "object" === typeof input && null !== input && $io0(input);
1054
+ };
1055
+ if (false === __is(input))
1056
+ ((input, _path, _exceptionable = true) => {
1057
+ const $guard = __typia.createAssertGuard.guard;
1058
+ const $ao0 = (input, _path, _exceptionable = true) => ("file" === input.type || $guard(_exceptionable, {
1059
+ path: _path + ".type",
1060
+ expected: "\"file\"",
1061
+ value: input.type
1062
+ }, errorFactory)) && ("string" === typeof input.protocol || $guard(_exceptionable, {
1063
+ path: _path + ".protocol",
1064
+ expected: "string",
1065
+ value: input.protocol
1066
+ }, errorFactory)) && (undefined === input.host || "string" === typeof input.host || $guard(_exceptionable, {
1067
+ path: _path + ".host",
1068
+ expected: "(string | undefined)",
1069
+ value: input.host
1070
+ }, errorFactory)) && (undefined === input.port || "number" === typeof input.port || $guard(_exceptionable, {
1071
+ path: _path + ".port",
1072
+ expected: "(number | undefined)",
1073
+ value: input.port
1074
+ }, errorFactory)) && (undefined === input.ignoreMissing || "boolean" === typeof input.ignoreMissing || $guard(_exceptionable, {
1075
+ path: _path + ".ignoreMissing",
1076
+ expected: "(boolean | undefined)",
1077
+ value: input.ignoreMissing
1078
+ }, errorFactory)) && (undefined === input.concurrency || "number" === typeof input.concurrency || $guard(_exceptionable, {
1079
+ path: _path + ".concurrency",
1080
+ expected: "(number | undefined)",
1081
+ value: input.concurrency
1082
+ }, errorFactory));
1083
+ return ("object" === typeof input && null !== input || $guard(true, {
1084
+ path: _path + "",
1085
+ expected: "FilePublishConnectionRecord",
1086
+ value: input
1087
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
1088
+ path: _path + "",
1089
+ expected: "FilePublishConnectionRecord",
1090
+ value: input
1091
+ }, errorFactory);
1092
+ })(input, "$input", true);
1093
+ };
1094
+ export const stringifyFilePublishConnectionRecord = input => {
1095
+ const $string = __typia.json.createStringify.string;
1096
+ const $throws = __typia.json.createStringify.throws;
1097
+ const $so0 = input => `{${undefined === input.host ? "" : `"host":${undefined !== input.host ? $string(input.host) : undefined},`}${undefined === input.port ? "" : `"port":${undefined !== input.port ? input.port : undefined},`}${undefined === input.ignoreMissing ? "" : `"ignoreMissing":${undefined !== input.ignoreMissing ? input.ignoreMissing : undefined},`}${undefined === input.concurrency ? "" : `"concurrency":${undefined !== input.concurrency ? input.concurrency : undefined},`}"type":${(() => {
1098
+ if ("string" === typeof input.type)
1099
+ return $string(input.type);
1100
+ if ("string" === typeof input.type)
1101
+ return "\"" + input.type + "\"";
1102
+ $throws({
1103
+ expected: "\"file\"",
1104
+ value: input.type
1105
+ });
1106
+ })()},"protocol":${$string(input.protocol)}}`;
1107
+ return $so0(input);
1108
+ };
1109
+ export const assertStringifyFilePublishConnectionRecord = (input, errorFactory) => { const assert = (input, errorFactory) => {
1110
+ const __is = input => {
1111
+ const $io0 = input => "file" === input.type && "string" === typeof input.protocol && (undefined === input.host || "string" === typeof input.host) && (undefined === input.port || "number" === typeof input.port && !Number.isNaN(input.port)) && (undefined === input.ignoreMissing || "boolean" === typeof input.ignoreMissing) && (undefined === input.concurrency || "number" === typeof input.concurrency && !Number.isNaN(input.concurrency));
1112
+ return "object" === typeof input && null !== input && $io0(input);
1113
+ };
1114
+ if (false === __is(input))
1115
+ ((input, _path, _exceptionable = true) => {
1116
+ const $guard = __typia.json.createAssertStringify.guard;
1117
+ const $ao0 = (input, _path, _exceptionable = true) => ("file" === input.type || $guard(_exceptionable, {
1118
+ path: _path + ".type",
1119
+ expected: "\"file\"",
1120
+ value: input.type
1121
+ }, errorFactory)) && ("string" === typeof input.protocol || $guard(_exceptionable, {
1122
+ path: _path + ".protocol",
1123
+ expected: "string",
1124
+ value: input.protocol
1125
+ }, errorFactory)) && (undefined === input.host || "string" === typeof input.host || $guard(_exceptionable, {
1126
+ path: _path + ".host",
1127
+ expected: "(string | undefined)",
1128
+ value: input.host
1129
+ }, errorFactory)) && (undefined === input.port || "number" === typeof input.port && !Number.isNaN(input.port) || $guard(_exceptionable, {
1130
+ path: _path + ".port",
1131
+ expected: "(number | undefined)",
1132
+ value: input.port
1133
+ }, errorFactory)) && (undefined === input.ignoreMissing || "boolean" === typeof input.ignoreMissing || $guard(_exceptionable, {
1134
+ path: _path + ".ignoreMissing",
1135
+ expected: "(boolean | undefined)",
1136
+ value: input.ignoreMissing
1137
+ }, errorFactory)) && (undefined === input.concurrency || "number" === typeof input.concurrency && !Number.isNaN(input.concurrency) || $guard(_exceptionable, {
1138
+ path: _path + ".concurrency",
1139
+ expected: "(number | undefined)",
1140
+ value: input.concurrency
1141
+ }, errorFactory));
1142
+ return ("object" === typeof input && null !== input || $guard(true, {
1143
+ path: _path + "",
1144
+ expected: "FilePublishConnectionRecord",
1145
+ value: input
1146
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
1147
+ path: _path + "",
1148
+ expected: "FilePublishConnectionRecord",
1149
+ value: input
1150
+ }, errorFactory);
1151
+ })(input, "$input", true);
1152
+ return input;
1153
+ }; const stringify = input => {
1154
+ const $string = __typia.json.createAssertStringify.string;
1155
+ const $throws = __typia.json.createAssertStringify.throws;
1156
+ const $so0 = input => `{${undefined === input.host ? "" : `"host":${undefined !== input.host ? $string(input.host) : undefined},`}${undefined === input.port ? "" : `"port":${undefined !== input.port ? input.port : undefined},`}${undefined === input.ignoreMissing ? "" : `"ignoreMissing":${undefined !== input.ignoreMissing ? input.ignoreMissing : undefined},`}${undefined === input.concurrency ? "" : `"concurrency":${undefined !== input.concurrency ? input.concurrency : undefined},`}"type":${(() => {
1157
+ if ("string" === typeof input.type)
1158
+ return $string(input.type);
1159
+ if ("string" === typeof input.type)
1160
+ return "\"" + input.type + "\"";
1161
+ $throws({
1162
+ expected: "\"file\"",
1163
+ value: input.type
1164
+ });
1165
+ })()},"protocol":${$string(input.protocol)}}`;
1166
+ return $so0(input);
1167
+ }; return stringify(assert(input, errorFactory)); };