@nxtedition/types 23.0.2 → 23.0.4

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.
Files changed (59) hide show
  1. package/dist/asset.d.ts +10 -0
  2. package/dist/asset.js +1 -0
  3. package/dist/common/clone.d.ts +32 -0
  4. package/dist/common/clone.js +602 -0
  5. package/dist/common/date.d.ts +8 -0
  6. package/dist/common/date.js +59 -0
  7. package/dist/common/index.d.ts +8 -0
  8. package/dist/common/index.js +8 -0
  9. package/dist/common/media.d.ts +8 -0
  10. package/dist/common/media.js +83 -0
  11. package/dist/common/nxtpression.d.ts +19 -0
  12. package/dist/common/nxtpression.js +240 -0
  13. package/dist/common/pipeline.d.ts +8 -0
  14. package/dist/common/pipeline.js +88 -0
  15. package/dist/common/promoted-tag.d.ts +13 -0
  16. package/dist/common/promoted-tag.js +147 -0
  17. package/dist/common/render-preset.d.ts +32 -0
  18. package/dist/common/render-preset.js +516 -0
  19. package/dist/common/search.d.ts +69 -0
  20. package/dist/common/search.js +1591 -0
  21. package/dist/common/settings.d.ts +26 -11
  22. package/dist/common/settings.js +812 -333
  23. package/dist/domains/asset.d.ts +172 -49
  24. package/dist/domains/asset.js +1533 -72
  25. package/dist/domains/clone.d.ts +14 -0
  26. package/dist/domains/clone.js +192 -0
  27. package/dist/domains/connection.d.ts +39 -15
  28. package/dist/domains/connection.js +621 -174
  29. package/dist/domains/design.d.ts +24 -0
  30. package/dist/domains/design.js +303 -0
  31. package/dist/domains/file.d.ts +17 -0
  32. package/dist/domains/file.js +233 -0
  33. package/dist/domains/index.d.ts +19 -1
  34. package/dist/domains/index.js +9 -0
  35. package/dist/domains/media.d.ts +42 -2
  36. package/dist/domains/media.js +1070 -24
  37. package/dist/domains/pipeline-preset.d.ts +17 -0
  38. package/dist/domains/pipeline-preset.js +225 -0
  39. package/dist/domains/pipeline.d.ts +29 -0
  40. package/dist/domains/pipeline.js +423 -0
  41. package/dist/domains/published.d.ts +18 -0
  42. package/dist/domains/published.js +164 -0
  43. package/dist/domains/render-preset.d.ts +4 -0
  44. package/dist/domains/render-preset.js +1 -0
  45. package/dist/domains/revs.d.ts +13 -0
  46. package/dist/domains/revs.js +125 -0
  47. package/dist/domains/search.d.ts +3 -0
  48. package/dist/domains/search.js +62 -13
  49. package/dist/domains/settings.js +796 -339
  50. package/dist/domains/storyboard.d.ts +14 -0
  51. package/dist/domains/storyboard.js +125 -0
  52. package/dist/domains/user.d.ts +14 -0
  53. package/dist/domains/user.js +141 -0
  54. package/dist/index.d.ts +88 -5
  55. package/dist/index.js +151 -0
  56. package/dist/rpc.d.ts +8 -13
  57. package/dist/rpc.js +9 -9
  58. package/dist/schema.json +1701 -1565
  59. package/package.json +1 -1
