@nestia/fetcher 12.0.0-dev.20260612.1 → 12.0.0-dev.20260619.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/lib/AesPkcs5.js +12 -9
  2. package/lib/AesPkcs5.js.map +1 -1
  3. package/lib/AesPkcs5.mjs +2 -45
  4. package/lib/AesPkcs5.mjs.map +1 -1
  5. package/lib/AesPkcs52.mjs +53 -0
  6. package/lib/AesPkcs52.mjs.map +1 -0
  7. package/lib/EncryptedFetcher.js +77 -62
  8. package/lib/EncryptedFetcher.js.map +1 -1
  9. package/lib/EncryptedFetcher.mjs +2 -82
  10. package/lib/EncryptedFetcher.mjs.map +1 -1
  11. package/lib/EncryptedFetcher2.mjs +105 -0
  12. package/lib/EncryptedFetcher2.mjs.map +1 -0
  13. package/lib/FormDataInput.js +3 -3
  14. package/lib/FormDataInput.js.map +1 -1
  15. package/lib/FormDataInput.mjs +2 -1
  16. package/lib/FormDataInput.mjs.map +1 -1
  17. package/lib/FormDataInput2.mjs +6 -0
  18. package/lib/FormDataInput2.mjs.map +1 -0
  19. package/lib/HttpError.js +6 -11
  20. package/lib/HttpError.js.map +1 -1
  21. package/lib/HttpError.mjs +1 -1
  22. package/lib/HttpError2.mjs +16 -0
  23. package/lib/HttpError2.mjs.map +1 -0
  24. package/lib/IConnection.js +3 -3
  25. package/lib/IConnection.js.map +1 -1
  26. package/lib/IConnection.mjs +2 -1
  27. package/lib/IConnection.mjs.map +1 -1
  28. package/lib/IConnection2.mjs +6 -0
  29. package/lib/IConnection2.mjs.map +1 -0
  30. package/lib/IEncryptionPassword.js +3 -3
  31. package/lib/IEncryptionPassword.js.map +1 -1
  32. package/lib/IEncryptionPassword.mjs +2 -1
  33. package/lib/IEncryptionPassword.mjs.map +1 -1
  34. package/lib/IEncryptionPassword2.mjs +6 -0
  35. package/lib/IEncryptionPassword2.mjs.map +1 -0
  36. package/lib/IFetchEvent.js +21 -3
  37. package/lib/IFetchEvent.js.map +1 -1
  38. package/lib/IFetchEvent.mjs +2 -1
  39. package/lib/IFetchEvent.mjs.map +1 -1
  40. package/lib/IFetchEvent2.mjs +6 -0
  41. package/lib/IFetchEvent2.mjs.map +1 -0
  42. package/lib/IFetchRoute.js +3 -3
  43. package/lib/IFetchRoute.js.map +1 -1
  44. package/lib/IFetchRoute.mjs +2 -1
  45. package/lib/IFetchRoute.mjs.map +1 -1
  46. package/lib/IFetchRoute2.mjs +6 -0
  47. package/lib/IFetchRoute2.mjs.map +1 -0
  48. package/lib/IPropagation.js +3 -3
  49. package/lib/IPropagation.js.map +1 -1
  50. package/lib/IPropagation.mjs +2 -1
  51. package/lib/IPropagation.mjs.map +1 -1
  52. package/lib/IPropagation2.mjs +6 -0
  53. package/lib/IPropagation2.mjs.map +1 -0
  54. package/lib/NestiaSimulator.js +8 -8
  55. package/lib/NestiaSimulator.js.map +1 -1
  56. package/lib/NestiaSimulator.mjs +2 -43
  57. package/lib/NestiaSimulator.mjs.map +1 -1
  58. package/lib/NestiaSimulator2.mjs +49 -0
  59. package/lib/NestiaSimulator2.mjs.map +1 -0
  60. package/lib/PlainFetcher.js +38 -23
  61. package/lib/PlainFetcher.js.map +1 -1
  62. package/lib/PlainFetcher.mjs +2 -42
  63. package/lib/PlainFetcher.mjs.map +1 -1
  64. package/lib/PlainFetcher2.mjs +63 -0
  65. package/lib/PlainFetcher2.mjs.map +1 -0
  66. package/lib/_virtual/AesPkcs5.mjs +4 -0
  67. package/lib/_virtual/AesPkcs5.mjs.map +1 -0
  68. package/lib/_virtual/EncryptedFetcher.mjs +4 -0
  69. package/lib/_virtual/EncryptedFetcher.mjs.map +1 -0
  70. package/lib/_virtual/FetcherBase.mjs +4 -0
  71. package/lib/_virtual/FetcherBase.mjs.map +1 -0
  72. package/lib/_virtual/FormDataInput.mjs +4 -0
  73. package/lib/_virtual/FormDataInput.mjs.map +1 -0
  74. package/lib/_virtual/HttpError.mjs +4 -0
  75. package/lib/_virtual/HttpError.mjs.map +1 -0
  76. package/lib/_virtual/IConnection.mjs +4 -0
  77. package/lib/_virtual/IConnection.mjs.map +1 -0
  78. package/lib/_virtual/IEncryptionPassword.mjs +4 -0
  79. package/lib/_virtual/IEncryptionPassword.mjs.map +1 -0
  80. package/lib/_virtual/IFetchEvent.mjs +4 -0
  81. package/lib/_virtual/IFetchEvent.mjs.map +1 -0
  82. package/lib/_virtual/IFetchRoute.mjs +4 -0
  83. package/lib/_virtual/IFetchRoute.mjs.map +1 -0
  84. package/lib/_virtual/IPropagation.mjs +4 -0
  85. package/lib/_virtual/IPropagation.mjs.map +1 -0
  86. package/lib/_virtual/NestiaSimulator.mjs +4 -0
  87. package/lib/_virtual/NestiaSimulator.mjs.map +1 -0
  88. package/lib/_virtual/PlainFetcher.mjs +4 -0
  89. package/lib/_virtual/PlainFetcher.mjs.map +1 -0
  90. package/lib/_virtual/_commonjsHelpers.mjs +35 -0
  91. package/lib/_virtual/_commonjsHelpers.mjs.map +1 -0
  92. package/lib/_virtual/_node_crypto.mjs +7 -0
  93. package/lib/_virtual/_node_crypto.mjs.map +1 -0
  94. package/lib/_virtual/index.mjs +4 -0
  95. package/lib/_virtual/index.mjs.map +1 -0
  96. package/lib/_virtual/is_binary_response_content_type.mjs +4 -0
  97. package/lib/_virtual/is_binary_response_content_type.mjs.map +1 -0
  98. package/lib/_virtual/utils.mjs +7 -0
  99. package/lib/_virtual/utils.mjs.map +1 -0
  100. package/lib/index.js +26 -21
  101. package/lib/index.js.map +1 -1
  102. package/lib/index.mjs +1 -3
  103. package/lib/index.mjs.map +1 -1
  104. package/lib/index2.mjs +53 -0
  105. package/lib/index2.mjs.map +1 -0
  106. package/lib/internal/FetcherBase.js +50 -44
  107. package/lib/internal/FetcherBase.js.map +1 -1
  108. package/lib/internal/FetcherBase.mjs +2 -189
  109. package/lib/internal/FetcherBase.mjs.map +1 -1
  110. package/lib/internal/FetcherBase2.mjs +203 -0
  111. package/lib/internal/FetcherBase2.mjs.map +1 -0
  112. package/lib/internal/is_binary_response_content_type.js +4 -4
  113. package/lib/internal/is_binary_response_content_type.js.map +1 -1
  114. package/lib/internal/is_binary_response_content_type.mjs +2 -12
  115. package/lib/internal/is_binary_response_content_type.mjs.map +1 -1
  116. package/lib/internal/is_binary_response_content_type2.mjs +18 -0
  117. package/lib/internal/is_binary_response_content_type2.mjs.map +1 -0
  118. package/package.json +5 -7
