@nxtedition/types 23.0.39 → 23.0.41

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 (243) hide show
  1. package/dist/app.d.ts +0 -51
  2. package/dist/app.js +1 -823
  3. package/dist/common/block.d.ts +6 -13
  4. package/dist/common/block.js +597 -1607
  5. package/dist/common/clone.d.ts +0 -19
  6. package/dist/common/clone.js +1 -602
  7. package/dist/common/date.d.ts +0 -7
  8. package/dist/common/date.js +1 -59
  9. package/dist/common/error.d.ts +0 -7
  10. package/dist/common/error.js +1 -404
  11. package/dist/common/file.d.ts +1 -21
  12. package/dist/common/file.js +782 -2521
  13. package/dist/common/index.d.ts +20 -26
  14. package/dist/common/index.js +20 -134
  15. package/dist/common/location.d.ts +0 -6
  16. package/dist/common/location.js +73 -238
  17. package/dist/common/lock.d.ts +1 -8
  18. package/dist/common/lock.js +1 -211
  19. package/dist/common/media.d.ts +0 -7
  20. package/dist/common/media.js +1 -83
  21. package/dist/common/nxtpression.d.ts +2 -9
  22. package/dist/common/nxtpression.js +1 -277
  23. package/dist/common/pipeline.d.ts +0 -7
  24. package/dist/common/pipeline.js +1 -97
  25. package/dist/common/promoted-tag.d.ts +0 -7
  26. package/dist/common/promoted-tag.js +1 -147
  27. package/dist/common/render-preset.d.ts +2 -15
  28. package/dist/common/render-preset.js +1 -1202
  29. package/dist/common/render-profile.d.ts +0 -19
  30. package/dist/common/render-profile.js +1 -1052
  31. package/dist/common/render-query.d.ts +2 -9
  32. package/dist/common/render-query.js +1 -1754
  33. package/dist/common/render-scene.d.ts +2 -15
  34. package/dist/common/render-scene.js +1 -2230
  35. package/dist/common/rule.d.ts +1 -7
  36. package/dist/common/rule.js +84 -254
  37. package/dist/common/search.d.ts +0 -25
  38. package/dist/common/search.js +1 -1591
  39. package/dist/common/settings.d.ts +128 -121
  40. package/dist/common/settings.js +1 -6936
  41. package/dist/common/subtitle-style.d.ts +25 -0
  42. package/dist/common/user-notification.d.ts +0 -7
  43. package/dist/common/user-notification.js +1 -85
  44. package/dist/index.d.ts +5 -85
  45. package/dist/index.js +5 -187
  46. package/dist/nxtpression.d.ts +732 -344
  47. package/dist/nxtpression.js +1 -323
  48. package/dist/records/domains/asset.d.ts +106 -0
  49. package/dist/records/domains/bundle.d.ts +12 -0
  50. package/dist/records/domains/bundle.js +1 -0
  51. package/dist/records/domains/clone.d.ts +7 -0
  52. package/dist/records/domains/clone.js +1 -0
  53. package/dist/records/domains/comment-reaction.d.ts +8 -0
  54. package/dist/records/domains/comment-reaction.js +1 -0
  55. package/dist/records/domains/comment-read-mark.d.ts +8 -0
  56. package/dist/records/domains/comment-read-mark.js +1 -0
  57. package/dist/records/domains/comment.d.ts +81 -0
  58. package/dist/records/domains/comment.js +19 -0
  59. package/dist/records/domains/connection.d.ts +77 -0
  60. package/dist/records/domains/connection.js +1 -0
  61. package/dist/records/domains/contact.d.ts +9 -0
  62. package/dist/records/domains/contact.js +1 -0
  63. package/dist/records/domains/deepstream.d.ts +7 -0
  64. package/dist/records/domains/deepstream.js +1 -0
  65. package/dist/records/domains/design.d.ts +11 -0
  66. package/dist/records/domains/design.js +1 -0
  67. package/dist/records/domains/edit.d.ts +10 -0
  68. package/dist/records/domains/edit.js +1 -0
  69. package/dist/records/domains/event.d.ts +66 -0
  70. package/dist/records/domains/event.js +1 -0
  71. package/dist/records/domains/file.d.ts +26 -0
  72. package/dist/records/domains/file.js +1 -0
  73. package/dist/records/domains/general.d.ts +41 -0
  74. package/dist/records/domains/general.js +1 -0
  75. package/dist/records/domains/index.d.ts +77 -0
  76. package/dist/records/domains/index.js +38 -0
  77. package/dist/records/domains/media.d.ts +64 -0
  78. package/dist/records/domains/media.js +1 -0
  79. package/dist/records/domains/monitor.d.ts +116 -0
  80. package/dist/records/domains/monitor.js +1 -0
  81. package/dist/records/domains/panel.d.ts +55 -0
  82. package/dist/records/domains/panel.js +1 -0
  83. package/dist/records/domains/permission.d.ts +25 -0
  84. package/dist/records/domains/permission.js +2 -0
  85. package/dist/records/domains/pipeline-preset.d.ts +10 -0
  86. package/dist/records/domains/pipeline-preset.js +1 -0
  87. package/dist/records/domains/pipeline.d.ts +17 -0
  88. package/dist/records/domains/pipeline.js +1 -0
  89. package/dist/records/domains/planning.d.ts +14 -0
  90. package/dist/records/domains/planning.js +1 -0
  91. package/dist/records/domains/prompter.d.ts +18 -0
  92. package/dist/records/domains/prompter.js +1 -0
  93. package/dist/records/domains/publish.d.ts +145 -0
  94. package/dist/records/domains/publish.js +1 -0
  95. package/dist/records/domains/published.d.ts +12 -0
  96. package/dist/records/domains/published.js +1 -0
  97. package/dist/records/domains/render-preset.d.ts +5 -0
  98. package/dist/records/domains/render-preset.js +1 -0
  99. package/dist/records/domains/render.d.ts +115 -0
  100. package/dist/records/domains/render.js +1 -0
  101. package/dist/records/domains/revs.d.ts +6 -0
  102. package/dist/records/domains/revs.js +1 -0
  103. package/dist/records/domains/role.d.ts +6 -0
  104. package/dist/records/domains/role.js +1 -0
  105. package/dist/records/domains/script.d.ts +101 -0
  106. package/dist/records/domains/script.js +1 -0
  107. package/dist/records/domains/search.d.ts +9 -0
  108. package/dist/records/domains/search.js +1 -0
  109. package/dist/records/domains/settings.d.ts +5 -0
  110. package/dist/records/domains/settings.js +1 -0
  111. package/dist/records/domains/storyboard.d.ts +10 -0
  112. package/dist/records/domains/storyboard.js +1 -0
  113. package/dist/records/domains/subtitle-style.d.ts +13 -0
  114. package/dist/records/domains/subtitle-style.js +1 -0
  115. package/dist/records/domains/subtitle.d.ts +12 -0
  116. package/dist/records/domains/subtitle.js +1 -0
  117. package/dist/records/domains/template.d.ts +10 -0
  118. package/dist/records/domains/template.js +1 -0
  119. package/dist/records/domains/user-notification-status.d.ts +30 -0
  120. package/dist/records/domains/user-notification-status.js +1 -0
  121. package/dist/records/domains/user-notification.d.ts +69 -0
  122. package/dist/records/domains/user-notification.js +1 -0
  123. package/dist/records/domains/user.d.ts +23 -0
  124. package/dist/records/domains/user.js +1 -0
  125. package/dist/records/exact/asset.d.ts +83 -0
  126. package/dist/records/exact/asset.js +1 -0
  127. package/dist/records/exact/index.d.ts +36 -0
  128. package/dist/records/exact/index.js +4 -0
  129. package/dist/records/exact/media.d.ts +52 -0
  130. package/dist/records/exact/media.js +1 -0
  131. package/dist/records/exact/monitor.d.ts +46 -0
  132. package/dist/records/exact/monitor.js +1 -0
  133. package/dist/records/exact/storage.d.ts +32 -0
  134. package/dist/records/exact/storage.js +1 -0
  135. package/dist/records/index.d.ts +10 -0
  136. package/dist/records/index.js +2 -0
  137. package/dist/records/utils.d.ts +7 -0
  138. package/dist/records/utils.js +1 -0
  139. package/dist/records/utils.tds.d.ts +1 -0
  140. package/dist/records/utils.tds.js +7 -0
  141. package/dist/records/validate/assert-guard.d.ts +4 -0
  142. package/dist/records/validate/assert-guard.js +15861 -0
  143. package/dist/records/validate/assert.d.ts +4 -0
  144. package/dist/records/validate/assert.js +15990 -0
  145. package/dist/records/validate/is.d.ts +4 -0
  146. package/dist/records/validate/is.js +1017 -0
  147. package/dist/records/validate/schemas.d.ts +9 -0
  148. package/dist/records/validate/schemas.js +12613 -0
  149. package/dist/records/validate/stringify.d.ts +4 -0
  150. package/dist/records/validate/stringify.js +1904 -0
  151. package/dist/records/validate/utils.d.ts +15 -0
  152. package/dist/records/validate/utils.js +18 -0
  153. package/dist/records/validate/utils.test.d.ts +1 -0
  154. package/dist/records/validate/utils.test.js +35 -0
  155. package/dist/records/validate/validate.d.ts +5 -0
  156. package/dist/records/validate/validate.js +14943 -0
  157. package/dist/rpc.d.ts +13 -14
  158. package/dist/rpc.js +126 -511
  159. package/dist/tsdoc-metadata.json +1 -1
  160. package/package.json +26 -15
  161. package/dist/asset.d.ts +0 -72
  162. package/dist/domains/asset.d.ts +0 -227
  163. package/dist/domains/asset.js +0 -2672
  164. package/dist/domains/bundle.d.ts +0 -25
  165. package/dist/domains/bundle.js +0 -512
  166. package/dist/domains/clone.d.ts +0 -14
  167. package/dist/domains/clone.js +0 -192
  168. package/dist/domains/comment-reaction.d.ts +0 -15
  169. package/dist/domains/comment-reaction.js +0 -115
  170. package/dist/domains/comment-read-mark.d.ts +0 -15
  171. package/dist/domains/comment-read-mark.js +0 -115
  172. package/dist/domains/comment.d.ts +0 -153
  173. package/dist/domains/comment.js +0 -5906
  174. package/dist/domains/connection.d.ts +0 -141
  175. package/dist/domains/connection.js +0 -5860
  176. package/dist/domains/contact.d.ts +0 -16
  177. package/dist/domains/contact.js +0 -149
  178. package/dist/domains/deepstream.d.ts +0 -14
  179. package/dist/domains/deepstream.js +0 -139
  180. package/dist/domains/design.d.ts +0 -24
  181. package/dist/domains/design.js +0 -303
  182. package/dist/domains/edit.d.ts +0 -17
  183. package/dist/domains/edit.js +0 -224
  184. package/dist/domains/event.d.ts +0 -42
  185. package/dist/domains/event.js +0 -754
  186. package/dist/domains/file.d.ts +0 -51
  187. package/dist/domains/file.js +0 -2506
  188. package/dist/domains/general.d.ts +0 -84
  189. package/dist/domains/general.js +0 -906
  190. package/dist/domains/index.d.ts +0 -75
  191. package/dist/domains/index.js +0 -37
  192. package/dist/domains/media.d.ts +0 -113
  193. package/dist/domains/media.js +0 -4553
  194. package/dist/domains/monitor.d.ts +0 -416
  195. package/dist/domains/monitor.js +0 -6382
  196. package/dist/domains/panel.d.ts +0 -371
  197. package/dist/domains/panel.js +0 -3198
  198. package/dist/domains/permission.d.ts +0 -61
  199. package/dist/domains/permission.js +0 -1926
  200. package/dist/domains/pipeline-preset.d.ts +0 -17
  201. package/dist/domains/pipeline-preset.js +0 -236
  202. package/dist/domains/pipeline.d.ts +0 -30
  203. package/dist/domains/pipeline.js +0 -460
  204. package/dist/domains/planning.d.ts +0 -33
  205. package/dist/domains/planning.js +0 -324
  206. package/dist/domains/publish.d.ts +0 -1397
  207. package/dist/domains/publish.js +0 -34436
  208. package/dist/domains/published.d.ts +0 -19
  209. package/dist/domains/published.js +0 -204
  210. package/dist/domains/render-preset.d.ts +0 -4
  211. package/dist/domains/render.d.ts +0 -172
  212. package/dist/domains/render.js +0 -4783
  213. package/dist/domains/revs.d.ts +0 -13
  214. package/dist/domains/revs.js +0 -125
  215. package/dist/domains/role.d.ts +0 -13
  216. package/dist/domains/role.js +0 -119
  217. package/dist/domains/script.d.ts +0 -13
  218. package/dist/domains/script.js +0 -125
  219. package/dist/domains/search.d.ts +0 -16
  220. package/dist/domains/search.js +0 -168
  221. package/dist/domains/settings.d.ts +0 -12
  222. package/dist/domains/settings.js +0 -6624
  223. package/dist/domains/storyboard.d.ts +0 -14
  224. package/dist/domains/storyboard.js +0 -125
  225. package/dist/domains/subtitle-style.d.ts +0 -37
  226. package/dist/domains/subtitle-style.js +0 -485
  227. package/dist/domains/subtitle.d.ts +0 -19
  228. package/dist/domains/subtitle.js +0 -212
  229. package/dist/domains/template.d.ts +0 -23
  230. package/dist/domains/template.js +0 -372
  231. package/dist/domains/user-notification-status.d.ts +0 -55
  232. package/dist/domains/user-notification-status.js +0 -715
  233. package/dist/domains/user-notification.d.ts +0 -118
  234. package/dist/domains/user-notification.js +0 -3040
  235. package/dist/domains/user.d.ts +0 -48
  236. package/dist/domains/user.js +0 -481
  237. package/dist/monitor.d.ts +0 -71
  238. package/dist/monitor.js +0 -1942
  239. package/dist/schema.json +0 -9075
  240. package/dist/storage.d.ts +0 -51
  241. package/dist/storage.js +0 -1036
  242. /package/dist/{asset.js → common/subtitle-style.js} +0 -0
  243. /package/dist/{domains/render-preset.js → records/domains/asset.js} +0 -0
@@ -1,2526 +1,787 @@
1
- import __typia from "typia";
2
- export const isFileRef = input => {
3
- const $io0 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
4
- return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
5
- };
6
- export const assertFileRef = (input, errorFactory) => {
7
- const __is = input => {
8
- const $io0 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
9
- return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
10
- };
11
- if (false === __is(input))
12
- ((input, _path, _exceptionable = true) => {
13
- const $guard = __typia.createAssert.guard;
14
- const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
15
- path: _path + ".file",
16
- expected: "(string | undefined)",
17
- value: input.file
18
- }, errorFactory)) && (undefined === input.offset || "number" === typeof input.offset || $guard(_exceptionable, {
19
- path: _path + ".offset",
20
- expected: "(number | undefined)",
21
- value: input.offset
22
- }, errorFactory)) && (undefined === input.start || "number" === typeof input.start || $guard(_exceptionable, {
23
- path: _path + ".start",
24
- expected: "(number | undefined)",
25
- value: input.start
26
- }, errorFactory)) && (undefined === input.end || "number" === typeof input.end || $guard(_exceptionable, {
27
- path: _path + ".end",
28
- expected: "(number | undefined)",
29
- value: input.end
30
- }, errorFactory));
31
- return ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
32
- path: _path + "",
33
- expected: "FileRef",
34
- value: input
35
- }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
36
- path: _path + "",
37
- expected: "FileRef",
38
- value: input
39
- }, errorFactory);
40
- })(input, "$input", true);
1
+ import * as __typia_transform__assertGuard from "typia/lib/internal/_assertGuard.js";
2
+ import * as __typia_transform__isTypeUint64 from "typia/lib/internal/_isTypeUint64.js";
3
+ import * as __typia_transform__accessExpressionAsString from "typia/lib/internal/_accessExpressionAsString.js";
4
+ import * as __typia_transform__jsonStringifyString from "typia/lib/internal/_jsonStringifyString.js";
5
+ import * as __typia_transform__throwTypeGuardError from "typia/lib/internal/_throwTypeGuardError.js";
6
+ import * as __typia_transform__jsonStringifyTail from "typia/lib/internal/_jsonStringifyTail.js";
7
+ import typia from 'typia';
8
+ export const assertFileRef = (() => { const _io0 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end); const _ao0 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || __typia_transform__assertGuard._assertGuard(_exceptionable, {
9
+ method: "typia.createAssert",
10
+ path: _path + ".file",
11
+ expected: "(string | undefined)",
12
+ value: input.file
13
+ }, _errorFactory)) && (undefined === input.offset || "number" === typeof input.offset || __typia_transform__assertGuard._assertGuard(_exceptionable, {
14
+ method: "typia.createAssert",
15
+ path: _path + ".offset",
16
+ expected: "(number | undefined)",
17
+ value: input.offset
18
+ }, _errorFactory)) && (undefined === input.start || "number" === typeof input.start || __typia_transform__assertGuard._assertGuard(_exceptionable, {
19
+ method: "typia.createAssert",
20
+ path: _path + ".start",
21
+ expected: "(number | undefined)",
22
+ value: input.start
23
+ }, _errorFactory)) && (undefined === input.end || "number" === typeof input.end || __typia_transform__assertGuard._assertGuard(_exceptionable, {
24
+ method: "typia.createAssert",
25
+ path: _path + ".end",
26
+ expected: "(number | undefined)",
27
+ value: input.end
28
+ }, _errorFactory)); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && _io0(input); let _errorFactory; return (input, errorFactory) => {
29
+ if (false === __is(input)) {
30
+ _errorFactory = errorFactory;
31
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || __typia_transform__assertGuard._assertGuard(true, {
32
+ method: "typia.createAssert",
33
+ path: _path + "",
34
+ expected: "FileRef",
35
+ value: input
36
+ }, _errorFactory)) && _ao0(input, _path + "", true) || __typia_transform__assertGuard._assertGuard(true, {
37
+ method: "typia.createAssert",
38
+ path: _path + "",
39
+ expected: "FileRef",
40
+ value: input
41
+ }, _errorFactory))(input, "$input", true);
42
+ }
41
43
  return input;
