@nestia/fetcher 10.0.2 → 11.0.0-dev.20260312

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Jeongho Nam
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,93 +1,93 @@
1
- # Nestia
2
- ![Nestia Logo](https://nestia.io/logo.png)
3
-
4
- [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/samchon/nestia/blob/master/LICENSE)
5
- [![npm version](https://img.shields.io/npm/v/@nestia/fetcher.svg)](https://www.npmjs.com/package/@nestia/fetcher)
6
- [![Downloads](https://img.shields.io/npm/dm/@nestia/fetcher.svg)](https://www.npmjs.com/package/@nestia/fetcher)
7
- [![Build Status](https://github.com/samchon/nestia/workflows/build/badge.svg)](https://github.com/samchon/nestia/actions?query=workflow%3Abuild)
8
- [![Guide Documents](https://img.shields.io/badge/Guide-Documents-forestgreen)](https://nestia.io/docs/)
9
- [![Gurubase](https://img.shields.io/badge/Gurubase-Document%20Chatbot-006BFF)](https://gurubase.io/g/nestia)
10
- [![Discord Badge](https://img.shields.io/badge/discord-samchon-d91965?style=flat&labelColor=5866f2&logo=discord&logoColor=white&link=https://discord.gg/E94XhzrUCZ)](https://discord.gg/E94XhzrUCZ)
11
-
12
- Nestia is a set of helper libraries for NestJS, supporting below features:
13
-
14
- - `@nestia/core`:
15
- - Super-fast/easy decorators
16
- - Advanced WebSocket routes
17
- - `@nestia/sdk`:
18
- - Swagger generator, more evolved than ever
19
- - SDK library generator for clients
20
- - Mockup Simulator for client applications
21
- - Automatic E2E test functions generator
22
- - `@nestia/e2e`: Test program utilizing e2e test functions
23
- - `@nestia/benchmark`: Benchmark program using e2e test functions
24
- - `@nestia/editor`: Swagger-UI with Online TypeScript Editor
25
- - [`@agentica`](https://github.com/wrtnlabs/agentica): Agentic AI library specialized in LLM function calling
26
- - [`@autobe`](https://github.com/wrtnlabs/autobe): Vibe coding agent generating NestJS application
27
- - `nestia`: Just CLI (command line interface) tool
28
-
29
- > [!NOTE]
30
- >
31
- > - **Only one line** required, with pure TypeScript type
32
- > - Enhance performance **30x** up
33
- > - Runtime validator is **20,000x faster** than `class-validator`
34
- > - JSON serialization is **200x faster** than `class-transformer`
35
- > - Software Development Kit
36
- > - Collection of typed `fetch` functions with DTO structures like [tRPC](https://trpc.io/)
37
- > - Mockup simulator means embedded backend simulator in the SDK
38
- > - similar with [msw](https://mswjs.io/), but fully automated
39
-
40
- ![nestia-sdk-demo](https://user-images.githubusercontent.com/13158709/215004990-368c589d-7101-404e-b81b-fbc936382f05.gif)
41
-
42
- > Left is NestJS server code, and right is client (frontend) code utilizing SDK
43
-
44
-
45
-
46
-
47
- ## Sponsors and Backers
48
- Thanks for your support.
49
-
50
- Your donation would encourage `nestia` development.
51
-
52
- [![Backers](https://opencollective.com/nestia/backers.svg?avatarHeight=75&width=600)](https://opencollective.com/nestia)
53
-
54
-
55
-
56
-
57
- ## Guide Documents
58
- Check out the document in the [website](https://nestia.io/docs/):
59
-
60
- ### 🏠 Home
61
- - [Introduction](https://nestia.io/docs/)
62
- - [Setup](https://nestia.io/docs/setup/)
63
- - [Pure TypeScript](https://nestia.io/docs/pure)
64
-
65
- ### 📖 Features
66
- - Core Library
67
- - [`@WebSocketRoute`](https://nestia.io/docs/core/WebSocketRoute)
68
- - [`@TypedRoute`](https://nestia.io/docs/core/TypedRoute/)
69
- - [**`@TypedBody`**](https://nestia.io/docs/core/TypedBody/)
70
- - [`@TypedParam`](https://nestia.io/docs/core/TypedParam/)
71
- - [`@TypedQuery`](https://nestia.io/docs/core/TypedQuery/)
72
- - [`@TypedFormData`](https://nestia.io/docs/core/TypedFormData/)
73
- - [`@TypedHeaders`](https://nestia.io/docs/core/TypedHeaders/)
74
- - [`@TypedException`](https://nestia.io/docs/core/TypedException/)
75
- - Software Development Kit
76
- - [SDK Builder](https://nestia.io/docs/sdk/)
77
- - [Mockup Simulator](https://nestia.io/docs/sdk/simulate/)
78
- - [E2E Test Functions](https://nestia.io/docs/sdk/e2e/)
79
- - [Distribution](https://nestia.io/docs/sdk/distribute/)
80
- - Swagger Document
81
- - [Swagger Builder](https://nestia.io/docs/swagger/)
82
- - [**AI Chatbot Development**](https://nestia.io/docs/swagger/chat/)
83
- - [Cloud Swagger Editor](https://nestia.io/docs/swagger/editor/)
84
- - [Documentation Strategy](https://nestia.io/docs/swagger/strategy/)
85
- - E2E Testing
86
- - [Why E2E Test?](https://nestia.io/docs/e2e/why/)
87
- - [Test Program Development](https://nestia.io/docs/e2e/development/)
88
- - [Performance Benchmark](https://nestia.io/docs/e2e/benchmark/)
89
-
90
- ### 🔗 Appendix
91
- - [API Documents](https://nestia.io/api)
92
- - [⇲ Benchmark Result](https://github.com/samchon/nestia/tree/master/benchmark/results/11th%20Gen%20Intel(R)%20Core(TM)%20i5-1135G7%20%40%202.40GHz)
93
- - [⇲ `dev.to` Articles](https://dev.to/samchon/series/22751)
1
+ # Nestia
2
+ ![Nestia Logo](https://nestia.io/logo.png)
3
+
4
+ [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/samchon/nestia/blob/master/LICENSE)
5
+ [![npm version](https://img.shields.io/npm/v/@nestia/fetcher.svg)](https://www.npmjs.com/package/@nestia/fetcher)
6
+ [![Downloads](https://img.shields.io/npm/dm/@nestia/fetcher.svg)](https://www.npmjs.com/package/@nestia/fetcher)
7
+ [![Build Status](https://github.com/samchon/nestia/workflows/test/badge.svg)](https://github.com/samchon/nestia/actions?query=workflow%3Atest)
8
+ [![Guide Documents](https://img.shields.io/badge/Guide-Documents-forestgreen)](https://nestia.io/docs/)
9
+ [![Gurubase](https://img.shields.io/badge/Gurubase-Document%20Chatbot-006BFF)](https://gurubase.io/g/nestia)
10
+ [![Discord Badge](https://img.shields.io/badge/discord-samchon-d91965?style=flat&labelColor=5866f2&logo=discord&logoColor=white&link=https://discord.gg/E94XhzrUCZ)](https://discord.gg/E94XhzrUCZ)
11
+
12
+ Nestia is a set of helper libraries for NestJS, supporting below features:
13
+
14
+ - `@nestia/core`:
15
+ - Super-fast/easy decorators
16
+ - Advanced WebSocket routes
17
+ - `@nestia/sdk`:
18
+ - Swagger generator, more evolved than ever
19
+ - SDK library generator for clients
20
+ - Mockup Simulator for client applications
21
+ - Automatic E2E test functions generator
22
+ - `@nestia/e2e`: Test program utilizing e2e test functions
23
+ - `@nestia/benchmark`: Benchmark program using e2e test functions
24
+ - `@nestia/editor`: Swagger-UI with Online TypeScript Editor
25
+ - [`@agentica`](https://github.com/wrtnlabs/agentica): Agentic AI library specialized in LLM function calling
26
+ - [`@autobe`](https://github.com/wrtnlabs/autobe): Vibe coding agent generating NestJS application
27
+ - `nestia`: Just CLI (command line interface) tool
28
+
29
+ > [!NOTE]
30
+ >
31
+ > - **Only one line** required, with pure TypeScript type
32
+ > - Enhance performance **30x** up
33
+ > - Runtime validator is **20,000x faster** than `class-validator`
34
+ > - JSON serialization is **200x faster** than `class-transformer`
35
+ > - Software Development Kit
36
+ > - Collection of typed `fetch` functions with DTO structures like [tRPC](https://trpc.io/)
37
+ > - Mockup simulator means embedded backend simulator in the SDK
38
+ > - similar with [msw](https://mswjs.io/), but fully automated
39
+
40
+ ![nestia-sdk-demo](https://user-images.githubusercontent.com/13158709/215004990-368c589d-7101-404e-b81b-fbc936382f05.gif)
41
+
42
+ > Left is NestJS server code, and right is client (frontend) code utilizing SDK
43
+
44
+
45
+
46
+
47
+ ## Sponsors and Backers
48
+ Thanks for your support.
49
+
50
+ Your donation would encourage `nestia` development.
51
+
52
+ [![Backers](https://opencollective.com/nestia/backers.svg?avatarHeight=75&width=600)](https://opencollective.com/nestia)
53
+
54
+
55
+
56
+
57
+ ## Guide Documents
58
+ Check out the document in the [website](https://nestia.io/docs/):
59
+
60
+ ### 🏠 Home
61
+ - [Introduction](https://nestia.io/docs/)
62
+ - [Setup](https://nestia.io/docs/setup/)
63
+ - [Pure TypeScript](https://nestia.io/docs/pure)
64
+
65
+ ### 📖 Features
66
+ - Core Library
67
+ - [`@WebSocketRoute`](https://nestia.io/docs/core/WebSocketRoute)
68
+ - [`@TypedRoute`](https://nestia.io/docs/core/TypedRoute/)
69
+ - [**`@TypedBody`**](https://nestia.io/docs/core/TypedBody/)
70
+ - [`@TypedParam`](https://nestia.io/docs/core/TypedParam/)
71
+ - [`@TypedQuery`](https://nestia.io/docs/core/TypedQuery/)
72
+ - [`@TypedFormData`](https://nestia.io/docs/core/TypedFormData/)
73
+ - [`@TypedHeaders`](https://nestia.io/docs/core/TypedHeaders/)
74
+ - [`@TypedException`](https://nestia.io/docs/core/TypedException/)
75
+ - Software Development Kit
76
+ - [SDK Builder](https://nestia.io/docs/sdk/)
77
+ - [Mockup Simulator](https://nestia.io/docs/sdk/simulate/)
78
+ - [E2E Test Functions](https://nestia.io/docs/sdk/e2e/)
79
+ - [Distribution](https://nestia.io/docs/sdk/distribute/)
80
+ - Swagger Document
81
+ - [Swagger Builder](https://nestia.io/docs/swagger/)
82
+ - [**AI Chatbot Development**](https://nestia.io/docs/swagger/chat/)
83
+ - [Cloud Swagger Editor](https://nestia.io/docs/swagger/editor/)
84
+ - [Documentation Strategy](https://nestia.io/docs/swagger/strategy/)
85
+ - E2E Testing
86
+ - [Why E2E Test?](https://nestia.io/docs/e2e/why/)
87
+ - [Test Program Development](https://nestia.io/docs/e2e/development/)
88
+ - [Performance Benchmark](https://nestia.io/docs/e2e/benchmark/)
89
+
90
+ ### 🔗 Appendix
91
+ - [API Documents](https://nestia.io/api)
92
+ - [⇲ Benchmark Result](https://github.com/samchon/nestia/tree/master/benchmark/results/11th%20Gen%20Intel(R)%20Core(TM)%20i5-1135G7%20%40%202.40GHz)
93
+ - [⇲ `dev.to` Articles](https://dev.to/samchon/series/22751)
package/lib/AesPkcs5.js CHANGED
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.AesPkcs5 = void 0;
7
- var crypto_1 = __importDefault(require("crypto"));
7
+ const crypto_1 = __importDefault(require("crypto"));
8
8
  /**
9
9
  * Utility class for the AES-128/256 encryption.
10
10
  *
@@ -26,8 +26,8 @@ var AesPkcs5;
26
26
  * @returns Encrypted data
27
27
  */
28
28
  function encrypt(data, key, iv) {
29
- var bytes = key.length * 8;
30
- var cipher = crypto_1.default.createCipheriv("AES-".concat(bytes, "-CBC"), key, iv);
29
+ const bytes = key.length * 8;
30
+ const cipher = crypto_1.default.createCipheriv(`AES-${bytes}-CBC`, key, iv);
31
31
  return cipher.update(data, "utf8", "base64") + cipher.final("base64");
32
32
  }
33
33
  AesPkcs5.encrypt = encrypt;
@@ -40,8 +40,8 @@ var AesPkcs5;
40
40
  * @returns Decrypted data.
41
41
  */
42
42
  function decrypt(data, key, iv) {
43
- var bytes = key.length * 8;
44
- var decipher = crypto_1.default.createDecipheriv("AES-".concat(bytes, "-CBC"), key, iv);
43
+ const bytes = key.length * 8;
44
+ const decipher = crypto_1.default.createDecipheriv(`AES-${bytes}-CBC`, key, iv);
45
45
  return decipher.update(data, "base64", "utf8") + decipher.final("utf8");
46
46
  }
47
47
  AesPkcs5.decrypt = decrypt;
@@ -1 +1 @@
1
- {"version":3,"file":"AesPkcs5.js","sourceRoot":"","sources":["../src/AesPkcs5.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA4B;AAE5B;;;;;;;;;GASG;AACH,IAAiB,QAAQ,CAoCxB;AApCD,WAAiB,QAAQ;IACvB;;;;;;;OAOG;IACH,SAAgB,OAAO,CAAC,IAAY,EAAE,GAAW,EAAE,EAAU;QAC3D,IAAM,KAAK,GAAW,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC;QACrC,IAAM,MAAM,GAAkB,gBAAM,CAAC,cAAc,CACjD,cAAO,KAAK,SAAM,EAClB,GAAG,EACH,EAAE,CACH,CAAC;QACF,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACxE,CAAC;IARe,gBAAO,UAQtB,CAAA;IAED;;;;;;;OAOG;IACH,SAAgB,OAAO,CAAC,IAAY,EAAE,GAAW,EAAE,EAAU;QAC3D,IAAM,KAAK,GAAW,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC;QACrC,IAAM,QAAQ,GAAoB,gBAAM,CAAC,gBAAgB,CACvD,cAAO,KAAK,SAAM,EAClB,GAAG,EACH,EAAE,CACH,CAAC;QACF,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1E,CAAC;IARe,gBAAO,UAQtB,CAAA;AACH,CAAC,EApCgB,QAAQ,wBAAR,QAAQ,QAoCxB"}
1
+ {"version":3,"file":"AesPkcs5.js","sourceRoot":"","sources":["../src/AesPkcs5.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B;;;;;;;;;GASG;AACH,IAAiB,QAAQ,CA4BxB;AA5BD,WAAiB,QAAQ;IACvB;;;;;;;OAOG;IACH,SAAgB,OAAO,CAAC,IAAY,EAAE,GAAW,EAAE,EAAU;QAC3D,MAAM,KAAK,GAAW,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC;QACrC,MAAM,MAAM,GAAG,gBAAM,CAAC,cAAc,CAAC,OAAO,KAAK,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QAClE,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACxE,CAAC;IAJe,gBAAO,UAItB,CAAA;IAED;;;;;;;OAOG;IACH,SAAgB,OAAO,CAAC,IAAY,EAAE,GAAW,EAAE,EAAU;QAC3D,MAAM,KAAK,GAAW,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC;QACrC,MAAM,QAAQ,GAAG,gBAAM,CAAC,gBAAgB,CAAC,OAAO,KAAK,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QACtE,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1E,CAAC;IAJe,gBAAO,UAItB,CAAA;AACH,CAAC,EA5BgB,QAAQ,wBAAR,QAAQ,QA4BxB"}
@@ -8,37 +8,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
11
  Object.defineProperty(exports, "__esModule", { value: true });
39
12
  exports.EncryptedFetcher = void 0;
40
- var AesPkcs5_1 = require("./AesPkcs5");
41
- var FetcherBase_1 = require("./internal/FetcherBase");
13
+ const AesPkcs5_1 = require("./AesPkcs5");
14
+ const FetcherBase_1 = require("./internal/FetcherBase");
42
15
  /**
43
16
  * Utility class for `fetch` functions used in `@nestia/sdk` with encryption.
44
17
  *
@@ -58,80 +31,66 @@ var FetcherBase_1 = require("./internal/FetcherBase");
58
31
  var EncryptedFetcher;
59
32
  (function (EncryptedFetcher) {
60
33
  function fetch(connection, route, input, stringify) {
61
- return __awaiter(this, void 0, void 0, function () {
62
- var closure;
34
+ return __awaiter(this, void 0, void 0, function* () {
63
35
  var _a, _b, _c, _d;
64
- return __generator(this, function (_e) {
65
- if ((((_a = route.request) === null || _a === void 0 ? void 0 : _a.encrypted) === true || ((_b = route.response) === null || _b === void 0 ? void 0 : _b.encrypted)) &&
66
- connection.encryption === undefined)
67
- throw new Error("Error on EncryptedFetcher.fetch(): the encryption password has not been configured.");
68
- closure = typeof connection.encryption === "function"
69
- ? function (direction) {
70
- return function (headers, body) {
71
- return connection.encryption({
72
- headers: headers,
73
- body: body,
74
- direction: direction,
75
- });
76
- };
36
+ if ((((_a = route.request) === null || _a === void 0 ? void 0 : _a.encrypted) === true || ((_b = route.response) === null || _b === void 0 ? void 0 : _b.encrypted)) &&
37
+ connection.encryption === undefined)
38
+ throw new Error("Error on EncryptedFetcher.fetch(): the encryption password has not been configured.");
39
+ const closure = typeof connection.encryption === "function"
40
+ ? (direction) => (headers, body) => connection.encryption({
41
+ headers,
42
+ body,
43
+ direction,
44
+ })
45
+ : () => () => connection.encryption;
46
+ return FetcherBase_1.FetcherBase.request({
47
+ className: "EncryptedFetcher",
48
+ encode: ((_c = route.request) === null || _c === void 0 ? void 0 : _c.encrypted) === true
49
+ ? (input, headers) => {
50
+ const p = closure("encode")(headers, input);
51
+ return AesPkcs5_1.AesPkcs5.encrypt((stringify !== null && stringify !== void 0 ? stringify : JSON.stringify)(input), p.key, p.iv);
77
52
  }
78
- : function () { return function () { return connection.encryption; }; };
79
- return [2 /*return*/, FetcherBase_1.FetcherBase.request({
80
- className: "EncryptedFetcher",
81
- encode: ((_c = route.request) === null || _c === void 0 ? void 0 : _c.encrypted) === true
82
- ? function (input, headers) {
83
- var p = closure("encode")(headers, input);
84
- return AesPkcs5_1.AesPkcs5.encrypt((stringify !== null && stringify !== void 0 ? stringify : JSON.stringify)(input), p.key, p.iv);
85
- }
86
- : function (input) { return input; },
87
- decode: ((_d = route.response) === null || _d === void 0 ? void 0 : _d.encrypted) === true
88
- ? function (input, headers) {
89
- var p = closure("decode")(headers, input);
90
- var s = AesPkcs5_1.AesPkcs5.decrypt(input, p.key, p.iv);
91
- return s.length ? JSON.parse(s) : s;
92
- }
93
- : function (input) { return input; },
94
- })(connection, route, input, stringify)];
95
- });
53
+ : (input) => input,
54
+ decode: ((_d = route.response) === null || _d === void 0 ? void 0 : _d.encrypted) === true
55
+ ? (input, headers) => {
56
+ const p = closure("decode")(headers, input);
57
+ const s = AesPkcs5_1.AesPkcs5.decrypt(input, p.key, p.iv);
58
+ return s.length ? JSON.parse(s) : s;
59
+ }
60
+ : (input) => input,
61
+ })(connection, route, input, stringify);
96
62
  });
97
63
  }
98
64
  EncryptedFetcher.fetch = fetch;
99
65
  function propagate(connection, route, input, stringify) {
100
- return __awaiter(this, void 0, void 0, function () {
101
- var closure;
66
+ return __awaiter(this, void 0, void 0, function* () {
102
67
  var _a, _b, _c, _d;
103
- return __generator(this, function (_e) {
104
- if ((((_a = route.request) === null || _a === void 0 ? void 0 : _a.encrypted) === true || ((_b = route.response) === null || _b === void 0 ? void 0 : _b.encrypted)) &&
105
- connection.encryption === undefined)
106
- throw new Error("Error on EncryptedFetcher.propagate(): the encryption password has not been configured.");
107
- closure = typeof connection.encryption === "function"
108
- ? function (direction) {
109
- return function (headers, body) {
110
- return connection.encryption({
111
- headers: headers,
112
- body: body,
113
- direction: direction,
114
- });
115
- };
68
+ if ((((_a = route.request) === null || _a === void 0 ? void 0 : _a.encrypted) === true || ((_b = route.response) === null || _b === void 0 ? void 0 : _b.encrypted)) &&
69
+ connection.encryption === undefined)
70
+ throw new Error("Error on EncryptedFetcher.propagate(): the encryption password has not been configured.");
71
+ const closure = typeof connection.encryption === "function"
72
+ ? (direction) => (headers, body) => connection.encryption({
73
+ headers,
74
+ body,
75
+ direction,
76
+ })
77
+ : () => () => connection.encryption;
78
+ return FetcherBase_1.FetcherBase.propagate({
79
+ className: "EncryptedFetcher",
80
+ encode: ((_c = route.request) === null || _c === void 0 ? void 0 : _c.encrypted) === true
81
+ ? (input, headers) => {
82
+ const p = closure("encode")(headers, input);
83
+ return AesPkcs5_1.AesPkcs5.encrypt((stringify !== null && stringify !== void 0 ? stringify : JSON.stringify)(input), p.key, p.iv);
84
+ }
85
+ : (input) => input,
86
+ decode: ((_d = route.response) === null || _d === void 0 ? void 0 : _d.encrypted) === true
87
+ ? (input, headers) => {
88
+ const p = closure("decode")(headers, input);
89
+ const s = AesPkcs5_1.AesPkcs5.decrypt(input, p.key, p.iv);
90
+ return s.length ? JSON.parse(s) : s;
116
91
  }
117
- : function () { return function () { return connection.encryption; }; };
118
- return [2 /*return*/, FetcherBase_1.FetcherBase.propagate({
119
- className: "EncryptedFetcher",
120
- encode: ((_c = route.request) === null || _c === void 0 ? void 0 : _c.encrypted) === true
121
- ? function (input, headers) {
122
- var p = closure("encode")(headers, input);
123
- return AesPkcs5_1.AesPkcs5.encrypt((stringify !== null && stringify !== void 0 ? stringify : JSON.stringify)(input), p.key, p.iv);
124
- }
125
- : function (input) { return input; },
126
- decode: ((_d = route.response) === null || _d === void 0 ? void 0 : _d.encrypted) === true
127
- ? function (input, headers) {
128
- var p = closure("decode")(headers, input);
129
- var s = AesPkcs5_1.AesPkcs5.decrypt(input, p.key, p.iv);
130
- return s.length ? JSON.parse(s) : s;
131
- }
132
- : function (input) { return input; },
133
- })(connection, route, input, stringify)];
134
- });
92
+ : (input) => input,
93
+ })(connection, route, input, stringify);
135
94
  });
136
95
  }
137
96
  EncryptedFetcher.propagate = propagate;
@@ -1 +1 @@
1
- {"version":3,"file":"EncryptedFetcher.js","sourceRoot":"","sources":["../src/EncryptedFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAsC;AAKtC,sDAAqD;AAErD;;;;;;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C,CAAC,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,CAAoB,CAAC;QAC7D,CAAC;KAAA;IAjDqB,0BAAS,YAiD9B,CAAA;AACH,CAAC,EAxJgB,gBAAgB,gCAAhB,gBAAgB,QAwJhC"}
@@ -1 +1 @@
1
- export { HttpError } from "@samchon/openapi";
1
+ export { HttpError } from "@typia/utils";
package/lib/HttpError.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HttpError = void 0;
4
- var openapi_1 = require("@samchon/openapi");
5
- Object.defineProperty(exports, "HttpError", { enumerable: true, get: function () { return openapi_1.HttpError; } });
4
+ var utils_1 = require("@typia/utils");
5
+ Object.defineProperty(exports, "HttpError", { enumerable: true, get: function () { return utils_1.HttpError; } });
6
6
  //# sourceMappingURL=HttpError.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"HttpError.js","sourceRoot":"","sources":["../src/HttpError.ts"],"names":[],"mappings":";;;AAAA,4CAA6C;AAApC,oGAAA,SAAS,OAAA"}
1
+ {"version":3,"file":"HttpError.js","sourceRoot":"","sources":["../src/HttpError.ts"],"names":[],"mappings":";;;AAAA,sCAAyC;AAAhC,kGAAA,SAAS,OAAA"}
@@ -1,62 +1,44 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NestiaSimulator = void 0;
4
- var HttpError_1 = require("./HttpError");
4
+ const HttpError_1 = require("./HttpError");
5
5
  var NestiaSimulator;
6
6
  (function (NestiaSimulator) {
7
- NestiaSimulator.assert = function (props) {
7
+ NestiaSimulator.assert = (props) => {
8
8
  return {
9
9
  param: param(props),
10
10
  query: query(props),
11
11
  body: body(props),
12
12
  };
13
13
  };
14
- var param = function (props) {
15
- return function (name) {
16
- return function (task) {
17
- validate(function (exp) { return "URL parameter \"".concat(name, "\" is not ").concat(exp.expected, " type."); })(props)(task);
18
- };
19
- };
20
- };
21
- var query = function (props) {
22
- return function (task) {
23
- return validate(function () { return "Request query parameters are not following the promised type."; })(props)(task);
24
- };
14
+ const param = (props) => (name) => (task) => {
15
+ validate((exp) => `URL parameter "${name}" is not ${exp.expected} type.`)(props)(task);
25
16
  };
26
- var body = function (props) {
27
- return function (task) {
28
- return validate(function () { return "Request body is not following the promised type."; })(props)(task);
29
- };
30
- };
31
- var validate = function (message, path) {
32
- return function (props) {
33
- return function (task) {
34
- try {
35
- task();
36
- }
37
- catch (exp) {
38
- if (isTypeGuardError(exp))
39
- throw new HttpError_1.HttpError(props.method, props.host + props.path, 400, {
40
- "Content-Type": props.contentType,
41
- }, JSON.stringify({
42
- method: exp.method,
43
- path: path !== null && path !== void 0 ? path : exp.path,
44
- expected: exp.expected,
45
- value: exp.value,
46
- message: message(exp),
47
- }));
48
- throw exp;
49
- }
50
- };
51
- };
17
+ const query = (props) => (task) => validate(() => "Request query parameters are not following the promised type.")(props)(task);
18
+ const body = (props) => (task) => validate(() => "Request body is not following the promised type.")(props)(task);
19
+ const validate = (message, path) => (props) => (task) => {
20
+ try {
21
+ task();
22
+ }
23
+ catch (exp) {
24
+ if (isTypeGuardError(exp))
25
+ throw new HttpError_1.HttpError(props.method, props.host + props.path, 400, {
26
+ "Content-Type": props.contentType,
27
+ }, JSON.stringify({
28
+ method: exp.method,
29
+ path: path !== null && path !== void 0 ? path : exp.path,
30
+ expected: exp.expected,
31
+ value: exp.value,
32
+ message: message(exp),
33
+ }));
34
+ throw exp;
35
+ }
52
36
  };
53
37
  })(NestiaSimulator || (exports.NestiaSimulator = NestiaSimulator = {}));
54
- var isTypeGuardError = function (input) {
55
- return "string" === typeof input.method &&
56
- (undefined === input.path || "string" === typeof input.path) &&
57
- "string" === typeof input.expected &&
58
- "string" === typeof input.name &&
59
- "string" === typeof input.message &&
60
- (undefined === input.stack || "string" === typeof input.stack);
61
- };
38
+ const isTypeGuardError = (input) => "string" === typeof input.method &&
39
+ (undefined === input.path || "string" === typeof input.path) &&
40
+ "string" === typeof input.expected &&
41
+ "string" === typeof input.name &&
42
+ "string" === typeof input.message &&
43
+ (undefined === input.stack || "string" === typeof input.stack);
62
44
  //# sourceMappingURL=NestiaSimulator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NestiaSimulator.js","sourceRoot":"","sources":["../src/NestiaSimulator.ts"],"names":[],"mappings":";;;AAAA,yCAAwC;AAExC,IAAiB,eAAe,CAgE/B;AAhED,WAAiB,eAAe;IAQjB,sBAAM,GAAG,UAAC,KAAa;QAClC,OAAO;YACL,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC;YACnB,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC;YACnB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC;SAClB,CAAC;IACJ,CAAC,CAAC;IACF,IAAM,KAAK,GACT,UAAC,KAAa;QACd,OAAA,UAAC,IAAY;YACb,OAAA,UAAI,IAAa;gBACf,QAAQ,CAAC,UAAC,GAAG,IAAK,OAAA,0BAAkB,IAAI,uBAAY,GAAG,CAAC,QAAQ,WAAQ,EAAtD,CAAsD,CAAC,CACvE,KAAK,CACN,CAAC,IAAI,CAAC,CAAC;YACV,CAAC;QAJD,CAIC;IALD,CAKC,CAAC;IAEJ,IAAM,KAAK,GACT,UAAC,KAAa;QACd,OAAA,UAAI,IAAa;YACf,OAAA,QAAQ,CACN,cAAM,OAAA,+DAA+D,EAA/D,CAA+D,CACtE,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;QAFd,CAEc;IAHhB,CAGgB,CAAC;IAEnB,IAAM,IAAI,GACR,UAAC,KAAa;QACd,OAAA,UAAI,IAAa;YACf,OAAA,QAAQ,CAAC,cAAM,OAAA,kDAAkD,EAAlD,CAAkD,CAAC,CAAC,KAAK,CAAC,CACvE,IAAI,CACL;QAFD,CAEC;IAHH,CAGG,CAAC;IAEN,IAAM,QAAQ,GACZ,UAAC,OAAwC,EAAE,IAAa;QACxD,OAAA,UAAC,KAAa;YACd,OAAA,UAAI,IAAa;gBACf,IAAI,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