package/lib/HttpError.js CHANGED
@@ -1,11 +1,6 @@
1
- 'use strict';
2
-
3
- var utils = require('@typia/utils');
4
-
5
-
6
-
7
- Object.defineProperty(exports, "HttpError", {
8
- enumerable: true,
9
- get: function () { return utils.HttpError; }
10
- });
11
- //# sourceMappingURL=HttpError.js.map
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HttpError = void 0;
4
+ var utils_1 = require("@typia/utils");
5
+ Object.defineProperty(exports, "HttpError", { enumerable: true, get: function () { return utils_1.HttpError; } });
6
+ //# sourceMappingURL=HttpError.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"HttpError.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
1
+ {"version":3,"file":"HttpError.js","sourceRoot":"","sources":["../src/HttpError.ts"],"names":[],"mappings":";;;AAAA,sCAAyC;AAAhC,kGAAA,SAAS,OAAA"}
package/lib/HttpError.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export { HttpError } from '@typia/utils';
1
+ export { default } from './HttpError2.mjs';
2
2
  //# sourceMappingURL=HttpError.mjs.map
@@ -0,0 +1,16 @@
1
+ import { getDefaultExportFromCjs } from './_virtual/_commonjsHelpers.mjs';
2
+ import { __exports as HttpError$1 } from './_virtual/HttpError.mjs';
3
+ import require$$0 from './_virtual/utils.mjs';
4
+
5
+ (function (exports) {
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.HttpError = void 0;
8
+ var utils_1 = require$$0;
9
+ Object.defineProperty(exports, "HttpError", { enumerable: true, get: function () { return utils_1.HttpError; } });
10
+
11
+ } (HttpError$1));
12
+
13
+ var HttpError = /*@__PURE__*/getDefaultExportFromCjs(HttpError$1);
14
+
15
+ export { HttpError as default };
16
+ //# sourceMappingURL=HttpError2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HttpError2.mjs","sources":["HttpError.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HttpError = void 0;\nvar utils_1 = require(\"@typia/utils\");\nObject.defineProperty(exports, \"HttpError\", { enumerable: true, get: function () { return utils_1.HttpError; } });\n//# sourceMappingURL=HttpError.js.map"],"names":[],"mappings":";;;;;CACA,MAAM,CAAC,cAAc,CAAA,OAAA,EAAU,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,CAAA,OAAA,CAAA,SAAA,GAAoB,MAAM;CAC1B,IAAI,OAAO,GAAG,UAAuB;CACrC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,OAAO,CAAC,SAAS,CAAC,CAAA,CAAE,EAAE,CAAC;AACjH;;;;;;;"}
@@ -1,3 +1,3 @@
1
- 'use strict';
2
-
3
- //# sourceMappingURL=IConnection.js.map
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IConnection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IConnection.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"IConnection.js","sourceRoot":"","sources":["../src/IConnection.ts"],"names":[],"mappings":""}
@@ -1,2 +1,3 @@
1
-
1
+ import './IConnection2.mjs';
2
+ export { __exports as default } from './_virtual/IConnection.mjs';
2
3
  //# sourceMappingURL=IConnection.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"IConnection.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"IConnection.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,6 @@