42
- };
43
- export const randomFileRef = generator => {
44
- const $generator = __typia.createRandom.generator;
45
- const $pick = __typia.createRandom.pick;
46
- const $ro0 = (_recursive = false, _depth = 0) => ({
47
- file: $pick([
48
- () => undefined,
49
- () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
50
- ])(),
51
- offset: $pick([
52
- () => undefined,
53
- () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
54
- ])(),
55
- start: $pick([
56
- () => undefined,
57
- () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
58
- ])(),
59
- end: $pick([
60
- () => undefined,
61
- () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
62
- ])()
63
- });
64
- return $ro0();
65
- };
66
- export const assertGuardFileRef = (input, errorFactory) => {
67
- const __is = input => {
68
- const $io0 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
69
- return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
70
- };
71
- if (false === __is(input))
72
- ((input, _path, _exceptionable = true) => {
73
- const $guard = __typia.createAssertGuard.guard;
74
- const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
75
- path: _path + ".file",
76
- expected: "(string | undefined)",
77
- value: input.file
78
- }, errorFactory)) && (undefined === input.offset || "number" === typeof input.offset || $guard(_exceptionable, {
79
- path: _path + ".offset",
80
- expected: "(number | undefined)",
81
- value: input.offset
82
- }, errorFactory)) && (undefined === input.start || "number" === typeof input.start || $guard(_exceptionable, {
83
- path: _path + ".start",
84
- expected: "(number | undefined)",
85
- value: input.start
86
- }, errorFactory)) && (undefined === input.end || "number" === typeof input.end || $guard(_exceptionable, {
87
- path: _path + ".end",
88
- expected: "(number | undefined)",
89
- value: input.end
90
- }, errorFactory));
91
- return ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
92
- path: _path + "",
93
- expected: "FileRef",
94
- value: input
95
- }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
96
- path: _path + "",
97
- expected: "FileRef",
98
- value: input
99
- }, errorFactory);
100
- })(input, "$input", true);
101
- };
102
- export const stringifyFileRef = input => {
103
- const $string = __typia.json.createStringify.string;
104
- const $tail = __typia.json.createStringify.tail;
105
- const $so0 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined},`}${undefined === input.offset ? "" : `"offset":${undefined !== input.offset ? input.offset : undefined},`}${undefined === input.start ? "" : `"start":${undefined !== input.start ? input.start : undefined},`}${undefined === input.end ? "" : `"end":${undefined !== input.end ? input.end : undefined}`}`)}}`;
106
- return $so0(input);
107
- };
108
- export const assertStringifyFileRef = (input, errorFactory) => { const assert = (input, errorFactory) => {
109
- const __is = input => {
110
- const $io0 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset && !Number.isNaN(input.offset)) && (undefined === input.start || "number" === typeof input.start && !Number.isNaN(input.start)) && (undefined === input.end || "number" === typeof input.end && !Number.isNaN(input.end));
111
- return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
112
- };
113
- if (false === __is(input))
114
- ((input, _path, _exceptionable = true) => {
115
- const $guard = __typia.json.createAssertStringify.guard;
116
- const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
117
- path: _path + ".file",
118
- expected: "(string | undefined)",
119
- value: input.file
120
- }, errorFactory)) && (undefined === input.offset || "number" === typeof input.offset && !Number.isNaN(input.offset) || $guard(_exceptionable, {
121
- path: _path + ".offset",
122
- expected: "(number | undefined)",
123
- value: input.offset
124
- }, errorFactory)) && (undefined === input.start || "number" === typeof input.start && !Number.isNaN(input.start) || $guard(_exceptionable, {
125
- path: _path + ".start",
126
- expected: "(number | undefined)",
127
- value: input.start
128
- }, errorFactory)) && (undefined === input.end || "number" === typeof input.end && !Number.isNaN(input.end) || $guard(_exceptionable, {
129
- path: _path + ".end",
130
- expected: "(number | undefined)",
131
- value: input.end
132
- }, errorFactory));
133
- return ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
134
- path: _path + "",
135
- expected: "FileRef",
136
- value: input
137
- }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
138
- path: _path + "",
139
- expected: "FileRef",
140
- value: input
141
- }, errorFactory);
142
- })(input, "$input", true);
143
- return input;
144
- }; const stringify = input => {
145
- const $string = __typia.json.createAssertStringify.string;
146
- const $tail = __typia.json.createAssertStringify.tail;
147
- const $so0 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined},`}${undefined === input.offset ? "" : `"offset":${undefined !== input.offset ? input.offset : undefined},`}${undefined === input.start ? "" : `"start":${undefined !== input.start ? input.start : undefined},`}${undefined === input.end ? "" : `"end":${undefined !== input.end ? input.end : undefined}`}`)}}`;
148
- return $so0(input);
149
- }; return stringify(assert(input, errorFactory)); };
150
- export const isFileRefs = input => {
151
- const $io0 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
152
- return Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io0(elem));
153
- };
154
- export const assertFileRefs = (input, errorFactory) => {
155
- const __is = input => {
156
- const $io0 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
157
- return Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io0(elem));
158
- };
159
- if (false === __is(input))
160
- ((input, _path, _exceptionable = true) => {
161
- const $guard = __typia.createAssert.guard;
162
- const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
163
- path: _path + ".file",
164
- expected: "(string | undefined)",
165
- value: input.file
166
- }, errorFactory)) && (undefined === input.offset || "number" === typeof input.offset || $guard(_exceptionable, {
167
- path: _path + ".offset",
168
- expected: "(number | undefined)",
169
- value: input.offset
170
- }, errorFactory)) && (undefined === input.start || "number" === typeof input.start || $guard(_exceptionable, {
171
- path: _path + ".start",
172
- expected: "(number | undefined)",
173
- value: input.start
174
- }, errorFactory)) && (undefined === input.end || "number" === typeof input.end || $guard(_exceptionable, {
175
- path: _path + ".end",
176
- expected: "(number | undefined)",
177
- value: input.end
178
- }, errorFactory));
179
- return (Array.isArray(input) || $guard(true, {
180
- path: _path + "",
181
- expected: "FileRefs",
182
- value: input
183
- }, errorFactory)) && input.every((elem, _index1) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || $guard(true, {
184
- path: _path + "[" + _index1 + "]",
185
- expected: "FileRef",
186
- value: elem
187
- }, errorFactory)) && $ao0(elem, _path + "[" + _index1 + "]", true) || $guard(true, {
188
- path: _path + "[" + _index1 + "]",
189
- expected: "FileRef",
190
- value: elem
191
- }, errorFactory)) || $guard(true, {
192
- path: _path + "",
193
- expected: "FileRefs",
194
- value: input
195
- }, errorFactory);
196
- })(input, "$input", true);
44
+ }; })();
45
+ export const assertFileRefs = (() => { const _io0 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end); const _ao0 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || __typia_transform__assertGuard._assertGuard(_exceptionable, {
46
+ method: "typia.createAssert",
47
+ path: _path + ".file",
48
+ expected: "(string | undefined)",
49
+ value: input.file
50
+ }, _errorFactory)) && (undefined === input.offset || "number" === typeof input.offset || __typia_transform__assertGuard._assertGuard(_exceptionable, {
51
+ method: "typia.createAssert",
52
+ path: _path + ".offset",
53
+ expected: "(number | undefined)",
54
+ value: input.offset
55
+ }, _errorFactory)) && (undefined === input.start || "number" === typeof input.start || __typia_transform__assertGuard._assertGuard(_exceptionable, {
56
+ method: "typia.createAssert",
57
+ path: _path + ".start",
58
+ expected: "(number | undefined)",
59
+ value: input.start
60
+ }, _errorFactory)) && (undefined === input.end || "number" === typeof input.end || __typia_transform__assertGuard._assertGuard(_exceptionable, {
61
+ method: "typia.createAssert",
62
+ path: _path + ".end",
63
+ expected: "(number | undefined)",
64
+ value: input.end
65
+ }, _errorFactory)); const __is = input => Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && _io0(elem)); let _errorFactory; return (input, errorFactory) => {
66
+ if (false === __is(input)) {
67
+ _errorFactory = errorFactory;
68
+ ((input, _path, _exceptionable = true) => (Array.isArray(input) || __typia_transform__assertGuard._assertGuard(true, {
69
+ method: "typia.createAssert",
70
+ path: _path + "",
71
+ expected: "FileRefs",
72
+ value: input
73
+ }, _errorFactory)) && input.every((elem, _index2) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || __typia_transform__assertGuard._assertGuard(true, {
74
+ method: "typia.createAssert",
75
+ path: _path + "[" + _index2 + "]",
76
+ expected: "FileRef",
77
+ value: elem
78
+ }, _errorFactory)) && _ao0(elem, _path + "[" + _index2 + "]", true) || __typia_transform__assertGuard._assertGuard(true, {
79
+ method: "typia.createAssert",
80
+ path: _path + "[" + _index2 + "]",
81
+ expected: "FileRef",
82
+ value: elem
83
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(true, {
84
+ method: "typia.createAssert",
85
+ path: _path + "",
86
+ expected: "FileRefs",
87
+ value: input
88
+ }, _errorFactory))(input, "$input", true);
89
+ }
197
90
  return input;
198
- };
199
- export const randomFileRefs = generator => {
200
- const $generator = __typia.createRandom.generator;
201
- const $pick = __typia.createRandom.pick;
202
- const $ro0 = (_recursive = false, _depth = 0) => ({
203
- file: $pick([
204
- () => undefined,
205
- () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
206
- ])(),
207
- offset: $pick([
208
- () => undefined,
209
- () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
210
- ])(),
211
- start: $pick([
212
- () => undefined,
213
- () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
214
- ])(),
215
- end: $pick([
216
- () => undefined,
217
- () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
218
- ])()
219
- });
220
- return (generator?.array ?? $generator.array)(() => $ro0());
221
- };
222
- export const assertGuardFileRefs = (input, errorFactory) => {
223
- const __is = input => {
224
- const $io0 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
225
- return Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io0(elem));
226
- };
227
- if (false === __is(input))
228
- ((input, _path, _exceptionable = true) => {
229
- const $guard = __typia.createAssertGuard.guard;
230
- const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
231
- path: _path + ".file",
232
- expected: "(string | undefined)",
233
- value: input.file
234
- }, errorFactory)) && (undefined === input.offset || "number" === typeof input.offset || $guard(_exceptionable, {
235
- path: _path + ".offset",
236
- expected: "(number | undefined)",
237
- value: input.offset
238
- }, errorFactory)) && (undefined === input.start || "number" === typeof input.start || $guard(_exceptionable, {
239
- path: _path + ".start",
240
- expected: "(number | undefined)",
241
- value: input.start
242
- }, errorFactory)) && (undefined === input.end || "number" === typeof input.end || $guard(_exceptionable, {
243
- path: _path + ".end",
244
- expected: "(number | undefined)",
245
- value: input.end
246
- }, errorFactory));
247
- return (Array.isArray(input) || $guard(true, {
248
- path: _path + "",
249
- expected: "FileRefs",
250
- value: input
251
- }, errorFactory)) && input.every((elem, _index1) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || $guard(true, {
252
- path: _path + "[" + _index1 + "]",
253
- expected: "FileRef",
254
- value: elem
255
- }, errorFactory)) && $ao0(elem, _path + "[" + _index1 + "]", true) || $guard(true, {
256
- path: _path + "[" + _index1 + "]",
257
- expected: "FileRef",
258
- value: elem
259
- }, errorFactory)) || $guard(true, {
260
- path: _path + "",
261
- expected: "FileRefs",
262
- value: input
263
- }, errorFactory);
264
- })(input, "$input", true);
265
- };
266
- export const stringifyFileRefs = input => {
267
- const $string = __typia.json.createStringify.string;
268
- const $tail = __typia.json.createStringify.tail;
269
- const $so0 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined},`}${undefined === input.offset ? "" : `"offset":${undefined !== input.offset ? input.offset : undefined},`}${undefined === input.start ? "" : `"start":${undefined !== input.start ? input.start : undefined},`}${undefined === input.end ? "" : `"end":${undefined !== input.end ? input.end : undefined}`}`)}}`;
270
- return `[${input.map(elem => $so0(elem)).join(",")}]`;
271
- };
272
- export const assertStringifyFileRefs = (input, errorFactory) => { const assert = (input, errorFactory) => {
273
- const __is = input => {
274
- const $io0 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset && !Number.isNaN(input.offset)) && (undefined === input.start || "number" === typeof input.start && !Number.isNaN(input.start)) && (undefined === input.end || "number" === typeof input.end && !Number.isNaN(input.end));
275
- return Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io0(elem));
276
- };
277
- if (false === __is(input))
278
- ((input, _path, _exceptionable = true) => {
279
- const $guard = __typia.json.createAssertStringify.guard;
280
- const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
281
- path: _path + ".file",
282
- expected: "(string | undefined)",
283
- value: input.file
284
- }, errorFactory)) && (undefined === input.offset || "number" === typeof input.offset && !Number.isNaN(input.offset) || $guard(_exceptionable, {
285
- path: _path + ".offset",
286
- expected: "(number | undefined)",
287
- value: input.offset
288
- }, errorFactory)) && (undefined === input.start || "number" === typeof input.start && !Number.isNaN(input.start) || $guard(_exceptionable, {
289
- path: _path + ".start",
290
- expected: "(number | undefined)",
291
- value: input.start
292
- }, errorFactory)) && (undefined === input.end || "number" === typeof input.end && !Number.isNaN(input.end) || $guard(_exceptionable, {
293
- path: _path + ".end",
294
- expected: "(number | undefined)",
295
- value: input.end
296
- }, errorFactory));
297
- return (Array.isArray(input) || $guard(true, {
298
- path: _path + "",
299
- expected: "FileRefs",
300
- value: input
301
- }, errorFactory)) && input.every((elem, _index1) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || $guard(true, {
302
- path: _path + "[" + _index1 + "]",
303
- expected: "FileRef",
304
- value: elem
305
- }, errorFactory)) && $ao0(elem, _path + "[" + _index1 + "]", true) || $guard(true, {
306
- path: _path + "[" + _index1 + "]",
307
- expected: "FileRef",
308
- value: elem
309
- }, errorFactory)) || $guard(true, {
310
- path: _path + "",
311
- expected: "FileRefs",
312
- value: input
313
- }, errorFactory);
314
- })(input, "$input", true);
315
- return input;
316
- }; const stringify = input => {
317
- const $string = __typia.json.createAssertStringify.string;
318
- const $tail = __typia.json.createAssertStringify.tail;
319
- const $so0 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined},`}${undefined === input.offset ? "" : `"offset":${undefined !== input.offset ? input.offset : undefined},`}${undefined === input.start ? "" : `"start":${undefined !== input.start ? input.start : undefined},`}${undefined === input.end ? "" : `"end":${undefined !== input.end ? input.end : undefined}`}`)}}`;
320
- return `[${input.map(elem => $so0(elem)).join(",")}]`;
321
- }; return stringify(assert(input, errorFactory)); };
322
- export const isFile = input => {
323
- const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && "string" === typeof input.encoding && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (undefined !== input.error && (null === input.error || (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)) || "object" === typeof input.error && null !== input.error && $io2(input.error))));
324
- const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
325
- const $io2 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io3(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io4(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io2(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
326
- const $io3 = input => Object.keys(input).every(key => {
327
- const value = input[key];
328
- if (undefined === value)
329
- return true;
330
- return "string" === typeof value;
331
- });
332
- const $io4 = input => true;
333
- return "object" === typeof input && null !== input && $io0(input);
334
- };
335
- export const assertFile = (input, errorFactory) => {
336
- const __is = input => {
337
- const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && "string" === typeof input.encoding && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (undefined !== input.error && (null === input.error || (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)) || "object" === typeof input.error && null !== input.error && $io2(input.error))));
338
- const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
339
- const $io2 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io3(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io4(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io2(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
340
- const $io3 = input => Object.keys(input).every(key => {
341
- const value = input[key];
342
- if (undefined === value)
343
- return true;
344
- return "string" === typeof value;
345
- });
346
- const $io4 = input => true;
347
- return "object" === typeof input && null !== input && $io0(input);
348
- };
349
- if (false === __is(input))
350
- ((input, _path, _exceptionable = true) => {
351
- const $guard = __typia.createAssert.guard;
352
- const $join = __typia.createAssert.join;
353
- const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
354
- path: _path + ".id",
355
- expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
356
- value: input.id
357
- }, errorFactory)) || $guard(_exceptionable, {
358
- path: _path + ".id",
359
- expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
360
- value: input.id
361
- }, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
362
- path: _path + ".size",
363
- expected: "number & Minimum<0>",
364
- value: input.size
365
- }, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000 || $guard(_exceptionable, {
366
- path: _path + ".size",
367
- expected: "number & Type<\"uint64\">",
368
- value: input.size
369
- }, errorFactory)) || $guard(_exceptionable, {
370
- path: _path + ".size",
371
- expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
372
- value: input.size
373
- }, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
374
- path: _path + ".seekable",
375
- expected: "boolean",
376
- value: input.seekable
377
- }, errorFactory)) && ("boolean" === typeof input.deleted || $guard(_exceptionable, {
378
- path: _path + ".deleted",
379
- expected: "boolean",
380
- value: input.deleted
381
- }, errorFactory)) && ((Array.isArray(input.refs) || $guard(_exceptionable, {
382
- path: _path + ".refs",
383
- expected: "FileRefs",
384
- value: input.refs
385
- }, errorFactory)) && input.refs.every((elem, _index1) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || $guard(_exceptionable, {
386
- path: _path + ".refs[" + _index1 + "]",
387
- expected: "FileRef",
388
- value: elem
389
- }, errorFactory)) && $ao1(elem, _path + ".refs[" + _index1 + "]", true && _exceptionable) || $guard(_exceptionable, {
390
- path: _path + ".refs[" + _index1 + "]",
391
- expected: "FileRef",
392
- value: elem
393
- }, errorFactory)) || $guard(_exceptionable, {
394
- path: _path + ".refs",
395
- expected: "FileRefs",
396
- value: input.refs
397
- }, errorFactory)) && ((Array.isArray(input.tags) || $guard(_exceptionable, {
398
- path: _path + ".tags",
399
- expected: "Array<string>",
400
- value: input.tags
401
- }, errorFactory)) && input.tags.every((elem, _index2) => "string" === typeof elem || $guard(_exceptionable, {
402
- path: _path + ".tags[" + _index2 + "]",
403
- expected: "string",
404
- value: elem
405
- }, errorFactory)) || $guard(_exceptionable, {
406
- path: _path + ".tags",
407
- expected: "Array<string>",
408
- value: input.tags
409
- }, errorFactory)) && ("string" === typeof input.resumable || $guard(_exceptionable, {
410
- path: _path + ".resumable",
411
- expected: "string",
412
- value: input.resumable
413
- }, errorFactory)) && ("string" === typeof input.mimeType || $guard(_exceptionable, {
414
- path: _path + ".mimeType",
415
- expected: "string",
416
- value: input.mimeType
417
- }, errorFactory)) && ("string" === typeof input.encoding || $guard(_exceptionable, {
418
- path: _path + ".encoding",
419
- expected: "string",
420
- value: input.encoding
421
- }, errorFactory)) && ("string" === typeof input.hash && (/^([A-Fa-f0-9]{32})?$/.test(input.hash) || $guard(_exceptionable, {
422
- path: _path + ".hash",
423
- expected: "string & Pattern<\"^([A-Fa-f0-9]{32})?$\">",
424
- value: input.hash
425
- }, errorFactory)) || $guard(_exceptionable, {
426
- path: _path + ".hash",
427
- expected: "(string & Pattern<\"^([A-Fa-f0-9]{32})?$\">)",
428
- value: input.hash
429
- }, errorFactory)) && ("number" === typeof input.btime && (0 <= input.btime || $guard(_exceptionable, {
430
- path: _path + ".btime",
431
- expected: "number & Minimum<0>",
432
- value: input.btime
433
- }, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000 || $guard(_exceptionable, {
434
- path: _path + ".btime",
435
- expected: "number & Type<\"uint64\">",
436
- value: input.btime
437
- }, errorFactory)) || $guard(_exceptionable, {
438
- path: _path + ".btime",
439
- expected: "(number & Minimum<0> & Type<\"uint64\">)",
440
- value: input.btime
441
- }, errorFactory)) && ("boolean" === typeof input.completed || $guard(_exceptionable, {
442
- path: _path + ".completed",
443
- expected: "boolean",
444
- value: input.completed
445
- }, errorFactory)) && ((undefined !== input.error || $guard(_exceptionable, {
446
- path: _path + ".error",
447
- expected: "(Array<NxtError> | NxtError | null)",
448
- value: input.error
449
- }, errorFactory)) && (null === input.error || (Array.isArray(input.error) && input.error.every((elem, _index3) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
450
- path: _path + ".error[" + _index3 + "]",
451
- expected: "NxtError",
452
- value: elem
453
- }, errorFactory)) && $ao2(elem, _path + ".error[" + _index3 + "]", true && _exceptionable) || $guard(_exceptionable, {
454
- path: _path + ".error[" + _index3 + "]",
455
- expected: "NxtError",
456
- value: elem
457
- }, errorFactory)) || "object" === typeof input.error && null !== input.error && $ao2(input.error, _path + ".error", true && _exceptionable) || $guard(_exceptionable, {
458
- path: _path + ".error",
459
- expected: "(Array<NxtError> | NxtError | null)",
460
- value: input.error
461
- }, errorFactory)) || $guard(_exceptionable, {
462
- path: _path + ".error",
463
- expected: "(Array<NxtError> | NxtError | null)",
464
- value: input.error
465
- }, errorFactory)));
466
- const $ao1 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
467
- path: _path + ".file",
468
- expected: "(string | undefined)",
469
- value: input.file
470
- }, errorFactory)) && (undefined === input.offset || "number" === typeof input.offset || $guard(_exceptionable, {
471
- path: _path + ".offset",
472
- expected: "(number | undefined)",
473
- value: input.offset
474
- }, errorFactory)) && (undefined === input.start || "number" === typeof input.start || $guard(_exceptionable, {
475
- path: _path + ".start",
476
- expected: "(number | undefined)",
477
- value: input.start
478
- }, errorFactory)) && (undefined === input.end || "number" === typeof input.end || $guard(_exceptionable, {
479
- path: _path + ".end",
480
- expected: "(number | undefined)",
481
- value: input.end
482
- }, errorFactory));
483
- const $ao2 = (input, _path, _exceptionable = true) => ("string" === typeof input.message || $guard(_exceptionable, {
484
- path: _path + ".message",
485
- expected: "string",
486
- value: input.message
487
- }, errorFactory)) && (undefined === input.type || "string" === typeof input.type || $guard(_exceptionable, {
488
- path: _path + ".type",
489
- expected: "(string | undefined)",
490
- value: input.type
491
- }, errorFactory)) && (undefined === input.code || "string" === typeof input.code || $guard(_exceptionable, {
492
- path: _path + ".code",
493
- expected: "(string | undefined)",
494
- value: input.code
495
- }, errorFactory)) && (undefined === input.exitCode || "number" === typeof input.exitCode || $guard(_exceptionable, {
496
- path: _path + ".exitCode",
497
- expected: "(number | undefined)",
498
- value: input.exitCode
499
- }, errorFactory)) && (undefined === input.signalCode || "number" === typeof input.signalCode || $guard(_exceptionable, {
500
- path: _path + ".signalCode",
501
- expected: "(number | undefined)",
502
- value: input.signalCode
503
- }, errorFactory)) && (undefined === input.statusCode || "number" === typeof input.statusCode || $guard(_exceptionable, {
504
- path: _path + ".statusCode",
505
- expected: "(number | undefined)",
506
- value: input.statusCode
507
- }, errorFactory)) && (undefined === input.headers || ("object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) || $guard(_exceptionable, {
508
- path: _path + ".headers",
509
- expected: "(Record<string, string> | undefined)",
510
- value: input.headers
511
- }, errorFactory)) && $ao3(input.headers, _path + ".headers", true && _exceptionable) || $guard(_exceptionable, {
512
- path: _path + ".headers",
513
- expected: "(Record<string, string> | undefined)",
514
- value: input.headers
515
- }, errorFactory)) && (undefined === input.data || ("object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) || $guard(_exceptionable, {
516
- path: _path + ".data",
517
- expected: "(object | undefined)",
518
- value: input.data
519
- }, errorFactory)) && $ao4(input.data, _path + ".data", true && _exceptionable) || $guard(_exceptionable, {
520
- path: _path + ".data",
521
- expected: "(object | undefined)",
522
- value: input.data
523
- }, errorFactory)) && (null === input.cause || undefined === input.cause || ("object" === typeof input.cause && null !== input.cause || $guard(_exceptionable, {
524
- path: _path + ".cause",
525
- expected: "(NxtError | null | undefined)",
526
- value: input.cause
527
- }, errorFactory)) && $ao2(input.cause, _path + ".cause", true && _exceptionable) || $guard(_exceptionable, {
528
- path: _path + ".cause",
529
- expected: "(NxtError | null | undefined)",
530
- value: input.cause
531
- }, errorFactory)) && (null === input.errors || undefined === input.errors || (Array.isArray(input.errors) || $guard(_exceptionable, {
532
- path: _path + ".errors",
533
- expected: "(Array<NxtError> | null | undefined)",
534
- value: input.errors
535
- }, errorFactory)) && input.errors.every((elem, _index4) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
536
- path: _path + ".errors[" + _index4 + "]",
537
- expected: "NxtError",
538
- value: elem
539
- }, errorFactory)) && $ao2(elem, _path + ".errors[" + _index4 + "]", true && _exceptionable) || $guard(_exceptionable, {
540
- path: _path + ".errors[" + _index4 + "]",
541
- expected: "NxtError",
542
- value: elem
543
- }, errorFactory)) || $guard(_exceptionable, {
544
- path: _path + ".errors",
545
- expected: "(Array<NxtError> | null | undefined)",
546
- value: input.errors
547
- }, errorFactory));
548
- const $ao3 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
549
- const value = input[key];
550
- if (undefined === value)
551
- return true;
552
- return "string" === typeof value || $guard(_exceptionable, {
553
- path: _path + $join(key),
554
- expected: "string",
555
- value: value
556
- }, errorFactory);
557
- });
558
- const $ao4 = (input, _path, _exceptionable = true) => true;
559
- return ("object" === typeof input && null !== input || $guard(true, {
560
- path: _path + "",
561
- expected: "File",
562
- value: input
563
- }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
564
- path: _path + "",
565
- expected: "File",
566
- value: input
567
- }, errorFactory);
568
- })(input, "$input", true);
91
+ }; })();
92
+ export const assertFile = (() => { const _io0 = input => "string" === typeof input.id && RegExp("^[0-9A-Za-z~][0-9A-Za-z~._: -]*$").test(input.id) && (null === input.size || "number" === typeof input.size && (0 <= input.size && __typia_transform__isTypeUint64._isTypeUint64(input.size))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && _io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && "string" === typeof input.encoding && ("string" === typeof input.hash && RegExp("^([A-Fa-f0-9]{32})?$").test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && __typia_transform__isTypeUint64._isTypeUint64(input.btime))) && "boolean" === typeof input.completed && (undefined !== input.error && (null === input.error || (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && _io2(elem)) || "object" === typeof input.error && null !== input.error && _io2(input.error)))); const _io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end); const _io2 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && _io3(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && _io4(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && _io2(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && _io2(elem))); const _io3 = input => Object.keys(input).every(key => {
93
+ const value = input[key];
94
+ if (undefined === value)
95
+ return true;
96
+ return "string" === typeof value;
97
+ }); const _io4 = input => true; const _ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id && (RegExp("^[0-9A-Za-z~][0-9A-Za-z~._: -]*$").test(input.id) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
98
+ method: "typia.createAssert",
99
+ path: _path + ".id",
100
+ expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
101
+ value: input.id
102
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
103
+ method: "typia.createAssert",
104
+ path: _path + ".id",
105
+ expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
106
+ value: input.id
107
+ }, _errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || __typia_transform__assertGuard._assertGuard(_exceptionable, {
108
+ method: "typia.createAssert",
109
+ path: _path + ".size",
110
+ expected: "number & Minimum<0>",
111
+ value: input.size
112
+ }, _errorFactory)) && (__typia_transform__isTypeUint64._isTypeUint64(input.size) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
113
+ method: "typia.createAssert",
114
+ path: _path + ".size",
115
+ expected: "number & Type<\"uint64\">",
116
+ value: input.size
117
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
118
+ method: "typia.createAssert",
119
+ path: _path + ".size",
120
+ expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
121
+ value: input.size
122
+ }, _errorFactory)) && ("boolean" === typeof input.seekable || __typia_transform__assertGuard._assertGuard(_exceptionable, {
123
+ method: "typia.createAssert",
124
+ path: _path + ".seekable",
125
+ expected: "boolean",
126
+ value: input.seekable
127
+ }, _errorFactory)) && ("boolean" === typeof input.deleted || __typia_transform__assertGuard._assertGuard(_exceptionable, {
128
+ method: "typia.createAssert",
129
+ path: _path + ".deleted",
130
+ expected: "boolean",
131
+ value: input.deleted
132
+ }, _errorFactory)) && ((Array.isArray(input.refs) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
133
+ method: "typia.createAssert",
134
+ path: _path + ".refs",
135
+ expected: "FileRefs",
136
+ value: input.refs
137
+ }, _errorFactory)) && input.refs.every((elem, _index5) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
138
+ method: "typia.createAssert",
139
+ path: _path + ".refs[" + _index5 + "]",
140
+ expected: "FileRef",
141
+ value: elem
142
+ }, _errorFactory)) && _ao1(elem, _path + ".refs[" + _index5 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
143
+ method: "typia.createAssert",
144
+ path: _path + ".refs[" + _index5 + "]",
145
+ expected: "FileRef",
146
+ value: elem
147
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
148
+ method: "typia.createAssert",
149
+ path: _path + ".refs",
150
+ expected: "FileRefs",
151
+ value: input.refs
152
+ }, _errorFactory)) && ((Array.isArray(input.tags) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
153
+ method: "typia.createAssert",
154
+ path: _path + ".tags",
155
+ expected: "Array<string>",
156
+ value: input.tags
157
+ }, _errorFactory)) && input.tags.every((elem, _index6) => "string" === typeof elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
158
+ method: "typia.createAssert",
159
+ path: _path + ".tags[" + _index6 + "]",
160
+ expected: "string",
161
+ value: elem
162
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
163
+ method: "typia.createAssert",
164
+ path: _path + ".tags",
165
+ expected: "Array<string>",
166
+ value: input.tags
167
+ }, _errorFactory)) && ("string" === typeof input.resumable || __typia_transform__assertGuard._assertGuard(_exceptionable, {
168
+ method: "typia.createAssert",
169
+ path: _path + ".resumable",
170
+ expected: "string",
171
+ value: input.resumable
172
+ }, _errorFactory)) && ("string" === typeof input.mimeType || __typia_transform__assertGuard._assertGuard(_exceptionable, {
173
+ method: "typia.createAssert",
174
+ path: _path + ".mimeType",
175
+ expected: "string",
176
+ value: input.mimeType
177
+ }, _errorFactory)) && ("string" === typeof input.encoding || __typia_transform__assertGuard._assertGuard(_exceptionable, {
178
+ method: "typia.createAssert",
179
+ path: _path + ".encoding",
180
+ expected: "string",
181
+ value: input.encoding
182
+ }, _errorFactory)) && ("string" === typeof input.hash && (RegExp("^([A-Fa-f0-9]{32})?$").test(input.hash) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
183
+ method: "typia.createAssert",
184
+ path: _path + ".hash",
185
+ expected: "string & Pattern<\"^([A-Fa-f0-9]{32})?$\">",
186
+ value: input.hash
187
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
188
+ method: "typia.createAssert",
189
+ path: _path + ".hash",
190
+ expected: "(string & Pattern<\"^([A-Fa-f0-9]{32})?$\">)",
191
+ value: input.hash
192
+ }, _errorFactory)) && ("number" === typeof input.btime && (0 <= input.btime || __typia_transform__assertGuard._assertGuard(_exceptionable, {
193
+ method: "typia.createAssert",
194
+ path: _path + ".btime",
195
+ expected: "number & Minimum<0>",
196
+ value: input.btime
197
+ }, _errorFactory)) && (__typia_transform__isTypeUint64._isTypeUint64(input.btime) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
198
+ method: "typia.createAssert",
199
+ path: _path + ".btime",
200
+ expected: "number & Type<\"uint64\">",
201
+ value: input.btime
202
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
203
+ method: "typia.createAssert",
204
+ path: _path + ".btime",
205
+ expected: "(number & Minimum<0> & Type<\"uint64\">)",
206
+ value: input.btime
207
+ }, _errorFactory)) && ("boolean" === typeof input.completed || __typia_transform__assertGuard._assertGuard(_exceptionable, {
208
+ method: "typia.createAssert",
209
+ path: _path + ".completed",
210
+ expected: "boolean",
211
+ value: input.completed
212
+ }, _errorFactory)) && ((undefined !== input.error || __typia_transform__assertGuard._assertGuard(_exceptionable, {
213
+ method: "typia.createAssert",
214
+ path: _path + ".error",
215
+ expected: "(Array<NxtError> | NxtError | null)",
216
+ value: input.error
217
+ }, _errorFactory)) && (null === input.error || (Array.isArray(input.error) && input.error.every((elem, _index7) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
218
+ method: "typia.createAssert",
219
+ path: _path + ".error[" + _index7 + "]",
220
+ expected: "NxtError",
221
+ value: elem
222
+ }, _errorFactory)) && _ao2(elem, _path + ".error[" + _index7 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
223
+ method: "typia.createAssert",
224
+ path: _path + ".error[" + _index7 + "]",
225
+ expected: "NxtError",
226
+ value: elem
227
+ }, _errorFactory)) || "object" === typeof input.error && null !== input.error && _ao2(input.error, _path + ".error", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
228
+ method: "typia.createAssert",
229
+ path: _path + ".error",
230
+ expected: "(Array<NxtError> | NxtError | null)",
231
+ value: input.error
232
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
233
+ method: "typia.createAssert",
234
+ path: _path + ".error",
235
+ expected: "(Array<NxtError> | NxtError | null)",
236
+ value: input.error
237
+ }, _errorFactory))); const _ao1 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || __typia_transform__assertGuard._assertGuard(_exceptionable, {
238
+ method: "typia.createAssert",
239
+ path: _path + ".file",
240
+ expected: "(string | undefined)",
241
+ value: input.file
242
+ }, _errorFactory)) && (undefined === input.offset || "number" === typeof input.offset || __typia_transform__assertGuard._assertGuard(_exceptionable, {
243
+ method: "typia.createAssert",
244
+ path: _path + ".offset",
245
+ expected: "(number | undefined)",
246
+ value: input.offset
247
+ }, _errorFactory)) && (undefined === input.start || "number" === typeof input.start || __typia_transform__assertGuard._assertGuard(_exceptionable, {
248
+ method: "typia.createAssert",
249
+ path: _path + ".start",
250
+ expected: "(number | undefined)",
251
+ value: input.start
252
+ }, _errorFactory)) && (undefined === input.end || "number" === typeof input.end || __typia_transform__assertGuard._assertGuard(_exceptionable, {
253
+ method: "typia.createAssert",
254
+ path: _path + ".end",
255
+ expected: "(number | undefined)",
256
+ value: input.end
257
+ }, _errorFactory)); const _ao2 = (input, _path, _exceptionable = true) => ("string" === typeof input.message || __typia_transform__assertGuard._assertGuard(_exceptionable, {
258
+ method: "typia.createAssert",
259
+ path: _path + ".message",
260
+ expected: "string",
261
+ value: input.message
262
+ }, _errorFactory)) && (undefined === input.type || "string" === typeof input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
263
+ method: "typia.createAssert",
264
+ path: _path + ".type",
265
+ expected: "(string | undefined)",
266
+ value: input.type
267
+ }, _errorFactory)) && (undefined === input.code || "string" === typeof input.code || __typia_transform__assertGuard._assertGuard(_exceptionable, {
268
+ method: "typia.createAssert",
269
+ path: _path + ".code",
270
+ expected: "(string | undefined)",
271
+ value: input.code
272
+ }, _errorFactory)) && (undefined === input.exitCode || "number" === typeof input.exitCode || __typia_transform__assertGuard._assertGuard(_exceptionable, {
273
+ method: "typia.createAssert",
274
+ path: _path + ".exitCode",
275
+ expected: "(number | undefined)",
276
+ value: input.exitCode
277
+ }, _errorFactory)) && (undefined === input.signalCode || "number" === typeof input.signalCode || __typia_transform__assertGuard._assertGuard(_exceptionable, {
278
+ method: "typia.createAssert",
279
+ path: _path + ".signalCode",
280
+ expected: "(number | undefined)",
281
+ value: input.signalCode
282
+ }, _errorFactory)) && (undefined === input.statusCode || "number" === typeof input.statusCode || __typia_transform__assertGuard._assertGuard(_exceptionable, {
283
+ method: "typia.createAssert",
284
+ path: _path + ".statusCode",
285
+ expected: "(number | undefined)",
286
+ value: input.statusCode
287
+ }, _errorFactory)) && (undefined === input.headers || ("object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
288
+ method: "typia.createAssert",
289
+ path: _path + ".headers",
290
+ expected: "(Record<string, string> | undefined)",
291
+ value: input.headers
292
+ }, _errorFactory)) && _ao3(input.headers, _path + ".headers", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
293
+ method: "typia.createAssert",
294
+ path: _path + ".headers",
295
+ expected: "(Record<string, string> | undefined)",
296
+ value: input.headers
297
+ }, _errorFactory)) && (undefined === input.data || ("object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
298
+ method: "typia.createAssert",
299
+ path: _path + ".data",
300
+ expected: "(object | undefined)",
301
+ value: input.data
302
+ }, _errorFactory)) && _ao4(input.data, _path + ".data", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
303
+ method: "typia.createAssert",
304
+ path: _path + ".data",
305
+ expected: "(object | undefined)",
306
+ value: input.data
307
+ }, _errorFactory)) && (null === input.cause || undefined === input.cause || ("object" === typeof input.cause && null !== input.cause || __typia_transform__assertGuard._assertGuard(_exceptionable, {
308
+ method: "typia.createAssert",
309
+ path: _path + ".cause",
310
+ expected: "(NxtError | null | undefined)",
311
+ value: input.cause
312
+ }, _errorFactory)) && _ao2(input.cause, _path + ".cause", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
313
+ method: "typia.createAssert",
314
+ path: _path + ".cause",
315
+ expected: "(NxtError | null | undefined)",
316
+ value: input.cause
317
+ }, _errorFactory)) && (null === input.errors || undefined === input.errors || (Array.isArray(input.errors) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
318
+ method: "typia.createAssert",
319
+ path: _path + ".errors",
320
+ expected: "(Array<NxtError> | null | undefined)",
321
+ value: input.errors
322
+ }, _errorFactory)) && input.errors.every((elem, _index8) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
323
+ method: "typia.createAssert",
324
+ path: _path + ".errors[" + _index8 + "]",
325
+ expected: "NxtError",
326
+ value: elem
327
+ }, _errorFactory)) && _ao2(elem, _path + ".errors[" + _index8 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
328
+ method: "typia.createAssert",
329
+ path: _path + ".errors[" + _index8 + "]",
330
+ expected: "NxtError",
331
+ value: elem
332
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
333
+ method: "typia.createAssert",
334
+ path: _path + ".errors",
335
+ expected: "(Array<NxtError> | null | undefined)",
336
+ value: input.errors
337
+ }, _errorFactory)); const _ao3 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
338
+ const value = input[key];
339
+ if (undefined === value)
340
+ return true;
341
+ return "string" === typeof value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
342
+ method: "typia.createAssert",
343
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
344
+ expected: "string",
345
+ value: value
346
+ }, _errorFactory);
347
+ }); const _ao4 = (input, _path, _exceptionable = true) => true; const __is = input => "object" === typeof input && null !== input && _io0(input); let _errorFactory; return (input, errorFactory) => {
348
+ if (false === __is(input)) {
349
+ _errorFactory = errorFactory;
350
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || __typia_transform__assertGuard._assertGuard(true, {
351
+ method: "typia.createAssert",
352
+ path: _path + "",
353
+ expected: "File",
354
+ value: input
355
+ }, _errorFactory)) && _ao0(input, _path + "", true) || __typia_transform__assertGuard._assertGuard(true, {
356
+ method: "typia.createAssert",
357
+ path: _path + "",
358
+ expected: "File",
359
+ value: input
360
+ }, _errorFactory))(input, "$input", true);
361
+ }
569
362
  return input;