@@ -0,0 +1,1591 @@
1
+ import __typia from "typia";
2
+ export const isSearch = input => {
3
+ const $io0 = input => "simple" === input.type && (undefined === input.user || "string" === typeof input.user) && (undefined === input.mode || "fuzzy" === input.mode || "exact" === input.mode || "similarity" === input.mode) && (undefined === input.query || "string" === typeof input.query) && (undefined === input.count || "number" === typeof input.count) && (undefined === input.deleted || "boolean" === typeof input.deleted) && (undefined === input.hidden || "boolean" === typeof input.hidden) && (undefined === input.sortBy || "string" === typeof input.sortBy) && (undefined === input.refreshInterval || "number" === typeof input.refreshInterval) && (undefined === input.highlight || "object" === typeof input.highlight && null !== input.highlight && $io1(input.highlight));
4
+ const $io1 = input => "object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) && $io2(input.fields);
5
+ const $io2 = input => Object.keys(input).every(key => {
6
+ const value = input[key];
7
+ if (undefined === value)
8
+ return true;
9
+ return true;
10
+ });
11
+ return "object" === typeof input && null !== input && $io0(input);
12
+ };
13
+ export const assertSearch = (input, errorFactory) => {
14
+ const __is = input => {
15
+ const $io0 = input => "simple" === input.type && (undefined === input.user || "string" === typeof input.user) && (undefined === input.mode || "fuzzy" === input.mode || "exact" === input.mode || "similarity" === input.mode) && (undefined === input.query || "string" === typeof input.query) && (undefined === input.count || "number" === typeof input.count) && (undefined === input.deleted || "boolean" === typeof input.deleted) && (undefined === input.hidden || "boolean" === typeof input.hidden) && (undefined === input.sortBy || "string" === typeof input.sortBy) && (undefined === input.refreshInterval || "number" === typeof input.refreshInterval) && (undefined === input.highlight || "object" === typeof input.highlight && null !== input.highlight && $io1(input.highlight));
16
+ const $io1 = input => "object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) && $io2(input.fields);
17
+ const $io2 = input => Object.keys(input).every(key => {
18
+ const value = input[key];
19
+ if (undefined === value)
20
+ return true;
21
+ return true;
22
+ });
23
+ return "object" === typeof input && null !== input && $io0(input);
24
+ };
25
+ if (false === __is(input))
26
+ ((input, _path, _exceptionable = true) => {
27
+ const $guard = __typia.createAssert.guard;
28
+ const $join = __typia.createAssert.join;
29
+ const $ao0 = (input, _path, _exceptionable = true) => ("simple" === input.type || $guard(_exceptionable, {
30
+ path: _path + ".type",
31
+ expected: "\"simple\"",
32
+ value: input.type
33
+ }, errorFactory)) && (undefined === input.user || "string" === typeof input.user || $guard(_exceptionable, {
34
+ path: _path + ".user",
35
+ expected: "(string | undefined)",
36
+ value: input.user
37
+ }, errorFactory)) && (undefined === input.mode || "fuzzy" === input.mode || "exact" === input.mode || "similarity" === input.mode || $guard(_exceptionable, {
38
+ path: _path + ".mode",
39
+ expected: "(\"exact\" | \"fuzzy\" | \"similarity\" | undefined)",
40
+ value: input.mode
41
+ }, errorFactory)) && (undefined === input.query || "string" === typeof input.query || $guard(_exceptionable, {
42
+ path: _path + ".query",
43
+ expected: "(string | undefined)",
44
+ value: input.query
45
+ }, errorFactory)) && (undefined === input.count || "number" === typeof input.count || $guard(_exceptionable, {
46
+ path: _path + ".count",
47
+ expected: "(number | undefined)",
48
+ value: input.count
49
+ }, errorFactory)) && (undefined === input.deleted || "boolean" === typeof input.deleted || $guard(_exceptionable, {
50
+ path: _path + ".deleted",
51
+ expected: "(boolean | undefined)",
52
+ value: input.deleted
53
+ }, errorFactory)) && (undefined === input.hidden || "boolean" === typeof input.hidden || $guard(_exceptionable, {
54
+ path: _path + ".hidden",
55
+ expected: "(boolean | undefined)",
56
+ value: input.hidden
57
+ }, errorFactory)) && (undefined === input.sortBy || "string" === typeof input.sortBy || $guard(_exceptionable, {
58
+ path: _path + ".sortBy",
59
+ expected: "(string | undefined)",
60
+ value: input.sortBy
61
+ }, errorFactory)) && (undefined === input.refreshInterval || "number" === typeof input.refreshInterval || $guard(_exceptionable, {
62
+ path: _path + ".refreshInterval",
63
+ expected: "(number | undefined)",
64
+ value: input.refreshInterval
65
+ }, errorFactory)) && (undefined === input.highlight || ("object" === typeof input.highlight && null !== input.highlight || $guard(_exceptionable, {
66
+ path: _path + ".highlight",
67
+ expected: "(SearchHighlightOption | undefined)",
68
+ value: input.highlight
69
+ }, errorFactory)) && $ao1(input.highlight, _path + ".highlight", true && _exceptionable) || $guard(_exceptionable, {
70
+ path: _path + ".highlight",
71
+ expected: "(SearchHighlightOption | undefined)",
72
+ value: input.highlight
73
+ }, errorFactory));
74
+ const $ao1 = (input, _path, _exceptionable = true) => ("object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) || $guard(_exceptionable, {
75
+ path: _path + ".fields",
76
+ expected: "__type",
77
+ value: input.fields
78
+ }, errorFactory)) && $ao2(input.fields, _path + ".fields", true && _exceptionable) || $guard(_exceptionable, {
79
+ path: _path + ".fields",
80
+ expected: "__type",
81
+ value: input.fields
82
+ }, errorFactory);
83
+ const $ao2 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
84
+ const value = input[key];
85
+ if (undefined === value)
86
+ return true;
87
+ return true;
88
+ });
89
+ return ("object" === typeof input && null !== input || $guard(true, {
90
+ path: _path + "",
91
+ expected: "SimpleSearch",
92
+ value: input
93
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
94
+ path: _path + "",
95
+ expected: "SimpleSearch",
96
+ value: input
97
+ }, errorFactory);
98
+ })(input, "$input", true);
99
+ return input;
100
+ };
101
+ export const randomSearch = generator => {
102
+ const $generator = __typia.createRandom.generator;
103
+ const $pick = __typia.createRandom.pick;
104
+ const $ro0 = (_recursive = false, _depth = 0) => ({
105
+ type: "simple",
106
+ user: $pick([
107
+ () => undefined,
108
+ () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
109
+ ])(),
110
+ mode: $pick([
111
+ () => undefined,
112
+ () => "fuzzy",
113
+ () => "exact",
114
+ () => "similarity"
115
+ ])(),
116
+ query: $pick([
117
+ () => undefined,
118
+ () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
119
+ ])(),
120
+ count: $pick([
121
+ () => undefined,
122
+ () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
123
+ ])(),
124
+ deleted: $pick([
125
+ () => undefined,
126
+ () => (generator?.boolean ?? $generator.boolean)()
127
+ ])(),
128
+ hidden: $pick([
129
+ () => undefined,
130
+ () => (generator?.boolean ?? $generator.boolean)()
131
+ ])(),
132
+ sortBy: $pick([
133
+ () => undefined,
134
+ () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
135
+ ])(),
136
+ refreshInterval: $pick([
137
+ () => undefined,
138
+ () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
139
+ ])(),
140
+ highlight: $pick([
141
+ () => undefined,
142
+ () => $ro1(_recursive, _recursive ? 1 + _depth : _depth)
143
+ ])()
144
+ });
145
+ const $ro1 = (_recursive = false, _depth = 0) => ({
146
+ fields: $ro2(_recursive, _recursive ? 1 + _depth : _depth)
147
+ });
148
+ const $ro2 = (_recursive = false, _depth = 0) => {
149
+ const output = {};
150
+ (generator?.array ?? $generator.array)(() => output[(generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()] = "any type used...", (generator?.integer ?? $generator.integer)(0, 3));
151
+ return output;
152
+ };
153
+ return $ro0();
154
+ };
155
+ export const assertGuardSearch = (input, errorFactory) => {
156
+ const __is = input => {
157
+ const $io0 = input => "simple" === input.type && (undefined === input.user || "string" === typeof input.user) && (undefined === input.mode || "fuzzy" === input.mode || "exact" === input.mode || "similarity" === input.mode) && (undefined === input.query || "string" === typeof input.query) && (undefined === input.count || "number" === typeof input.count) && (undefined === input.deleted || "boolean" === typeof input.deleted) && (undefined === input.hidden || "boolean" === typeof input.hidden) && (undefined === input.sortBy || "string" === typeof input.sortBy) && (undefined === input.refreshInterval || "number" === typeof input.refreshInterval) && (undefined === input.highlight || "object" === typeof input.highlight && null !== input.highlight && $io1(input.highlight));
158
+ const $io1 = input => "object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) && $io2(input.fields);
159
+ const $io2 = input => Object.keys(input).every(key => {
160
+ const value = input[key];
161
+ if (undefined === value)
162
+ return true;
163
+ return true;
164
+ });
165
+ return "object" === typeof input && null !== input && $io0(input);
166
+ };
167
+ if (false === __is(input))
168
+ ((input, _path, _exceptionable = true) => {
169
+ const $guard = __typia.createAssertGuard.guard;
170
+ const $join = __typia.createAssertGuard.join;
171
+ const $ao0 = (input, _path, _exceptionable = true) => ("simple" === input.type || $guard(_exceptionable, {
172
+ path: _path + ".type",
173
+ expected: "\"simple\"",
174
+ value: input.type
175
+ }, errorFactory)) && (undefined === input.user || "string" === typeof input.user || $guard(_exceptionable, {
176
+ path: _path + ".user",
177
+ expected: "(string | undefined)",
178
+ value: input.user
179
+ }, errorFactory)) && (undefined === input.mode || "fuzzy" === input.mode || "exact" === input.mode || "similarity" === input.mode || $guard(_exceptionable, {
180
+ path: _path + ".mode",
181
+ expected: "(\"exact\" | \"fuzzy\" | \"similarity\" | undefined)",
182
+ value: input.mode
183
+ }, errorFactory)) && (undefined === input.query || "string" === typeof input.query || $guard(_exceptionable, {
184
+ path: _path + ".query",
185
+ expected: "(string | undefined)",
186
+ value: input.query
187
+ }, errorFactory)) && (undefined === input.count || "number" === typeof input.count || $guard(_exceptionable, {
188
+ path: _path + ".count",
189
+ expected: "(number | undefined)",
190
+ value: input.count
191
+ }, errorFactory)) && (undefined === input.deleted || "boolean" === typeof input.deleted || $guard(_exceptionable, {
192
+ path: _path + ".deleted",
193
+ expected: "(boolean | undefined)",
194
+ value: input.deleted
195
+ }, errorFactory)) && (undefined === input.hidden || "boolean" === typeof input.hidden || $guard(_exceptionable, {
196
+ path: _path + ".hidden",
197
+ expected: "(boolean | undefined)",
198
+ value: input.hidden
199
+ }, errorFactory)) && (undefined === input.sortBy || "string" === typeof input.sortBy || $guard(_exceptionable, {
200
+ path: _path + ".sortBy",
201
+ expected: "(string | undefined)",
202
+ value: input.sortBy
203
+ }, errorFactory)) && (undefined === input.refreshInterval || "number" === typeof input.refreshInterval || $guard(_exceptionable, {
204
+ path: _path + ".refreshInterval",
205
+ expected: "(number | undefined)",
206
+ value: input.refreshInterval
207
+ }, errorFactory)) && (undefined === input.highlight || ("object" === typeof input.highlight && null !== input.highlight || $guard(_exceptionable, {
208
+ path: _path + ".highlight",
209
+ expected: "(SearchHighlightOption | undefined)",
210
+ value: input.highlight
211
+ }, errorFactory)) && $ao1(input.highlight, _path + ".highlight", true && _exceptionable) || $guard(_exceptionable, {
212
+ path: _path + ".highlight",
213
+ expected: "(SearchHighlightOption | undefined)",
214
+ value: input.highlight
215
+ }, errorFactory));
216
+ const $ao1 = (input, _path, _exceptionable = true) => ("object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) || $guard(_exceptionable, {
217
+ path: _path + ".fields",
218
+ expected: "__type",
219
+ value: input.fields
220
+ }, errorFactory)) && $ao2(input.fields, _path + ".fields", true && _exceptionable) || $guard(_exceptionable, {
221
+ path: _path + ".fields",
222
+ expected: "__type",
223
+ value: input.fields
224
+ }, errorFactory);
225
+ const $ao2 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
226
+ const value = input[key];
227
+ if (undefined === value)
228
+ return true;
229
+ return true;
230
+ });
231
+ return ("object" === typeof input && null !== input || $guard(true, {
232
+ path: _path + "",
233
+ expected: "SimpleSearch",
234
+ value: input
235
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
236
+ path: _path + "",
237
+ expected: "SimpleSearch",
238
+ value: input
239
+ }, errorFactory);
240
+ })(input, "$input", true);
241
+ };
242
+ export const stringifySearch = input => {
243
+ const $io1 = input => "object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) && $io2(input.fields);
244
+ const $io2 = input => Object.keys(input).every(key => {
245
+ const value = input[key];
246
+ if (undefined === value)
247
+ return true;
248
+ return true;
249
+ });
250
+ const $string = __typia.json.createStringify.string;
251
+ const $throws = __typia.json.createStringify.throws;
252
+ const $so0 = input => `{${undefined === input.user ? "" : `"user":${undefined !== input.user ? $string(input.user) : undefined},`}${undefined === input.mode ? "" : `"mode":${undefined !== input.mode ? (() => {
253
+ if ("string" === typeof input.mode)
254
+ return $string(input.mode);
255
+ if ("string" === typeof input.mode)
256
+ return "\"" + input.mode + "\"";
257
+ $throws({
258
+ expected: "(\"exact\" | \"fuzzy\" | \"similarity\" | undefined)",
259
+ value: input.mode
260
+ });
261
+ })() : undefined},`}${undefined === input.query ? "" : `"query":${undefined !== input.query ? $string(input.query) : undefined},`}${undefined === input.count ? "" : `"count":${undefined !== input.count ? input.count : undefined},`}${undefined === input.deleted ? "" : `"deleted":${undefined !== input.deleted ? input.deleted : undefined},`}${undefined === input.hidden ? "" : `"hidden":${undefined !== input.hidden ? input.hidden : undefined},`}${undefined === input.sortBy ? "" : `"sortBy":${undefined !== input.sortBy ? $string(input.sortBy) : undefined},`}${undefined === input.refreshInterval ? "" : `"refreshInterval":${undefined !== input.refreshInterval ? input.refreshInterval : undefined},`}${undefined === input.highlight ? "" : `"highlight":${undefined !== input.highlight ? $so1(input.highlight) : undefined},`}"type":${(() => {
262
+ if ("string" === typeof input.type)
263
+ return $string(input.type);
264
+ if ("string" === typeof input.type)
265
+ return "\"" + input.type + "\"";
266
+ $throws({
267
+ expected: "\"simple\"",
268
+ value: input.type
269
+ });
270
+ })()}}`;
271
+ const $so1 = input => `{"fields":${$so2(input.fields)}}`;
272
+ const $so2 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
273
+ return ""; return `${JSON.stringify(key)}:${undefined !== value ? JSON.stringify(value) : undefined}`; }).filter(str => "" !== str).join(",")}}`;
274
+ return $so0(input);
275
+ };
276
+ export const assertStringifySearch = (input, errorFactory) => { const assert = (input, errorFactory) => {
277
+ const __is = input => {
278
+ const $io0 = input => "simple" === input.type && (undefined === input.user || "string" === typeof input.user) && (undefined === input.mode || "fuzzy" === input.mode || "exact" === input.mode || "similarity" === input.mode) && (undefined === input.query || "string" === typeof input.query) && (undefined === input.count || "number" === typeof input.count && !Number.isNaN(input.count)) && (undefined === input.deleted || "boolean" === typeof input.deleted) && (undefined === input.hidden || "boolean" === typeof input.hidden) && (undefined === input.sortBy || "string" === typeof input.sortBy) && (undefined === input.refreshInterval || "number" === typeof input.refreshInterval && !Number.isNaN(input.refreshInterval)) && (undefined === input.highlight || "object" === typeof input.highlight && null !== input.highlight && $io1(input.highlight));
279
+ const $io1 = input => "object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) && $io2(input.fields);
280
+ const $io2 = input => Object.keys(input).every(key => {
281
+ const value = input[key];
282
+ if (undefined === value)
283
+ return true;
284
+ return true;
285
+ });
286
+ return "object" === typeof input && null !== input && $io0(input);
287
+ };
288
+ if (false === __is(input))
289
+ ((input, _path, _exceptionable = true) => {
290
+ const $guard = __typia.json.createAssertStringify.guard;
291
+ const $join = __typia.json.createAssertStringify.join;
292
+ const $ao0 = (input, _path, _exceptionable = true) => ("simple" === input.type || $guard(_exceptionable, {
293
+ path: _path + ".type",
294
+ expected: "\"simple\"",
295
+ value: input.type
296
+ }, errorFactory)) && (undefined === input.user || "string" === typeof input.user || $guard(_exceptionable, {
297
+ path: _path + ".user",
298
+ expected: "(string | undefined)",
299
+ value: input.user
300
+ }, errorFactory)) && (undefined === input.mode || "fuzzy" === input.mode || "exact" === input.mode || "similarity" === input.mode || $guard(_exceptionable, {
301
+ path: _path + ".mode",
302
+ expected: "(\"exact\" | \"fuzzy\" | \"similarity\" | undefined)",
303
+ value: input.mode
304
+ }, errorFactory)) && (undefined === input.query || "string" === typeof input.query || $guard(_exceptionable, {
305
+ path: _path + ".query",
306
+ expected: "(string | undefined)",
307
+ value: input.query
308
+ }, errorFactory)) && (undefined === input.count || "number" === typeof input.count && !Number.isNaN(input.count) || $guard(_exceptionable, {
309
+ path: _path + ".count",
310
+ expected: "(number | undefined)",
311
+ value: input.count
312
+ }, errorFactory)) && (undefined === input.deleted || "boolean" === typeof input.deleted || $guard(_exceptionable, {
313
+ path: _path + ".deleted",
314
+ expected: "(boolean | undefined)",
315
+ value: input.deleted
316
+ }, errorFactory)) && (undefined === input.hidden || "boolean" === typeof input.hidden || $guard(_exceptionable, {
317
+ path: _path + ".hidden",
318
+ expected: "(boolean | undefined)",
319
+ value: input.hidden
320
+ }, errorFactory)) && (undefined === input.sortBy || "string" === typeof input.sortBy || $guard(_exceptionable, {
321
+ path: _path + ".sortBy",
322
+ expected: "(string | undefined)",
323
+ value: input.sortBy
324
+ }, errorFactory)) && (undefined === input.refreshInterval || "number" === typeof input.refreshInterval && !Number.isNaN(input.refreshInterval) || $guard(_exceptionable, {
325
+ path: _path + ".refreshInterval",
326
+ expected: "(number | undefined)",
327
+ value: input.refreshInterval
328
+ }, errorFactory)) && (undefined === input.highlight || ("object" === typeof input.highlight && null !== input.highlight || $guard(_exceptionable, {
329
+ path: _path + ".highlight",
330
+ expected: "(SearchHighlightOption | undefined)",
331
+ value: input.highlight
332
+ }, errorFactory)) && $ao1(input.highlight, _path + ".highlight", true && _exceptionable) || $guard(_exceptionable, {
333
+ path: _path + ".highlight",
334
+ expected: "(SearchHighlightOption | undefined)",
335
+ value: input.highlight
336
+ }, errorFactory));
337
+ const $ao1 = (input, _path, _exceptionable = true) => ("object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) || $guard(_exceptionable, {
338
+ path: _path + ".fields",
339
+ expected: "__type",
340
+ value: input.fields
341
+ }, errorFactory)) && $ao2(input.fields, _path + ".fields", true && _exceptionable) || $guard(_exceptionable, {
342
+ path: _path + ".fields",
343
+ expected: "__type",
344
+ value: input.fields
345
+ }, errorFactory);
346
+ const $ao2 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
347
+ const value = input[key];
348
+ if (undefined === value)
349
+ return true;
350
+ return true;
351
+ });
352
+ return ("object" === typeof input && null !== input || $guard(true, {
353
+ path: _path + "",
354
+ expected: "SimpleSearch",
355
+ value: input
356
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
357
+ path: _path + "",
358
+ expected: "SimpleSearch",
359
+ value: input
360
+ }, errorFactory);
361
+ })(input, "$input", true);
362
+ return input;
363
+ }; const stringify = input => {
364
+ const $io1 = input => "object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) && $io2(input.fields);
365
+ const $io2 = input => Object.keys(input).every(key => {
366
+ const value = input[key];
367
+ if (undefined === value)
368
+ return true;
369
+ return true;
370
+ });
371
+ const $string = __typia.json.createAssertStringify.string;
372
+ const $throws = __typia.json.createAssertStringify.throws;
373
+ const $so0 = input => `{${undefined === input.user ? "" : `"user":${undefined !== input.user ? $string(input.user) : undefined},`}${undefined === input.mode ? "" : `"mode":${undefined !== input.mode ? (() => {
374
+ if ("string" === typeof input.mode)
375
+ return $string(input.mode);
376
+ if ("string" === typeof input.mode)
377
+ return "\"" + input.mode + "\"";
378
+ $throws({
379
+ expected: "(\"exact\" | \"fuzzy\" | \"similarity\" | undefined)",
380
+ value: input.mode
381
+ });
382
+ })() : undefined},`}${undefined === input.query ? "" : `"query":${undefined !== input.query ? $string(input.query) : undefined},`}${undefined === input.count ? "" : `"count":${undefined !== input.count ? input.count : undefined},`}${undefined === input.deleted ? "" : `"deleted":${undefined !== input.deleted ? input.deleted : undefined},`}${undefined === input.hidden ? "" : `"hidden":${undefined !== input.hidden ? input.hidden : undefined},`}${undefined === input.sortBy ? "" : `"sortBy":${undefined !== input.sortBy ? $string(input.sortBy) : undefined},`}${undefined === input.refreshInterval ? "" : `"refreshInterval":${undefined !== input.refreshInterval ? input.refreshInterval : undefined},`}${undefined === input.highlight ? "" : `"highlight":${undefined !== input.highlight ? $so1(input.highlight) : undefined},`}"type":${(() => {
383
+ if ("string" === typeof input.type)
384
+ return $string(input.type);
385
+ if ("string" === typeof input.type)
386
+ return "\"" + input.type + "\"";
387
+ $throws({
388
+ expected: "\"simple\"",
389
+ value: input.type
390
+ });
391
+ })()}}`;
392
+ const $so1 = input => `{"fields":${$so2(input.fields)}}`;
393
+ const $so2 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
394
+ return ""; return `${JSON.stringify(key)}:${undefined !== value ? JSON.stringify(value) : undefined}`; }).filter(str => "" !== str).join(",")}}`;
395
+ return $so0(input);
396
+ }; return stringify(assert(input, errorFactory)); };
397
+ export const isSimpleSearch = input => {
398
+ const $io0 = input => "simple" === input.type && (undefined === input.user || "string" === typeof input.user) && (undefined === input.mode || "fuzzy" === input.mode || "exact" === input.mode || "similarity" === input.mode) && (undefined === input.query || "string" === typeof input.query) && (undefined === input.count || "number" === typeof input.count) && (undefined === input.deleted || "boolean" === typeof input.deleted) && (undefined === input.hidden || "boolean" === typeof input.hidden) && (undefined === input.sortBy || "string" === typeof input.sortBy) && (undefined === input.refreshInterval || "number" === typeof input.refreshInterval) && (undefined === input.highlight || "object" === typeof input.highlight && null !== input.highlight && $io1(input.highlight));
399
+ const $io1 = input => "object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) && $io2(input.fields);
400
+ const $io2 = input => Object.keys(input).every(key => {
401
+ const value = input[key];
402
+ if (undefined === value)
403
+ return true;
404
+ return true;
405
+ });
406
+ return "object" === typeof input && null !== input && $io0(input);
407
+ };
408
+ export const assertSimpleSearch = (input, errorFactory) => {
409
+ const __is = input => {
410
+ const $io0 = input => "simple" === input.type && (undefined === input.user || "string" === typeof input.user) && (undefined === input.mode || "fuzzy" === input.mode || "exact" === input.mode || "similarity" === input.mode) && (undefined === input.query || "string" === typeof input.query) && (undefined === input.count || "number" === typeof input.count) && (undefined === input.deleted || "boolean" === typeof input.deleted) && (undefined === input.hidden || "boolean" === typeof input.hidden) && (undefined === input.sortBy || "string" === typeof input.sortBy) && (undefined === input.refreshInterval || "number" === typeof input.refreshInterval) && (undefined === input.highlight || "object" === typeof input.highlight && null !== input.highlight && $io1(input.highlight));
411
+ const $io1 = input => "object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) && $io2(input.fields);
412
+ const $io2 = input => Object.keys(input).every(key => {
413
+ const value = input[key];
414
+ if (undefined === value)
415
+ return true;
416
+ return true;
417
+ });
418
+ return "object" === typeof input && null !== input && $io0(input);
419
+ };
420
+ if (false === __is(input))
421
+ ((input, _path, _exceptionable = true) => {
422
+ const $guard = __typia.createAssert.guard;
423
+ const $join = __typia.createAssert.join;
424
+ const $ao0 = (input, _path, _exceptionable = true) => ("simple" === input.type || $guard(_exceptionable, {
425
+ path: _path + ".type",
426
+ expected: "\"simple\"",
427
+ value: input.type
428
+ }, errorFactory)) && (undefined === input.user || "string" === typeof input.user || $guard(_exceptionable, {
429
+ path: _path + ".user",
430
+ expected: "(string | undefined)",
431
+ value: input.user
432
+ }, errorFactory)) && (undefined === input.mode || "fuzzy" === input.mode || "exact" === input.mode || "similarity" === input.mode || $guard(_exceptionable, {
433
+ path: _path + ".mode",
434
+ expected: "(\"exact\" | \"fuzzy\" | \"similarity\" | undefined)",
435
+ value: input.mode
436
+ }, errorFactory)) && (undefined === input.query || "string" === typeof input.query || $guard(_exceptionable, {
437
+ path: _path + ".query",
438
+ expected: "(string | undefined)",
439
+ value: input.query
440
+ }, errorFactory)) && (undefined === input.count || "number" === typeof input.count || $guard(_exceptionable, {
441
+ path: _path + ".count",
442
+ expected: "(number | undefined)",
443
+ value: input.count
444
+ }, errorFactory)) && (undefined === input.deleted || "boolean" === typeof input.deleted || $guard(_exceptionable, {
445
+ path: _path + ".deleted",
446
+ expected: "(boolean | undefined)",
447
+ value: input.deleted
448
+ }, errorFactory)) && (undefined === input.hidden || "boolean" === typeof input.hidden || $guard(_exceptionable, {
449
+ path: _path + ".hidden",
450
+ expected: "(boolean | undefined)",
451
+ value: input.hidden
452
+ }, errorFactory)) && (undefined === input.sortBy || "string" === typeof input.sortBy || $guard(_exceptionable, {
453
+ path: _path + ".sortBy",
454
+ expected: "(string | undefined)",
455
+ value: input.sortBy
456
+ }, errorFactory)) && (undefined === input.refreshInterval || "number" === typeof input.refreshInterval || $guard(_exceptionable, {
457
+ path: _path + ".refreshInterval",
458
+ expected: "(number | undefined)",
459
+ value: input.refreshInterval
460
+ }, errorFactory)) && (undefined === input.highlight || ("object" === typeof input.highlight && null !== input.highlight || $guard(_exceptionable, {
461
+ path: _path + ".highlight",
462
+ expected: "(SearchHighlightOption | undefined)",
463
+ value: input.highlight
464
+ }, errorFactory)) && $ao1(input.highlight, _path + ".highlight", true && _exceptionable) || $guard(_exceptionable, {
465
+ path: _path + ".highlight",
466
+ expected: "(SearchHighlightOption | undefined)",
467
+ value: input.highlight
468
+ }, errorFactory));
469
+ const $ao1 = (input, _path, _exceptionable = true) => ("object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) || $guard(_exceptionable, {
470
+ path: _path + ".fields",
471
+ expected: "__type",
472
+ value: input.fields
473
+ }, errorFactory)) && $ao2(input.fields, _path + ".fields", true && _exceptionable) || $guard(_exceptionable, {
474
+ path: _path + ".fields",
475
+ expected: "__type",
476
+ value: input.fields
477
+ }, errorFactory);
478
+ const $ao2 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
479
+ const value = input[key];
480
+ if (undefined === value)
481
+ return true;
482
+ return true;
483
+ });
484
+ return ("object" === typeof input && null !== input || $guard(true, {
485
+ path: _path + "",
486
+ expected: "SimpleSearch",
487
+ value: input
488
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
489
+ path: _path + "",
490
+ expected: "SimpleSearch",
491
+ value: input
492
+ }, errorFactory);
493
+ })(input, "$input", true);
494
+ return input;
495
+ };
496
+ export const randomSimpleSearch = generator => {
497
+ const $generator = __typia.createRandom.generator;
498
+ const $pick = __typia.createRandom.pick;
499
+ const $ro0 = (_recursive = false, _depth = 0) => ({
500
+ type: "simple",
501
+ user: $pick([
502
+ () => undefined,
503
+ () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
504
+ ])(),
505
+ mode: $pick([
506
+ () => undefined,
507
+ () => "fuzzy",
508
+ () => "exact",
509
+ () => "similarity"
510
+ ])(),
511
+ query: $pick([
512
+ () => undefined,
513
+ () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
514
+ ])(),
515
+ count: $pick([
516
+ () => undefined,
517
+ () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
518
+ ])(),
519
+ deleted: $pick([
520
+ () => undefined,
521
+ () => (generator?.boolean ?? $generator.boolean)()
522
+ ])(),
523
+ hidden: $pick([
524
+ () => undefined,
525
+ () => (generator?.boolean ?? $generator.boolean)()
526
+ ])(),
527
+ sortBy: $pick([
528
+ () => undefined,
529
+ () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
530
+ ])(),
531
+ refreshInterval: $pick([
532
+ () => undefined,
533
+ () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
534
+ ])(),
535
+ highlight: $pick([
536
+ () => undefined,
537
+ () => $ro1(_recursive, _recursive ? 1 + _depth : _depth)
538
+ ])()
539
+ });
540
+ const $ro1 = (_recursive = false, _depth = 0) => ({
541
+ fields: $ro2(_recursive, _recursive ? 1 + _depth : _depth)
542
+ });
543
+ const $ro2 = (_recursive = false, _depth = 0) => {
544
+ const output = {};
545
+ (generator?.array ?? $generator.array)(() => output[(generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()] = "any type used...", (generator?.integer ?? $generator.integer)(0, 3));
546
+ return output;
547
+ };
548
+ return $ro0();
549
+ };
550
+ export const assertGuardSimpleSearch = (input, errorFactory) => {
551
+ const __is = input => {
552
+ const $io0 = input => "simple" === input.type && (undefined === input.user || "string" === typeof input.user) && (undefined === input.mode || "fuzzy" === input.mode || "exact" === input.mode || "similarity" === input.mode) && (undefined === input.query || "string" === typeof input.query) && (undefined === input.count || "number" === typeof input.count) && (undefined === input.deleted || "boolean" === typeof input.deleted) && (undefined === input.hidden || "boolean" === typeof input.hidden) && (undefined === input.sortBy || "string" === typeof input.sortBy) && (undefined === input.refreshInterval || "number" === typeof input.refreshInterval) && (undefined === input.highlight || "object" === typeof input.highlight && null !== input.highlight && $io1(input.highlight));
553
+ const $io1 = input => "object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) && $io2(input.fields);
554
+ const $io2 = input => Object.keys(input).every(key => {
555
+ const value = input[key];
556
+ if (undefined === value)
557
+ return true;
558
+ return true;
559
+ });
560
+ return "object" === typeof input && null !== input && $io0(input);
561
+ };
562
+ if (false === __is(input))
563
+ ((input, _path, _exceptionable = true) => {
564
+ const $guard = __typia.createAssertGuard.guard;
565
+ const $join = __typia.createAssertGuard.join;
566
+ const $ao0 = (input, _path, _exceptionable = true) => ("simple" === input.type || $guard(_exceptionable, {
567
+ path: _path + ".type",
568
+ expected: "\"simple\"",
569
+ value: input.type
570
+ }, errorFactory)) && (undefined === input.user || "string" === typeof input.user || $guard(_exceptionable, {
571
+ path: _path + ".user",
572
+ expected: "(string | undefined)",
573
+ value: input.user
574
+ }, errorFactory)) && (undefined === input.mode || "fuzzy" === input.mode || "exact" === input.mode || "similarity" === input.mode || $guard(_exceptionable, {
575
+ path: _path + ".mode",
576
+ expected: "(\"exact\" | \"fuzzy\" | \"similarity\" | undefined)",
577
+ value: input.mode
578
+ }, errorFactory)) && (undefined === input.query || "string" === typeof input.query || $guard(_exceptionable, {
579
+ path: _path + ".query",
580
+ expected: "(string | undefined)",
581
+ value: input.query
582
+ }, errorFactory)) && (undefined === input.count || "number" === typeof input.count || $guard(_exceptionable, {
583
+ path: _path + ".count",
584
+ expected: "(number | undefined)",
585
+ value: input.count
586
+ }, errorFactory)) && (undefined === input.deleted || "boolean" === typeof input.deleted || $guard(_exceptionable, {
587
+ path: _path + ".deleted",
588
+ expected: "(boolean | undefined)",
589
+ value: input.deleted
590
+ }, errorFactory)) && (undefined === input.hidden || "boolean" === typeof input.hidden || $guard(_exceptionable, {
591
+ path: _path + ".hidden",
592
+ expected: "(boolean | undefined)",
593
+ value: input.hidden
594
+ }, errorFactory)) && (undefined === input.sortBy || "string" === typeof input.sortBy || $guard(_exceptionable, {
595
+ path: _path + ".sortBy",
596
+ expected: "(string | undefined)",
597
+ value: input.sortBy
598
+ }, errorFactory)) && (undefined === input.refreshInterval || "number" === typeof input.refreshInterval || $guard(_exceptionable, {
599
+ path: _path + ".refreshInterval",
600
+ expected: "(number | undefined)",
601
+ value: input.refreshInterval
602
+ }, errorFactory)) && (undefined === input.highlight || ("object" === typeof input.highlight && null !== input.highlight || $guard(_exceptionable, {
603
+ path: _path + ".highlight",
604
+ expected: "(SearchHighlightOption | undefined)",
605
+ value: input.highlight
606
+ }, errorFactory)) && $ao1(input.highlight, _path + ".highlight", true && _exceptionable) || $guard(_exceptionable, {
607
+ path: _path + ".highlight",
608
+ expected: "(SearchHighlightOption | undefined)",
609
+ value: input.highlight
610
+ }, errorFactory));
611
+ const $ao1 = (input, _path, _exceptionable = true) => ("object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) || $guard(_exceptionable, {
612
+ path: _path + ".fields",
613
+ expected: "__type",
614
+ value: input.fields
615
+ }, errorFactory)) && $ao2(input.fields, _path + ".fields", true && _exceptionable) || $guard(_exceptionable, {
616
+ path: _path + ".fields",
617
+ expected: "__type",
618
+ value: input.fields
619
+ }, errorFactory);
620
+ const $ao2 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
621
+ const value = input[key];
622
+ if (undefined === value)
623
+ return true;
624
+ return true;
625
+ });
626
+ return ("object" === typeof input && null !== input || $guard(true, {
627
+ path: _path + "",
628
+ expected: "SimpleSearch",
629
+ value: input
630
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
631
+ path: _path + "",
632
+ expected: "SimpleSearch",
633
+ value: input
634
+ }, errorFactory);
635
+ })(input, "$input", true);
636
+ };
637
+ export const stringifySimpleSearch = input => {
638
+ const $io1 = input => "object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) && $io2(input.fields);
639
+ const $io2 = input => Object.keys(input).every(key => {
640
+ const value = input[key];
641
+ if (undefined === value)
642
+ return true;
643
+ return true;
644
+ });
645
+ const $string = __typia.json.createStringify.string;
646
+ const $throws = __typia.json.createStringify.throws;
647
+ const $so0 = input => `{${undefined === input.user ? "" : `"user":${undefined !== input.user ? $string(input.user) : undefined},`}${undefined === input.mode ? "" : `"mode":${undefined !== input.mode ? (() => {
648
+ if ("string" === typeof input.mode)
649
+ return $string(input.mode);
650
+ if ("string" === typeof input.mode)
651
+ return "\"" + input.mode + "\"";
652
+ $throws({
653
+ expected: "(\"exact\" | \"fuzzy\" | \"similarity\" | undefined)",
654
+ value: input.mode
655
+ });
656
+ })() : undefined},`}${undefined === input.query ? "" : `"query":${undefined !== input.query ? $string(input.query) : undefined},`}${undefined === input.count ? "" : `"count":${undefined !== input.count ? input.count : undefined},`}${undefined === input.deleted ? "" : `"deleted":${undefined !== input.deleted ? input.deleted : undefined},`}${undefined === input.hidden ? "" : `"hidden":${undefined !== input.hidden ? input.hidden : undefined},`}${undefined === input.sortBy ? "" : `"sortBy":${undefined !== input.sortBy ? $string(input.sortBy) : undefined},`}${undefined === input.refreshInterval ? "" : `"refreshInterval":${undefined !== input.refreshInterval ? input.refreshInterval : undefined},`}${undefined === input.highlight ? "" : `"highlight":${undefined !== input.highlight ? $so1(input.highlight) : undefined},`}"type":${(() => {
657
+ if ("string" === typeof input.type)
658
+ return $string(input.type);
659
+ if ("string" === typeof input.type)
660
+ return "\"" + input.type + "\"";
661
+ $throws({
662
+ expected: "\"simple\"",
663
+ value: input.type
664
+ });
665
+ })()}}`;
666
+ const $so1 = input => `{"fields":${$so2(input.fields)}}`;
667
+ const $so2 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
668
+ return ""; return `${JSON.stringify(key)}:${undefined !== value ? JSON.stringify(value) : undefined}`; }).filter(str => "" !== str).join(",")}}`;
669
+ return $so0(input);
670
+ };
671
+ export const assertStringifySimpleSearch = (input, errorFactory) => { const assert = (input, errorFactory) => {
672
+ const __is = input => {
673
+ const $io0 = input => "simple" === input.type && (undefined === input.user || "string" === typeof input.user) && (undefined === input.mode || "fuzzy" === input.mode || "exact" === input.mode || "similarity" === input.mode) && (undefined === input.query || "string" === typeof input.query) && (undefined === input.count || "number" === typeof input.count && !Number.isNaN(input.count)) && (undefined === input.deleted || "boolean" === typeof input.deleted) && (undefined === input.hidden || "boolean" === typeof input.hidden) && (undefined === input.sortBy || "string" === typeof input.sortBy) && (undefined === input.refreshInterval || "number" === typeof input.refreshInterval && !Number.isNaN(input.refreshInterval)) && (undefined === input.highlight || "object" === typeof input.highlight && null !== input.highlight && $io1(input.highlight));
674
+ const $io1 = input => "object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) && $io2(input.fields);
675
+ const $io2 = input => Object.keys(input).every(key => {
676
+ const value = input[key];
677
+ if (undefined === value)
678
+ return true;
679
+ return true;
680
+ });
681
+ return "object" === typeof input && null !== input && $io0(input);
682
+ };
683
+ if (false === __is(input))
684
+ ((input, _path, _exceptionable = true) => {
685
+ const $guard = __typia.json.createAssertStringify.guard;
686
+ const $join = __typia.json.createAssertStringify.join;
687
+ const $ao0 = (input, _path, _exceptionable = true) => ("simple" === input.type || $guard(_exceptionable, {
688
+ path: _path + ".type",
689
+ expected: "\"simple\"",
690
+ value: input.type
691
+ }, errorFactory)) && (undefined === input.user || "string" === typeof input.user || $guard(_exceptionable, {
692
+ path: _path + ".user",
693
+ expected: "(string | undefined)",
694
+ value: input.user
695
+ }, errorFactory)) && (undefined === input.mode || "fuzzy" === input.mode || "exact" === input.mode || "similarity" === input.mode || $guard(_exceptionable, {
696
+ path: _path + ".mode",
697
+ expected: "(\"exact\" | \"fuzzy\" | \"similarity\" | undefined)",
698
+ value: input.mode
699
+ }, errorFactory)) && (undefined === input.query || "string" === typeof input.query || $guard(_exceptionable, {
700
+ path: _path + ".query",
701
+ expected: "(string | undefined)",
702
+ value: input.query
703
+ }, errorFactory)) && (undefined === input.count || "number" === typeof input.count && !Number.isNaN(input.count) || $guard(_exceptionable, {
704
+ path: _path + ".count",
705
+ expected: "(number | undefined)",
706
+ value: input.count
707
+ }, errorFactory)) && (undefined === input.deleted || "boolean" === typeof input.deleted || $guard(_exceptionable, {
708
+ path: _path + ".deleted",
709
+ expected: "(boolean | undefined)",
710
+ value: input.deleted
711
+ }, errorFactory)) && (undefined === input.hidden || "boolean" === typeof input.hidden || $guard(_exceptionable, {
712
+ path: _path + ".hidden",
713
+ expected: "(boolean | undefined)",
714
+ value: input.hidden
715
+ }, errorFactory)) && (undefined === input.sortBy || "string" === typeof input.sortBy || $guard(_exceptionable, {
716
+ path: _path + ".sortBy",
717
+ expected: "(string | undefined)",
718
+ value: input.sortBy
719
+ }, errorFactory)) && (undefined === input.refreshInterval || "number" === typeof input.refreshInterval && !Number.isNaN(input.refreshInterval) || $guard(_exceptionable, {
720
+ path: _path + ".refreshInterval",
721
+ expected: "(number | undefined)",
722
+ value: input.refreshInterval
723
+ }, errorFactory)) && (undefined === input.highlight || ("object" === typeof input.highlight && null !== input.highlight || $guard(_exceptionable, {
724
+ path: _path + ".highlight",
725
+ expected: "(SearchHighlightOption | undefined)",
726
+ value: input.highlight
727
+ }, errorFactory)) && $ao1(input.highlight, _path + ".highlight", true && _exceptionable) || $guard(_exceptionable, {
728
+ path: _path + ".highlight",
729
+ expected: "(SearchHighlightOption | undefined)",
730
+ value: input.highlight
731
+ }, errorFactory));
732
+ const $ao1 = (input, _path, _exceptionable = true) => ("object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) || $guard(_exceptionable, {
733
+ path: _path + ".fields",
734
+ expected: "__type",
735
+ value: input.fields
736
+ }, errorFactory)) && $ao2(input.fields, _path + ".fields", true && _exceptionable) || $guard(_exceptionable, {
737
+ path: _path + ".fields",
738
+ expected: "__type",
739
+ value: input.fields
740
+ }, errorFactory);
741
+ const $ao2 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
742
+ const value = input[key];
743
+ if (undefined === value)
744
+ return true;
745
+ return true;
746
+ });
747
+ return ("object" === typeof input && null !== input || $guard(true, {
748
+ path: _path + "",
749
+ expected: "SimpleSearch",
750
+ value: input
751
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
752
+ path: _path + "",
753
+ expected: "SimpleSearch",
754
+ value: input
755
+ }, errorFactory);
756
+ })(input, "$input", true);
757
+ return input;
758
+ }; const stringify = input => {
759
+ const $io1 = input => "object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) && $io2(input.fields);
760
+ const $io2 = input => Object.keys(input).every(key => {
761
+ const value = input[key];
762
+ if (undefined === value)
763
+ return true;
764
+ return true;
765
+ });
766
+ const $string = __typia.json.createAssertStringify.string;
767
+ const $throws = __typia.json.createAssertStringify.throws;
768
+ const $so0 = input => `{${undefined === input.user ? "" : `"user":${undefined !== input.user ? $string(input.user) : undefined},`}${undefined === input.mode ? "" : `"mode":${undefined !== input.mode ? (() => {
769
+ if ("string" === typeof input.mode)
770
+ return $string(input.mode);
771
+ if ("string" === typeof input.mode)
772
+ return "\"" + input.mode + "\"";
773
+ $throws({
774
+ expected: "(\"exact\" | \"fuzzy\" | \"similarity\" | undefined)",
775
+ value: input.mode
776
+ });
777
+ })() : undefined},`}${undefined === input.query ? "" : `"query":${undefined !== input.query ? $string(input.query) : undefined},`}${undefined === input.count ? "" : `"count":${undefined !== input.count ? input.count : undefined},`}${undefined === input.deleted ? "" : `"deleted":${undefined !== input.deleted ? input.deleted : undefined},`}${undefined === input.hidden ? "" : `"hidden":${undefined !== input.hidden ? input.hidden : undefined},`}${undefined === input.sortBy ? "" : `"sortBy":${undefined !== input.sortBy ? $string(input.sortBy) : undefined},`}${undefined === input.refreshInterval ? "" : `"refreshInterval":${undefined !== input.refreshInterval ? input.refreshInterval : undefined},`}${undefined === input.highlight ? "" : `"highlight":${undefined !== input.highlight ? $so1(input.highlight) : undefined},`}"type":${(() => {
778
+ if ("string" === typeof input.type)
779
+ return $string(input.type);
780
+ if ("string" === typeof input.type)
781
+ return "\"" + input.type + "\"";
782
+ $throws({
783
+ expected: "\"simple\"",
784
+ value: input.type
785
+ });
786
+ })()}}`;
787
+ const $so1 = input => `{"fields":${$so2(input.fields)}}`;
788
+ const $so2 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
789
+ return ""; return `${JSON.stringify(key)}:${undefined !== value ? JSON.stringify(value) : undefined}`; }).filter(str => "" !== str).join(",")}}`;
790
+ return $so0(input);
791
+ }; return stringify(assert(input, errorFactory)); };
792
+ export const isConditionalSearch = input => {
793
+ const $io0 = input => "conditional" === input.type && (undefined === input.user || "string" === typeof input.user) && (undefined === input.searchIds || Array.isArray(input.searchIds) && input.searchIds.every(elem => "string" === typeof elem)) && (undefined === input.searches || Array.isArray(input.searches) && input.searches.every(elem => "string" === typeof elem)) && (undefined === input.mode || "fuzzy" === input.mode || "exact" === input.mode || "similarity" === input.mode) && (undefined === input.query || "string" === typeof input.query) && (undefined === input.sort || "string" === typeof input.sort) && (undefined === input.hidden || "boolean" === typeof input.hidden) && (undefined === input.deleted || "boolean" === typeof input.deleted) && (undefined === input.count || "number" === typeof input.count) && (undefined === input.refreshInterval || "number" === typeof input.refreshInterval) && (undefined === input.highlight || "object" === typeof input.highlight && null !== input.highlight && $io1(input.highlight)) && (undefined === input.timeField || "string" === typeof input.timeField) && (undefined === input.startTime || "string" === typeof input.startTime) && (undefined === input.endTime || "string" === typeof input.endTime) && (undefined === input.geoField || "string" === typeof input.geoField) && (undefined === input.geoBounds || "object" === typeof input.geoBounds && null !== input.geoBounds && $io3(input.geoBounds));
794
+ const $io1 = input => "object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) && $io2(input.fields);
795
+ const $io2 = input => Object.keys(input).every(key => {
796
+ const value = input[key];
797
+ if (undefined === value)
798
+ return true;
799
+ return true;
800
+ });
801
+ const $io3 = input => "number" === typeof input.x1 && "number" === typeof input.y1 && "number" === typeof input.x2 && "number" === typeof input.y2;
802
+ return "object" === typeof input && null !== input && $io0(input);
803
+ };
804
+ export const assertConditionalSearch = (input, errorFactory) => {
805
+ const __is = input => {
806
+ const $io0 = input => "conditional" === input.type && (undefined === input.user || "string" === typeof input.user) && (undefined === input.searchIds || Array.isArray(input.searchIds) && input.searchIds.every(elem => "string" === typeof elem)) && (undefined === input.searches || Array.isArray(input.searches) && input.searches.every(elem => "string" === typeof elem)) && (undefined === input.mode || "fuzzy" === input.mode || "exact" === input.mode || "similarity" === input.mode) && (undefined === input.query || "string" === typeof input.query) && (undefined === input.sort || "string" === typeof input.sort) && (undefined === input.hidden || "boolean" === typeof input.hidden) && (undefined === input.deleted || "boolean" === typeof input.deleted) && (undefined === input.count || "number" === typeof input.count) && (undefined === input.refreshInterval || "number" === typeof input.refreshInterval) && (undefined === input.highlight || "object" === typeof input.highlight && null !== input.highlight && $io1(input.highlight)) && (undefined === input.timeField || "string" === typeof input.timeField) && (undefined === input.startTime || "string" === typeof input.startTime) && (undefined === input.endTime || "string" === typeof input.endTime) && (undefined === input.geoField || "string" === typeof input.geoField) && (undefined === input.geoBounds || "object" === typeof input.geoBounds && null !== input.geoBounds && $io3(input.geoBounds));
807
+ const $io1 = input => "object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) && $io2(input.fields);
808
+ const $io2 = input => Object.keys(input).every(key => {
809
+ const value = input[key];
810
+ if (undefined === value)
811
+ return true;
812
+ return true;
813
+ });
814
+ const $io3 = input => "number" === typeof input.x1 && "number" === typeof input.y1 && "number" === typeof input.x2 && "number" === typeof input.y2;
815
+ return "object" === typeof input && null !== input && $io0(input);
816
+ };
817
+ if (false === __is(input))
818
+ ((input, _path, _exceptionable = true) => {
819
+ const $guard = __typia.createAssert.guard;
820
+ const $join = __typia.createAssert.join;
821
+ const $ao0 = (input, _path, _exceptionable = true) => ("conditional" === input.type || $guard(_exceptionable, {
822
+ path: _path + ".type",
823
+ expected: "\"conditional\"",
824
+ value: input.type
825
+ }, errorFactory)) && (undefined === input.user || "string" === typeof input.user || $guard(_exceptionable, {
826
+ path: _path + ".user",
827
+ expected: "(string | undefined)",
828
+ value: input.user
829
+ }, errorFactory)) && (undefined === input.searchIds || (Array.isArray(input.searchIds) || $guard(_exceptionable, {
830
+ path: _path + ".searchIds",
831
+ expected: "(Array<string> | undefined)",
832
+ value: input.searchIds
833
+ }, errorFactory)) && input.searchIds.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
834
+ path: _path + ".searchIds[" + _index1 + "]",
835
+ expected: "string",
836
+ value: elem
837
+ }, errorFactory)) || $guard(_exceptionable, {
838
+ path: _path + ".searchIds",
839
+ expected: "(Array<string> | undefined)",
840
+ value: input.searchIds
841
+ }, errorFactory)) && (undefined === input.searches || (Array.isArray(input.searches) || $guard(_exceptionable, {
842
+ path: _path + ".searches",
843
+ expected: "(Array<string> | undefined)",
844
+ value: input.searches
845
+ }, errorFactory)) && input.searches.every((elem, _index2) => "string" === typeof elem || $guard(_exceptionable, {
846
+ path: _path + ".searches[" + _index2 + "]",
847
+ expected: "string",
848
+ value: elem
849
+ }, errorFactory)) || $guard(_exceptionable, {
850
+ path: _path + ".searches",
851
+ expected: "(Array<string> | undefined)",
852
+ value: input.searches
853
+ }, errorFactory)) && (undefined === input.mode || "fuzzy" === input.mode || "exact" === input.mode || "similarity" === input.mode || $guard(_exceptionable, {
854
+ path: _path + ".mode",
855
+ expected: "(\"exact\" | \"fuzzy\" | \"similarity\" | undefined)",
856
+ value: input.mode
857
+ }, errorFactory)) && (undefined === input.query || "string" === typeof input.query || $guard(_exceptionable, {
858
+ path: _path + ".query",
859
+ expected: "(string | undefined)",
860
+ value: input.query
861
+ }, errorFactory)) && (undefined === input.sort || "string" === typeof input.sort || $guard(_exceptionable, {
862
+ path: _path + ".sort",
863
+ expected: "(string | undefined)",
864
+ value: input.sort
865
+ }, errorFactory)) && (undefined === input.hidden || "boolean" === typeof input.hidden || $guard(_exceptionable, {
866
+ path: _path + ".hidden",
867
+ expected: "(boolean | undefined)",
868
+ value: input.hidden
869
+ }, errorFactory)) && (undefined === input.deleted || "boolean" === typeof input.deleted || $guard(_exceptionable, {
870
+ path: _path + ".deleted",
871
+ expected: "(boolean | undefined)",
872
+ value: input.deleted
873
+ }, errorFactory)) && (undefined === input.count || "number" === typeof input.count || $guard(_exceptionable, {
874
+ path: _path + ".count",
875
+ expected: "(number | undefined)",
876
+ value: input.count
877
+ }, errorFactory)) && (undefined === input.refreshInterval || "number" === typeof input.refreshInterval || $guard(_exceptionable, {
878
+ path: _path + ".refreshInterval",
879
+ expected: "(number | undefined)",
880
+ value: input.refreshInterval
881
+ }, errorFactory)) && (undefined === input.highlight || ("object" === typeof input.highlight && null !== input.highlight || $guard(_exceptionable, {
882
+ path: _path + ".highlight",
883
+ expected: "(SearchHighlightOption | undefined)",
884
+ value: input.highlight
885
+ }, errorFactory)) && $ao1(input.highlight, _path + ".highlight", true && _exceptionable) || $guard(_exceptionable, {
886
+ path: _path + ".highlight",
887
+ expected: "(SearchHighlightOption | undefined)",
888
+ value: input.highlight
889
+ }, errorFactory)) && (undefined === input.timeField || "string" === typeof input.timeField || $guard(_exceptionable, {
890
+ path: _path + ".timeField",
891
+ expected: "(string | undefined)",
892
+ value: input.timeField
893
+ }, errorFactory)) && (undefined === input.startTime || "string" === typeof input.startTime || $guard(_exceptionable, {
894
+ path: _path + ".startTime",
895
+ expected: "(string | undefined)",
896
+ value: input.startTime
897
+ }, errorFactory)) && (undefined === input.endTime || "string" === typeof input.endTime || $guard(_exceptionable, {
898
+ path: _path + ".endTime",
899
+ expected: "(string | undefined)",
900
+ value: input.endTime
901
+ }, errorFactory)) && (undefined === input.geoField || "string" === typeof input.geoField || $guard(_exceptionable, {
902
+ path: _path + ".geoField",
903
+ expected: "(string | undefined)",
904
+ value: input.geoField
905
+ }, errorFactory)) && (undefined === input.geoBounds || ("object" === typeof input.geoBounds && null !== input.geoBounds || $guard(_exceptionable, {
906
+ path: _path + ".geoBounds",
907
+ expected: "(__type.o1 | undefined)",
908
+ value: input.geoBounds
909
+ }, errorFactory)) && $ao3(input.geoBounds, _path + ".geoBounds", true && _exceptionable) || $guard(_exceptionable, {
910
+ path: _path + ".geoBounds",
911
+ expected: "(__type.o1 | undefined)",
912
+ value: input.geoBounds
913
+ }, errorFactory));
914
+ const $ao1 = (input, _path, _exceptionable = true) => ("object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) || $guard(_exceptionable, {
915
+ path: _path + ".fields",
916
+ expected: "__type",
917
+ value: input.fields
918
+ }, errorFactory)) && $ao2(input.fields, _path + ".fields", true && _exceptionable) || $guard(_exceptionable, {
919
+ path: _path + ".fields",
920
+ expected: "__type",
921
+ value: input.fields
922
+ }, errorFactory);
923
+ const $ao2 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
924
+ const value = input[key];
925
+ if (undefined === value)
926
+ return true;
927
+ return true;
928
+ });
929
+ const $ao3 = (input, _path, _exceptionable = true) => ("number" === typeof input.x1 || $guard(_exceptionable, {
930
+ path: _path + ".x1",
931
+ expected: "number",
932
+ value: input.x1
933
+ }, errorFactory)) && ("number" === typeof input.y1 || $guard(_exceptionable, {
934
+ path: _path + ".y1",
935
+ expected: "number",
936
+ value: input.y1
937
+ }, errorFactory)) && ("number" === typeof input.x2 || $guard(_exceptionable, {
938
+ path: _path + ".x2",
939
+ expected: "number",
940
+ value: input.x2
941
+ }, errorFactory)) && ("number" === typeof input.y2 || $guard(_exceptionable, {
942
+ path: _path + ".y2",
943
+ expected: "number",
944
+ value: input.y2
945
+ }, errorFactory));
946
+ return ("object" === typeof input && null !== input || $guard(true, {
947
+ path: _path + "",
948
+ expected: "ConditionalSearch",
949
+ value: input
950
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
951
+ path: _path + "",
952
+ expected: "ConditionalSearch",
953
+ value: input
954
+ }, errorFactory);
955
+ })(input, "$input", true);
956
+ return input;
957
+ };
958
+ export const randomConditionalSearch = generator => {
959
+ const $generator = __typia.createRandom.generator;
960
+ const $pick = __typia.createRandom.pick;
961
+ const $ro0 = (_recursive = false, _depth = 0) => ({
962
+ type: "conditional",
963
+ user: $pick([
964
+ () => undefined,
965
+ () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
966
+ ])(),
967
+ searchIds: $pick([
968
+ () => undefined,
969
+ () => (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)())
970
+ ])(),
971
+ searches: $pick([
972
+ () => undefined,
973
+ () => (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)())
974
+ ])(),
975
+ mode: $pick([
976
+ () => undefined,
977
+ () => "fuzzy",
978
+ () => "exact",
979
+ () => "similarity"
980
+ ])(),
981
+ query: $pick([
982
+ () => undefined,
983
+ () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
984
+ ])(),
985
+ sort: $pick([
986
+ () => undefined,
987
+ () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
988
+ ])(),
989
+ hidden: $pick([
990
+ () => undefined,
991
+ () => (generator?.boolean ?? $generator.boolean)()
992
+ ])(),
993
+ deleted: $pick([
994
+ () => undefined,
995
+ () => (generator?.boolean ?? $generator.boolean)()
996
+ ])(),
997
+ count: $pick([
998
+ () => undefined,
999
+ () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
1000
+ ])(),
1001
+ refreshInterval: $pick([
1002
+ () => undefined,
1003
+ () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
1004
+ ])(),
1005
+ highlight: $pick([
1006
+ () => undefined,
1007
+ () => $ro1(_recursive, _recursive ? 1 + _depth : _depth)
1008
+ ])(),
1009
+ timeField: $pick([
1010
+ () => undefined,
1011
+ () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
1012
+ ])(),
1013
+ startTime: $pick([
1014
+ () => undefined,
1015
+ () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
1016
+ ])(),
1017
+ endTime: $pick([
1018
+ () => undefined,
1019
+ () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
1020
+ ])(),
1021
+ geoField: $pick([
1022
+ () => undefined,
1023
+ () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
1024
+ ])(),
1025
+ geoBounds: $pick([
1026
+ () => undefined,
1027
+ () => $ro3(_recursive, _recursive ? 1 + _depth : _depth)
1028
+ ])()
1029
+ });
1030
+ const $ro1 = (_recursive = false, _depth = 0) => ({
1031
+ fields: $ro2(_recursive, _recursive ? 1 + _depth : _depth)
1032
+ });
1033
+ const $ro2 = (_recursive = false, _depth = 0) => {
1034
+ const output = {};
1035
+ (generator?.array ?? $generator.array)(() => output[(generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()] = "any type used...", (generator?.integer ?? $generator.integer)(0, 3));
1036
+ return output;
1037
+ };
1038
+ const $ro3 = (_recursive = false, _depth = 0) => ({
1039
+ x1: (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100),
1040
+ y1: (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100),
1041
+ x2: (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100),
1042
+ y2: (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
1043
+ });
1044
+ return $ro0();
1045
+ };
1046
+ export const assertGuardConditionalSearch = (input, errorFactory) => {
1047
+ const __is = input => {
1048
+ const $io0 = input => "conditional" === input.type && (undefined === input.user || "string" === typeof input.user) && (undefined === input.searchIds || Array.isArray(input.searchIds) && input.searchIds.every(elem => "string" === typeof elem)) && (undefined === input.searches || Array.isArray(input.searches) && input.searches.every(elem => "string" === typeof elem)) && (undefined === input.mode || "fuzzy" === input.mode || "exact" === input.mode || "similarity" === input.mode) && (undefined === input.query || "string" === typeof input.query) && (undefined === input.sort || "string" === typeof input.sort) && (undefined === input.hidden || "boolean" === typeof input.hidden) && (undefined === input.deleted || "boolean" === typeof input.deleted) && (undefined === input.count || "number" === typeof input.count) && (undefined === input.refreshInterval || "number" === typeof input.refreshInterval) && (undefined === input.highlight || "object" === typeof input.highlight && null !== input.highlight && $io1(input.highlight)) && (undefined === input.timeField || "string" === typeof input.timeField) && (undefined === input.startTime || "string" === typeof input.startTime) && (undefined === input.endTime || "string" === typeof input.endTime) && (undefined === input.geoField || "string" === typeof input.geoField) && (undefined === input.geoBounds || "object" === typeof input.geoBounds && null !== input.geoBounds && $io3(input.geoBounds));
1049
+ const $io1 = input => "object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) && $io2(input.fields);
1050
+ const $io2 = input => Object.keys(input).every(key => {
1051
+ const value = input[key];
1052
+ if (undefined === value)
1053
+ return true;
1054
+ return true;
1055
+ });
1056
+ const $io3 = input => "number" === typeof input.x1 && "number" === typeof input.y1 && "number" === typeof input.x2 && "number" === typeof input.y2;
1057
+ return "object" === typeof input && null !== input && $io0(input);
1058
+ };
1059
+ if (false === __is(input))
1060
+ ((input, _path, _exceptionable = true) => {
1061
+ const $guard = __typia.createAssertGuard.guard;
1062
+ const $join = __typia.createAssertGuard.join;
1063
+ const $ao0 = (input, _path, _exceptionable = true) => ("conditional" === input.type || $guard(_exceptionable, {
1064
+ path: _path + ".type",
1065
+ expected: "\"conditional\"",
1066
+ value: input.type
1067
+ }, errorFactory)) && (undefined === input.user || "string" === typeof input.user || $guard(_exceptionable, {
1068
+ path: _path + ".user",
1069
+ expected: "(string | undefined)",
1070
+ value: input.user
1071
+ }, errorFactory)) && (undefined === input.searchIds || (Array.isArray(input.searchIds) || $guard(_exceptionable, {
1072
+ path: _path + ".searchIds",
1073
+ expected: "(Array<string> | undefined)",
1074
+ value: input.searchIds
1075
+ }, errorFactory)) && input.searchIds.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
1076
+ path: _path + ".searchIds[" + _index1 + "]",
1077
+ expected: "string",
1078
+ value: elem
1079
+ }, errorFactory)) || $guard(_exceptionable, {
1080
+ path: _path + ".searchIds",
1081
+ expected: "(Array<string> | undefined)",
1082
+ value: input.searchIds
1083
+ }, errorFactory)) && (undefined === input.searches || (Array.isArray(input.searches) || $guard(_exceptionable, {
1084
+ path: _path + ".searches",
1085
+ expected: "(Array<string> | undefined)",
1086
+ value: input.searches
1087
+ }, errorFactory)) && input.searches.every((elem, _index2) => "string" === typeof elem || $guard(_exceptionable, {
1088
+ path: _path + ".searches[" + _index2 + "]",
1089
+ expected: "string",
1090
+ value: elem
1091
+ }, errorFactory)) || $guard(_exceptionable, {
1092
+ path: _path + ".searches",
1093
+ expected: "(Array<string> | undefined)",
1094
+ value: input.searches
1095
+ }, errorFactory)) && (undefined === input.mode || "fuzzy" === input.mode || "exact" === input.mode || "similarity" === input.mode || $guard(_exceptionable, {
1096
+ path: _path + ".mode",
1097
+ expected: "(\"exact\" | \"fuzzy\" | \"similarity\" | undefined)",
1098
+ value: input.mode
1099
+ }, errorFactory)) && (undefined === input.query || "string" === typeof input.query || $guard(_exceptionable, {
1100
+ path: _path + ".query",
1101
+ expected: "(string | undefined)",
1102
+ value: input.query
1103
+ }, errorFactory)) && (undefined === input.sort || "string" === typeof input.sort || $guard(_exceptionable, {
1104
+ path: _path + ".sort",
1105
+ expected: "(string | undefined)",
1106
+ value: input.sort
1107
+ }, errorFactory)) && (undefined === input.hidden || "boolean" === typeof input.hidden || $guard(_exceptionable, {
1108
+ path: _path + ".hidden",
1109
+ expected: "(boolean | undefined)",
1110
+ value: input.hidden
1111
+ }, errorFactory)) && (undefined === input.deleted || "boolean" === typeof input.deleted || $guard(_exceptionable, {
1112
+ path: _path + ".deleted",
1113
+ expected: "(boolean | undefined)",
1114
+ value: input.deleted
1115
+ }, errorFactory)) && (undefined === input.count || "number" === typeof input.count || $guard(_exceptionable, {
1116
+ path: _path + ".count",
1117
+ expected: "(number | undefined)",
1118
+ value: input.count
1119
+ }, errorFactory)) && (undefined === input.refreshInterval || "number" === typeof input.refreshInterval || $guard(_exceptionable, {
1120
+ path: _path + ".refreshInterval",
1121
+ expected: "(number | undefined)",
1122
+ value: input.refreshInterval
1123
+ }, errorFactory)) && (undefined === input.highlight || ("object" === typeof input.highlight && null !== input.highlight || $guard(_exceptionable, {
1124
+ path: _path + ".highlight",
1125
+ expected: "(SearchHighlightOption | undefined)",
1126
+ value: input.highlight
1127
+ }, errorFactory)) && $ao1(input.highlight, _path + ".highlight", true && _exceptionable) || $guard(_exceptionable, {
1128
+ path: _path + ".highlight",
1129
+ expected: "(SearchHighlightOption | undefined)",
1130
+ value: input.highlight
1131
+ }, errorFactory)) && (undefined === input.timeField || "string" === typeof input.timeField || $guard(_exceptionable, {
1132
+ path: _path + ".timeField",
1133
+ expected: "(string | undefined)",
1134
+ value: input.timeField
1135
+ }, errorFactory)) && (undefined === input.startTime || "string" === typeof input.startTime || $guard(_exceptionable, {
1136
+ path: _path + ".startTime",
1137
+ expected: "(string | undefined)",
1138
+ value: input.startTime
1139
+ }, errorFactory)) && (undefined === input.endTime || "string" === typeof input.endTime || $guard(_exceptionable, {
1140
+ path: _path + ".endTime",
1141
+ expected: "(string | undefined)",
1142
+ value: input.endTime
1143
+ }, errorFactory)) && (undefined === input.geoField || "string" === typeof input.geoField || $guard(_exceptionable, {
1144
+ path: _path + ".geoField",
1145
+ expected: "(string | undefined)",
1146
+ value: input.geoField
1147
+ }, errorFactory)) && (undefined === input.geoBounds || ("object" === typeof input.geoBounds && null !== input.geoBounds || $guard(_exceptionable, {
1148
+ path: _path + ".geoBounds",
1149
+ expected: "(__type.o1 | undefined)",
1150
+ value: input.geoBounds
1151
+ }, errorFactory)) && $ao3(input.geoBounds, _path + ".geoBounds", true && _exceptionable) || $guard(_exceptionable, {
1152
+ path: _path + ".geoBounds",
1153
+ expected: "(__type.o1 | undefined)",
1154
+ value: input.geoBounds
1155
+ }, errorFactory));
1156
+ const $ao1 = (input, _path, _exceptionable = true) => ("object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) || $guard(_exceptionable, {
1157
+ path: _path + ".fields",
1158
+ expected: "__type",
1159
+ value: input.fields
1160
+ }, errorFactory)) && $ao2(input.fields, _path + ".fields", true && _exceptionable) || $guard(_exceptionable, {
1161
+ path: _path + ".fields",
1162
+ expected: "__type",
1163
+ value: input.fields
1164
+ }, errorFactory);
1165
+ const $ao2 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
1166
+ const value = input[key];
1167
+ if (undefined === value)
1168
+ return true;
1169
+ return true;
1170
+ });
1171
+ const $ao3 = (input, _path, _exceptionable = true) => ("number" === typeof input.x1 || $guard(_exceptionable, {
1172
+ path: _path + ".x1",
1173
+ expected: "number",
1174
+ value: input.x1
1175
+ }, errorFactory)) && ("number" === typeof input.y1 || $guard(_exceptionable, {
1176
+ path: _path + ".y1",
1177
+ expected: "number",
1178
+ value: input.y1
1179
+ }, errorFactory)) && ("number" === typeof input.x2 || $guard(_exceptionable, {
1180
+ path: _path + ".x2",
1181
+ expected: "number",
1182
+ value: input.x2
1183
+ }, errorFactory)) && ("number" === typeof input.y2 || $guard(_exceptionable, {
1184
+ path: _path + ".y2",
1185
+ expected: "number",
1186
+ value: input.y2
1187
+ }, errorFactory));
1188
+ return ("object" === typeof input && null !== input || $guard(true, {
1189
+ path: _path + "",
1190
+ expected: "ConditionalSearch",
1191
+ value: input
1192
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
1193
+ path: _path + "",
1194
+ expected: "ConditionalSearch",
1195
+ value: input
1196
+ }, errorFactory);
1197
+ })(input, "$input", true);
1198
+ };
1199
+ export const stringifyConditionalSearch = input => {
1200
+ const $io1 = input => "object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) && $io2(input.fields);
1201
+ const $io2 = input => Object.keys(input).every(key => {
1202
+ const value = input[key];
1203
+ if (undefined === value)
1204
+ return true;
1205
+ return true;
1206
+ });
1207
+ const $io3 = input => "number" === typeof input.x1 && "number" === typeof input.y1 && "number" === typeof input.x2 && "number" === typeof input.y2;
1208
+ const $string = __typia.json.createStringify.string;
1209
+ const $throws = __typia.json.createStringify.throws;
1210
+ const $so0 = input => `{${undefined === input.user ? "" : `"user":${undefined !== input.user ? $string(input.user) : undefined},`}${undefined === input.searchIds ? "" : `"searchIds":${undefined !== input.searchIds ? `[${input.searchIds.map(elem => $string(elem)).join(",")}]` : undefined},`}${undefined === input.searches ? "" : `"searches":${undefined !== input.searches ? `[${input.searches.map(elem => $string(elem)).join(",")}]` : undefined},`}${undefined === input.mode ? "" : `"mode":${undefined !== input.mode ? (() => {
1211
+ if ("string" === typeof input.mode)
1212
+ return $string(input.mode);
1213
+ if ("string" === typeof input.mode)
1214
+ return "\"" + input.mode + "\"";
1215
+ $throws({
1216
+ expected: "(\"exact\" | \"fuzzy\" | \"similarity\" | undefined)",
1217
+ value: input.mode
1218
+ });
1219
+ })() : undefined},`}${undefined === input.query ? "" : `"query":${undefined !== input.query ? $string(input.query) : undefined},`}${undefined === input.sort ? "" : `"sort":${undefined !== input.sort ? $string(input.sort) : undefined},`}${undefined === input.hidden ? "" : `"hidden":${undefined !== input.hidden ? input.hidden : undefined},`}${undefined === input.deleted ? "" : `"deleted":${undefined !== input.deleted ? input.deleted : undefined},`}${undefined === input.count ? "" : `"count":${undefined !== input.count ? input.count : undefined},`}${undefined === input.refreshInterval ? "" : `"refreshInterval":${undefined !== input.refreshInterval ? input.refreshInterval : undefined},`}${undefined === input.highlight ? "" : `"highlight":${undefined !== input.highlight ? $so1(input.highlight) : undefined},`}${undefined === input.timeField ? "" : `"timeField":${undefined !== input.timeField ? $string(input.timeField) : undefined},`}${undefined === input.startTime ? "" : `"startTime":${undefined !== input.startTime ? $string(input.startTime) : undefined},`}${undefined === input.endTime ? "" : `"endTime":${undefined !== input.endTime ? $string(input.endTime) : undefined},`}${undefined === input.geoField ? "" : `"geoField":${undefined !== input.geoField ? $string(input.geoField) : undefined},`}${undefined === input.geoBounds ? "" : `"geoBounds":${undefined !== input.geoBounds ? `{"x1":${input.geoBounds.x1},"y1":${input.geoBounds.y1},"x2":${input.geoBounds.x2},"y2":${input.geoBounds.y2}}` : undefined},`}"type":${(() => {
1220
+ if ("string" === typeof input.type)
1221
+ return $string(input.type);
1222
+ if ("string" === typeof input.type)
1223
+ return "\"" + input.type + "\"";
1224
+ $throws({
1225
+ expected: "\"conditional\"",
1226
+ value: input.type
1227
+ });
1228
+ })()}}`;
1229
+ const $so1 = input => `{"fields":${$so2(input.fields)}}`;
1230
+ const $so2 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
1231
+ return ""; return `${JSON.stringify(key)}:${undefined !== value ? JSON.stringify(value) : undefined}`; }).filter(str => "" !== str).join(",")}}`;
1232
+ return $so0(input);
1233
+ };
1234
+ export const assertStringifyConditionalSearch = (input, errorFactory) => { const assert = (input, errorFactory) => {
1235
+ const __is = input => {
1236
+ const $io0 = input => "conditional" === input.type && (undefined === input.user || "string" === typeof input.user) && (undefined === input.searchIds || Array.isArray(input.searchIds) && input.searchIds.every(elem => "string" === typeof elem)) && (undefined === input.searches || Array.isArray(input.searches) && input.searches.every(elem => "string" === typeof elem)) && (undefined === input.mode || "fuzzy" === input.mode || "exact" === input.mode || "similarity" === input.mode) && (undefined === input.query || "string" === typeof input.query) && (undefined === input.sort || "string" === typeof input.sort) && (undefined === input.hidden || "boolean" === typeof input.hidden) && (undefined === input.deleted || "boolean" === typeof input.deleted) && (undefined === input.count || "number" === typeof input.count && !Number.isNaN(input.count)) && (undefined === input.refreshInterval || "number" === typeof input.refreshInterval && !Number.isNaN(input.refreshInterval)) && (undefined === input.highlight || "object" === typeof input.highlight && null !== input.highlight && $io1(input.highlight)) && (undefined === input.timeField || "string" === typeof input.timeField) && (undefined === input.startTime || "string" === typeof input.startTime) && (undefined === input.endTime || "string" === typeof input.endTime) && (undefined === input.geoField || "string" === typeof input.geoField) && (undefined === input.geoBounds || "object" === typeof input.geoBounds && null !== input.geoBounds && $io3(input.geoBounds));
1237
+ const $io1 = input => "object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) && $io2(input.fields);
1238
+ const $io2 = input => Object.keys(input).every(key => {
1239
+ const value = input[key];
1240
+ if (undefined === value)
1241
+ return true;
1242
+ return true;
1243
+ });
1244
+ const $io3 = input => "number" === typeof input.x1 && !Number.isNaN(input.x1) && ("number" === typeof input.y1 && !Number.isNaN(input.y1)) && ("number" === typeof input.x2 && !Number.isNaN(input.x2)) && ("number" === typeof input.y2 && !Number.isNaN(input.y2));
1245
+ return "object" === typeof input && null !== input && $io0(input);
1246
+ };
1247
+ if (false === __is(input))
1248
+ ((input, _path, _exceptionable = true) => {
1249
+ const $guard = __typia.json.createAssertStringify.guard;
1250
+ const $join = __typia.json.createAssertStringify.join;
1251
+ const $ao0 = (input, _path, _exceptionable = true) => ("conditional" === input.type || $guard(_exceptionable, {
1252
+ path: _path + ".type",
1253
+ expected: "\"conditional\"",
1254
+ value: input.type
1255
+ }, errorFactory)) && (undefined === input.user || "string" === typeof input.user || $guard(_exceptionable, {
1256
+ path: _path + ".user",
1257
+ expected: "(string | undefined)",
1258
+ value: input.user
1259
+ }, errorFactory)) && (undefined === input.searchIds || (Array.isArray(input.searchIds) || $guard(_exceptionable, {
1260
+ path: _path + ".searchIds",
1261
+ expected: "(Array<string> | undefined)",
1262
+ value: input.searchIds
1263
+ }, errorFactory)) && input.searchIds.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
1264
+ path: _path + ".searchIds[" + _index1 + "]",
1265
+ expected: "string",
1266
+ value: elem
1267
+ }, errorFactory)) || $guard(_exceptionable, {
1268
+ path: _path + ".searchIds",
1269
+ expected: "(Array<string> | undefined)",
1270
+ value: input.searchIds
1271
+ }, errorFactory)) && (undefined === input.searches || (Array.isArray(input.searches) || $guard(_exceptionable, {
1272
+ path: _path + ".searches",
1273
+ expected: "(Array<string> | undefined)",
1274
+ value: input.searches
1275
+ }, errorFactory)) && input.searches.every((elem, _index2) => "string" === typeof elem || $guard(_exceptionable, {
1276
+ path: _path + ".searches[" + _index2 + "]",
1277
+ expected: "string",
1278
+ value: elem
1279
+ }, errorFactory)) || $guard(_exceptionable, {
1280
+ path: _path + ".searches",
1281
+ expected: "(Array<string> | undefined)",
1282
+ value: input.searches
1283
+ }, errorFactory)) && (undefined === input.mode || "fuzzy" === input.mode || "exact" === input.mode || "similarity" === input.mode || $guard(_exceptionable, {
1284
+ path: _path + ".mode",
1285
+ expected: "(\"exact\" | \"fuzzy\" | \"similarity\" | undefined)",
1286
+ value: input.mode
1287
+ }, errorFactory)) && (undefined === input.query || "string" === typeof input.query || $guard(_exceptionable, {
1288
+ path: _path + ".query",
1289
+ expected: "(string | undefined)",
1290
+ value: input.query
1291
+ }, errorFactory)) && (undefined === input.sort || "string" === typeof input.sort || $guard(_exceptionable, {
1292
+ path: _path + ".sort",
1293
+ expected: "(string | undefined)",
1294
+ value: input.sort
1295
+ }, errorFactory)) && (undefined === input.hidden || "boolean" === typeof input.hidden || $guard(_exceptionable, {
1296
+ path: _path + ".hidden",
1297
+ expected: "(boolean | undefined)",
1298
+ value: input.hidden
1299
+ }, errorFactory)) && (undefined === input.deleted || "boolean" === typeof input.deleted || $guard(_exceptionable, {
1300
+ path: _path + ".deleted",
1301
+ expected: "(boolean | undefined)",
1302
+ value: input.deleted
1303
+ }, errorFactory)) && (undefined === input.count || "number" === typeof input.count && !Number.isNaN(input.count) || $guard(_exceptionable, {
1304
+ path: _path + ".count",
1305
+ expected: "(number | undefined)",
1306
+ value: input.count
1307
+ }, errorFactory)) && (undefined === input.refreshInterval || "number" === typeof input.refreshInterval && !Number.isNaN(input.refreshInterval) || $guard(_exceptionable, {
1308
+ path: _path + ".refreshInterval",
1309
+ expected: "(number | undefined)",
1310
+ value: input.refreshInterval
1311
+ }, errorFactory)) && (undefined === input.highlight || ("object" === typeof input.highlight && null !== input.highlight || $guard(_exceptionable, {
1312
+ path: _path + ".highlight",
1313
+ expected: "(SearchHighlightOption | undefined)",
1314
+ value: input.highlight
1315
+ }, errorFactory)) && $ao1(input.highlight, _path + ".highlight", true && _exceptionable) || $guard(_exceptionable, {
1316
+ path: _path + ".highlight",
1317
+ expected: "(SearchHighlightOption | undefined)",
1318
+ value: input.highlight
1319
+ }, errorFactory)) && (undefined === input.timeField || "string" === typeof input.timeField || $guard(_exceptionable, {
1320
+ path: _path + ".timeField",
1321
+ expected: "(string | undefined)",
1322
+ value: input.timeField
1323
+ }, errorFactory)) && (undefined === input.startTime || "string" === typeof input.startTime || $guard(_exceptionable, {
1324
+ path: _path + ".startTime",
1325
+ expected: "(string | undefined)",
1326
+ value: input.startTime
1327
+ }, errorFactory)) && (undefined === input.endTime || "string" === typeof input.endTime || $guard(_exceptionable, {
1328
+ path: _path + ".endTime",
1329
+ expected: "(string | undefined)",
1330
+ value: input.endTime
1331
+ }, errorFactory)) && (undefined === input.geoField || "string" === typeof input.geoField || $guard(_exceptionable, {
1332
+ path: _path + ".geoField",
1333
+ expected: "(string | undefined)",
1334
+ value: input.geoField
1335
+ }, errorFactory)) && (undefined === input.geoBounds || ("object" === typeof input.geoBounds && null !== input.geoBounds || $guard(_exceptionable, {
1336
+ path: _path + ".geoBounds",
1337
+ expected: "(__type.o1 | undefined)",
1338
+ value: input.geoBounds
1339
+ }, errorFactory)) && $ao3(input.geoBounds, _path + ".geoBounds", true && _exceptionable) || $guard(_exceptionable, {
1340
+ path: _path + ".geoBounds",
1341
+ expected: "(__type.o1 | undefined)",
1342
+ value: input.geoBounds
1343
+ }, errorFactory));
1344
+ const $ao1 = (input, _path, _exceptionable = true) => ("object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) || $guard(_exceptionable, {
1345
+ path: _path + ".fields",
1346
+ expected: "__type",
1347
+ value: input.fields
1348
+ }, errorFactory)) && $ao2(input.fields, _path + ".fields", true && _exceptionable) || $guard(_exceptionable, {
1349
+ path: _path + ".fields",
1350
+ expected: "__type",
1351
+ value: input.fields
1352
+ }, errorFactory);
1353
+ const $ao2 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
1354
+ const value = input[key];
1355
+ if (undefined === value)
1356
+ return true;
1357
+ return true;
1358
+ });
1359
+ const $ao3 = (input, _path, _exceptionable = true) => ("number" === typeof input.x1 && !Number.isNaN(input.x1) || $guard(_exceptionable, {
1360
+ path: _path + ".x1",
1361
+ expected: "number",
1362
+ value: input.x1
1363
+ }, errorFactory)) && ("number" === typeof input.y1 && !Number.isNaN(input.y1) || $guard(_exceptionable, {
1364
+ path: _path + ".y1",
1365
+ expected: "number",
1366
+ value: input.y1
1367
+ }, errorFactory)) && ("number" === typeof input.x2 && !Number.isNaN(input.x2) || $guard(_exceptionable, {
1368
+ path: _path + ".x2",
1369
+ expected: "number",
1370
+ value: input.x2
1371
+ }, errorFactory)) && ("number" === typeof input.y2 && !Number.isNaN(input.y2) || $guard(_exceptionable, {
1372
+ path: _path + ".y2",
1373
+ expected: "number",
1374
+ value: input.y2
1375
+ }, errorFactory));
1376
+ return ("object" === typeof input && null !== input || $guard(true, {
1377
+ path: _path + "",
1378
+ expected: "ConditionalSearch",
1379
+ value: input
1380
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
1381
+ path: _path + "",
1382
+ expected: "ConditionalSearch",
1383
+ value: input
1384
+ }, errorFactory);
1385
+ })(input, "$input", true);
1386
+ return input;
1387
+ }; const stringify = input => {
1388
+ const $io1 = input => "object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) && $io2(input.fields);
1389
+ const $io2 = input => Object.keys(input).every(key => {
1390
+ const value = input[key];
1391
+ if (undefined === value)
1392
+ return true;
1393
+ return true;
1394
+ });
1395
+ const $io3 = input => "number" === typeof input.x1 && "number" === typeof input.y1 && "number" === typeof input.x2 && "number" === typeof input.y2;
1396
+ const $string = __typia.json.createAssertStringify.string;
1397
+ const $throws = __typia.json.createAssertStringify.throws;
1398
+ const $so0 = input => `{${undefined === input.user ? "" : `"user":${undefined !== input.user ? $string(input.user) : undefined},`}${undefined === input.searchIds ? "" : `"searchIds":${undefined !== input.searchIds ? `[${input.searchIds.map(elem => $string(elem)).join(",")}]` : undefined},`}${undefined === input.searches ? "" : `"searches":${undefined !== input.searches ? `[${input.searches.map(elem => $string(elem)).join(",")}]` : undefined},`}${undefined === input.mode ? "" : `"mode":${undefined !== input.mode ? (() => {
1399
+ if ("string" === typeof input.mode)
1400
+ return $string(input.mode);
1401
+ if ("string" === typeof input.mode)
1402
+ return "\"" + input.mode + "\"";
1403
+ $throws({
1404
+ expected: "(\"exact\" | \"fuzzy\" | \"similarity\" | undefined)",
1405
+ value: input.mode
1406
+ });
1407
+ })() : undefined},`}${undefined === input.query ? "" : `"query":${undefined !== input.query ? $string(input.query) : undefined},`}${undefined === input.sort ? "" : `"sort":${undefined !== input.sort ? $string(input.sort) : undefined},`}${undefined === input.hidden ? "" : `"hidden":${undefined !== input.hidden ? input.hidden : undefined},`}${undefined === input.deleted ? "" : `"deleted":${undefined !== input.deleted ? input.deleted : undefined},`}${undefined === input.count ? "" : `"count":${undefined !== input.count ? input.count : undefined},`}${undefined === input.refreshInterval ? "" : `"refreshInterval":${undefined !== input.refreshInterval ? input.refreshInterval : undefined},`}${undefined === input.highlight ? "" : `"highlight":${undefined !== input.highlight ? $so1(input.highlight) : undefined},`}${undefined === input.timeField ? "" : `"timeField":${undefined !== input.timeField ? $string(input.timeField) : undefined},`}${undefined === input.startTime ? "" : `"startTime":${undefined !== input.startTime ? $string(input.startTime) : undefined},`}${undefined === input.endTime ? "" : `"endTime":${undefined !== input.endTime ? $string(input.endTime) : undefined},`}${undefined === input.geoField ? "" : `"geoField":${undefined !== input.geoField ? $string(input.geoField) : undefined},`}${undefined === input.geoBounds ? "" : `"geoBounds":${undefined !== input.geoBounds ? `{"x1":${input.geoBounds.x1},"y1":${input.geoBounds.y1},"x2":${input.geoBounds.x2},"y2":${input.geoBounds.y2}}` : undefined},`}"type":${(() => {
1408
+ if ("string" === typeof input.type)
1409
+ return $string(input.type);
1410
+ if ("string" === typeof input.type)
1411
+ return "\"" + input.type + "\"";
1412
+ $throws({
1413
+ expected: "\"conditional\"",
1414
+ value: input.type
1415
+ });
1416
+ })()}}`;
1417
+ const $so1 = input => `{"fields":${$so2(input.fields)}}`;
1418
+ const $so2 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
1419
+ return ""; return `${JSON.stringify(key)}:${undefined !== value ? JSON.stringify(value) : undefined}`; }).filter(str => "" !== str).join(",")}}`;
1420
+ return $so0(input);
1421
+ }; return stringify(assert(input, errorFactory)); };
1422
+ export const isSearchHighlightOption = input => {
1423
+ const $io0 = input => "object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) && $io1(input.fields);
1424
+ const $io1 = input => Object.keys(input).every(key => {
1425
+ const value = input[key];
1426
+ if (undefined === value)
1427
+ return true;
1428
+ return true;
1429
+ });
1430
+ return "object" === typeof input && null !== input && $io0(input);
1431
+ };
1432
+ export const assertSearchHighlightOption = (input, errorFactory) => {
1433
+ const __is = input => {
1434
+ const $io0 = input => "object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) && $io1(input.fields);
1435
+ const $io1 = input => Object.keys(input).every(key => {
1436
+ const value = input[key];
1437
+ if (undefined === value)
1438
+ return true;
1439
+ return true;
1440
+ });
1441
+ return "object" === typeof input && null !== input && $io0(input);
1442
+ };
1443
+ if (false === __is(input))
1444
+ ((input, _path, _exceptionable = true) => {
1445
+ const $guard = __typia.createAssert.guard;
1446
+ const $join = __typia.createAssert.join;
1447
+ const $ao0 = (input, _path, _exceptionable = true) => ("object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) || $guard(_exceptionable, {
1448
+ path: _path + ".fields",
1449
+ expected: "__type",
1450
+ value: input.fields
1451
+ }, errorFactory)) && $ao1(input.fields, _path + ".fields", true && _exceptionable) || $guard(_exceptionable, {
1452
+ path: _path + ".fields",
1453
+ expected: "__type",
1454
+ value: input.fields
1455
+ }, errorFactory);
1456
+ const $ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
1457
+ const value = input[key];
1458
+ if (undefined === value)
1459
+ return true;
1460
+ return true;
1461
+ });
1462
+ return ("object" === typeof input && null !== input || $guard(true, {
1463
+ path: _path + "",
1464
+ expected: "SearchHighlightOption",
1465
+ value: input
1466
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
1467
+ path: _path + "",
1468
+ expected: "SearchHighlightOption",
1469
+ value: input
1470
+ }, errorFactory);
1471
+ })(input, "$input", true);
1472
+ return input;
1473
+ };
1474
+ export const randomSearchHighlightOption = generator => {
1475
+ const $generator = __typia.createRandom.generator;
1476
+ const $ro0 = (_recursive = false, _depth = 0) => ({
1477
+ fields: $ro1(_recursive, _recursive ? 1 + _depth : _depth)
1478
+ });
1479
+ const $ro1 = (_recursive = false, _depth = 0) => {
1480
+ const output = {};
1481
+ (generator?.array ?? $generator.array)(() => output[(generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()] = "any type used...", (generator?.integer ?? $generator.integer)(0, 3));
1482
+ return output;
1483
+ };
1484
+ return $ro0();
1485
+ };
1486
+ export const assertGuardSearchHighlightOption = (input, errorFactory) => {
1487
+ const __is = input => {
1488
+ const $io0 = input => "object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) && $io1(input.fields);
1489
+ const $io1 = input => Object.keys(input).every(key => {
1490
+ const value = input[key];
1491
+ if (undefined === value)
1492
+ return true;
1493
+ return true;
1494
+ });
1495
+ return "object" === typeof input && null !== input && $io0(input);
1496
+ };
1497
+ if (false === __is(input))
1498
+ ((input, _path, _exceptionable = true) => {
1499
+ const $guard = __typia.createAssertGuard.guard;
1500
+ const $join = __typia.createAssertGuard.join;
1501
+ const $ao0 = (input, _path, _exceptionable = true) => ("object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) || $guard(_exceptionable, {
1502
+ path: _path + ".fields",
1503
+ expected: "__type",
1504
+ value: input.fields
1505
+ }, errorFactory)) && $ao1(input.fields, _path + ".fields", true && _exceptionable) || $guard(_exceptionable, {
1506
+ path: _path + ".fields",
1507
+ expected: "__type",
1508
+ value: input.fields
1509
+ }, errorFactory);
1510
+ const $ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
1511
+ const value = input[key];
1512
+ if (undefined === value)
1513
+ return true;
1514
+ return true;
1515
+ });
1516
+ return ("object" === typeof input && null !== input || $guard(true, {
1517
+ path: _path + "",
1518
+ expected: "SearchHighlightOption",
1519
+ value: input
1520
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
1521
+ path: _path + "",
1522
+ expected: "SearchHighlightOption",
1523
+ value: input
1524
+ }, errorFactory);
1525
+ })(input, "$input", true);
1526
+ };
1527
+ export const stringifySearchHighlightOption = input => {
1528
+ const $io1 = input => Object.keys(input).every(key => {
1529
+ const value = input[key];
1530
+ if (undefined === value)
1531
+ return true;
1532
+ return true;
1533
+ });
1534
+ const $so0 = input => `{"fields":${$so1(input.fields)}}`;
1535
+ const $so1 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
1536
+ return ""; return `${JSON.stringify(key)}:${undefined !== value ? JSON.stringify(value) : undefined}`; }).filter(str => "" !== str).join(",")}}`;
1537
+ return $so0(input);
1538
+ };
1539
+ export const assertStringifySearchHighlightOption = (input, errorFactory) => { const assert = (input, errorFactory) => {
1540
+ const __is = input => {
1541
+ const $io0 = input => "object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) && $io1(input.fields);
1542
+ const $io1 = input => Object.keys(input).every(key => {
1543
+ const value = input[key];
1544
+ if (undefined === value)
1545
+ return true;
1546
+ return true;
1547
+ });
1548
+ return "object" === typeof input && null !== input && $io0(input);
1549
+ };
1550
+ if (false === __is(input))
1551
+ ((input, _path, _exceptionable = true) => {
1552
+ const $guard = __typia.json.createAssertStringify.guard;
1553
+ const $join = __typia.json.createAssertStringify.join;
1554
+ const $ao0 = (input, _path, _exceptionable = true) => ("object" === typeof input.fields && null !== input.fields && false === Array.isArray(input.fields) || $guard(_exceptionable, {
1555
+ path: _path + ".fields",
1556
+ expected: "__type",
1557
+ value: input.fields
1558
+ }, errorFactory)) && $ao1(input.fields, _path + ".fields", true && _exceptionable) || $guard(_exceptionable, {
1559
+ path: _path + ".fields",
1560
+ expected: "__type",
1561
+ value: input.fields
1562
+ }, errorFactory);
1563
+ const $ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
1564
+ const value = input[key];
1565
+ if (undefined === value)
1566
+ return true;
1567
+ return true;
1568
+ });
1569
+ return ("object" === typeof input && null !== input || $guard(true, {
1570
+ path: _path + "",
1571
+ expected: "SearchHighlightOption",
1572
+ value: input
1573
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
1574
+ path: _path + "",
1575
+ expected: "SearchHighlightOption",
1576
+ value: input
1577
+ }, errorFactory);
1578
+ })(input, "$input", true);
1579
+ return input;
1580
+ }; const stringify = input => {
1581
+ const $io1 = input => Object.keys(input).every(key => {
1582
+ const value = input[key];
1583
+ if (undefined === value)
1584
+ return true;
1585
+ return true;
1586
+ });
1587
+ const $so0 = input => `{"fields":${$so1(input.fields)}}`;
1588
+ const $so1 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
1589
+ return ""; return `${JSON.stringify(key)}:${undefined !== value ? JSON.stringify(value) : undefined}`; }).filter(str => "" !== str).join(",")}}`;
1590
+ return $so0(input);
1591
+ }; return stringify(assert(input, errorFactory)); };