1
+ import { __exports as IConnection } from './_virtual/IConnection.mjs';
2
+
3
+ Object.defineProperty(IConnection, "__esModule", { value: true });
4
+
5
+ export { IConnection as default };
6
+ //# sourceMappingURL=IConnection2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IConnection2.mjs","sources":["IConnection.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=IConnection.js.map"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,WAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;;;;"}
@@ -1,3 +1,3 @@
1
- 'use strict';
2
-
3
- //# sourceMappingURL=IEncryptionPassword.js.map
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IEncryptionPassword.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IEncryptionPassword.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"IEncryptionPassword.js","sourceRoot":"","sources":["../src/IEncryptionPassword.ts"],"names":[],"mappings":""}
@@ -1,2 +1,3 @@
1
-
1
+ import './IEncryptionPassword2.mjs';
2
+ export { __exports as default } from './_virtual/IEncryptionPassword.mjs';
2
3
  //# sourceMappingURL=IEncryptionPassword.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"IEncryptionPassword.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"IEncryptionPassword.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,6 @@
1
+ import { __exports as IEncryptionPassword } from './_virtual/IEncryptionPassword.mjs';
2
+
3
+ Object.defineProperty(IEncryptionPassword, "__esModule", { value: true });
4
+
5
+ export { IEncryptionPassword as default };
6
+ //# sourceMappingURL=IEncryptionPassword2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IEncryptionPassword2.mjs","sources":["IEncryptionPassword.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=IEncryptionPassword.js.map"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,mBAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;;;;"}
@@ -1,3 +1,21 @@
1
- 'use strict';
2
-
3
- //# sourceMappingURL=IFetchEvent.js.map
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // export namespace IFetchEvent {
4
+ // export interface IFunction {
5
+ // (connection: IConnection, ...args: any[]): Promise<any>;
6
+ // METADATA: {
7
+ // method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
8
+ // path: string;
9
+ // request: null | {
10
+ // type: string;
11
+ // encrypted: boolean;
12
+ // };
13
+ // response: null | {
14
+ // type: string;
15
+ // encrypted: boolean;
16
+ // };
17
+ // };
18
+ // status: null | number;
19
+ // }
20
+ // }
21
+ //# sourceMappingURL=IFetchEvent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IFetchEvent.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"IFetchEvent.js","sourceRoot":"","sources":["../src/IFetchEvent.ts"],"names":[],"mappings":";;AAaA,iCAAiC;AACjC,iCAAiC;AACjC,+DAA+D;AAC/D,kBAAkB;AAClB,kFAAkF;AAClF,sBAAsB;AACtB,0BAA0B;AAC1B,wBAAwB;AACxB,8BAA8B;AAC9B,WAAW;AACX,2BAA2B;AAC3B,wBAAwB;AACxB,8BAA8B;AAC9B,WAAW;AACX,SAAS;AACT,6BAA6B;AAC7B,MAAM;AACN,IAAI"}
@@ -1,2 +1,3 @@
1
-
1
+ import './IFetchEvent2.mjs';
2
+ export { __exports as default } from './_virtual/IFetchEvent.mjs';
2
3
  //# sourceMappingURL=IFetchEvent.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"IFetchEvent.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"IFetchEvent.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,6 @@
1
+ import { __exports as IFetchEvent } from './_virtual/IFetchEvent.mjs';
2
+
3
+ Object.defineProperty(IFetchEvent, "__esModule", { value: true });
4
+
5
+ export { IFetchEvent as default };
6
+ //# sourceMappingURL=IFetchEvent2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IFetchEvent2.mjs","sources":["IFetchEvent.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// export namespace IFetchEvent {\n// export interface IFunction {\n// (connection: IConnection, ...args: any[]): Promise<any>;\n// METADATA: {\n// method: \"GET\" | \"POST\" | \"PUT\" | \"DELETE\" | \"PATCH\" | \"HEAD\" | \"OPTIONS\";\n// path: string;\n// request: null | {\n// type: string;\n// encrypted: boolean;\n// };\n// response: null | {\n// type: string;\n// encrypted: boolean;\n// };\n// };\n// status: null | number;\n// }\n// }\n//# sourceMappingURL=IFetchEvent.js.map"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,WAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;;;;"}
@@ -1,3 +1,3 @@
1
- 'use strict';
2
-
3
- //# sourceMappingURL=IFetchRoute.js.map
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IFetchRoute.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IFetchRoute.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"IFetchRoute.js","sourceRoot":"","sources":["../src/IFetchRoute.ts"],"names":[],"mappings":""}
@@ -1,2 +1,3 @@
1
-
1
+ import './IFetchRoute2.mjs';
2
+ export { __exports as default } from './_virtual/IFetchRoute.mjs';
2
3
  //# sourceMappingURL=IFetchRoute.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"IFetchRoute.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"IFetchRoute.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,6 @@