570
- };
571
- export const randomFile = generator => {
572
- const $generator = __typia.createRandom.generator;
573
- const $pick = __typia.createRandom.pick;
574
- const $ro0 = (_recursive = false, _depth = 0) => ({
575
- id: (generator?.customs ?? $generator.customs)?.string?.([
576
- {
577
- name: "Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
578
- kind: "pattern",
579
- value: "^[0-9A-Za-z~][0-9A-Za-z~._: -]*$"
580
- }
581
- ]) ?? (generator?.pattern ?? $generator.pattern)(/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/),
582
- size: $pick([
583
- () => null,
584
- () => (generator?.customs ?? $generator.customs)?.number?.([
585
- {
586
- name: "Minimum<0>",
587
- kind: "minimum",
588
- value: 0
589
- },
590
- {
591
- name: "Type<\"uint64\">",
592
- kind: "type",
593
- value: "uint64"
594
- }
595
- ]) ?? (generator?.integer ?? $generator.integer)(0, 10)
596
- ])(),
597
- seekable: (generator?.boolean ?? $generator.boolean)(),
598
- deleted: (generator?.boolean ?? $generator.boolean)(),
599
- refs: (generator?.array ?? $generator.array)(() => $ro1(_recursive, _recursive ? 1 + _depth : _depth)),
600
- tags: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()),
601
- resumable: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
602
- mimeType: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
603
- encoding: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
604
- hash: (generator?.customs ?? $generator.customs)?.string?.([
605
- {
606
- name: "Pattern<\"^([A-Fa-f0-9]{32})?$\">",
607
- kind: "pattern",
608
- value: "^([A-Fa-f0-9]{32})?$"
609
- }
610
- ]) ?? (generator?.pattern ?? $generator.pattern)(/^([A-Fa-f0-9]{32})?$/),
611
- btime: (generator?.customs ?? $generator.customs)?.number?.([
612
- {
613
- name: "Minimum<0>",
614
- kind: "minimum",
615
- value: 0
616
- },
617
- {
618
- name: "Type<\"uint64\">",
619
- kind: "type",
620
- value: "uint64"
621
- }
622
- ]) ?? (generator?.integer ?? $generator.integer)(0, 10),
623
- completed: (generator?.boolean ?? $generator.boolean)(),
624
- error: $pick([
625
- () => null,
626
- () => (generator?.array ?? $generator.array)(() => $ro2(_recursive, _recursive ? 1 + _depth : _depth)),
627
- () => $ro2(_recursive, _recursive ? 1 + _depth : _depth)
628
- ])()
629
- });
630
- const $ro1 = (_recursive = false, _depth = 0) => ({
631
- file: $pick([
632
- () => undefined,
633
- () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
634
- ])(),
635
- offset: $pick([
636
- () => undefined,
637
- () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
638
- ])(),
639
- start: $pick([
640
- () => undefined,
641
- () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
642
- ])(),
643
- end: $pick([
644
- () => undefined,
645
- () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
646
- ])()
647
- });
648
- const $ro2 = (_recursive = true, _depth = 0) => ({
649
- message: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
650
- type: $pick([
651
- () => undefined,
652
- () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
653
- ])(),
654
- code: $pick([
655
- () => undefined,
656
- () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
657
- ])(),
658
- exitCode: $pick([
659
- () => undefined,
660
- () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
661
- ])(),
662
- signalCode: $pick([
663
- () => undefined,
664
- () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
665
- ])(),
666
- statusCode: $pick([
667
- () => undefined,
668
- () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
669
- ])(),
670
- headers: $pick([
671
- () => undefined,
672
- () => $ro3(true, _recursive ? 1 + _depth : _depth)
673
- ])(),
674
- data: $pick([
675
- () => undefined,
676
- () => $ro4(true, _recursive ? 1 + _depth : _depth)
677
- ])(),
678
- cause: $pick([
679
- () => undefined,
680
- () => null,
681
- () => $ro2(true, _recursive ? 1 + _depth : _depth)
682
- ])(),
683
- errors: $pick([
684
- () => undefined,
685
- () => null,
686
- () => _recursive && 5 < _depth ? [] : 5 >= _depth ? (generator?.array ?? $generator.array)(() => $ro2(true, _recursive ? 1 + _depth : _depth)) : []
687
- ])()
688
- });
689
- const $ro3 = (_recursive = false, _depth = 0) => {
690
- const output = {};
691
- (generator?.array ?? $generator.array)(() => output[(generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()] = (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(), (generator?.integer ?? $generator.integer)(0, 3));
692
- return output;
693
- };
694
- const $ro4 = (_recursive = false, _depth = 0) => {};
695
- return $ro0();
696
- };
697
- export const assertGuardFile = (input, errorFactory) => {
698
- const __is = input => {
699
- const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && "string" === typeof input.encoding && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (undefined !== input.error && (null === input.error || (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)) || "object" === typeof input.error && null !== input.error && $io2(input.error))));
700
- const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
701
- const $io2 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io3(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io4(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io2(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
702
- const $io3 = input => Object.keys(input).every(key => {
703
- const value = input[key];
704
- if (undefined === value)
705
- return true;
706
- return "string" === typeof value;
707
- });
708
- const $io4 = input => true;
709
- return "object" === typeof input && null !== input && $io0(input);
710
- };
711
- if (false === __is(input))
712
- ((input, _path, _exceptionable = true) => {
713
- const $guard = __typia.createAssertGuard.guard;
714
- const $join = __typia.createAssertGuard.join;
715
- const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
716
- path: _path + ".id",
717
- expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
718
- value: input.id
719
- }, errorFactory)) || $guard(_exceptionable, {
720
- path: _path + ".id",
721
- expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
722
- value: input.id
723
- }, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
724
- path: _path + ".size",
725
- expected: "number & Minimum<0>",
726
- value: input.size
727
- }, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000 || $guard(_exceptionable, {
728
- path: _path + ".size",
729
- expected: "number & Type<\"uint64\">",
730
- value: input.size
731
- }, errorFactory)) || $guard(_exceptionable, {
732
- path: _path + ".size",
733
- expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
734
- value: input.size
735
- }, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
736
- path: _path + ".seekable",
737
- expected: "boolean",
738
- value: input.seekable
739
- }, errorFactory)) && ("boolean" === typeof input.deleted || $guard(_exceptionable, {
740
- path: _path + ".deleted",
741
- expected: "boolean",
742
- value: input.deleted
743
- }, errorFactory)) && ((Array.isArray(input.refs) || $guard(_exceptionable, {
744
- path: _path + ".refs",
745
- expected: "FileRefs",
746
- value: input.refs
747
- }, errorFactory)) && input.refs.every((elem, _index1) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || $guard(_exceptionable, {
748
- path: _path + ".refs[" + _index1 + "]",
749
- expected: "FileRef",
750
- value: elem
751
- }, errorFactory)) && $ao1(elem, _path + ".refs[" + _index1 + "]", true && _exceptionable) || $guard(_exceptionable, {
752
- path: _path + ".refs[" + _index1 + "]",
753
- expected: "FileRef",
754
- value: elem
755
- }, errorFactory)) || $guard(_exceptionable, {
756
- path: _path + ".refs",
757
- expected: "FileRefs",
758
- value: input.refs
759
- }, errorFactory)) && ((Array.isArray(input.tags) || $guard(_exceptionable, {
760
- path: _path + ".tags",
761
- expected: "Array<string>",
762
- value: input.tags
763
- }, errorFactory)) && input.tags.every((elem, _index2) => "string" === typeof elem || $guard(_exceptionable, {
764
- path: _path + ".tags[" + _index2 + "]",
765
- expected: "string",
766
- value: elem
767
- }, errorFactory)) || $guard(_exceptionable, {
768
- path: _path + ".tags",
769
- expected: "Array<string>",
770
- value: input.tags
771
- }, errorFactory)) && ("string" === typeof input.resumable || $guard(_exceptionable, {
772
- path: _path + ".resumable",
773
- expected: "string",
774
- value: input.resumable
775
- }, errorFactory)) && ("string" === typeof input.mimeType || $guard(_exceptionable, {
776
- path: _path + ".mimeType",
777
- expected: "string",
778
- value: input.mimeType
779
- }, errorFactory)) && ("string" === typeof input.encoding || $guard(_exceptionable, {
780
- path: _path + ".encoding",
781
- expected: "string",
782
- value: input.encoding
783
- }, errorFactory)) && ("string" === typeof input.hash && (/^([A-Fa-f0-9]{32})?$/.test(input.hash) || $guard(_exceptionable, {
784
- path: _path + ".hash",
785
- expected: "string & Pattern<\"^([A-Fa-f0-9]{32})?$\">",
786
- value: input.hash
787
- }, errorFactory)) || $guard(_exceptionable, {
788
- path: _path + ".hash",
789
- expected: "(string & Pattern<\"^([A-Fa-f0-9]{32})?$\">)",
790
- value: input.hash
791
- }, errorFactory)) && ("number" === typeof input.btime && (0 <= input.btime || $guard(_exceptionable, {
792
- path: _path + ".btime",
793
- expected: "number & Minimum<0>",
794
- value: input.btime
795
- }, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000 || $guard(_exceptionable, {
796
- path: _path + ".btime",
797
- expected: "number & Type<\"uint64\">",
798
- value: input.btime
799
- }, errorFactory)) || $guard(_exceptionable, {
800
- path: _path + ".btime",
801
- expected: "(number & Minimum<0> & Type<\"uint64\">)",
802
- value: input.btime
803
- }, errorFactory)) && ("boolean" === typeof input.completed || $guard(_exceptionable, {
804
- path: _path + ".completed",
805
- expected: "boolean",
806
- value: input.completed
807
- }, errorFactory)) && ((undefined !== input.error || $guard(_exceptionable, {
808
- path: _path + ".error",
809
- expected: "(Array<NxtError> | NxtError | null)",
810
- value: input.error
811
- }, errorFactory)) && (null === input.error || (Array.isArray(input.error) && input.error.every((elem, _index3) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
812
- path: _path + ".error[" + _index3 + "]",
813
- expected: "NxtError",
814
- value: elem
815
- }, errorFactory)) && $ao2(elem, _path + ".error[" + _index3 + "]", true && _exceptionable) || $guard(_exceptionable, {
816
- path: _path + ".error[" + _index3 + "]",
817
- expected: "NxtError",
818
- value: elem
819
- }, errorFactory)) || "object" === typeof input.error && null !== input.error && $ao2(input.error, _path + ".error", true && _exceptionable) || $guard(_exceptionable, {
820
- path: _path + ".error",
821
- expected: "(Array<NxtError> | NxtError | null)",
822
- value: input.error
823
- }, errorFactory)) || $guard(_exceptionable, {
824
- path: _path + ".error",
825
- expected: "(Array<NxtError> | NxtError | null)",
826
- value: input.error
827
- }, errorFactory)));
828
- const $ao1 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
829
- path: _path + ".file",
830
- expected: "(string | undefined)",
831
- value: input.file
832
- }, errorFactory)) && (undefined === input.offset || "number" === typeof input.offset || $guard(_exceptionable, {
833
- path: _path + ".offset",
834
- expected: "(number | undefined)",
835
- value: input.offset
836
- }, errorFactory)) && (undefined === input.start || "number" === typeof input.start || $guard(_exceptionable, {
837
- path: _path + ".start",
838
- expected: "(number | undefined)",
839
- value: input.start
840
- }, errorFactory)) && (undefined === input.end || "number" === typeof input.end || $guard(_exceptionable, {
841
- path: _path + ".end",
842
- expected: "(number | undefined)",
843
- value: input.end
844
- }, errorFactory));
845
- const $ao2 = (input, _path, _exceptionable = true) => ("string" === typeof input.message || $guard(_exceptionable, {
846
- path: _path + ".message",
847
- expected: "string",
848
- value: input.message
849
- }, errorFactory)) && (undefined === input.type || "string" === typeof input.type || $guard(_exceptionable, {
850
- path: _path + ".type",
851
- expected: "(string | undefined)",
852
- value: input.type
853
- }, errorFactory)) && (undefined === input.code || "string" === typeof input.code || $guard(_exceptionable, {
854
- path: _path + ".code",
855
- expected: "(string | undefined)",
856
- value: input.code
857
- }, errorFactory)) && (undefined === input.exitCode || "number" === typeof input.exitCode || $guard(_exceptionable, {
858
- path: _path + ".exitCode",
859
- expected: "(number | undefined)",
860
- value: input.exitCode
861
- }, errorFactory)) && (undefined === input.signalCode || "number" === typeof input.signalCode || $guard(_exceptionable, {
862
- path: _path + ".signalCode",
863
- expected: "(number | undefined)",
864
- value: input.signalCode
865
- }, errorFactory)) && (undefined === input.statusCode || "number" === typeof input.statusCode || $guard(_exceptionable, {
866
- path: _path + ".statusCode",
867
- expected: "(number | undefined)",
868
- value: input.statusCode
869
- }, errorFactory)) && (undefined === input.headers || ("object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) || $guard(_exceptionable, {
870
- path: _path + ".headers",
871
- expected: "(Record<string, string> | undefined)",
872
- value: input.headers
873
- }, errorFactory)) && $ao3(input.headers, _path + ".headers", true && _exceptionable) || $guard(_exceptionable, {
874
- path: _path + ".headers",
875
- expected: "(Record<string, string> | undefined)",
876
- value: input.headers
877
- }, errorFactory)) && (undefined === input.data || ("object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) || $guard(_exceptionable, {
878
- path: _path + ".data",
879
- expected: "(object | undefined)",
880
- value: input.data
881
- }, errorFactory)) && $ao4(input.data, _path + ".data", true && _exceptionable) || $guard(_exceptionable, {
882
- path: _path + ".data",
883
- expected: "(object | undefined)",
884
- value: input.data
885
- }, errorFactory)) && (null === input.cause || undefined === input.cause || ("object" === typeof input.cause && null !== input.cause || $guard(_exceptionable, {
886
- path: _path + ".cause",
887
- expected: "(NxtError | null | undefined)",
888
- value: input.cause
889
- }, errorFactory)) && $ao2(input.cause, _path + ".cause", true && _exceptionable) || $guard(_exceptionable, {
890
- path: _path + ".cause",
891
- expected: "(NxtError | null | undefined)",
892
- value: input.cause
893
- }, errorFactory)) && (null === input.errors || undefined === input.errors || (Array.isArray(input.errors) || $guard(_exceptionable, {
894
- path: _path + ".errors",
895
- expected: "(Array<NxtError> | null | undefined)",
896
- value: input.errors
897
- }, errorFactory)) && input.errors.every((elem, _index4) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
898
- path: _path + ".errors[" + _index4 + "]",
899
- expected: "NxtError",
900
- value: elem
901
- }, errorFactory)) && $ao2(elem, _path + ".errors[" + _index4 + "]", true && _exceptionable) || $guard(_exceptionable, {
902
- path: _path + ".errors[" + _index4 + "]",
903
- expected: "NxtError",
904
- value: elem
905
- }, errorFactory)) || $guard(_exceptionable, {
906
- path: _path + ".errors",
907
- expected: "(Array<NxtError> | null | undefined)",
908
- value: input.errors
909
- }, errorFactory));
910
- const $ao3 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
911
- const value = input[key];
912
- if (undefined === value)
913
- return true;
914
- return "string" === typeof value || $guard(_exceptionable, {
915
- path: _path + $join(key),
916
- expected: "string",
917
- value: value
918
- }, errorFactory);
919
- });
920
- const $ao4 = (input, _path, _exceptionable = true) => true;
921
- return ("object" === typeof input && null !== input || $guard(true, {
922
- path: _path + "",
923
- expected: "File",
924
- value: input
925
- }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
926
- path: _path + "",
927
- expected: "File",
928
- value: input
929
- }, errorFactory);
930
- })(input, "$input", true);
931
- };
932
- export const stringifyFile = input => {
933
- const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
934
- const $io2 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io3(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io4(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io2(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
935
- const $io3 = input => Object.keys(input).every(key => {
936
- const value = input[key];
937
- if (undefined === value)
938
- return true;
939
- return "string" === typeof value;
940
- });
941
- const $io4 = input => true;
942
- const $string = __typia.json.createStringify.string;
943
- const $throws = __typia.json.createStringify.throws;
944
- const $tail = __typia.json.createStringify.tail;
945
- const $so0 = input => `{"id":${$string(input.id)},"size":${null !== input.size ? input.size : "null"},"seekable":${input.seekable},"deleted":${input.deleted},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"encoding":${$string(input.encoding)},"hash":${$string(input.hash)},"btime":${input.btime},"completed":${input.completed},"error":${null !== input.error ? (() => {
946
- if (Array.isArray(input.error))
947
- return `[${input.error.map(elem => $so2(elem)).join(",")}]`;
948
- if ("object" === typeof input.error && null !== input.error)
949
- return $so2(input.error);
950
- $throws({
951
- expected: "(Array<NxtError> | NxtError | null)",
952
- value: input.error
953
- });
954
- })() : "null"}}`;
955
- const $so1 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined},`}${undefined === input.offset ? "" : `"offset":${undefined !== input.offset ? input.offset : undefined},`}${undefined === input.start ? "" : `"start":${undefined !== input.start ? input.start : undefined},`}${undefined === input.end ? "" : `"end":${undefined !== input.end ? input.end : undefined}`}`)}}`;
956
- const $so2 = input => `{${undefined === input.type ? "" : `"type":${undefined !== input.type ? $string(input.type) : undefined},`}${undefined === input.code ? "" : `"code":${undefined !== input.code ? $string(input.code) : undefined},`}${undefined === input.exitCode ? "" : `"exitCode":${undefined !== input.exitCode ? input.exitCode : undefined},`}${undefined === input.signalCode ? "" : `"signalCode":${undefined !== input.signalCode ? input.signalCode : undefined},`}${undefined === input.statusCode ? "" : `"statusCode":${undefined !== input.statusCode ? input.statusCode : undefined},`}${undefined === input.headers ? "" : `"headers":${undefined !== input.headers ? $so3(input.headers) : undefined},`}${undefined === input.data ? "" : `"data":${undefined !== input.data ? "{}" : undefined},`}${undefined === input.cause ? "" : `"cause":${undefined !== input.cause ? null !== input.cause ? $so2(input.cause) : "null" : undefined},`}${undefined === input.errors ? "" : `"errors":${undefined !== input.errors ? null !== input.errors ? `[${input.errors.map(elem => $so2(elem)).join(",")}]` : "null" : undefined},`}"message":${$string(input.message)}}`;
957
- const $so3 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
958
- return ""; return `${JSON.stringify(key)}:${$string(value)}`; }).filter(str => "" !== str).join(",")}}`;
959
- return $so0(input);
960
- };
961
- export const assertStringifyFile = (input, errorFactory) => { const assert = (input, errorFactory) => {
962
- const __is = input => {
963
- const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && "string" === typeof input.encoding && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (undefined !== input.error && (null === input.error || (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)) || "object" === typeof input.error && null !== input.error && $io2(input.error))));
964
- const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset && !Number.isNaN(input.offset)) && (undefined === input.start || "number" === typeof input.start && !Number.isNaN(input.start)) && (undefined === input.end || "number" === typeof input.end && !Number.isNaN(input.end));
965
- const $io2 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode && !Number.isNaN(input.exitCode)) && (undefined === input.signalCode || "number" === typeof input.signalCode && !Number.isNaN(input.signalCode)) && (undefined === input.statusCode || "number" === typeof input.statusCode && !Number.isNaN(input.statusCode)) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io3(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io4(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io2(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
966
- const $io3 = input => Object.keys(input).every(key => {
967
- const value = input[key];
968
- if (undefined === value)
969
- return true;
970
- return "string" === typeof value;
971
- });
972
- const $io4 = input => true;
973
- return "object" === typeof input && null !== input && $io0(input);
974
- };
975
- if (false === __is(input))
976
- ((input, _path, _exceptionable = true) => {
977
- const $guard = __typia.json.createAssertStringify.guard;
978
- const $join = __typia.json.createAssertStringify.join;
979
- const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
980
- path: _path + ".id",
981
- expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
982
- value: input.id
983
- }, errorFactory)) || $guard(_exceptionable, {
984
- path: _path + ".id",
985
- expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
986
- value: input.id
987
- }, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
988
- path: _path + ".size",
989
- expected: "number & Minimum<0>",
990
- value: input.size
991
- }, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000 || $guard(_exceptionable, {
992
- path: _path + ".size",
993
- expected: "number & Type<\"uint64\">",
994
- value: input.size
995
- }, errorFactory)) || $guard(_exceptionable, {
996
- path: _path + ".size",
997
- expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
998
- value: input.size
999
- }, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
1000
- path: _path + ".seekable",
1001
- expected: "boolean",
1002
- value: input.seekable
1003
- }, errorFactory)) && ("boolean" === typeof input.deleted || $guard(_exceptionable, {
1004
- path: _path + ".deleted",
1005
- expected: "boolean",
1006
- value: input.deleted
1007
- }, errorFactory)) && ((Array.isArray(input.refs) || $guard(_exceptionable, {
1008
- path: _path + ".refs",
1009
- expected: "FileRefs",
1010
- value: input.refs
1011
- }, errorFactory)) && input.refs.every((elem, _index1) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || $guard(_exceptionable, {
1012
- path: _path + ".refs[" + _index1 + "]",
1013
- expected: "FileRef",
1014
- value: elem
1015
- }, errorFactory)) && $ao1(elem, _path + ".refs[" + _index1 + "]", true && _exceptionable) || $guard(_exceptionable, {
1016
- path: _path + ".refs[" + _index1 + "]",
1017
- expected: "FileRef",
1018
- value: elem
1019
- }, errorFactory)) || $guard(_exceptionable, {
1020
- path: _path + ".refs",
1021
- expected: "FileRefs",
1022
- value: input.refs
1023
- }, errorFactory)) && ((Array.isArray(input.tags) || $guard(_exceptionable, {
1024
- path: _path + ".tags",
1025
- expected: "Array<string>",
1026
- value: input.tags
1027
- }, errorFactory)) && input.tags.every((elem, _index2) => "string" === typeof elem || $guard(_exceptionable, {
1028
- path: _path + ".tags[" + _index2 + "]",
1029
- expected: "string",
1030
- value: elem
1031
- }, errorFactory)) || $guard(_exceptionable, {
1032
- path: _path + ".tags",
1033
- expected: "Array<string>",
1034
- value: input.tags
1035
- }, errorFactory)) && ("string" === typeof input.resumable || $guard(_exceptionable, {
1036
- path: _path + ".resumable",
1037
- expected: "string",
1038
- value: input.resumable
1039
- }, errorFactory)) && ("string" === typeof input.mimeType || $guard(_exceptionable, {
1040
- path: _path + ".mimeType",
1041
- expected: "string",
1042
- value: input.mimeType
1043
- }, errorFactory)) && ("string" === typeof input.encoding || $guard(_exceptionable, {
1044
- path: _path + ".encoding",
1045
- expected: "string",
1046
- value: input.encoding
1047
- }, errorFactory)) && ("string" === typeof input.hash && (/^([A-Fa-f0-9]{32})?$/.test(input.hash) || $guard(_exceptionable, {
1048
- path: _path + ".hash",
1049
- expected: "string & Pattern<\"^([A-Fa-f0-9]{32})?$\">",
1050
- value: input.hash
1051
- }, errorFactory)) || $guard(_exceptionable, {
1052
- path: _path + ".hash",
1053
- expected: "(string & Pattern<\"^([A-Fa-f0-9]{32})?$\">)",
1054
- value: input.hash
1055
- }, errorFactory)) && ("number" === typeof input.btime && (0 <= input.btime || $guard(_exceptionable, {
1056
- path: _path + ".btime",
1057
- expected: "number & Minimum<0>",
1058
- value: input.btime
1059
- }, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000 || $guard(_exceptionable, {
1060
- path: _path + ".btime",
1061
- expected: "number & Type<\"uint64\">",
1062
- value: input.btime
1063
- }, errorFactory)) || $guard(_exceptionable, {
1064
- path: _path + ".btime",
1065
- expected: "(number & Minimum<0> & Type<\"uint64\">)",
1066
- value: input.btime
1067
- }, errorFactory)) && ("boolean" === typeof input.completed || $guard(_exceptionable, {
1068
- path: _path + ".completed",
1069
- expected: "boolean",
1070
- value: input.completed
1071
- }, errorFactory)) && ((undefined !== input.error || $guard(_exceptionable, {
1072
- path: _path + ".error",
1073
- expected: "(Array<NxtError> | NxtError | null)",
1074
- value: input.error
1075
- }, errorFactory)) && (null === input.error || (Array.isArray(input.error) && input.error.every((elem, _index3) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
1076
- path: _path + ".error[" + _index3 + "]",
1077
- expected: "NxtError",
1078
- value: elem
1079
- }, errorFactory)) && $ao2(elem, _path + ".error[" + _index3 + "]", true && _exceptionable) || $guard(_exceptionable, {
1080
- path: _path + ".error[" + _index3 + "]",
1081
- expected: "NxtError",
1082
- value: elem
1083
- }, errorFactory)) || "object" === typeof input.error && null !== input.error && $ao2(input.error, _path + ".error", true && _exceptionable) || $guard(_exceptionable, {
1084
- path: _path + ".error",
1085
- expected: "(Array<NxtError> | NxtError | null)",
1086
- value: input.error
1087
- }, errorFactory)) || $guard(_exceptionable, {
1088
- path: _path + ".error",
1089
- expected: "(Array<NxtError> | NxtError | null)",
1090
- value: input.error
1091
- }, errorFactory)));
1092
- const $ao1 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
1093
- path: _path + ".file",
1094
- expected: "(string | undefined)",
1095
- value: input.file
1096
- }, errorFactory)) && (undefined === input.offset || "number" === typeof input.offset && !Number.isNaN(input.offset) || $guard(_exceptionable, {
1097
- path: _path + ".offset",
1098
- expected: "(number | undefined)",
1099
- value: input.offset
1100
- }, errorFactory)) && (undefined === input.start || "number" === typeof input.start && !Number.isNaN(input.start) || $guard(_exceptionable, {
1101
- path: _path + ".start",
1102
- expected: "(number | undefined)",
1103
- value: input.start
1104
- }, errorFactory)) && (undefined === input.end || "number" === typeof input.end && !Number.isNaN(input.end) || $guard(_exceptionable, {
1105
- path: _path + ".end",
1106
- expected: "(number | undefined)",
1107
- value: input.end
1108
- }, errorFactory));
1109
- const $ao2 = (input, _path, _exceptionable = true) => ("string" === typeof input.message || $guard(_exceptionable, {
1110
- path: _path + ".message",
1111
- expected: "string",
1112
- value: input.message
1113
- }, errorFactory)) && (undefined === input.type || "string" === typeof input.type || $guard(_exceptionable, {
1114
- path: _path + ".type",
1115
- expected: "(string | undefined)",
1116
- value: input.type
1117
- }, errorFactory)) && (undefined === input.code || "string" === typeof input.code || $guard(_exceptionable, {
1118
- path: _path + ".code",
1119
- expected: "(string | undefined)",
1120
- value: input.code
1121
- }, errorFactory)) && (undefined === input.exitCode || "number" === typeof input.exitCode && !Number.isNaN(input.exitCode) || $guard(_exceptionable, {
1122
- path: _path + ".exitCode",
1123
- expected: "(number | undefined)",
1124
- value: input.exitCode
1125
- }, errorFactory)) && (undefined === input.signalCode || "number" === typeof input.signalCode && !Number.isNaN(input.signalCode) || $guard(_exceptionable, {
1126
- path: _path + ".signalCode",
1127
- expected: "(number | undefined)",
1128
- value: input.signalCode
1129
- }, errorFactory)) && (undefined === input.statusCode || "number" === typeof input.statusCode && !Number.isNaN(input.statusCode) || $guard(_exceptionable, {
1130
- path: _path + ".statusCode",
1131
- expected: "(number | undefined)",
1132
- value: input.statusCode
1133
- }, errorFactory)) && (undefined === input.headers || ("object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) || $guard(_exceptionable, {
1134
- path: _path + ".headers",
1135
- expected: "(Record<string, string> | undefined)",
1136
- value: input.headers
1137
- }, errorFactory)) && $ao3(input.headers, _path + ".headers", true && _exceptionable) || $guard(_exceptionable, {
1138
- path: _path + ".headers",
1139
- expected: "(Record<string, string> | undefined)",
1140
- value: input.headers
1141
- }, errorFactory)) && (undefined === input.data || ("object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) || $guard(_exceptionable, {
1142
- path: _path + ".data",
1143
- expected: "(object | undefined)",
1144
- value: input.data
1145
- }, errorFactory)) && $ao4(input.data, _path + ".data", true && _exceptionable) || $guard(_exceptionable, {
1146
- path: _path + ".data",
1147
- expected: "(object | undefined)",
1148
- value: input.data
1149
- }, errorFactory)) && (null === input.cause || undefined === input.cause || ("object" === typeof input.cause && null !== input.cause || $guard(_exceptionable, {
1150
- path: _path + ".cause",
1151
- expected: "(NxtError | null | undefined)",
1152
- value: input.cause
1153
- }, errorFactory)) && $ao2(input.cause, _path + ".cause", true && _exceptionable) || $guard(_exceptionable, {
1154
- path: _path + ".cause",
1155
- expected: "(NxtError | null | undefined)",
1156
- value: input.cause
1157
- }, errorFactory)) && (null === input.errors || undefined === input.errors || (Array.isArray(input.errors) || $guard(_exceptionable, {
1158
- path: _path + ".errors",
1159
- expected: "(Array<NxtError> | null | undefined)",
1160
- value: input.errors
1161
- }, errorFactory)) && input.errors.every((elem, _index4) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
1162
- path: _path + ".errors[" + _index4 + "]",
1163
- expected: "NxtError",
1164
- value: elem
1165
- }, errorFactory)) && $ao2(elem, _path + ".errors[" + _index4 + "]", true && _exceptionable) || $guard(_exceptionable, {
1166
- path: _path + ".errors[" + _index4 + "]",
1167
- expected: "NxtError",
1168
- value: elem
1169
- }, errorFactory)) || $guard(_exceptionable, {
1170
- path: _path + ".errors",
1171
- expected: "(Array<NxtError> | null | undefined)",
1172
- value: input.errors
1173
- }, errorFactory));
1174
- const $ao3 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
1175
- const value = input[key];
1176
- if (undefined === value)
1177
- return true;
1178
- return "string" === typeof value || $guard(_exceptionable, {
1179
- path: _path + $join(key),
1180
- expected: "string",
1181
- value: value
1182
- }, errorFactory);
1183
- });
1184
- const $ao4 = (input, _path, _exceptionable = true) => true;
1185
- return ("object" === typeof input && null !== input || $guard(true, {
1186
- path: _path + "",
1187
- expected: "File",
1188
- value: input
1189
- }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
1190
- path: _path + "",
1191
- expected: "File",
1192
- value: input
1193
- }, errorFactory);
1194
- })(input, "$input", true);
1195
- return input;
1196
- }; const stringify = input => {
1197
- const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
1198
- const $io2 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io3(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io4(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io2(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
1199
- const $io3 = input => Object.keys(input).every(key => {
1200
- const value = input[key];
1201
- if (undefined === value)
1202
- return true;
1203
- return "string" === typeof value;
1204
- });
1205
- const $io4 = input => true;
1206
- const $string = __typia.json.createAssertStringify.string;
1207
- const $throws = __typia.json.createAssertStringify.throws;
1208
- const $tail = __typia.json.createAssertStringify.tail;
1209
- const $so0 = input => `{"id":${$string(input.id)},"size":${null !== input.size ? input.size : "null"},"seekable":${input.seekable},"deleted":${input.deleted},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"encoding":${$string(input.encoding)},"hash":${$string(input.hash)},"btime":${input.btime},"completed":${input.completed},"error":${null !== input.error ? (() => {
1210
- if (Array.isArray(input.error))
1211
- return `[${input.error.map(elem => $so2(elem)).join(",")}]`;
1212
- if ("object" === typeof input.error && null !== input.error)
1213
- return $so2(input.error);
1214
- $throws({
1215
- expected: "(Array<NxtError> | NxtError | null)",
1216
- value: input.error
1217
- });
1218
- })() : "null"}}`;
1219
- const $so1 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined},`}${undefined === input.offset ? "" : `"offset":${undefined !== input.offset ? input.offset : undefined},`}${undefined === input.start ? "" : `"start":${undefined !== input.start ? input.start : undefined},`}${undefined === input.end ? "" : `"end":${undefined !== input.end ? input.end : undefined}`}`)}}`;
1220
- const $so2 = input => `{${undefined === input.type ? "" : `"type":${undefined !== input.type ? $string(input.type) : undefined},`}${undefined === input.code ? "" : `"code":${undefined !== input.code ? $string(input.code) : undefined},`}${undefined === input.exitCode ? "" : `"exitCode":${undefined !== input.exitCode ? input.exitCode : undefined},`}${undefined === input.signalCode ? "" : `"signalCode":${undefined !== input.signalCode ? input.signalCode : undefined},`}${undefined === input.statusCode ? "" : `"statusCode":${undefined !== input.statusCode ? input.statusCode : undefined},`}${undefined === input.headers ? "" : `"headers":${undefined !== input.headers ? $so3(input.headers) : undefined},`}${undefined === input.data ? "" : `"data":${undefined !== input.data ? "{}" : undefined},`}${undefined === input.cause ? "" : `"cause":${undefined !== input.cause ? null !== input.cause ? $so2(input.cause) : "null" : undefined},`}${undefined === input.errors ? "" : `"errors":${undefined !== input.errors ? null !== input.errors ? `[${input.errors.map(elem => $so2(elem)).join(",")}]` : "null" : undefined},`}"message":${$string(input.message)}}`;
1221
- const $so3 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
1222
- return ""; return `${JSON.stringify(key)}:${$string(value)}`; }).filter(str => "" !== str).join(",")}}`;
1223
- return $so0(input);
1224
- }; return stringify(assert(input, errorFactory)); };
1225
- export const isFileStats = input => {
1226
- const $io0 = input => (null === input.position || "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000))) && (null === input.uploading || "boolean" === typeof input.uploading) && (Array.isArray(input.zones) && input.zones.every(elem => "string" === typeof elem)) && (Array.isArray(input.replicas) && input.replicas.every(elem => "string" === typeof elem)) && (Array.isArray(input.locations) && input.locations.every(elem => "string" === typeof elem)) && (Array.isArray(input.ranges) && input.ranges.every(elem => Array.isArray(elem) && (elem.length === 2 && ("number" === typeof elem[0] && 0 <= elem[0]) && ("number" === typeof elem[1] && 0 <= elem[1])))) && (undefined === input.progress || "number" === typeof input.progress && (0 <= input.progress && input.progress <= 1)) && (undefined === input.speed || "number" === typeof input.speed && 0 <= input.speed) && ("string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id)) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && "string" === typeof input.encoding && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (undefined !== input.error && (null === input.error || (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)) || "object" === typeof input.error && null !== input.error && $io2(input.error))));
1227
- const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
1228
- const $io2 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io3(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io4(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io2(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
1229
- const $io3 = input => Object.keys(input).every(key => {
1230
- const value = input[key];
1231
- if (undefined === value)
1232
- return true;
1233
- return "string" === typeof value;
1234
- });
1235
- const $io4 = input => true;
1236
- return "object" === typeof input && null !== input && $io0(input);
1237
- };
1238
- export const assertFileStats = (input, errorFactory) => {
1239
- const __is = input => {
1240
- const $io0 = input => (null === input.position || "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000))) && (null === input.uploading || "boolean" === typeof input.uploading) && (Array.isArray(input.zones) && input.zones.every(elem => "string" === typeof elem)) && (Array.isArray(input.replicas) && input.replicas.every(elem => "string" === typeof elem)) && (Array.isArray(input.locations) && input.locations.every(elem => "string" === typeof elem)) && (Array.isArray(input.ranges) && input.ranges.every(elem => Array.isArray(elem) && (elem.length === 2 && ("number" === typeof elem[0] && 0 <= elem[0]) && ("number" === typeof elem[1] && 0 <= elem[1])))) && (undefined === input.progress || "number" === typeof input.progress && (0 <= input.progress && input.progress <= 1)) && (undefined === input.speed || "number" === typeof input.speed && 0 <= input.speed) && ("string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id)) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && "string" === typeof input.encoding && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (undefined !== input.error && (null === input.error || (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)) || "object" === typeof input.error && null !== input.error && $io2(input.error))));
1241
- const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
1242
- const $io2 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io3(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io4(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io2(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
1243
- const $io3 = input => Object.keys(input).every(key => {
1244
- const value = input[key];
1245
- if (undefined === value)
1246
- return true;
1247
- return "string" === typeof value;
1248
- });
1249
- const $io4 = input => true;
1250
- return "object" === typeof input && null !== input && $io0(input);
1251
- };
1252
- if (false === __is(input))
1253
- ((input, _path, _exceptionable = true) => {
1254
- const $guard = __typia.createAssert.guard;
1255
- const $join = __typia.createAssert.join;
1256
- const $ao0 = (input, _path, _exceptionable = true) => (null === input.position || "number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
1257
- path: _path + ".position",
1258
- expected: "number & Minimum<0>",
1259
- value: input.position
1260
- }, errorFactory)) && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000 || $guard(_exceptionable, {
1261
- path: _path + ".position",
1262
- expected: "number & Type<\"uint64\">",
1263
- value: input.position
1264
- }, errorFactory)) || $guard(_exceptionable, {
1265
- path: _path + ".position",
1266
- expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
1267
- value: input.position
1268
- }, errorFactory)) && (null === input.uploading || "boolean" === typeof input.uploading || $guard(_exceptionable, {
1269
- path: _path + ".uploading",
1270
- expected: "(boolean | null)",
1271
- value: input.uploading
1272
- }, errorFactory)) && ((Array.isArray(input.zones) || $guard(_exceptionable, {
1273
- path: _path + ".zones",
1274
- expected: "Array<string>",
1275
- value: input.zones
1276
- }, errorFactory)) && input.zones.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
1277
- path: _path + ".zones[" + _index1 + "]",
1278
- expected: "string",
1279
- value: elem
1280
- }, errorFactory)) || $guard(_exceptionable, {
1281
- path: _path + ".zones",
1282
- expected: "Array<string>",
1283
- value: input.zones
1284
- }, errorFactory)) && ((Array.isArray(input.replicas) || $guard(_exceptionable, {
1285
- path: _path + ".replicas",
1286
- expected: "Array<string>",
1287
- value: input.replicas
1288
- }, errorFactory)) && input.replicas.every((elem, _index2) => "string" === typeof elem || $guard(_exceptionable, {
1289
- path: _path + ".replicas[" + _index2 + "]",
1290
- expected: "string",
1291
- value: elem
1292
- }, errorFactory)) || $guard(_exceptionable, {
1293
- path: _path + ".replicas",
1294
- expected: "Array<string>",
1295
- value: input.replicas
1296
- }, errorFactory)) && ((Array.isArray(input.locations) || $guard(_exceptionable, {
1297
- path: _path + ".locations",
1298
- expected: "Array<string>",
1299
- value: input.locations
1300
- }, errorFactory)) && input.locations.every((elem, _index3) => "string" === typeof elem || $guard(_exceptionable, {
1301
- path: _path + ".locations[" + _index3 + "]",
1302
- expected: "string",
1303
- value: elem
1304
- }, errorFactory)) || $guard(_exceptionable, {
1305
- path: _path + ".locations",
1306
- expected: "Array<string>",
1307
- value: input.locations
1308
- }, errorFactory)) && ((Array.isArray(input.ranges) || $guard(_exceptionable, {
1309
- path: _path + ".ranges",
1310
- expected: "Array<[start: number & Minimum<0>, end: number & Minimum<0>]>",
1311
- value: input.ranges
1312
- }, errorFactory)) && input.ranges.every((elem, _index4) => (Array.isArray(elem) || $guard(_exceptionable, {
1313
- path: _path + ".ranges[" + _index4 + "]",
1314
- expected: "[start: number & Minimum<0>, end: number & Minimum<0>]",
1315
- value: elem
1316
- }, errorFactory)) && ((elem.length === 2 || $guard(_exceptionable, {
1317
- path: _path + ".ranges[" + _index4 + "]",
1318
- expected: "[(number & Minimum<0>), (number & Minimum<0>)]",
1319
- value: elem
1320
- }, errorFactory)) && ("number" === typeof elem[0] && (0 <= elem[0] || $guard(_exceptionable, {
1321
- path: _path + ".ranges[" + _index4 + "][0]",
1322
- expected: "number & Minimum<0>",
1323
- value: elem[0]
1324
- }, errorFactory)) || $guard(_exceptionable, {
1325
- path: _path + ".ranges[" + _index4 + "][0]",
1326
- expected: "(number & Minimum<0>)",
1327
- value: elem[0]
1328
- }, errorFactory)) && ("number" === typeof elem[1] && (0 <= elem[1] || $guard(_exceptionable, {
1329
- path: _path + ".ranges[" + _index4 + "][1]",
1330
- expected: "number & Minimum<0>",
1331
- value: elem[1]
1332
- }, errorFactory)) || $guard(_exceptionable, {
1333
- path: _path + ".ranges[" + _index4 + "][1]",
1334
- expected: "(number & Minimum<0>)",
1335
- value: elem[1]
1336
- }, errorFactory))) || $guard(_exceptionable, {
1337
- path: _path + ".ranges[" + _index4 + "]",
1338
- expected: "[start: number & Minimum<0>, end: number & Minimum<0>]",
1339
- value: elem
1340
- }, errorFactory)) || $guard(_exceptionable, {
1341
- path: _path + ".ranges",
1342
- expected: "Array<[start: number & Minimum<0>, end: number & Minimum<0>]>",
1343
- value: input.ranges
1344
- }, errorFactory)) && (undefined === input.progress || "number" === typeof input.progress && (0 <= input.progress || $guard(_exceptionable, {
1345
- path: _path + ".progress",
1346
- expected: "number & Minimum<0>",
1347
- value: input.progress
1348
- }, errorFactory)) && (input.progress <= 1 || $guard(_exceptionable, {
1349
- path: _path + ".progress",
1350
- expected: "number & Maximum<1>",
1351
- value: input.progress
1352
- }, errorFactory)) || $guard(_exceptionable, {
1353
- path: _path + ".progress",
1354
- expected: "((number & Minimum<0> & Maximum<1>) | undefined)",
1355
- value: input.progress
1356
- }, errorFactory)) && (undefined === input.speed || "number" === typeof input.speed && (0 <= input.speed || $guard(_exceptionable, {
1357
- path: _path + ".speed",
1358
- expected: "number & Minimum<0>",
1359
- value: input.speed
1360
- }, errorFactory)) || $guard(_exceptionable, {
1361
- path: _path + ".speed",
1362
- expected: "((number & Minimum<0>) | undefined)",
1363
- value: input.speed
1364
- }, errorFactory)) && ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
1365
- path: _path + ".id",
1366
- expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
1367
- value: input.id
1368
- }, errorFactory)) || $guard(_exceptionable, {
1369
- path: _path + ".id",
1370
- expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
1371
- value: input.id
1372
- }, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
1373
- path: _path + ".size",
1374
- expected: "number & Minimum<0>",
1375
- value: input.size
1376
- }, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000 || $guard(_exceptionable, {
1377
- path: _path + ".size",
1378
- expected: "number & Type<\"uint64\">",
1379
- value: input.size
1380
- }, errorFactory)) || $guard(_exceptionable, {
1381
- path: _path + ".size",
1382
- expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
1383
- value: input.size
1384
- }, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
1385
- path: _path + ".seekable",
1386
- expected: "boolean",
1387
- value: input.seekable
1388
- }, errorFactory)) && ("boolean" === typeof input.deleted || $guard(_exceptionable, {
1389
- path: _path + ".deleted",
1390
- expected: "boolean",
1391
- value: input.deleted
1392
- }, errorFactory)) && ((Array.isArray(input.refs) || $guard(_exceptionable, {
1393
- path: _path + ".refs",
1394
- expected: "FileRefs",
1395
- value: input.refs
1396
- }, errorFactory)) && input.refs.every((elem, _index5) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || $guard(_exceptionable, {
1397
- path: _path + ".refs[" + _index5 + "]",
1398
- expected: "FileRef",
1399
- value: elem
1400
- }, errorFactory)) && $ao1(elem, _path + ".refs[" + _index5 + "]", true && _exceptionable) || $guard(_exceptionable, {
1401
- path: _path + ".refs[" + _index5 + "]",
1402
- expected: "FileRef",
1403
- value: elem
1404
- }, errorFactory)) || $guard(_exceptionable, {
1405
- path: _path + ".refs",
1406
- expected: "FileRefs",
1407
- value: input.refs
1408
- }, errorFactory)) && ((Array.isArray(input.tags) || $guard(_exceptionable, {
1409
- path: _path + ".tags",
1410
- expected: "Array<string>",
1411
- value: input.tags
1412
- }, errorFactory)) && input.tags.every((elem, _index6) => "string" === typeof elem || $guard(_exceptionable, {
1413
- path: _path + ".tags[" + _index6 + "]",
1414
- expected: "string",
1415
- value: elem
1416
- }, errorFactory)) || $guard(_exceptionable, {
1417
- path: _path + ".tags",
1418
- expected: "Array<string>",
1419
- value: input.tags
1420
- }, errorFactory)) && ("string" === typeof input.resumable || $guard(_exceptionable, {
1421
- path: _path + ".resumable",
1422
- expected: "string",
1423
- value: input.resumable
1424
- }, errorFactory)) && ("string" === typeof input.mimeType || $guard(_exceptionable, {
1425
- path: _path + ".mimeType",
1426
- expected: "string",
1427
- value: input.mimeType
1428
- }, errorFactory)) && ("string" === typeof input.encoding || $guard(_exceptionable, {
1429
- path: _path + ".encoding",
1430
- expected: "string",
1431
- value: input.encoding
1432
- }, errorFactory)) && ("string" === typeof input.hash && (/^([A-Fa-f0-9]{32})?$/.test(input.hash) || $guard(_exceptionable, {
1433
- path: _path + ".hash",
1434
- expected: "string & Pattern<\"^([A-Fa-f0-9]{32})?$\">",
1435
- value: input.hash
1436
- }, errorFactory)) || $guard(_exceptionable, {
1437
- path: _path + ".hash",
1438
- expected: "(string & Pattern<\"^([A-Fa-f0-9]{32})?$\">)",
1439
- value: input.hash
1440
- }, errorFactory)) && ("number" === typeof input.btime && (0 <= input.btime || $guard(_exceptionable, {
1441
- path: _path + ".btime",
1442
- expected: "number & Minimum<0>",
1443
- value: input.btime
1444
- }, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000 || $guard(_exceptionable, {
1445
- path: _path + ".btime",
1446
- expected: "number & Type<\"uint64\">",
1447
- value: input.btime
1448
- }, errorFactory)) || $guard(_exceptionable, {
1449
- path: _path + ".btime",
1450
- expected: "(number & Minimum<0> & Type<\"uint64\">)",
1451
- value: input.btime
1452
- }, errorFactory)) && ("boolean" === typeof input.completed || $guard(_exceptionable, {
1453
- path: _path + ".completed",
1454
- expected: "boolean",
1455
- value: input.completed
1456
- }, errorFactory)) && ((undefined !== input.error || $guard(_exceptionable, {
1457
- path: _path + ".error",
1458
- expected: "(Array<NxtError> | NxtError | null)",
1459
- value: input.error
1460
- }, errorFactory)) && (null === input.error || (Array.isArray(input.error) && input.error.every((elem, _index7) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
1461
- path: _path + ".error[" + _index7 + "]",
1462
- expected: "NxtError",
1463
- value: elem
1464
- }, errorFactory)) && $ao2(elem, _path + ".error[" + _index7 + "]", true && _exceptionable) || $guard(_exceptionable, {
1465
- path: _path + ".error[" + _index7 + "]",
1466
- expected: "NxtError",
1467
- value: elem
1468
- }, errorFactory)) || "object" === typeof input.error && null !== input.error && $ao2(input.error, _path + ".error", true && _exceptionable) || $guard(_exceptionable, {
1469
- path: _path + ".error",
1470
- expected: "(Array<NxtError> | NxtError | null)",
1471
- value: input.error
1472
- }, errorFactory)) || $guard(_exceptionable, {
1473
- path: _path + ".error",
1474
- expected: "(Array<NxtError> | NxtError | null)",
1475
- value: input.error
1476
- }, errorFactory)));
1477
- const $ao1 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
1478
- path: _path + ".file",
1479
- expected: "(string | undefined)",
1480
- value: input.file
1481
- }, errorFactory)) && (undefined === input.offset || "number" === typeof input.offset || $guard(_exceptionable, {
1482
- path: _path + ".offset",
1483
- expected: "(number | undefined)",
1484
- value: input.offset
1485
- }, errorFactory)) && (undefined === input.start || "number" === typeof input.start || $guard(_exceptionable, {
1486
- path: _path + ".start",
1487
- expected: "(number | undefined)",
1488
- value: input.start
1489
- }, errorFactory)) && (undefined === input.end || "number" === typeof input.end || $guard(_exceptionable, {
1490
- path: _path + ".end",
1491
- expected: "(number | undefined)",
1492
- value: input.end
1493
- }, errorFactory));
1494
- const $ao2 = (input, _path, _exceptionable = true) => ("string" === typeof input.message || $guard(_exceptionable, {
1495
- path: _path + ".message",
1496
- expected: "string",
1497
- value: input.message
1498
- }, errorFactory)) && (undefined === input.type || "string" === typeof input.type || $guard(_exceptionable, {
1499
- path: _path + ".type",
1500
- expected: "(string | undefined)",
1501
- value: input.type
1502
- }, errorFactory)) && (undefined === input.code || "string" === typeof input.code || $guard(_exceptionable, {
1503
- path: _path + ".code",
1504
- expected: "(string | undefined)",
1505
- value: input.code
1506
- }, errorFactory)) && (undefined === input.exitCode || "number" === typeof input.exitCode || $guard(_exceptionable, {
1507
- path: _path + ".exitCode",
1508
- expected: "(number | undefined)",
1509
- value: input.exitCode
1510
- }, errorFactory)) && (undefined === input.signalCode || "number" === typeof input.signalCode || $guard(_exceptionable, {
1511
- path: _path + ".signalCode",
1512
- expected: "(number | undefined)",
1513
- value: input.signalCode
1514
- }, errorFactory)) && (undefined === input.statusCode || "number" === typeof input.statusCode || $guard(_exceptionable, {
1515
- path: _path + ".statusCode",
1516
- expected: "(number | undefined)",
1517
- value: input.statusCode
1518
- }, errorFactory)) && (undefined === input.headers || ("object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) || $guard(_exceptionable, {
1519
- path: _path + ".headers",
1520
- expected: "(Record<string, string> | undefined)",
1521
- value: input.headers
1522
- }, errorFactory)) && $ao3(input.headers, _path + ".headers", true && _exceptionable) || $guard(_exceptionable, {
1523
- path: _path + ".headers",
1524
- expected: "(Record<string, string> | undefined)",
1525
- value: input.headers
1526
- }, errorFactory)) && (undefined === input.data || ("object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) || $guard(_exceptionable, {
1527
- path: _path + ".data",
1528
- expected: "(object | undefined)",
1529
- value: input.data
1530
- }, errorFactory)) && $ao4(input.data, _path + ".data", true && _exceptionable) || $guard(_exceptionable, {
1531
- path: _path + ".data",
1532
- expected: "(object | undefined)",
1533
- value: input.data
1534
- }, errorFactory)) && (null === input.cause || undefined === input.cause || ("object" === typeof input.cause && null !== input.cause || $guard(_exceptionable, {
1535
- path: _path + ".cause",
1536
- expected: "(NxtError | null | undefined)",
1537
- value: input.cause
1538
- }, errorFactory)) && $ao2(input.cause, _path + ".cause", true && _exceptionable) || $guard(_exceptionable, {
1539
- path: _path + ".cause",
1540
- expected: "(NxtError | null | undefined)",
1541
- value: input.cause
1542
- }, errorFactory)) && (null === input.errors || undefined === input.errors || (Array.isArray(input.errors) || $guard(_exceptionable, {
1543
- path: _path + ".errors",
1544
- expected: "(Array<NxtError> | null | undefined)",
1545
- value: input.errors
1546
- }, errorFactory)) && input.errors.every((elem, _index8) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
1547
- path: _path + ".errors[" + _index8 + "]",
1548
- expected: "NxtError",
1549
- value: elem
1550
- }, errorFactory)) && $ao2(elem, _path + ".errors[" + _index8 + "]", true && _exceptionable) || $guard(_exceptionable, {
1551
- path: _path + ".errors[" + _index8 + "]",
1552
- expected: "NxtError",
1553
- value: elem
1554
- }, errorFactory)) || $guard(_exceptionable, {
1555
- path: _path + ".errors",
1556
- expected: "(Array<NxtError> | null | undefined)",
1557
- value: input.errors
1558
- }, errorFactory));
1559
- const $ao3 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
1560
- const value = input[key];
1561
- if (undefined === value)
1562
- return true;
1563
- return "string" === typeof value || $guard(_exceptionable, {
1564
- path: _path + $join(key),
1565
- expected: "string",
1566
- value: value
1567
- }, errorFactory);
1568
- });
1569
- const $ao4 = (input, _path, _exceptionable = true) => true;
1570
- return ("object" === typeof input && null !== input || $guard(true, {
1571
- path: _path + "",
1572
- expected: "FileStats",
1573
- value: input
1574
- }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
1575
- path: _path + "",
1576
- expected: "FileStats",
1577
- value: input
1578
- }, errorFactory);
1579
- })(input, "$input", true);
1580
- return input;
1581
- };
1582
- export const randomFileStats = generator => {
1583
- const $generator = __typia.createRandom.generator;
1584
- const $pick = __typia.createRandom.pick;
1585
- const $ro0 = (_recursive = false, _depth = 0) => ({
1586
- position: $pick([
1587
- () => null,
1588
- () => (generator?.customs ?? $generator.customs)?.number?.([
1589
- {
1590
- name: "Minimum<0>",
1591
- kind: "minimum",
1592
- value: 0
1593
- },
1594
- {
1595
- name: "Type<\"uint64\">",
1596
- kind: "type",
1597
- value: "uint64"
1598
- }
1599
- ]) ?? (generator?.integer ?? $generator.integer)(0, 10)
1600
- ])(),
1601
- uploading: $pick([
1602
- () => null,
1603
- () => (generator?.boolean ?? $generator.boolean)()
1604
- ])(),
1605
- zones: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()),
1606
- replicas: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()),
1607
- locations: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()),
1608
- ranges: (generator?.array ?? $generator.array)(() => [
1609
- (generator?.customs ?? $generator.customs)?.number?.([
1610
- {
1611
- name: "Minimum<0>",
1612
- kind: "minimum",
1613
- value: 0
1614
- }
1615
- ]) ?? (generator?.number ?? $generator.number)(0, 10),
1616
- (generator?.customs ?? $generator.customs)?.number?.([
1617
- {
1618
- name: "Minimum<0>",
1619
- kind: "minimum",
1620
- value: 0
1621
- }
1622
- ]) ?? (generator?.number ?? $generator.number)(0, 10)
1623
- ]),
1624
- progress: $pick([
1625
- () => undefined,
1626
- () => (generator?.customs ?? $generator.customs)?.number?.([
1627
- {
1628
- name: "Minimum<0>",
1629
- kind: "minimum",
1630
- value: 0
1631
- },
1632
- {
1633
- name: "Maximum<1>",
1634
- kind: "maximum",
1635
- value: 1
1636
- }
1637
- ]) ?? (generator?.number ?? $generator.number)(0, 1)
1638
- ])(),
1639
- speed: $pick([
1640
- () => undefined,
1641
- () => (generator?.customs ?? $generator.customs)?.number?.([
1642
- {
1643
- name: "Minimum<0>",
1644
- kind: "minimum",
1645
- value: 0
1646
- }
1647
- ]) ?? (generator?.number ?? $generator.number)(0, 10)
1648
- ])(),
1649
- id: (generator?.customs ?? $generator.customs)?.string?.([
1650
- {
1651
- name: "Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
1652
- kind: "pattern",
1653
- value: "^[0-9A-Za-z~][0-9A-Za-z~._: -]*$"
1654
- }
1655
- ]) ?? (generator?.pattern ?? $generator.pattern)(/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/),
1656
- size: $pick([
1657
- () => null,
1658
- () => (generator?.customs ?? $generator.customs)?.number?.([
1659
- {
1660
- name: "Minimum<0>",
1661
- kind: "minimum",
1662
- value: 0
1663
- },
1664
- {
1665
- name: "Type<\"uint64\">",
1666
- kind: "type",
1667
- value: "uint64"
1668
- }
1669
- ]) ?? (generator?.integer ?? $generator.integer)(0, 10)
1670
- ])(),
1671
- seekable: (generator?.boolean ?? $generator.boolean)(),
1672
- deleted: (generator?.boolean ?? $generator.boolean)(),
1673
- refs: (generator?.array ?? $generator.array)(() => $ro1(_recursive, _recursive ? 1 + _depth : _depth)),
1674
- tags: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()),
1675
- resumable: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
1676
- mimeType: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
1677
- encoding: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
1678
- hash: (generator?.customs ?? $generator.customs)?.string?.([
1679
- {
1680
- name: "Pattern<\"^([A-Fa-f0-9]{32})?$\">",
1681
- kind: "pattern",
1682
- value: "^([A-Fa-f0-9]{32})?$"
1683
- }
1684
- ]) ?? (generator?.pattern ?? $generator.pattern)(/^([A-Fa-f0-9]{32})?$/),
1685
- btime: (generator?.customs ?? $generator.customs)?.number?.([
1686
- {
1687
- name: "Minimum<0>",
1688
- kind: "minimum",
1689
- value: 0
1690
- },
1691
- {
1692
- name: "Type<\"uint64\">",
1693
- kind: "type",
1694
- value: "uint64"
1695
- }
1696
- ]) ?? (generator?.integer ?? $generator.integer)(0, 10),
1697
- completed: (generator?.boolean ?? $generator.boolean)(),
1698
- error: $pick([
1699
- () => null,
1700
- () => (generator?.array ?? $generator.array)(() => $ro2(_recursive, _recursive ? 1 + _depth : _depth)),
1701
- () => $ro2(_recursive, _recursive ? 1 + _depth : _depth)
1702
- ])()
1703
- });
1704
- const $ro1 = (_recursive = false, _depth = 0) => ({
1705
- file: $pick([
1706
- () => undefined,
1707
- () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
1708
- ])(),
1709
- offset: $pick([
1710
- () => undefined,
1711
- () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
1712
- ])(),
1713
- start: $pick([
1714
- () => undefined,
1715
- () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
1716
- ])(),
1717
- end: $pick([
1718
- () => undefined,
1719
- () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
1720
- ])()
1721
- });
1722
- const $ro2 = (_recursive = true, _depth = 0) => ({
1723
- message: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
1724
- type: $pick([
1725
- () => undefined,
1726
- () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
1727
- ])(),
1728
- code: $pick([
1729
- () => undefined,
1730
- () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
1731
- ])(),
1732
- exitCode: $pick([
1733
- () => undefined,
1734
- () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
1735
- ])(),
1736
- signalCode: $pick([
1737
- () => undefined,
1738
- () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
1739
- ])(),
1740
- statusCode: $pick([
1741
- () => undefined,
1742
- () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
1743
- ])(),
1744
- headers: $pick([
1745
- () => undefined,
1746
- () => $ro3(true, _recursive ? 1 + _depth : _depth)
1747
- ])(),
1748
- data: $pick([
1749
- () => undefined,
1750
- () => $ro4(true, _recursive ? 1 + _depth : _depth)
1751
- ])(),
1752
- cause: $pick([
1753
- () => undefined,
1754
- () => null,
1755
- () => $ro2(true, _recursive ? 1 + _depth : _depth)
1756
- ])(),
1757
- errors: $pick([
1758
- () => undefined,
1759
- () => null,
1760
- () => _recursive && 5 < _depth ? [] : 5 >= _depth ? (generator?.array ?? $generator.array)(() => $ro2(true, _recursive ? 1 + _depth : _depth)) : []
1761
- ])()
1762
- });
1763
- const $ro3 = (_recursive = false, _depth = 0) => {
1764
- const output = {};
1765
- (generator?.array ?? $generator.array)(() => output[(generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()] = (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(), (generator?.integer ?? $generator.integer)(0, 3));
1766
- return output;
1767
- };
1768
- const $ro4 = (_recursive = false, _depth = 0) => {};
1769
- return $ro0();
1770
- };
1771
- export const assertGuardFileStats = (input, errorFactory) => {
1772
- const __is = input => {
1773
- const $io0 = input => (null === input.position || "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000))) && (null === input.uploading || "boolean" === typeof input.uploading) && (Array.isArray(input.zones) && input.zones.every(elem => "string" === typeof elem)) && (Array.isArray(input.replicas) && input.replicas.every(elem => "string" === typeof elem)) && (Array.isArray(input.locations) && input.locations.every(elem => "string" === typeof elem)) && (Array.isArray(input.ranges) && input.ranges.every(elem => Array.isArray(elem) && (elem.length === 2 && ("number" === typeof elem[0] && 0 <= elem[0]) && ("number" === typeof elem[1] && 0 <= elem[1])))) && (undefined === input.progress || "number" === typeof input.progress && (0 <= input.progress && input.progress <= 1)) && (undefined === input.speed || "number" === typeof input.speed && 0 <= input.speed) && ("string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id)) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && "string" === typeof input.encoding && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (undefined !== input.error && (null === input.error || (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)) || "object" === typeof input.error && null !== input.error && $io2(input.error))));
1774
- const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
1775
- const $io2 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io3(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io4(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io2(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
1776
- const $io3 = input => Object.keys(input).every(key => {
1777
- const value = input[key];
1778
- if (undefined === value)
1779
- return true;
1780
- return "string" === typeof value;
1781
- });
1782
- const $io4 = input => true;
1783
- return "object" === typeof input && null !== input && $io0(input);
1784
- };
1785
- if (false === __is(input))
1786
- ((input, _path, _exceptionable = true) => {
1787
- const $guard = __typia.createAssertGuard.guard;
1788
- const $join = __typia.createAssertGuard.join;
1789
- const $ao0 = (input, _path, _exceptionable = true) => (null === input.position || "number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
1790
- path: _path + ".position",
1791
- expected: "number & Minimum<0>",
1792
- value: input.position
1793
- }, errorFactory)) && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000 || $guard(_exceptionable, {
1794
- path: _path + ".position",
1795
- expected: "number & Type<\"uint64\">",
1796
- value: input.position
1797
- }, errorFactory)) || $guard(_exceptionable, {
1798
- path: _path + ".position",
1799
- expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
1800
- value: input.position
1801
- }, errorFactory)) && (null === input.uploading || "boolean" === typeof input.uploading || $guard(_exceptionable, {
1802
- path: _path + ".uploading",
1803
- expected: "(boolean | null)",
1804
- value: input.uploading
1805
- }, errorFactory)) && ((Array.isArray(input.zones) || $guard(_exceptionable, {
1806
- path: _path + ".zones",
1807
- expected: "Array<string>",
1808
- value: input.zones
1809
- }, errorFactory)) && input.zones.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
1810
- path: _path + ".zones[" + _index1 + "]",
1811
- expected: "string",
1812
- value: elem
1813
- }, errorFactory)) || $guard(_exceptionable, {
1814
- path: _path + ".zones",
1815
- expected: "Array<string>",
1816
- value: input.zones
1817
- }, errorFactory)) && ((Array.isArray(input.replicas) || $guard(_exceptionable, {
1818
- path: _path + ".replicas",
1819
- expected: "Array<string>",
1820
- value: input.replicas
1821
- }, errorFactory)) && input.replicas.every((elem, _index2) => "string" === typeof elem || $guard(_exceptionable, {
1822
- path: _path + ".replicas[" + _index2 + "]",
1823
- expected: "string",
1824
- value: elem
1825
- }, errorFactory)) || $guard(_exceptionable, {
1826
- path: _path + ".replicas",
1827
- expected: "Array<string>",
1828
- value: input.replicas
1829
- }, errorFactory)) && ((Array.isArray(input.locations) || $guard(_exceptionable, {
1830
- path: _path + ".locations",
1831
- expected: "Array<string>",
1832
- value: input.locations
1833
- }, errorFactory)) && input.locations.every((elem, _index3) => "string" === typeof elem || $guard(_exceptionable, {
1834
- path: _path + ".locations[" + _index3 + "]",
1835
- expected: "string",
1836
- value: elem
1837
- }, errorFactory)) || $guard(_exceptionable, {
1838
- path: _path + ".locations",
1839
- expected: "Array<string>",
1840
- value: input.locations
1841
- }, errorFactory)) && ((Array.isArray(input.ranges) || $guard(_exceptionable, {
1842
- path: _path + ".ranges",
1843
- expected: "Array<[start: number & Minimum<0>, end: number & Minimum<0>]>",
1844
- value: input.ranges
1845
- }, errorFactory)) && input.ranges.every((elem, _index4) => (Array.isArray(elem) || $guard(_exceptionable, {
1846
- path: _path + ".ranges[" + _index4 + "]",
1847
- expected: "[start: number & Minimum<0>, end: number & Minimum<0>]",
1848
- value: elem
1849
- }, errorFactory)) && ((elem.length === 2 || $guard(_exceptionable, {
1850
- path: _path + ".ranges[" + _index4 + "]",
1851
- expected: "[(number & Minimum<0>), (number & Minimum<0>)]",
1852
- value: elem
1853
- }, errorFactory)) && ("number" === typeof elem[0] && (0 <= elem[0] || $guard(_exceptionable, {
1854
- path: _path + ".ranges[" + _index4 + "][0]",
1855
- expected: "number & Minimum<0>",
1856
- value: elem[0]
1857
- }, errorFactory)) || $guard(_exceptionable, {
1858
- path: _path + ".ranges[" + _index4 + "][0]",
1859
- expected: "(number & Minimum<0>)",
1860
- value: elem[0]
1861
- }, errorFactory)) && ("number" === typeof elem[1] && (0 <= elem[1] || $guard(_exceptionable, {
1862
- path: _path + ".ranges[" + _index4 + "][1]",
1863
- expected: "number & Minimum<0>",
1864
- value: elem[1]
1865
- }, errorFactory)) || $guard(_exceptionable, {
1866
- path: _path + ".ranges[" + _index4 + "][1]",
1867
- expected: "(number & Minimum<0>)",
1868
- value: elem[1]
1869
- }, errorFactory))) || $guard(_exceptionable, {
1870
- path: _path + ".ranges[" + _index4 + "]",
1871
- expected: "[start: number & Minimum<0>, end: number & Minimum<0>]",
1872
- value: elem
1873
- }, errorFactory)) || $guard(_exceptionable, {
1874
- path: _path + ".ranges",
1875
- expected: "Array<[start: number & Minimum<0>, end: number & Minimum<0>]>",
1876
- value: input.ranges
1877
- }, errorFactory)) && (undefined === input.progress || "number" === typeof input.progress && (0 <= input.progress || $guard(_exceptionable, {
1878
- path: _path + ".progress",
1879
- expected: "number & Minimum<0>",
1880
- value: input.progress
1881
- }, errorFactory)) && (input.progress <= 1 || $guard(_exceptionable, {
1882
- path: _path + ".progress",
1883
- expected: "number & Maximum<1>",
1884
- value: input.progress
1885
- }, errorFactory)) || $guard(_exceptionable, {
1886
- path: _path + ".progress",
1887
- expected: "((number & Minimum<0> & Maximum<1>) | undefined)",
1888
- value: input.progress
1889
- }, errorFactory)) && (undefined === input.speed || "number" === typeof input.speed && (0 <= input.speed || $guard(_exceptionable, {
1890
- path: _path + ".speed",
1891
- expected: "number & Minimum<0>",
1892
- value: input.speed
1893
- }, errorFactory)) || $guard(_exceptionable, {
1894
- path: _path + ".speed",
1895
- expected: "((number & Minimum<0>) | undefined)",
1896
- value: input.speed
1897
- }, errorFactory)) && ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
1898
- path: _path + ".id",
1899
- expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
1900
- value: input.id
1901
- }, errorFactory)) || $guard(_exceptionable, {
1902
- path: _path + ".id",
1903
- expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
1904
- value: input.id
1905
- }, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
1906
- path: _path + ".size",
1907
- expected: "number & Minimum<0>",
1908
- value: input.size
1909
- }, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000 || $guard(_exceptionable, {
1910
- path: _path + ".size",
1911
- expected: "number & Type<\"uint64\">",
1912
- value: input.size
1913
- }, errorFactory)) || $guard(_exceptionable, {
1914
- path: _path + ".size",
1915
- expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
1916
- value: input.size
1917
- }, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
1918
- path: _path + ".seekable",
1919
- expected: "boolean",
1920
- value: input.seekable
1921
- }, errorFactory)) && ("boolean" === typeof input.deleted || $guard(_exceptionable, {
1922
- path: _path + ".deleted",
1923
- expected: "boolean",
1924
- value: input.deleted
1925
- }, errorFactory)) && ((Array.isArray(input.refs) || $guard(_exceptionable, {
1926
- path: _path + ".refs",
1927
- expected: "FileRefs",
1928
- value: input.refs
1929
- }, errorFactory)) && input.refs.every((elem, _index5) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || $guard(_exceptionable, {
1930
- path: _path + ".refs[" + _index5 + "]",
1931
- expected: "FileRef",
1932
- value: elem
1933
- }, errorFactory)) && $ao1(elem, _path + ".refs[" + _index5 + "]", true && _exceptionable) || $guard(_exceptionable, {
1934
- path: _path + ".refs[" + _index5 + "]",
1935
- expected: "FileRef",
1936
- value: elem
1937
- }, errorFactory)) || $guard(_exceptionable, {
1938
- path: _path + ".refs",
1939
- expected: "FileRefs",
1940
- value: input.refs
1941
- }, errorFactory)) && ((Array.isArray(input.tags) || $guard(_exceptionable, {
1942
- path: _path + ".tags",
1943
- expected: "Array<string>",
1944
- value: input.tags
1945
- }, errorFactory)) && input.tags.every((elem, _index6) => "string" === typeof elem || $guard(_exceptionable, {
1946
- path: _path + ".tags[" + _index6 + "]",
1947
- expected: "string",
1948
- value: elem
1949
- }, errorFactory)) || $guard(_exceptionable, {
1950
- path: _path + ".tags",
1951
- expected: "Array<string>",
1952
- value: input.tags
1953
- }, errorFactory)) && ("string" === typeof input.resumable || $guard(_exceptionable, {
1954
- path: _path + ".resumable",
1955
- expected: "string",
1956
- value: input.resumable
1957
- }, errorFactory)) && ("string" === typeof input.mimeType || $guard(_exceptionable, {
1958
- path: _path + ".mimeType",
1959
- expected: "string",
1960
- value: input.mimeType
1961
- }, errorFactory)) && ("string" === typeof input.encoding || $guard(_exceptionable, {
1962
- path: _path + ".encoding",
1963
- expected: "string",
1964
- value: input.encoding
1965
- }, errorFactory)) && ("string" === typeof input.hash && (/^([A-Fa-f0-9]{32})?$/.test(input.hash) || $guard(_exceptionable, {
1966
- path: _path + ".hash",
1967
- expected: "string & Pattern<\"^([A-Fa-f0-9]{32})?$\">",
1968
- value: input.hash
1969
- }, errorFactory)) || $guard(_exceptionable, {
1970
- path: _path + ".hash",
1971
- expected: "(string & Pattern<\"^([A-Fa-f0-9]{32})?$\">)",
1972
- value: input.hash
1973
- }, errorFactory)) && ("number" === typeof input.btime && (0 <= input.btime || $guard(_exceptionable, {
1974
- path: _path + ".btime",
1975
- expected: "number & Minimum<0>",
1976
- value: input.btime
1977
- }, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000 || $guard(_exceptionable, {
1978
- path: _path + ".btime",
1979
- expected: "number & Type<\"uint64\">",
1980
- value: input.btime
1981
- }, errorFactory)) || $guard(_exceptionable, {
1982
- path: _path + ".btime",
1983
- expected: "(number & Minimum<0> & Type<\"uint64\">)",
1984
- value: input.btime
1985
- }, errorFactory)) && ("boolean" === typeof input.completed || $guard(_exceptionable, {
1986
- path: _path + ".completed",
1987
- expected: "boolean",
1988
- value: input.completed
1989
- }, errorFactory)) && ((undefined !== input.error || $guard(_exceptionable, {
1990
- path: _path + ".error",
1991
- expected: "(Array<NxtError> | NxtError | null)",
1992
- value: input.error
1993
- }, errorFactory)) && (null === input.error || (Array.isArray(input.error) && input.error.every((elem, _index7) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
1994
- path: _path + ".error[" + _index7 + "]",
1995
- expected: "NxtError",
1996
- value: elem
1997
- }, errorFactory)) && $ao2(elem, _path + ".error[" + _index7 + "]", true && _exceptionable) || $guard(_exceptionable, {
1998
- path: _path + ".error[" + _index7 + "]",
1999
- expected: "NxtError",
2000
- value: elem
2001
- }, errorFactory)) || "object" === typeof input.error && null !== input.error && $ao2(input.error, _path + ".error", true && _exceptionable) || $guard(_exceptionable, {
2002
- path: _path + ".error",
2003
- expected: "(Array<NxtError> | NxtError | null)",
2004
- value: input.error
2005
- }, errorFactory)) || $guard(_exceptionable, {
2006
- path: _path + ".error",
2007
- expected: "(Array<NxtError> | NxtError | null)",
2008
- value: input.error
2009
- }, errorFactory)));
2010
- const $ao1 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
2011
- path: _path + ".file",
2012
- expected: "(string | undefined)",
2013
- value: input.file
2014
- }, errorFactory)) && (undefined === input.offset || "number" === typeof input.offset || $guard(_exceptionable, {
2015
- path: _path + ".offset",
2016
- expected: "(number | undefined)",
2017
- value: input.offset
2018
- }, errorFactory)) && (undefined === input.start || "number" === typeof input.start || $guard(_exceptionable, {
2019
- path: _path + ".start",
2020
- expected: "(number | undefined)",
2021
- value: input.start
2022
- }, errorFactory)) && (undefined === input.end || "number" === typeof input.end || $guard(_exceptionable, {
2023
- path: _path + ".end",
2024
- expected: "(number | undefined)",
2025
- value: input.end
2026
- }, errorFactory));
2027
- const $ao2 = (input, _path, _exceptionable = true) => ("string" === typeof input.message || $guard(_exceptionable, {
2028
- path: _path + ".message",
2029
- expected: "string",
2030
- value: input.message
2031
- }, errorFactory)) && (undefined === input.type || "string" === typeof input.type || $guard(_exceptionable, {
2032
- path: _path + ".type",
2033
- expected: "(string | undefined)",
2034
- value: input.type
2035
- }, errorFactory)) && (undefined === input.code || "string" === typeof input.code || $guard(_exceptionable, {
2036
- path: _path + ".code",
2037
- expected: "(string | undefined)",
2038
- value: input.code
2039
- }, errorFactory)) && (undefined === input.exitCode || "number" === typeof input.exitCode || $guard(_exceptionable, {
2040
- path: _path + ".exitCode",
2041
- expected: "(number | undefined)",
2042
- value: input.exitCode
2043
- }, errorFactory)) && (undefined === input.signalCode || "number" === typeof input.signalCode || $guard(_exceptionable, {
2044
- path: _path + ".signalCode",
2045
- expected: "(number | undefined)",
2046
- value: input.signalCode
2047
- }, errorFactory)) && (undefined === input.statusCode || "number" === typeof input.statusCode || $guard(_exceptionable, {
2048
- path: _path + ".statusCode",
2049
- expected: "(number | undefined)",
2050
- value: input.statusCode
2051
- }, errorFactory)) && (undefined === input.headers || ("object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) || $guard(_exceptionable, {
2052
- path: _path + ".headers",
2053
- expected: "(Record<string, string> | undefined)",
2054
- value: input.headers
2055
- }, errorFactory)) && $ao3(input.headers, _path + ".headers", true && _exceptionable) || $guard(_exceptionable, {
2056
- path: _path + ".headers",
2057
- expected: "(Record<string, string> | undefined)",
2058
- value: input.headers
2059
- }, errorFactory)) && (undefined === input.data || ("object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) || $guard(_exceptionable, {
2060
- path: _path + ".data",
2061
- expected: "(object | undefined)",
2062
- value: input.data
2063
- }, errorFactory)) && $ao4(input.data, _path + ".data", true && _exceptionable) || $guard(_exceptionable, {
2064
- path: _path + ".data",
2065
- expected: "(object | undefined)",
2066
- value: input.data
2067
- }, errorFactory)) && (null === input.cause || undefined === input.cause || ("object" === typeof input.cause && null !== input.cause || $guard(_exceptionable, {
2068
- path: _path + ".cause",
2069
- expected: "(NxtError | null | undefined)",
2070
- value: input.cause
2071
- }, errorFactory)) && $ao2(input.cause, _path + ".cause", true && _exceptionable) || $guard(_exceptionable, {
2072
- path: _path + ".cause",
2073
- expected: "(NxtError | null | undefined)",
2074
- value: input.cause
2075
- }, errorFactory)) && (null === input.errors || undefined === input.errors || (Array.isArray(input.errors) || $guard(_exceptionable, {
2076
- path: _path + ".errors",
2077
- expected: "(Array<NxtError> | null | undefined)",
2078
- value: input.errors
2079
- }, errorFactory)) && input.errors.every((elem, _index8) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
2080
- path: _path + ".errors[" + _index8 + "]",
2081
- expected: "NxtError",
2082
- value: elem
2083
- }, errorFactory)) && $ao2(elem, _path + ".errors[" + _index8 + "]", true && _exceptionable) || $guard(_exceptionable, {
2084
- path: _path + ".errors[" + _index8 + "]",
2085
- expected: "NxtError",
2086
- value: elem
2087
- }, errorFactory)) || $guard(_exceptionable, {
2088
- path: _path + ".errors",
2089
- expected: "(Array<NxtError> | null | undefined)",
2090
- value: input.errors
2091
- }, errorFactory));
2092
- const $ao3 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
2093
- const value = input[key];
2094
- if (undefined === value)
2095
- return true;
2096
- return "string" === typeof value || $guard(_exceptionable, {
2097
- path: _path + $join(key),
2098
- expected: "string",
2099
- value: value
2100
- }, errorFactory);
2101
- });
2102
- const $ao4 = (input, _path, _exceptionable = true) => true;
2103
- return ("object" === typeof input && null !== input || $guard(true, {
2104
- path: _path + "",
2105
- expected: "FileStats",
2106
- value: input
2107
- }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
2108
- path: _path + "",
2109
- expected: "FileStats",
2110
- value: input
2111
- }, errorFactory);
2112
- })(input, "$input", true);
2113
- };
2114
- export const stringifyFileStats = input => {
2115
- const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
2116
- const $io2 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io3(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io4(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io2(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
2117
- const $io3 = input => Object.keys(input).every(key => {
2118
- const value = input[key];
2119
- if (undefined === value)
2120
- return true;
2121
- return "string" === typeof value;
2122
- });
2123
- const $io4 = input => true;
2124
- const $string = __typia.json.createStringify.string;
2125
- const $throws = __typia.json.createStringify.throws;
2126
- const $tail = __typia.json.createStringify.tail;
2127
- const $so0 = input => `{${undefined === input.progress ? "" : `"progress":${undefined !== input.progress ? input.progress : undefined},`}${undefined === input.speed ? "" : `"speed":${undefined !== input.speed ? input.speed : undefined},`}"position":${null !== input.position ? input.position : "null"},"uploading":${null !== input.uploading ? input.uploading : "null"},"zones":${`[${input.zones.map(elem => $string(elem)).join(",")}]`},"replicas":${`[${input.replicas.map(elem => $string(elem)).join(",")}]`},"locations":${`[${input.locations.map(elem => $string(elem)).join(",")}]`},"ranges":${`[${input.ranges.map(elem => `[${elem[0]},${elem[1]}]`).join(",")}]`},"id":${$string(input.id)},"size":${null !== input.size ? input.size : "null"},"seekable":${input.seekable},"deleted":${input.deleted},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"encoding":${$string(input.encoding)},"hash":${$string(input.hash)},"btime":${input.btime},"completed":${input.completed},"error":${null !== input.error ? (() => {
2128
- if (Array.isArray(input.error))
2129
- return `[${input.error.map(elem => $so2(elem)).join(",")}]`;
2130
- if ("object" === typeof input.error && null !== input.error)
2131
- return $so2(input.error);
2132
- $throws({
2133
- expected: "(Array<NxtError> | NxtError | null)",
2134
- value: input.error
2135
- });
2136
- })() : "null"}}`;
2137
- const $so1 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined},`}${undefined === input.offset ? "" : `"offset":${undefined !== input.offset ? input.offset : undefined},`}${undefined === input.start ? "" : `"start":${undefined !== input.start ? input.start : undefined},`}${undefined === input.end ? "" : `"end":${undefined !== input.end ? input.end : undefined}`}`)}}`;
2138
- const $so2 = input => `{${undefined === input.type ? "" : `"type":${undefined !== input.type ? $string(input.type) : undefined},`}${undefined === input.code ? "" : `"code":${undefined !== input.code ? $string(input.code) : undefined},`}${undefined === input.exitCode ? "" : `"exitCode":${undefined !== input.exitCode ? input.exitCode : undefined},`}${undefined === input.signalCode ? "" : `"signalCode":${undefined !== input.signalCode ? input.signalCode : undefined},`}${undefined === input.statusCode ? "" : `"statusCode":${undefined !== input.statusCode ? input.statusCode : undefined},`}${undefined === input.headers ? "" : `"headers":${undefined !== input.headers ? $so3(input.headers) : undefined},`}${undefined === input.data ? "" : `"data":${undefined !== input.data ? "{}" : undefined},`}${undefined === input.cause ? "" : `"cause":${undefined !== input.cause ? null !== input.cause ? $so2(input.cause) : "null" : undefined},`}${undefined === input.errors ? "" : `"errors":${undefined !== input.errors ? null !== input.errors ? `[${input.errors.map(elem => $so2(elem)).join(",")}]` : "null" : undefined},`}"message":${$string(input.message)}}`;
2139
- const $so3 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
2140
- return ""; return `${JSON.stringify(key)}:${$string(value)}`; }).filter(str => "" !== str).join(",")}}`;
2141
- return $so0(input);
2142
- };
2143
- export const assertStringifyFileStats = (input, errorFactory) => { const assert = (input, errorFactory) => {
2144
- const __is = input => {
2145
- const $io0 = input => (null === input.position || "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000))) && (null === input.uploading || "boolean" === typeof input.uploading) && (Array.isArray(input.zones) && input.zones.every(elem => "string" === typeof elem)) && (Array.isArray(input.replicas) && input.replicas.every(elem => "string" === typeof elem)) && (Array.isArray(input.locations) && input.locations.every(elem => "string" === typeof elem)) && (Array.isArray(input.ranges) && input.ranges.every(elem => Array.isArray(elem) && (elem.length === 2 && ("number" === typeof elem[0] && (!Number.isNaN(elem[0]) && 0 <= elem[0])) && ("number" === typeof elem[1] && (!Number.isNaN(elem[1]) && 0 <= elem[1]))))) && (undefined === input.progress || "number" === typeof input.progress && (0 <= input.progress && input.progress <= 1)) && (undefined === input.speed || "number" === typeof input.speed && (!Number.isNaN(input.speed) && 0 <= input.speed)) && ("string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id)) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && "string" === typeof input.encoding && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (undefined !== input.error && (null === input.error || (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)) || "object" === typeof input.error && null !== input.error && $io2(input.error))));
2146
- const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset && !Number.isNaN(input.offset)) && (undefined === input.start || "number" === typeof input.start && !Number.isNaN(input.start)) && (undefined === input.end || "number" === typeof input.end && !Number.isNaN(input.end));
2147
- const $io2 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode && !Number.isNaN(input.exitCode)) && (undefined === input.signalCode || "number" === typeof input.signalCode && !Number.isNaN(input.signalCode)) && (undefined === input.statusCode || "number" === typeof input.statusCode && !Number.isNaN(input.statusCode)) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io3(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io4(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io2(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
2148
- const $io3 = input => Object.keys(input).every(key => {
2149
- const value = input[key];
2150
- if (undefined === value)
2151
- return true;
2152
- return "string" === typeof value;
2153
- });
2154
- const $io4 = input => true;
2155
- return "object" === typeof input && null !== input && $io0(input);
2156
- };
2157
- if (false === __is(input))
2158
- ((input, _path, _exceptionable = true) => {
2159
- const $guard = __typia.json.createAssertStringify.guard;
2160
- const $join = __typia.json.createAssertStringify.join;
2161
- const $ao0 = (input, _path, _exceptionable = true) => (null === input.position || "number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
2162
- path: _path + ".position",
2163
- expected: "number & Minimum<0>",
2164
- value: input.position
2165
- }, errorFactory)) && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000 || $guard(_exceptionable, {
2166
- path: _path + ".position",
2167
- expected: "number & Type<\"uint64\">",
2168
- value: input.position
2169
- }, errorFactory)) || $guard(_exceptionable, {
2170
- path: _path + ".position",
2171
- expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
2172
- value: input.position
2173
- }, errorFactory)) && (null === input.uploading || "boolean" === typeof input.uploading || $guard(_exceptionable, {
2174
- path: _path + ".uploading",
2175
- expected: "(boolean | null)",
2176
- value: input.uploading
2177
- }, errorFactory)) && ((Array.isArray(input.zones) || $guard(_exceptionable, {
2178
- path: _path + ".zones",
2179
- expected: "Array<string>",
2180
- value: input.zones
2181
- }, errorFactory)) && input.zones.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
2182
- path: _path + ".zones[" + _index1 + "]",
2183
- expected: "string",
2184
- value: elem
2185
- }, errorFactory)) || $guard(_exceptionable, {
2186
- path: _path + ".zones",
2187
- expected: "Array<string>",
2188
- value: input.zones
2189
- }, errorFactory)) && ((Array.isArray(input.replicas) || $guard(_exceptionable, {
2190
- path: _path + ".replicas",
2191
- expected: "Array<string>",
2192
- value: input.replicas
2193
- }, errorFactory)) && input.replicas.every((elem, _index2) => "string" === typeof elem || $guard(_exceptionable, {
2194
- path: _path + ".replicas[" + _index2 + "]",
2195
- expected: "string",
2196
- value: elem
2197
- }, errorFactory)) || $guard(_exceptionable, {
2198
- path: _path + ".replicas",
2199
- expected: "Array<string>",
2200
- value: input.replicas
2201
- }, errorFactory)) && ((Array.isArray(input.locations) || $guard(_exceptionable, {
2202
- path: _path + ".locations",
2203
- expected: "Array<string>",
2204
- value: input.locations
2205
- }, errorFactory)) && input.locations.every((elem, _index3) => "string" === typeof elem || $guard(_exceptionable, {
2206
- path: _path + ".locations[" + _index3 + "]",
2207
- expected: "string",
2208
- value: elem
2209
- }, errorFactory)) || $guard(_exceptionable, {
2210
- path: _path + ".locations",
2211
- expected: "Array<string>",
2212
- value: input.locations
2213
- }, errorFactory)) && ((Array.isArray(input.ranges) || $guard(_exceptionable, {
2214
- path: _path + ".ranges",
2215
- expected: "Array<[start: number & Minimum<0>, end: number & Minimum<0>]>",
2216
- value: input.ranges
2217
- }, errorFactory)) && input.ranges.every((elem, _index4) => (Array.isArray(elem) || $guard(_exceptionable, {
2218
- path: _path + ".ranges[" + _index4 + "]",
2219
- expected: "[start: number & Minimum<0>, end: number & Minimum<0>]",
2220
- value: elem
2221
- }, errorFactory)) && ((elem.length === 2 || $guard(_exceptionable, {
2222
- path: _path + ".ranges[" + _index4 + "]",
2223
- expected: "[(number & Minimum<0>), (number & Minimum<0>)]",
2224
- value: elem
2225
- }, errorFactory)) && ("number" === typeof elem[0] && (!Number.isNaN(elem[0]) || $guard(_exceptionable, {
2226
- path: _path + ".ranges[" + _index4 + "][0]",
2227
- expected: "number",
2228
- value: elem[0]
2229
- }, errorFactory)) && (0 <= elem[0] || $guard(_exceptionable, {
2230
- path: _path + ".ranges[" + _index4 + "][0]",
2231
- expected: "number & Minimum<0>",
2232
- value: elem[0]
2233
- }, errorFactory)) || $guard(_exceptionable, {
2234
- path: _path + ".ranges[" + _index4 + "][0]",
2235
- expected: "(number & Minimum<0>)",
2236
- value: elem[0]
2237
- }, errorFactory)) && ("number" === typeof elem[1] && (!Number.isNaN(elem[1]) || $guard(_exceptionable, {
2238
- path: _path + ".ranges[" + _index4 + "][1]",
2239
- expected: "number",
2240
- value: elem[1]
2241
- }, errorFactory)) && (0 <= elem[1] || $guard(_exceptionable, {
2242
- path: _path + ".ranges[" + _index4 + "][1]",
2243
- expected: "number & Minimum<0>",
2244
- value: elem[1]
2245
- }, errorFactory)) || $guard(_exceptionable, {
2246
- path: _path + ".ranges[" + _index4 + "][1]",
2247
- expected: "(number & Minimum<0>)",
2248
- value: elem[1]
2249
- }, errorFactory))) || $guard(_exceptionable, {
2250
- path: _path + ".ranges[" + _index4 + "]",
2251
- expected: "[start: number & Minimum<0>, end: number & Minimum<0>]",
2252
- value: elem
2253
- }, errorFactory)) || $guard(_exceptionable, {
2254
- path: _path + ".ranges",
2255
- expected: "Array<[start: number & Minimum<0>, end: number & Minimum<0>]>",
2256
- value: input.ranges
2257
- }, errorFactory)) && (undefined === input.progress || "number" === typeof input.progress && (0 <= input.progress || $guard(_exceptionable, {
2258
- path: _path + ".progress",
2259
- expected: "number & Minimum<0>",
2260
- value: input.progress
2261
- }, errorFactory)) && (input.progress <= 1 || $guard(_exceptionable, {
2262
- path: _path + ".progress",
2263
- expected: "number & Maximum<1>",
2264
- value: input.progress
2265
- }, errorFactory)) || $guard(_exceptionable, {
2266
- path: _path + ".progress",
2267
- expected: "((number & Minimum<0> & Maximum<1>) | undefined)",
2268
- value: input.progress
2269
- }, errorFactory)) && (undefined === input.speed || "number" === typeof input.speed && (!Number.isNaN(input.speed) || $guard(_exceptionable, {
2270
- path: _path + ".speed",
2271
- expected: "number",
2272
- value: input.speed
2273
- }, errorFactory)) && (0 <= input.speed || $guard(_exceptionable, {
2274
- path: _path + ".speed",
2275
- expected: "number & Minimum<0>",
2276
- value: input.speed
2277
- }, errorFactory)) || $guard(_exceptionable, {
2278
- path: _path + ".speed",
2279
- expected: "((number & Minimum<0>) | undefined)",
2280
- value: input.speed
2281
- }, errorFactory)) && ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
2282
- path: _path + ".id",
2283
- expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
2284
- value: input.id
2285
- }, errorFactory)) || $guard(_exceptionable, {
2286
- path: _path + ".id",
2287
- expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
2288
- value: input.id
2289
- }, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
2290
- path: _path + ".size",
2291
- expected: "number & Minimum<0>",
2292
- value: input.size
2293
- }, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000 || $guard(_exceptionable, {
2294
- path: _path + ".size",
2295
- expected: "number & Type<\"uint64\">",
2296
- value: input.size
2297
- }, errorFactory)) || $guard(_exceptionable, {
2298
- path: _path + ".size",
2299
- expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
2300
- value: input.size
2301
- }, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
2302
- path: _path + ".seekable",
2303
- expected: "boolean",
2304
- value: input.seekable
2305
- }, errorFactory)) && ("boolean" === typeof input.deleted || $guard(_exceptionable, {
2306
- path: _path + ".deleted",
2307
- expected: "boolean",
2308
- value: input.deleted
2309
- }, errorFactory)) && ((Array.isArray(input.refs) || $guard(_exceptionable, {
2310
- path: _path + ".refs",
2311
- expected: "FileRefs",
2312
- value: input.refs
2313
- }, errorFactory)) && input.refs.every((elem, _index5) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || $guard(_exceptionable, {
2314
- path: _path + ".refs[" + _index5 + "]",
2315
- expected: "FileRef",
2316
- value: elem
2317
- }, errorFactory)) && $ao1(elem, _path + ".refs[" + _index5 + "]", true && _exceptionable) || $guard(_exceptionable, {
2318
- path: _path + ".refs[" + _index5 + "]",
2319
- expected: "FileRef",
2320
- value: elem
2321
- }, errorFactory)) || $guard(_exceptionable, {
2322
- path: _path + ".refs",
2323
- expected: "FileRefs",
2324
- value: input.refs
2325
- }, errorFactory)) && ((Array.isArray(input.tags) || $guard(_exceptionable, {
2326
- path: _path + ".tags",
2327
- expected: "Array<string>",
2328
- value: input.tags
2329
- }, errorFactory)) && input.tags.every((elem, _index6) => "string" === typeof elem || $guard(_exceptionable, {
2330
- path: _path + ".tags[" + _index6 + "]",
2331
- expected: "string",
2332
- value: elem
2333
- }, errorFactory)) || $guard(_exceptionable, {
2334
- path: _path + ".tags",
2335
- expected: "Array<string>",
2336
- value: input.tags
2337
- }, errorFactory)) && ("string" === typeof input.resumable || $guard(_exceptionable, {
2338
- path: _path + ".resumable",
2339
- expected: "string",
2340
- value: input.resumable
2341
- }, errorFactory)) && ("string" === typeof input.mimeType || $guard(_exceptionable, {
2342
- path: _path + ".mimeType",
2343
- expected: "string",
2344
- value: input.mimeType
2345
- }, errorFactory)) && ("string" === typeof input.encoding || $guard(_exceptionable, {
2346
- path: _path + ".encoding",
2347
- expected: "string",
2348
- value: input.encoding
2349
- }, errorFactory)) && ("string" === typeof input.hash && (/^([A-Fa-f0-9]{32})?$/.test(input.hash) || $guard(_exceptionable, {
2350
- path: _path + ".hash",
2351
- expected: "string & Pattern<\"^([A-Fa-f0-9]{32})?$\">",
2352
- value: input.hash
2353
- }, errorFactory)) || $guard(_exceptionable, {
2354
- path: _path + ".hash",
2355
- expected: "(string & Pattern<\"^([A-Fa-f0-9]{32})?$\">)",
2356
- value: input.hash
2357
- }, errorFactory)) && ("number" === typeof input.btime && (0 <= input.btime || $guard(_exceptionable, {
2358
- path: _path + ".btime",
2359
- expected: "number & Minimum<0>",
2360
- value: input.btime
2361
- }, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000 || $guard(_exceptionable, {
2362
- path: _path + ".btime",
2363
- expected: "number & Type<\"uint64\">",
2364
- value: input.btime
2365
- }, errorFactory)) || $guard(_exceptionable, {
2366
- path: _path + ".btime",
2367
- expected: "(number & Minimum<0> & Type<\"uint64\">)",
2368
- value: input.btime
2369
- }, errorFactory)) && ("boolean" === typeof input.completed || $guard(_exceptionable, {
2370
- path: _path + ".completed",
2371
- expected: "boolean",
2372
- value: input.completed
2373
- }, errorFactory)) && ((undefined !== input.error || $guard(_exceptionable, {
2374
- path: _path + ".error",
2375
- expected: "(Array<NxtError> | NxtError | null)",
2376
- value: input.error
2377
- }, errorFactory)) && (null === input.error || (Array.isArray(input.error) && input.error.every((elem, _index7) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
2378
- path: _path + ".error[" + _index7 + "]",
2379
- expected: "NxtError",
2380
- value: elem
2381
- }, errorFactory)) && $ao2(elem, _path + ".error[" + _index7 + "]", true && _exceptionable) || $guard(_exceptionable, {
2382
- path: _path + ".error[" + _index7 + "]",
2383
- expected: "NxtError",
2384
- value: elem
2385
- }, errorFactory)) || "object" === typeof input.error && null !== input.error && $ao2(input.error, _path + ".error", true && _exceptionable) || $guard(_exceptionable, {
2386
- path: _path + ".error",
2387
- expected: "(Array<NxtError> | NxtError | null)",
2388
- value: input.error
2389
- }, errorFactory)) || $guard(_exceptionable, {
2390
- path: _path + ".error",
2391
- expected: "(Array<NxtError> | NxtError | null)",
2392
- value: input.error
2393
- }, errorFactory)));
2394
- const $ao1 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
2395
- path: _path + ".file",
2396
- expected: "(string | undefined)",
2397
- value: input.file
2398
- }, errorFactory)) && (undefined === input.offset || "number" === typeof input.offset && !Number.isNaN(input.offset) || $guard(_exceptionable, {
2399
- path: _path + ".offset",
2400
- expected: "(number | undefined)",
2401
- value: input.offset
2402
- }, errorFactory)) && (undefined === input.start || "number" === typeof input.start && !Number.isNaN(input.start) || $guard(_exceptionable, {
2403
- path: _path + ".start",
2404
- expected: "(number | undefined)",
2405
- value: input.start
2406
- }, errorFactory)) && (undefined === input.end || "number" === typeof input.end && !Number.isNaN(input.end) || $guard(_exceptionable, {
2407
- path: _path + ".end",
2408
- expected: "(number | undefined)",
2409
- value: input.end
2410
- }, errorFactory));
2411
- const $ao2 = (input, _path, _exceptionable = true) => ("string" === typeof input.message || $guard(_exceptionable, {
2412
- path: _path + ".message",
2413
- expected: "string",
2414
- value: input.message
2415
- }, errorFactory)) && (undefined === input.type || "string" === typeof input.type || $guard(_exceptionable, {
2416
- path: _path + ".type",
2417
- expected: "(string | undefined)",
2418
- value: input.type
2419
- }, errorFactory)) && (undefined === input.code || "string" === typeof input.code || $guard(_exceptionable, {
2420
- path: _path + ".code",
2421
- expected: "(string | undefined)",
2422
- value: input.code
2423
- }, errorFactory)) && (undefined === input.exitCode || "number" === typeof input.exitCode && !Number.isNaN(input.exitCode) || $guard(_exceptionable, {
2424
- path: _path + ".exitCode",
2425
- expected: "(number | undefined)",
2426
- value: input.exitCode
2427
- }, errorFactory)) && (undefined === input.signalCode || "number" === typeof input.signalCode && !Number.isNaN(input.signalCode) || $guard(_exceptionable, {
2428
- path: _path + ".signalCode",
2429
- expected: "(number | undefined)",
2430
- value: input.signalCode
2431
- }, errorFactory)) && (undefined === input.statusCode || "number" === typeof input.statusCode && !Number.isNaN(input.statusCode) || $guard(_exceptionable, {
2432
- path: _path + ".statusCode",
2433
- expected: "(number | undefined)",
2434
- value: input.statusCode
2435
- }, errorFactory)) && (undefined === input.headers || ("object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) || $guard(_exceptionable, {
2436
- path: _path + ".headers",
2437
- expected: "(Record<string, string> | undefined)",
2438
- value: input.headers
2439
- }, errorFactory)) && $ao3(input.headers, _path + ".headers", true && _exceptionable) || $guard(_exceptionable, {
2440
- path: _path + ".headers",
2441
- expected: "(Record<string, string> | undefined)",
2442
- value: input.headers
2443
- }, errorFactory)) && (undefined === input.data || ("object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) || $guard(_exceptionable, {
2444
- path: _path + ".data",
2445
- expected: "(object | undefined)",
2446
- value: input.data
2447
- }, errorFactory)) && $ao4(input.data, _path + ".data", true && _exceptionable) || $guard(_exceptionable, {
2448
- path: _path + ".data",
2449
- expected: "(object | undefined)",
2450
- value: input.data
2451
- }, errorFactory)) && (null === input.cause || undefined === input.cause || ("object" === typeof input.cause && null !== input.cause || $guard(_exceptionable, {
2452
- path: _path + ".cause",
2453
- expected: "(NxtError | null | undefined)",
2454
- value: input.cause
2455
- }, errorFactory)) && $ao2(input.cause, _path + ".cause", true && _exceptionable) || $guard(_exceptionable, {
2456
- path: _path + ".cause",
2457
- expected: "(NxtError | null | undefined)",
2458
- value: input.cause
2459
- }, errorFactory)) && (null === input.errors || undefined === input.errors || (Array.isArray(input.errors) || $guard(_exceptionable, {
2460
- path: _path + ".errors",
2461
- expected: "(Array<NxtError> | null | undefined)",
2462
- value: input.errors
2463
- }, errorFactory)) && input.errors.every((elem, _index8) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
2464
- path: _path + ".errors[" + _index8 + "]",
2465
- expected: "NxtError",
2466
- value: elem
2467
- }, errorFactory)) && $ao2(elem, _path + ".errors[" + _index8 + "]", true && _exceptionable) || $guard(_exceptionable, {
2468
- path: _path + ".errors[" + _index8 + "]",
2469
- expected: "NxtError",
2470
- value: elem
2471
- }, errorFactory)) || $guard(_exceptionable, {
2472
- path: _path + ".errors",
2473
- expected: "(Array<NxtError> | null | undefined)",
2474
- value: input.errors
2475
- }, errorFactory));
2476
- const $ao3 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
2477
- const value = input[key];
2478
- if (undefined === value)
2479
- return true;
2480
- return "string" === typeof value || $guard(_exceptionable, {
2481
- path: _path + $join(key),
2482
- expected: "string",
2483
- value: value
2484
- }, errorFactory);
2485
- });
2486
- const $ao4 = (input, _path, _exceptionable = true) => true;
2487
- return ("object" === typeof input && null !== input || $guard(true, {
2488
- path: _path + "",
2489
- expected: "FileStats",
2490
- value: input
2491
- }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
2492
- path: _path + "",
2493
- expected: "FileStats",
2494
- value: input
2495
- }, errorFactory);
2496
- })(input, "$input", true);
363
+ }; })();
364
+ export const assertFileStats = (() => { const _io0 = input => (null === input.position || "number" === typeof input.position && (0 <= input.position && __typia_transform__isTypeUint64._isTypeUint64(input.position))) && (null === input.uploading || "boolean" === typeof input.uploading) && (Array.isArray(input.zones) && input.zones.every(elem => "string" === typeof elem)) && (Array.isArray(input.replicas) && input.replicas.every(elem => "string" === typeof elem)) && (Array.isArray(input.locations) && input.locations.every(elem => "string" === typeof elem)) && (Array.isArray(input.ranges) && input.ranges.every(elem => Array.isArray(elem) && (elem.length === 2 && ("number" === typeof elem[0] && 0 <= elem[0]) && ("number" === typeof elem[1] && 0 <= elem[1])))) && (undefined === input.progress || "number" === typeof input.progress && (0 <= input.progress && input.progress <= 1)) && (undefined === input.speed || "number" === typeof input.speed && 0 <= input.speed) && ("string" === typeof input.id && RegExp("^[0-9A-Za-z~][0-9A-Za-z~._: -]*$").test(input.id)) && (null === input.size || "number" === typeof input.size && (0 <= input.size && __typia_transform__isTypeUint64._isTypeUint64(input.size))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && _io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && "string" === typeof input.encoding && ("string" === typeof input.hash && RegExp("^([A-Fa-f0-9]{32})?$").test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && __typia_transform__isTypeUint64._isTypeUint64(input.btime))) && "boolean" === typeof input.completed && (undefined !== input.error && (null === input.error || (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && _io2(elem)) || "object" === typeof input.error && null !== input.error && _io2(input.error)))); const _io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end); const _io2 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && _io3(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && _io4(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && _io2(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && _io2(elem))); const _io3 = input => Object.keys(input).every(key => {
365
+ const value = input[key];
366
+ if (undefined === value)
367
+ return true;
368
+ return "string" === typeof value;
369
+ }); const _io4 = input => true; const _ao0 = (input, _path, _exceptionable = true) => (null === input.position || "number" === typeof input.position && (0 <= input.position || __typia_transform__assertGuard._assertGuard(_exceptionable, {
370
+ method: "typia.createAssert",
371
+ path: _path + ".position",
372
+ expected: "number & Minimum<0>",
373
+ value: input.position
374
+ }, _errorFactory)) && (__typia_transform__isTypeUint64._isTypeUint64(input.position) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
375
+ method: "typia.createAssert",
376
+ path: _path + ".position",
377
+ expected: "number & Type<\"uint64\">",
378
+ value: input.position
379
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
380
+ method: "typia.createAssert",
381
+ path: _path + ".position",
382
+ expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
383
+ value: input.position
384
+ }, _errorFactory)) && (null === input.uploading || "boolean" === typeof input.uploading || __typia_transform__assertGuard._assertGuard(_exceptionable, {
385
+ method: "typia.createAssert",
386
+ path: _path + ".uploading",
387
+ expected: "(boolean | null)",
388
+ value: input.uploading
389
+ }, _errorFactory)) && ((Array.isArray(input.zones) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
390
+ method: "typia.createAssert",
391
+ path: _path + ".zones",
392
+ expected: "Array<string>",
393
+ value: input.zones
394
+ }, _errorFactory)) && input.zones.every((elem, _index9) => "string" === typeof elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
395
+ method: "typia.createAssert",
396
+ path: _path + ".zones[" + _index9 + "]",
397
+ expected: "string",
398
+ value: elem
399
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
400
+ method: "typia.createAssert",
401
+ path: _path + ".zones",
402
+ expected: "Array<string>",
403
+ value: input.zones
404
+ }, _errorFactory)) && ((Array.isArray(input.replicas) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
405
+ method: "typia.createAssert",
406
+ path: _path + ".replicas",
407
+ expected: "Array<string>",
408
+ value: input.replicas
409
+ }, _errorFactory)) && input.replicas.every((elem, _index10) => "string" === typeof elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
410
+ method: "typia.createAssert",
411
+ path: _path + ".replicas[" + _index10 + "]",
412
+ expected: "string",
413
+ value: elem
414
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
415
+ method: "typia.createAssert",
416
+ path: _path + ".replicas",
417
+ expected: "Array<string>",
418
+ value: input.replicas
419
+ }, _errorFactory)) && ((Array.isArray(input.locations) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
420
+ method: "typia.createAssert",
421
+ path: _path + ".locations",
422
+ expected: "Array<string>",
423
+ value: input.locations
424
+ }, _errorFactory)) && input.locations.every((elem, _index11) => "string" === typeof elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
425
+ method: "typia.createAssert",
426
+ path: _path + ".locations[" + _index11 + "]",
427
+ expected: "string",
428
+ value: elem
429
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
430
+ method: "typia.createAssert",
431
+ path: _path + ".locations",
432
+ expected: "Array<string>",
433
+ value: input.locations
434
+ }, _errorFactory)) && ((Array.isArray(input.ranges) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
435
+ method: "typia.createAssert",
436
+ path: _path + ".ranges",
437
+ expected: "Array<[start: number & Minimum<0>, end: number & Minimum<0>]>",
438
+ value: input.ranges
439
+ }, _errorFactory)) && input.ranges.every((elem, _index12) => (Array.isArray(elem) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
440
+ method: "typia.createAssert",
441
+ path: _path + ".ranges[" + _index12 + "]",
442
+ expected: "[start: number & Minimum<0>, end: number & Minimum<0>]",
443
+ value: elem
444
+ }, _errorFactory)) && ((elem.length === 2 || __typia_transform__assertGuard._assertGuard(_exceptionable, {
445
+ method: "typia.createAssert",
446
+ path: _path + ".ranges[" + _index12 + "]",
447
+ expected: "[(number & Minimum<0>), (number & Minimum<0>)]",
448
+ value: elem
449
+ }, _errorFactory)) && ("number" === typeof elem[0] && (0 <= elem[0] || __typia_transform__assertGuard._assertGuard(_exceptionable, {
450
+ method: "typia.createAssert",
451
+ path: _path + ".ranges[" + _index12 + "][0]",
452
+ expected: "number & Minimum<0>",
453
+ value: elem[0]
454
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
455
+ method: "typia.createAssert",
456
+ path: _path + ".ranges[" + _index12 + "][0]",
457
+ expected: "(number & Minimum<0>)",
458
+ value: elem[0]
459
+ }, _errorFactory)) && ("number" === typeof elem[1] && (0 <= elem[1] || __typia_transform__assertGuard._assertGuard(_exceptionable, {
460
+ method: "typia.createAssert",
461
+ path: _path + ".ranges[" + _index12 + "][1]",
462
+ expected: "number & Minimum<0>",
463
+ value: elem[1]
464
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
465
+ method: "typia.createAssert",
466
+ path: _path + ".ranges[" + _index12 + "][1]",
467
+ expected: "(number & Minimum<0>)",
468
+ value: elem[1]
469
+ }, _errorFactory))) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
470
+ method: "typia.createAssert",
471
+ path: _path + ".ranges[" + _index12 + "]",
472
+ expected: "[start: number & Minimum<0>, end: number & Minimum<0>]",
473
+ value: elem
474
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
475
+ method: "typia.createAssert",
476
+ path: _path + ".ranges",
477
+ expected: "Array<[start: number & Minimum<0>, end: number & Minimum<0>]>",
478
+ value: input.ranges
479
+ }, _errorFactory)) && (undefined === input.progress || "number" === typeof input.progress && (0 <= input.progress || __typia_transform__assertGuard._assertGuard(_exceptionable, {
480
+ method: "typia.createAssert",
481
+ path: _path + ".progress",
482
+ expected: "number & Minimum<0>",
483
+ value: input.progress
484
+ }, _errorFactory)) && (input.progress <= 1 || __typia_transform__assertGuard._assertGuard(_exceptionable, {
485
+ method: "typia.createAssert",
486
+ path: _path + ".progress",
487
+ expected: "number & Maximum<1>",
488
+ value: input.progress
489
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
490
+ method: "typia.createAssert",
491
+ path: _path + ".progress",
492
+ expected: "((number & Minimum<0> & Maximum<1>) | undefined)",
493
+ value: input.progress
494
+ }, _errorFactory)) && (undefined === input.speed || "number" === typeof input.speed && (0 <= input.speed || __typia_transform__assertGuard._assertGuard(_exceptionable, {
495
+ method: "typia.createAssert",
496
+ path: _path + ".speed",
497
+ expected: "number & Minimum<0>",
498
+ value: input.speed
499
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
500
+ method: "typia.createAssert",
501
+ path: _path + ".speed",
502
+ expected: "((number & Minimum<0>) | undefined)",
503
+ value: input.speed
504
+ }, _errorFactory)) && ("string" === typeof input.id && (RegExp("^[0-9A-Za-z~][0-9A-Za-z~._: -]*$").test(input.id) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
505
+ method: "typia.createAssert",
506
+ path: _path + ".id",
507
+ expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
508
+ value: input.id
509
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
510
+ method: "typia.createAssert",
511
+ path: _path + ".id",
512
+ expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
513
+ value: input.id
514
+ }, _errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || __typia_transform__assertGuard._assertGuard(_exceptionable, {
515
+ method: "typia.createAssert",
516
+ path: _path + ".size",
517
+ expected: "number & Minimum<0>",
518
+ value: input.size
519
+ }, _errorFactory)) && (__typia_transform__isTypeUint64._isTypeUint64(input.size) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
520
+ method: "typia.createAssert",
521
+ path: _path + ".size",
522
+ expected: "number & Type<\"uint64\">",
523
+ value: input.size
524
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
525
+ method: "typia.createAssert",
526
+ path: _path + ".size",
527
+ expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
528
+ value: input.size
529
+ }, _errorFactory)) && ("boolean" === typeof input.seekable || __typia_transform__assertGuard._assertGuard(_exceptionable, {
530
+ method: "typia.createAssert",
531
+ path: _path + ".seekable",
532
+ expected: "boolean",
533
+ value: input.seekable
534
+ }, _errorFactory)) && ("boolean" === typeof input.deleted || __typia_transform__assertGuard._assertGuard(_exceptionable, {
535
+ method: "typia.createAssert",
536
+ path: _path + ".deleted",
537
+ expected: "boolean",
538
+ value: input.deleted
539
+ }, _errorFactory)) && ((Array.isArray(input.refs) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
540
+ method: "typia.createAssert",
541
+ path: _path + ".refs",
542
+ expected: "FileRefs",
543
+ value: input.refs
544
+ }, _errorFactory)) && input.refs.every((elem, _index13) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
545
+ method: "typia.createAssert",
546
+ path: _path + ".refs[" + _index13 + "]",
547
+ expected: "FileRef",
548
+ value: elem
549
+ }, _errorFactory)) && _ao1(elem, _path + ".refs[" + _index13 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
550
+ method: "typia.createAssert",
551
+ path: _path + ".refs[" + _index13 + "]",
552
+ expected: "FileRef",
553
+ value: elem
554
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
555
+ method: "typia.createAssert",
556
+ path: _path + ".refs",
557
+ expected: "FileRefs",
558
+ value: input.refs
559
+ }, _errorFactory)) && ((Array.isArray(input.tags) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
560
+ method: "typia.createAssert",
561
+ path: _path + ".tags",
562
+ expected: "Array<string>",
563
+ value: input.tags
564
+ }, _errorFactory)) && input.tags.every((elem, _index14) => "string" === typeof elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
565
+ method: "typia.createAssert",
566
+ path: _path + ".tags[" + _index14 + "]",
567
+ expected: "string",
568
+ value: elem
569
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
570
+ method: "typia.createAssert",
571
+ path: _path + ".tags",
572
+ expected: "Array<string>",
573
+ value: input.tags
574
+ }, _errorFactory)) && ("string" === typeof input.resumable || __typia_transform__assertGuard._assertGuard(_exceptionable, {
575
+ method: "typia.createAssert",
576
+ path: _path + ".resumable",
577
+ expected: "string",
578
+ value: input.resumable
579
+ }, _errorFactory)) && ("string" === typeof input.mimeType || __typia_transform__assertGuard._assertGuard(_exceptionable, {
580
+ method: "typia.createAssert",
581
+ path: _path + ".mimeType",
582
+ expected: "string",
583
+ value: input.mimeType
584
+ }, _errorFactory)) && ("string" === typeof input.encoding || __typia_transform__assertGuard._assertGuard(_exceptionable, {
585
+ method: "typia.createAssert",
586
+ path: _path + ".encoding",
587
+ expected: "string",
588
+ value: input.encoding
589
+ }, _errorFactory)) && ("string" === typeof input.hash && (RegExp("^([A-Fa-f0-9]{32})?$").test(input.hash) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
590
+ method: "typia.createAssert",
591
+ path: _path + ".hash",
592
+ expected: "string & Pattern<\"^([A-Fa-f0-9]{32})?$\">",
593
+ value: input.hash
594
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
595
+ method: "typia.createAssert",
596
+ path: _path + ".hash",
597
+ expected: "(string & Pattern<\"^([A-Fa-f0-9]{32})?$\">)",
598
+ value: input.hash
599
+ }, _errorFactory)) && ("number" === typeof input.btime && (0 <= input.btime || __typia_transform__assertGuard._assertGuard(_exceptionable, {
600
+ method: "typia.createAssert",
601
+ path: _path + ".btime",
602
+ expected: "number & Minimum<0>",
603
+ value: input.btime
604
+ }, _errorFactory)) && (__typia_transform__isTypeUint64._isTypeUint64(input.btime) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
605
+ method: "typia.createAssert",
606
+ path: _path + ".btime",
607
+ expected: "number & Type<\"uint64\">",
608
+ value: input.btime
609
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
610
+ method: "typia.createAssert",
611
+ path: _path + ".btime",
612
+ expected: "(number & Minimum<0> & Type<\"uint64\">)",
613
+ value: input.btime
614
+ }, _errorFactory)) && ("boolean" === typeof input.completed || __typia_transform__assertGuard._assertGuard(_exceptionable, {
615
+ method: "typia.createAssert",
616
+ path: _path + ".completed",
617
+ expected: "boolean",
618
+ value: input.completed
619
+ }, _errorFactory)) && ((undefined !== input.error || __typia_transform__assertGuard._assertGuard(_exceptionable, {
620
+ method: "typia.createAssert",
621
+ path: _path + ".error",
622
+ expected: "(Array<NxtError> | NxtError | null)",
623
+ value: input.error
624
+ }, _errorFactory)) && (null === input.error || (Array.isArray(input.error) && input.error.every((elem, _index15) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
625
+ method: "typia.createAssert",
626
+ path: _path + ".error[" + _index15 + "]",
627
+ expected: "NxtError",
628
+ value: elem
629
+ }, _errorFactory)) && _ao2(elem, _path + ".error[" + _index15 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
630
+ method: "typia.createAssert",
631
+ path: _path + ".error[" + _index15 + "]",
632
+ expected: "NxtError",
633
+ value: elem
634
+ }, _errorFactory)) || "object" === typeof input.error && null !== input.error && _ao2(input.error, _path + ".error", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
635
+ method: "typia.createAssert",
636
+ path: _path + ".error",
637
+ expected: "(Array<NxtError> | NxtError | null)",
638
+ value: input.error
639
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
640
+ method: "typia.createAssert",
641
+ path: _path + ".error",
642
+ expected: "(Array<NxtError> | NxtError | null)",
643
+ value: input.error
644
+ }, _errorFactory))); const _ao1 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || __typia_transform__assertGuard._assertGuard(_exceptionable, {
645
+ method: "typia.createAssert",
646
+ path: _path + ".file",
647
+ expected: "(string | undefined)",
648
+ value: input.file
649
+ }, _errorFactory)) && (undefined === input.offset || "number" === typeof input.offset || __typia_transform__assertGuard._assertGuard(_exceptionable, {
650
+ method: "typia.createAssert",
651
+ path: _path + ".offset",
652
+ expected: "(number | undefined)",
653
+ value: input.offset
654
+ }, _errorFactory)) && (undefined === input.start || "number" === typeof input.start || __typia_transform__assertGuard._assertGuard(_exceptionable, {
655
+ method: "typia.createAssert",
656
+ path: _path + ".start",
657
+ expected: "(number | undefined)",
658
+ value: input.start
659
+ }, _errorFactory)) && (undefined === input.end || "number" === typeof input.end || __typia_transform__assertGuard._assertGuard(_exceptionable, {
660
+ method: "typia.createAssert",
661
+ path: _path + ".end",
662
+ expected: "(number | undefined)",
663
+ value: input.end
664
+ }, _errorFactory)); const _ao2 = (input, _path, _exceptionable = true) => ("string" === typeof input.message || __typia_transform__assertGuard._assertGuard(_exceptionable, {
665
+ method: "typia.createAssert",
666
+ path: _path + ".message",
667
+ expected: "string",
668
+ value: input.message
669
+ }, _errorFactory)) && (undefined === input.type || "string" === typeof input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
670
+ method: "typia.createAssert",
671
+ path: _path + ".type",
672
+ expected: "(string | undefined)",
673
+ value: input.type
674
+ }, _errorFactory)) && (undefined === input.code || "string" === typeof input.code || __typia_transform__assertGuard._assertGuard(_exceptionable, {
675
+ method: "typia.createAssert",
676
+ path: _path + ".code",
677
+ expected: "(string | undefined)",
678
+ value: input.code
679
+ }, _errorFactory)) && (undefined === input.exitCode || "number" === typeof input.exitCode || __typia_transform__assertGuard._assertGuard(_exceptionable, {
680
+ method: "typia.createAssert",
681
+ path: _path + ".exitCode",
682
+ expected: "(number | undefined)",
683
+ value: input.exitCode
684
+ }, _errorFactory)) && (undefined === input.signalCode || "number" === typeof input.signalCode || __typia_transform__assertGuard._assertGuard(_exceptionable, {
685
+ method: "typia.createAssert",
686
+ path: _path + ".signalCode",
687
+ expected: "(number | undefined)",
688
+ value: input.signalCode
689
+ }, _errorFactory)) && (undefined === input.statusCode || "number" === typeof input.statusCode || __typia_transform__assertGuard._assertGuard(_exceptionable, {
690
+ method: "typia.createAssert",
691
+ path: _path + ".statusCode",
692
+ expected: "(number | undefined)",
693
+ value: input.statusCode
694
+ }, _errorFactory)) && (undefined === input.headers || ("object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
695
+ method: "typia.createAssert",
696
+ path: _path + ".headers",
697
+ expected: "(Record<string, string> | undefined)",
698
+ value: input.headers
699
+ }, _errorFactory)) && _ao3(input.headers, _path + ".headers", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
700
+ method: "typia.createAssert",
701
+ path: _path + ".headers",
702
+ expected: "(Record<string, string> | undefined)",
703
+ value: input.headers
704
+ }, _errorFactory)) && (undefined === input.data || ("object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
705
+ method: "typia.createAssert",
706
+ path: _path + ".data",
707
+ expected: "(object | undefined)",
708
+ value: input.data
709
+ }, _errorFactory)) && _ao4(input.data, _path + ".data", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
710
+ method: "typia.createAssert",
711
+ path: _path + ".data",
712
+ expected: "(object | undefined)",
713
+ value: input.data
714
+ }, _errorFactory)) && (null === input.cause || undefined === input.cause || ("object" === typeof input.cause && null !== input.cause || __typia_transform__assertGuard._assertGuard(_exceptionable, {
715
+ method: "typia.createAssert",
716
+ path: _path + ".cause",
717
+ expected: "(NxtError | null | undefined)",
718
+ value: input.cause
719
+ }, _errorFactory)) && _ao2(input.cause, _path + ".cause", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
720
+ method: "typia.createAssert",
721
+ path: _path + ".cause",
722
+ expected: "(NxtError | null | undefined)",
723
+ value: input.cause
724
+ }, _errorFactory)) && (null === input.errors || undefined === input.errors || (Array.isArray(input.errors) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
725
+ method: "typia.createAssert",
726
+ path: _path + ".errors",
727
+ expected: "(Array<NxtError> | null | undefined)",
728
+ value: input.errors
729
+ }, _errorFactory)) && input.errors.every((elem, _index16) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
730
+ method: "typia.createAssert",
731
+ path: _path + ".errors[" + _index16 + "]",
732
+ expected: "NxtError",
733
+ value: elem
734
+ }, _errorFactory)) && _ao2(elem, _path + ".errors[" + _index16 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
735
+ method: "typia.createAssert",
736
+ path: _path + ".errors[" + _index16 + "]",
737
+ expected: "NxtError",
738
+ value: elem
739
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
740
+ method: "typia.createAssert",
741
+ path: _path + ".errors",
742
+ expected: "(Array<NxtError> | null | undefined)",
743
+ value: input.errors
744
+ }, _errorFactory)); const _ao3 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
745
+ const value = input[key];
746
+ if (undefined === value)
747
+ return true;
748
+ return "string" === typeof value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
749
+ method: "typia.createAssert",
750
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
751
+ expected: "string",
752
+ value: value
753
+ }, _errorFactory);
754
+ }); const _ao4 = (input, _path, _exceptionable = true) => true; const __is = input => "object" === typeof input && null !== input && _io0(input); let _errorFactory; return (input, errorFactory) => {
755
+ if (false === __is(input)) {
756
+ _errorFactory = errorFactory;
757
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || __typia_transform__assertGuard._assertGuard(true, {
758
+ method: "typia.createAssert",
759
+ path: _path + "",
760
+ expected: "FileStats",
761
+ value: input
762
+ }, _errorFactory)) && _ao0(input, _path + "", true) || __typia_transform__assertGuard._assertGuard(true, {
763
+ method: "typia.createAssert",
764
+ path: _path + "",
765
+ expected: "FileStats",
766
+ value: input
767
+ }, _errorFactory))(input, "$input", true);
768
+ }
2497
769
  return input;