1
+ import { __exports as IFetchRoute } from './_virtual/IFetchRoute.mjs';
2
+
3
+ Object.defineProperty(IFetchRoute, "__esModule", { value: true });
4
+
5
+ export { IFetchRoute as default };
6
+ //# sourceMappingURL=IFetchRoute2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IFetchRoute2.mjs","sources":["IFetchRoute.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=IFetchRoute.js.map"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,WAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;;;;"}
@@ -1,3 +1,3 @@
1
- 'use strict';
2
-
3
- //# sourceMappingURL=IPropagation.js.map
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IPropagation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IPropagation.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"IPropagation.js","sourceRoot":"","sources":["../src/IPropagation.ts"],"names":[],"mappings":""}
@@ -1,2 +1,3 @@
1
-
1
+ import './IPropagation2.mjs';
2
+ export { __exports as default } from './_virtual/IPropagation.mjs';
2
3
  //# sourceMappingURL=IPropagation.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"IPropagation.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"IPropagation.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,6 @@
1
+ import { __exports as IPropagation } from './_virtual/IPropagation.mjs';
2
+
3
+ Object.defineProperty(IPropagation, "__esModule", { value: true });
4
+
5
+ export { IPropagation as default };
6
+ //# sourceMappingURL=IPropagation2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IPropagation2.mjs","sources":["IPropagation.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=IPropagation.js.map"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,YAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;;;;"}
@@ -1,8 +1,8 @@
1
- 'use strict';
2
-
3
- var utils = require('@typia/utils');
4
-
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
5
3
  exports.NestiaSimulator = void 0;