2498
- }; const stringify = input => {
2499
- const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
2500
- const $io2 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io3(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io4(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io2(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
2501
- const $io3 = input => Object.keys(input).every(key => {
2502
- const value = input[key];
2503
- if (undefined === value)
2504
- return true;
2505
- return "string" === typeof value;
770
+ }; })();
771
+ export const stringifyFileStats = (() => { const _so0 = input => `{${undefined === input.progress ? "" : `"progress":${undefined !== input.progress ? input.progress : undefined},`}${undefined === input.speed ? "" : `"speed":${undefined !== input.speed ? input.speed : undefined},`}"position":${null !== input.position ? input.position : "null"},"uploading":${null !== input.uploading ? input.uploading : "null"},"zones":${`[${input.zones.map(elem => __typia_transform__jsonStringifyString._jsonStringifyString(elem)).join(",")}]`},"replicas":${`[${input.replicas.map(elem => __typia_transform__jsonStringifyString._jsonStringifyString(elem)).join(",")}]`},"locations":${`[${input.locations.map(elem => __typia_transform__jsonStringifyString._jsonStringifyString(elem)).join(",")}]`},"ranges":${`[${input.ranges.map(elem => `[${elem[0]},${elem[1]}]`).join(",")}]`},"id":${__typia_transform__jsonStringifyString._jsonStringifyString(input.id)},"size":${null !== input.size ? input.size : "null"},"seekable":${input.seekable},"deleted":${input.deleted},"refs":${`[${input.refs.map(elem => _so1(elem)).join(",")}]`},"tags":${`[${input.tags.map(elem => __typia_transform__jsonStringifyString._jsonStringifyString(elem)).join(",")}]`},"resumable":${__typia_transform__jsonStringifyString._jsonStringifyString(input.resumable)},"mimeType":${__typia_transform__jsonStringifyString._jsonStringifyString(input.mimeType)},"encoding":${__typia_transform__jsonStringifyString._jsonStringifyString(input.encoding)},"hash":${__typia_transform__jsonStringifyString._jsonStringifyString(input.hash)},"btime":${input.btime},"completed":${input.completed},"error":${null !== input.error ? (() => {
772
+ if (Array.isArray(input.error))
773
+ return `[${input.error.map(elem => _so2(elem)).join(",")}]`;
774
+ if ("object" === typeof input.error && null !== input.error)
775
+ return _so2(input.error);
776
+ __typia_transform__throwTypeGuardError._throwTypeGuardError({
777
+ method: "typia.json.createStringify",
778
+ expected: "(Array<NxtError> | NxtError | null)",
779
+ value: input.error
2506
780
  });
2507
- const $io4 = input => true;
2508
- const $string = __typia.json.createAssertStringify.string;
2509
- const $throws = __typia.json.createAssertStringify.throws;
2510
- const $tail = __typia.json.createAssertStringify.tail;
2511
- const $so0 = input => `{${undefined === input.progress ? "" : `"progress":${undefined !== input.progress ? input.progress : undefined},`}${undefined === input.speed ? "" : `"speed":${undefined !== input.speed ? input.speed : undefined},`}"position":${null !== input.position ? input.position : "null"},"uploading":${null !== input.uploading ? input.uploading : "null"},"zones":${`[${input.zones.map(elem => $string(elem)).join(",")}]`},"replicas":${`[${input.replicas.map(elem => $string(elem)).join(",")}]`},"locations":${`[${input.locations.map(elem => $string(elem)).join(",")}]`},"ranges":${`[${input.ranges.map(elem => `[${elem[0]},${elem[1]}]`).join(",")}]`},"id":${$string(input.id)},"size":${null !== input.size ? input.size : "null"},"seekable":${input.seekable},"deleted":${input.deleted},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"encoding":${$string(input.encoding)},"hash":${$string(input.hash)},"btime":${input.btime},"completed":${input.completed},"error":${null !== input.error ? (() => {
2512
- if (Array.isArray(input.error))
2513
- return `[${input.error.map(elem => $so2(elem)).join(",")}]`;
2514
- if ("object" === typeof input.error && null !== input.error)
2515
- return $so2(input.error);
2516
- $throws({
2517
- expected: "(Array<NxtError> | NxtError | null)",
2518
- value: input.error
2519
- });
2520
- })() : "null"}}`;
2521
- const $so1 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined},`}${undefined === input.offset ? "" : `"offset":${undefined !== input.offset ? input.offset : undefined},`}${undefined === input.start ? "" : `"start":${undefined !== input.start ? input.start : undefined},`}${undefined === input.end ? "" : `"end":${undefined !== input.end ? input.end : undefined}`}`)}}`;
2522
- const $so2 = input => `{${undefined === input.type ? "" : `"type":${undefined !== input.type ? $string(input.type) : undefined},`}${undefined === input.code ? "" : `"code":${undefined !== input.code ? $string(input.code) : undefined},`}${undefined === input.exitCode ? "" : `"exitCode":${undefined !== input.exitCode ? input.exitCode : undefined},`}${undefined === input.signalCode ? "" : `"signalCode":${undefined !== input.signalCode ? input.signalCode : undefined},`}${undefined === input.statusCode ? "" : `"statusCode":${undefined !== input.statusCode ? input.statusCode : undefined},`}${undefined === input.headers ? "" : `"headers":${undefined !== input.headers ? $so3(input.headers) : undefined},`}${undefined === input.data ? "" : `"data":${undefined !== input.data ? "{}" : undefined},`}${undefined === input.cause ? "" : `"cause":${undefined !== input.cause ? null !== input.cause ? $so2(input.cause) : "null" : undefined},`}${undefined === input.errors ? "" : `"errors":${undefined !== input.errors ? null !== input.errors ? `[${input.errors.map(elem => $so2(elem)).join(",")}]` : "null" : undefined},`}"message":${$string(input.message)}}`;
2523
- const $so3 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
2524
- return ""; return `${JSON.stringify(key)}:${$string(value)}`; }).filter(str => "" !== str).join(",")}}`;
2525
- return $so0(input);
2526
- }; return stringify(assert(input, errorFactory)); };
781
+ })() : "null"}}`; const _so1 = input => `{${__typia_transform__jsonStringifyTail._jsonStringifyTail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? __typia_transform__jsonStringifyString._jsonStringifyString(input.file) : undefined},`}${undefined === input.offset ? "" : `"offset":${undefined !== input.offset ? input.offset : undefined},`}${undefined === input.start ? "" : `"start":${undefined !== input.start ? input.start : undefined},`}${undefined === input.end ? "" : `"end":${undefined !== input.end ? input.end : undefined}`}`)}}`; const _so2 = input => `{${undefined === input.type ? "" : `"type":${undefined !== input.type ? __typia_transform__jsonStringifyString._jsonStringifyString(input.type) : undefined},`}${undefined === input.code ? "" : `"code":${undefined !== input.code ? __typia_transform__jsonStringifyString._jsonStringifyString(input.code) : undefined},`}${undefined === input.exitCode ? "" : `"exitCode":${undefined !== input.exitCode ? input.exitCode : undefined},`}${undefined === input.signalCode ? "" : `"signalCode":${undefined !== input.signalCode ? input.signalCode : undefined},`}${undefined === input.statusCode ? "" : `"statusCode":${undefined !== input.statusCode ? input.statusCode : undefined},`}${undefined === input.headers ? "" : `"headers":${undefined !== input.headers ? _so3(input.headers) : undefined},`}${undefined === input.data ? "" : `"data":${undefined !== input.data ? _so4(input.data) : undefined},`}${undefined === input.cause ? "" : `"cause":${undefined !== input.cause ? null !== input.cause ? _so2(input.cause) : "null" : undefined},`}${undefined === input.errors ? "" : `"errors":${undefined !== input.errors ? null !== input.errors ? `[${input.errors.map(elem => _so2(elem)).join(",")}]` : "null" : undefined},`}"message":${__typia_transform__jsonStringifyString._jsonStringifyString(input.message)}}`; const _so3 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
782
+ return ""; return `${JSON.stringify(key)}:${__typia_transform__jsonStringifyString._jsonStringifyString(value)}`; }).filter(str => "" !== str).join(",")}}`; const _so4 = input => "{}"; const _io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end); const _io2 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && _io3(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && _io4(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && _io2(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && _io2(elem))); const _io3 = input => Object.keys(input).every(key => {
783
+ const value = input[key];
784
+ if (undefined === value)
785
+ return true;
786
+ return "string" === typeof value;
787
+ }); const _io4 = input => true; return input => _so0(input); })();