4
+ const HttpError_1 = require("./HttpError");
5
+ var NestiaSimulator;
6
6
  (function (NestiaSimulator) {
7
7
  NestiaSimulator.assert = (props) => {
8
8
  return {
@@ -22,11 +22,11 @@ exports.NestiaSimulator = void 0;
22
22
  }
23
23
  catch (exp) {
24
24
  if (isTypeGuardError(exp))
25
- throw new utils.HttpError(props.method, props.host + props.path, 400, {
25
+ throw new HttpError_1.HttpError(props.method, props.host + props.path, 400, {
26
26
  "Content-Type": props.contentType,
27
27
  }, JSON.stringify({
28
28
  method: exp.method,
29
- path: exp.path,
29
+ path: path !== null && path !== void 0 ? path : exp.path,
30
30
  expected: exp.expected,
31
31
  value: exp.value,
32
32
  message: message(exp),
@@ -34,11 +34,11 @@ exports.NestiaSimulator = void 0;
34
34
  throw exp;
35
35
  }
36
36
  };
37
- })(exports.NestiaSimulator || (exports.NestiaSimulator = {}));
37
+ })(NestiaSimulator || (exports.NestiaSimulator = NestiaSimulator = {}));
38
38
  const isTypeGuardError = (input) => "string" === typeof input.method &&
39
39
  (undefined === input.path || "string" === typeof input.path) &&
40
40
  "string" === typeof input.expected &&
41
41
  "string" === typeof input.name &&
42
42
  "string" === typeof input.message &&
43
43
  (undefined === input.stack || "string" === typeof input.stack);
44
- //# sourceMappingURL=NestiaSimulator.js.map
44
+ //# sourceMappingURL=NestiaSimulator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NestiaSimulator.js","sources":["../src/NestiaSimulator.ts"],"sourcesContent":[null],"names":["NestiaSimulator","HttpError"],"mappings":";;;;AAEiBA;AAAjB,CAAA,UAAiB,eAAe,EAAA;AAQjB,IAAA,eAAA,CAAA,MAAM,GAAG,CAAC,KAAa,KAAI;QACtC,OAAO;AACL,YAAA,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC;AACnB,YAAA,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC;AACnB,YAAA,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC;SAClB;AACH,IAAA,CAAC;AACD,IAAA,MAAM,KAAK,GACT,CAAC,KAAa,KACd,CAAC,IAAY,KACb,CAAI,IAAa,KAAU;QACzB,QAAQ,CAAC,CAAC,GAAG,KAAK,CAAA,eAAA,EAAkB,IAAI,CAAA,SAAA,EAAY,GAAG,CAAC,QAAQ,CAAA,MAAA,CAAQ,CAAC,CACvE,KAAK,CACN,CAAC,IAAI,CAAC;AACT,IAAA,CAAC;IAEH,MAAM,KAAK,GACT,CAAC,KAAa,KACd,CAAI,IAAa,KACf,QAAQ,CACN,MAAM,+DAA+D,CACtE,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;IAElB,MAAM,IAAI,GACR,CAAC,KAAa,KACd,CAAI,IAAa,KACf,QAAQ,CAAC,MAAM,kDAAkD,CAAC,CAAC,KAAK,CAAC,CACvE,IAAI,CACL;AAEL,IAAA,MAAM,QAAQ,GACZ,CAAC,OAAwC,EAAE,IAAa,KACxD,CAAC,KAAa,KACd,CAAI,IAAa,KAAU;AACzB,QAAA,IAAI;AACF,YAAA,IAAI,EAAE;QACR;QAAE,OAAO,GAAG,EAAE;YACZ,IAAI,gBAAgB,CAAC,GAAG,CAAC;AACvB,gBAAA,MAAM,IAAIC,eAAS,CACjB,KAAK,CAAC,MAAM,EACZ,K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AG,CAAC,KAAK;oBAChB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC;iBACtB,CAAC,CACH,CAAC;YACJ,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC,CAAC;AACN,CAAC,EAhEgB,eAAe,aAAf,eAAe,GAAf,eAAe,QAgE/B;AAED,MAAM,gBAAgB,GAAG,CAAC,KAAU,EAA2B,EAAE,CAC/D,QAAQ,KAAK,OAAO,KAAK,CAAC,MAAM;IAChC,CAAC,SAAS,KAAK,KAAK,CAAC,IAAI,IAAI,QAAQ,KAAK,OAAO,KAAK,CAAC,IAAI,CAAC;IAC5D,QAAQ,KAAK,OAAO,KAAK,CAAC,QAAQ;IAClC,QAAQ,KAAK,OAAO,KAAK,CAAC,IAAI;IAC9B,QAAQ,KAAK,OAAO,KAAK,CAAC,OAAO;IACjC,CAAC,SAAS,KAAK,KAAK,CAAC,KAAK,IAAI,QAAQ,KAAK,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC"}
@@ -1,44 +1,3 @@
1
- import { HttpError } from '@typia/utils';
2
-
3
- var NestiaSimulator;
4
- (function (NestiaSimulator) {
5
- NestiaSimulator.assert = (props) => {
6
- return {
7
- param: param(props),
8
- query: query(props),
9
- body: body(props),
10
- };
11
- };
12
- const param = (props) => (name) => (task) => {
13
- validate((exp) => `URL parameter "${name}" is not ${exp.expected} type.`)(props)(task);
14
- };
15
- const query = (props) => (task) => validate(() => "Request query parameters are not following the promised type.")(props)(task);
16
- const body = (props) => (task) => validate(() => "Request body is not following the promised type.")(props)(task);
17
- const validate = (message, path) => (props) => (task) => {
18
- try {
19
- task();
20
- }
21
- catch (exp) {
22
- if (isTypeGuardError(exp))
23
- throw new HttpError(props.method, props.host + props.path, 400, {
24
- "Content-Type": props.contentType,
25
- }, JSON.stringify({
26
- method: exp.method,
27
- path: exp.path,
28
- expected: exp.expected,
29
- value: exp.value,
30
- message: message(exp),
31
- }));
32
- throw exp;
33
- }
34
- };
35
- })(NestiaSimulator || (NestiaSimulator = {}));
36
- const isTypeGuardError = (input) => "string" === typeof input.method &&
37
- (undefined === input.path || "string" === typeof input.path) &&
38
- "string" === typeof input.expected &&
39
- "string" === typeof input.name &&
40
- "string" === typeof input.message &&
41
- (undefined === input.stack || "string" === typeof input.stack);
42
-
43
- export { NestiaSimulator };
1
+ export { NestiaSimulator } from './NestiaSimulator2.mjs';
2
+ export { __exports as default } from './_virtual/NestiaSimulator.mjs';
44
3
  //# sourceMappingURL=NestiaSimulator.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"NestiaSimulator.mjs","sources":["../src/NestiaSimulator.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEM,IAAW;AAAjB,CAAA,UAAiB,eAAe,EAAA;AAQjB,IAAA,eAAA,CAAA,MAAM,GAAG,CAAC,KAAa,KAAI;QACtC,OAAO;AACL,YAAA,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC;AACnB,YAAA,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC;AACnB,YAAA,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC;SAClB;AACH,IAAA,CAAC;AACD,IAAA,MAAM,KAAK,GACT,CAAC,KAAa,KACd,CAAC,IAAY,KACb,CAAI,IAAa,KAAU;QACzB,QAAQ,CAAC,CAAC,GAAG,KAAK,CAAA,eAAA,EAAkB,IAAI,CAAA,SAAA,EAAY,GAAG,CAAC,QAAQ,CAAA,MAAA,CAAQ,CAAC,CACvE,KAAK,CACN,CAAC,IAAI,CAAC;AACT,IAAA,CAAC;IAEH,MAAM,KAAK,GACT,CAAC,KAAa,KACd,CAAI,IAAa,KACf,QAAQ,CACN,MAAM,+DAA+D,CACtE,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;IAElB,MAAM,IAAI,GACR,CAAC,KAAa,KACd,CAAI,IAAa,KACf,QAAQ,CAAC,MAAM,kDAAkD,CAAC,CAAC,KAAK,CAAC,CACvE,IAAI,CACL;AAEL,IAAA,MAAM,QAAQ,GACZ,CAAC,OAAw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'./_virtual/NestiaSimulator.mjs';
2
+ import './HttpError2.mjs';
3
+ import { __exports as HttpError } from './_virtual/HttpError.mjs';
4
+
5
+ Object.defineProperty(NestiaSimulator$1, "__esModule", { value: true });
6
+ var NestiaSimulator_2 = NestiaSimulator$1.NestiaSimulator = void 0;
7
+ const HttpError_1 = HttpError;
8
+ var NestiaSimulator;
9
+ (function (NestiaSimulator) {
10
+ NestiaSimulator.assert = (props) => {
11
+ return {
12
+ param: param(props),
13
+ query: query(props),
14
+ body: body(props),
15
+ };
16
+ };
17
+ const param = (props) => (name) => (task) => {
18
+ validate((exp) => `URL parameter "${name}" is not ${exp.expected} type.`)(props)(task);
19
+ };
20
+ const query = (props) => (task) => validate(() => "Request query parameters are not following the promised type.")(props)(task);
21
+ const body = (props) => (task) => validate(() => "Request body is not following the promised type.")(props)(task);
22
+ const validate = (message, path) => (props) => (task) => {
23
+ try {
24
+ task();
25
+ }
26
+ catch (exp) {
27
+ if (isTypeGuardError(exp))
28
+ throw new HttpError_1.HttpError(props.method, props.host + props.path, 400, {
29
+ "Content-Type": props.contentType,
30
+ }, JSON.stringify({
31
+ method: exp.method,
32
+ path: exp.path,
33
+ expected: exp.expected,
34
+ value: exp.value,
35
+ message: message(exp),
36
+ }));
37
+ throw exp;
38
+ }
39
+ };
40
+ })(NestiaSimulator || (NestiaSimulator_2 = NestiaSimulator$1.NestiaSimulator = NestiaSimulator = {}));
41
+ const isTypeGuardError = (input) => "string" === typeof input.method &&
42
+ (undefined === input.path || "string" === typeof input.path) &&
43
+ "string" === typeof input.expected &&
44
+ "string" === typeof input.name &&
45
+ "string" === typeof input.message &&
46
+ (undefined === input.stack || "string" === typeof input.stack);
47
+
48
+ export { NestiaSimulator_2 as NestiaSimulator, NestiaSimulator$1 as default };
49
+ //# sourceMappingURL=NestiaSimulator2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NestiaSimulator2.mjs","sources":["NestiaSimulator.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NestiaSimulator = void 0;\nconst HttpError_1 = require(\"./HttpError\");\nvar NestiaSimulator;\n(function (NestiaSimulator) {\n NestiaSimulator.assert = (props) => {\n return {\n param: param(props),\n query: query(props),\n body: body(props),\n };\n };\n const param = (props) => (name) => (task) => {\n validate((exp) => `URL parameter \"${name}\" is not ${exp.expected} type.`)(props)(task);\n };\n const query = (props) => (task) => validate(() => \"Request query parameters are not following the promised type.\")(props)(task);\n const body = (props) => (task) => validate(() => \"Request body is not following the promised type.\")(props)(task);\n const validate = (message, path) => (props) => (task) => {\n try {\n task();\n }\n catch (exp) {\n if (isTypeGuardError(exp))\n throw new HttpError_1.HttpError(props.method, props.host + props.path, 400, {\n \"Content-Type\": props.contentType,\n }, JSON.stringify({\n method: exp.method,\n path: path !== null && path !== void 0 ? path : exp.path,\n expected: exp.expected,\n value: exp.value,\n message: message(exp),\n }));\n throw exp;\n }\n };\n})(NestiaSimulator || (exports.NestiaSimulator = NestiaSimulator = {}));\nconst isTypeGuardError = (input) => \"string\" === typeof input.method &&\n (undefined === input.path || \"string\" === typeof input.path) &&\n \"string\" === typeof input.expected &&\n \"string\" === typeof input.name &&\n \"string\" === typeof input.message &&\n (undefined === input.stack || \"string\" === typeof input.stack);\n//# sourceMappingURL=NestiaSimulator.js.map"],"names":["NestiaSimulator_1","require$$0"],"mappings":";;;;AACA,MAAM,CAAC,cAAc,CAACA,iBAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,IAAA,iBAAA,GAAAA,iBAAA,CAAA,eAAuB,GAAG;AAC1B,MAAM,WAAW,GAAGC,SAAsB;AAC1C,IAAI,eAAe;AACnB,CAAC,UAAU,eAAe,EAAE;AAC5B,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,KAAK,KAAK;AACxC,QAAQ,OAAO;AACf,YAAY,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC;AAC/B,YAAY,KAAK,EAAE,KAAK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C1C,oBAAoB,KAAK,EAAE,GAAG,CAAC,KAAK;AACpC,oBAAoB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC;AACzC,iBAAiB,CAAC,CAAC;AACnB,YAAY,MAAM,GAAG;AACrB,QAAA;AACA,IAAA,CAAK;AACL,CAAC,EAAE,eAAe,KAAK,iBAAA,GAAAD,iBAAA,CAAA,eAAuB,GAAG,eAAe,GAAG,EAAE,CAAC,CAAC;AACvE,MAAM,gBAAgB,GAAG,CAAC,KAAK,KAAK,QAAQ,KAAK,OAAO,KAAK,CAAC,MAAM;AACpE,KAAK,SAAS,KAAK,KAAK,CAAC,IAAI,IAAI,QAAQ,KAAK,OAAO,KAAK,CAAC,IAAI,CAAC;AAChE,IAAI,QAAQ,KAAK,OAAO,KAAK,CAAC,QAAQ;AACtC,IAAI,QAAQ,KAAK,OAAO,KAAK,CAAC,IAAI;AAClC,IAAI,QAAQ,KAAK,OAAO,KAAK,CAAC,OAAO;AACrC,KAAK,SAAS,KAAK,KAAK,CAAC,KAAK,IAAI,QAAQ,KAAK,OAAO,KAAK,CAAC,KAAK,CAAC;;;;"}
@@ -1,7 +1,16 @@
1
- 'use strict';
2
-
3
- var FetcherBase = require('./internal/FetcherBase.js');
4
-
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.PlainFetcher = void 0;
13
+ const FetcherBase_1 = require("./internal/FetcherBase");
5
14
  /**
6
15
  * Utility class for `fetch` functions used in `@nestia/sdk`.
7
16
  *
@@ -17,27 +26,33 @@ var FetcherBase = require('./internal/FetcherBase.js');
17
26
  *
18
27
  * @author Jeongho Nam - https://github.com/samchon
19
28
  */
20
- exports.PlainFetcher = void 0;
29
+ var PlainFetcher;
21
30
  (function (PlainFetcher) {
22
- async function fetch(connection, route, input, stringify) {
23
- if (route.request?.encrypted === true || route.response?.encrypted === true)
24
- throw new Error("Error on PlainFetcher.fetch(): PlainFetcher doesn't have encryption ability. Use EncryptedFetcher instead.");
25
- return FetcherBase.FetcherBase.request({
26
- className: "PlainFetcher",
27
- encode: (input) => input,
28
- decode: (input) => input,
29
- })(connection, route, input, stringify);
31
+ function fetch(connection, route, input, stringify) {
32
+ return __awaiter(this, void 0, void 0, function* () {
33
+ var _a, _b;
34
+ if (((_a = route.request) === null || _a === void 0 ? void 0 : _a.encrypted) === true || ((_b = route.response) === null || _b === void 0 ? void 0 : _b.encrypted) === true)
35
+ throw new Error("Error on PlainFetcher.fetch(): PlainFetcher doesn't have encryption ability. Use EncryptedFetcher instead.");
36
+ return FetcherBase_1.FetcherBase.request({
37
+ className: "PlainFetcher",
38
+ encode: (input) => input,
39
+ decode: (input) => input,
40
+ })(connection, route, input, stringify);
41
+ });
30
42
  }
31
43
  PlainFetcher.fetch = fetch;
32
- async function propagate(connection, route, input, stringify) {
33
- if (route.request?.encrypted === true || route.response?.encrypted === true)
34
- throw new Error("Error on PlainFetcher.propagate(): PlainFetcher doesn't have encryption ability. Use EncryptedFetcher instead.");
35
- return FetcherBase.FetcherBase.propagate({
36
- className: "PlainFetcher",
37
- encode: (input) => input,
38
- decode: (input) => input,
39
- })(connection, route, input, stringify);
44
+ function propagate(connection, route, input, stringify) {
45
+ return __awaiter(this, void 0, void 0, function* () {
46
+ var _a, _b;
47
+ if (((_a = route.request) === null || _a === void 0 ? void 0 : _a.encrypted) === true || ((_b = route.response) === null || _b === void 0 ? void 0 : _b.encrypted) === true)
48
+ throw new Error("Error on PlainFetcher.propagate(): PlainFetcher doesn't have encryption ability. Use EncryptedFetcher instead.");
49
+ return FetcherBase_1.FetcherBase.propagate({
50
+ className: "PlainFetcher",
51
+ encode: (input) => input,
52
+ decode: (input) => input,
53
+ })(connection, route, input, stringify);
54
+ });
40
55
  }
41
56
  PlainFetcher.propagate = propagate;
42
- })(exports.PlainFetcher || (exports.PlainFetcher = {}));
43
- //# sourceMappingURL=PlainFetcher.js.map
57
+ })(PlainFetcher || (exports.PlainFetcher = PlainFetcher = {}));
58
+ //# sourceMappingURL=PlainFetcher.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PlainFetcher.js","sources":["../src/PlainFetcher.ts"],"sourcesContent":[null],"names":["PlainFetcher","FetcherBase"],"mappings":";;;;AAKA;;;;;;;;;;;;;;AAcG;AACcA;AAAjB,CAAA,UAAiB,YAAY,EAAA;IAuCpB,eAAe,KAAK,CACzB,UAAuB,EACvB,KAAwE,EACxE,KAAa,EACb,SAAoC,EAAA;AAEpC,QAAA,IAAI,KAAK,CAAC,OAAO,EAAE,SAAS,KAAK,IAAI,IAAI,KAAK,CAAC,QAAQ,EAAE,SAAS,KAAK,IAAI;AACzE,YAAA,MAAM,IAAI,KAAK,CACb,4GAA4G,CAC7G;QACH,OAAOC,uBAAW,CAAC,OAAO,CAAC;AACzB,YAAA,SAAS,EAAE,cAAc;AACzB,YAAA,MAAM,EAAE,CAAC,KAAK,KAAK,KAAK;AACxB,YAAA,MAAM,EAAE,CAAC,KAAK,KAAK,KAAK;SACzB,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,CAAC;IACzC;AAfsB,IAAA,YAAA,CAAA,KAAK,QAe1B;IAcM,eAAe,SAAS,CAC7B,UAAuB,EACvB,KAAwE,EACxE,KAAa,EACb,SAAoC,EAAA;AAEpC,QAAA,IAAI,KAAK,CAAC,OAAO,EAAE,SAAS,KAAK,IAAI,IAAI,KAAK,CAAC,QAAQ,EAAE,SAAS,KAAK,IAAI;AACzE,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,OAAO,0CAAE,SAAS,MAAK,IAAI,IAAI,CAAA,MAAA,KAAK,CAAC,QAAQ,0CAAE,SAAS,MAAK,IAAI;gBACzE,MAAM,IAAI,KAAK,CACb,gHAAgH,CACjH,CAAC;YACJ,OAAO,yBAAW,CAAC,SAAS,CAAC;gBAC3B,SAAS,EAAE,cAAc;gBACzB,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK;gBACxB,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK;aACzB,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,CAAoB,CAAC;QAC7D,CAAC;KAAA;IAfqB,aAAA,SAAS,YAe9B,CAAA;AACH,CAAC,EApFgB,YAAY,aAAZ,YAAY,GAAZ,YAAY,QAoF5B"}
@@ -1,43 +1,3 @@
1
- import { FetcherBase } from './internal/FetcherBase.mjs';
2
-
3
- /**
4
- * Utility class for `fetch` functions used in `@nestia/sdk`.
5
- *
6
- * `PlainFetcher` is a utility class designed for SDK functions generated by
7
- * [`@nestia/sdk`](https://nestia.io/docs/sdk/sdk), interacting with the remote
8
- * HTTP sever API. In other words, this is a collection of dedicated `fetch()`
9
- * functions for `@nestia/sdk`.
10
- *
11
- * For reference, `PlainFetcher` class does not encrypt or decrypt the body data
12
- * at all. It just delivers plain data without any post processing. If you've
13
- * defined a controller method through `@EncryptedRoute` or `@EncryptedBody`
14
- * decorator, then {@liink EncryptedFetcher} class would be used instead.
15
- *
16
- * @author Jeongho Nam - https://github.com/samchon
17
- */
18
- var PlainFetcher;
19
- (function (PlainFetcher) {
20
- async function fetch(connection, route, input, stringify) {
21
- if (route.request?.encrypted === true || route.response?.encrypted === true)
22
- throw new Error("Error on PlainFetcher.fetch(): PlainFetcher doesn't have encryption ability. Use EncryptedFetcher instead.");
23
- return FetcherBase.request({
24
- className: "PlainFetcher",
25
- encode: (input) => input,
26
- decode: (input) => input,
27
- })(connection, route, input, stringify);
28
- }
29
- PlainFetcher.fetch = fetch;
30
- async function propagate(connection, route, input, stringify) {
31
- if (route.request?.encrypted === true || route.response?.encrypted === true)
32
- throw new Error("Error on PlainFetcher.propagate(): PlainFetcher doesn't have encryption ability. Use EncryptedFetcher instead.");
33
- return FetcherBase.propagate({
34
- className: "PlainFetcher",
35
- encode: (input) => input,
36
- decode: (input) => input,
37
- })(connection, route, input, stringify);
38
- }
39
- PlainFetcher.propagate = propagate;
40
- })(PlainFetcher || (PlainFetcher = {}));
41
-
42
- export { PlainFetcher };
1
+ export { PlainFetcher } from './PlainFetcher2.mjs';
2
+ export { __exports as default } from './_virtual/PlainFetcher.mjs';
43
3
  //# sourceMappingURL=PlainFetcher.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"PlainFetcher.mjs","sources":["../src/PlainFetcher.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAKA;;;;;;;;;;;;;;AAcG;AACG,IAAW;AAAjB,CAAA,UAAiB,YAAY,EAAA;IAuCpB,eAAe,KAAK,CACzB,UAAuB,EACvB,KAAwE,EACxE,KAAa,EACb,SAAoC,EAAA;AAEpC,QAAA,IAAI,KAAK,CAAC,OAAO,EAAE,SAAS,KAAK,IAAI,IAAI,KAAK,CAAC,QAAQ,EAAE,SAAS,KAAK,IAAI;AACzE,YAAA,MAAM,IAAI,KAAK,CACb,4GAA4G,CAC7G;QACH,OAAO,WAAW,CAAC,OAAO,CAAC;AACzB,YAAA,SAAS,EAAE,cAAc;AACzB,YAAA,MAAM,EAAE,CAAC,KAAK,KAAK,KAAK;AACxB,YAAA,MAAM,EAAE,CAAC,KAAK,KAAK,KAAK;SACzB,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,CAAC;IACzC;AAfsB,IAAA,YAAA,CAAA,KAAK,QAe1B;IAcM,eAAe,SAAS,CAC7B,UAAuB,EACvB,KAAwE,EACxE,KAAa,EACb,SAAoC,EAAA;AAEpC,QAAA,IAAI,KAAK,CAAC,OAAO,EAAE,SAAS,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