@nestia/fetcher 12.0.0-dev.20260601.1 → 12.0.0-dev.20260612.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.
- package/LICENSE +21 -21
- package/README.md +93 -93
- package/lib/IFetchRoute.d.ts +1 -1
- package/lib/IPropagation.d.ts +1 -1
- package/lib/internal/FetcherBase.js +12 -2
- package/lib/internal/FetcherBase.js.map +1 -1
- package/lib/internal/FetcherBase.mjs +12 -2
- package/lib/internal/FetcherBase.mjs.map +1 -1
- package/lib/internal/is_binary_response_content_type.d.ts +1 -0
- package/lib/internal/is_binary_response_content_type.js +15 -0
- package/lib/internal/is_binary_response_content_type.js.map +1 -0
- package/lib/internal/is_binary_response_content_type.mjs +13 -0
- package/lib/internal/is_binary_response_content_type.mjs.map +1 -0
- package/package.json +3 -3
- package/src/AesPkcs5.ts +41 -41
- package/src/EncryptedFetcher.ts +176 -176
- package/src/FormDataInput.ts +80 -80
- package/src/HttpError.ts +1 -1
- package/src/IConnection.ts +241 -241
- package/src/IEncryptionPassword.ts +44 -44
- package/src/IFetchEvent.ts +31 -31
- package/src/IFetchRoute.ts +61 -60
- package/src/IPropagation.ts +99 -99
- package/src/NestiaSimulator.ts +82 -82
- package/src/PlainFetcher.ts +105 -105
- package/src/index.ts +10 -10
- package/src/internal/FetcherBase.ts +243 -235
- package/src/internal/is_binary_response_content_type.ts +14 -0
package/LICENSE
CHANGED
|
@@ -1,21 +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.
|
|
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
|
-

|
|
3
|
-
|
|
4
|
-
[](https://github.com/samchon/nestia/blob/master/LICENSE)
|
|
5
|
-
[](https://www.npmjs.com/package/@nestia/fetcher)
|
|
6
|
-
[](https://www.npmjs.com/package/@nestia/fetcher)
|
|
7
|
-
[](https://github.com/samchon/nestia/actions?query=workflow%3Atest)
|
|
8
|
-
[](https://nestia.io/docs/)
|
|
9
|
-
[](https://gurubase.io/g/nestia)
|
|
10
|
-
[](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
|
-

|
|
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
|
-
[](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
|
+

|
|
3
|
+
|
|
4
|
+
[](https://github.com/samchon/nestia/blob/master/LICENSE)
|
|
5
|
+
[](https://www.npmjs.com/package/@nestia/fetcher)
|
|
6
|
+
[](https://www.npmjs.com/package/@nestia/fetcher)
|
|
7
|
+
[](https://github.com/samchon/nestia/actions?query=workflow%3Atest)
|
|
8
|
+
[](https://nestia.io/docs/)
|
|
9
|
+
[](https://gurubase.io/g/nestia)
|
|
10
|
+
[](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
|
+

|
|
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
|
+
[](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/IFetchRoute.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ export declare namespace IFetchRoute {
|
|
|
40
40
|
* not.
|
|
41
41
|
*/
|
|
42
42
|
interface IBody {
|
|
43
|
-
type: "application/json" | "application/x-www-form-urlencoded" | "multipart/form-data" | "text/plain";
|
|
43
|
+
type: "application/json" | "application/x-www-form-urlencoded" | "multipart/form-data" | "text/plain" | (string & {});
|
|
44
44
|
encrypted?: boolean;
|
|
45
45
|
}
|
|
46
46
|
}
|
package/lib/IPropagation.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ export type IPropagation<StatusMap extends {
|
|
|
38
38
|
[P in IPropagation.Status]?: any;
|
|
39
39
|
}, Success extends number = 200 | 201> = {
|
|
40
40
|
[P in keyof StatusMap]: IPropagation.IBranch<P extends Success ? true : false, P, StatusMap[P]>;
|
|
41
|
-
}[keyof StatusMap] | IPropagation.IBranch<false,
|
|
41
|
+
}[keyof StatusMap] | IPropagation.IBranch<false, number, unknown>;
|
|
42
42
|
export declare namespace IPropagation {
|
|
43
43
|
/**
|
|
44
44
|
* Type of configurable status codes.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var utils = require('@typia/utils');
|
|
4
|
+
var is_binary_response_content_type = require('./is_binary_response_content_type.js');
|
|
4
5
|
|
|
5
6
|
/** @internal */
|
|
6
7
|
exports.FetcherBase = void 0;
|
|
@@ -115,6 +116,8 @@ exports.FetcherBase = void 0;
|
|
|
115
116
|
const query = new URLSearchParams(await response.text());
|
|
116
117
|
result.data = route.parseQuery ? route.parseQuery(query) : query;
|
|
117
118
|
}
|
|
119
|
+
else if (is_binary_response_content_type.is_binary_response_content_type(route.response?.type))
|
|
120
|
+
result.data = response.body ?? new ReadableStream();
|
|
118
121
|
else
|
|
119
122
|
result.data = props.decode(await response.text(), result.headers);
|
|
120
123
|
}
|
|
@@ -167,10 +170,17 @@ const request_form_data_body = (input) => {
|
|
|
167
170
|
/** @internal */
|
|
168
171
|
const response_headers_to_object = (headers) => {
|
|
169
172
|
const output = {};
|
|
173
|
+
const cookieHeaders = typeof headers.getSetCookie === "function"
|
|
174
|
+
? headers.getSetCookie()
|
|
175
|
+
: undefined;
|
|
176
|
+
if (cookieHeaders?.length)
|
|
177
|
+
output["set-cookie"] = cookieHeaders;
|
|
170
178
|
headers.forEach((value, key) => {
|
|
171
|
-
if (key === "set-cookie") {
|
|
179
|
+
if (key.toLowerCase() === "set-cookie") {
|
|
180
|
+
if (cookieHeaders?.length)
|
|
181
|
+
return;
|
|
172
182
|
output[key] ??= [];
|
|
173
|
-
output[key].push(
|
|
183
|
+
output[key].push(value);
|
|
174
184
|
}
|
|
175
185
|
else
|
|
176
186
|
output[key] = value;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FetcherBase.js","sources":["../../src/internal/FetcherBase.ts"],"sourcesContent":[null],"names":["FetcherBase","HttpError"],"mappings":"
|
|
1
|
+
{"version":3,"file":"FetcherBase.js","sources":["../../src/internal/FetcherBase.ts"],"sourcesContent":[null],"names":["FetcherBase","HttpError","is_binary_response_content_type"],"mappings":";;;;;AAOA;AACiBA;AAAjB,CAAA,UAAiB,WAAW,EAAA;AAab,IAAA,WAAA,CAAA,OAAO,GAClB,CAAC,KAAa,KACd,OACE,UAAuB,EACvB,KAAwE,EACxE,KAAa,EACb,SAAoC,KACjB;AACnB,QAAA,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,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C,KAAK,CAAC;AAC9C,QAAA,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;YAAE,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;;AAC3C,YAAA,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC;AACzB,IAAA,OAAO,OAAO;AAChB,CAAC;AAED;AACA,MAAM,0BAA0B,GAAG,CACjC,OAAgB,KACqB;IACrC,MAAM,MAAM,GAAsC,EAAE;AACpD,IAAA,MAAM,aAAa,GACjB,OAAQ,OAAe,CAAC,YAAY,KAAK;AACvC,UAAG,OAAe,CAAC,YAAY;UAC7B,SAAS;IACf,IAAI,aAAa,EAAE,MAAM;AAAE,QAAA,MAAM,CAAC,YAAY,CAAC,GAAG,aAAa;IAE/D,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,KAAI;AAC7B,QAAA,IAAI,GAAG,CAAC,WAAW,EAAE,KAAK,YAAY,EAAE;YACtC,IAAI,aAAa,EAAE,MAAM;gBAAE;AAC3B,YAAA,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE;YACjB,MAAM,CAAC,GAAG,CAAc,CAAC,IAAI,CAAC,KAAK,CAAC;QACvC;;AAAO,YAAA,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK;AAC5B,IAAA,CAAC,CAAC;AACF,IAAA,OAAO,MAAM;AACf,CAAC;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { HttpError } from '@typia/utils';
|
|
2
|
+
import { is_binary_response_content_type } from './is_binary_response_content_type.mjs';
|
|
2
3
|
|
|
3
4
|
/** @internal */
|
|
4
5
|
var FetcherBase;
|
|
@@ -113,6 +114,8 @@ var FetcherBase;
|
|
|
113
114
|
const query = new URLSearchParams(await response.text());
|
|
114
115
|
result.data = route.parseQuery ? route.parseQuery(query) : query;
|
|
115
116
|
}
|
|
117
|
+
else if (is_binary_response_content_type(route.response?.type))
|
|
118
|
+
result.data = response.body ?? new ReadableStream();
|
|
116
119
|
else
|
|
117
120
|
result.data = props.decode(await response.text(), result.headers);
|
|
118
121
|
}
|
|
@@ -165,10 +168,17 @@ const request_form_data_body = (input) => {
|
|
|
165
168
|
/** @internal */
|
|
166
169
|
const response_headers_to_object = (headers) => {
|
|
167
170
|
const output = {};
|
|
171
|
+
const cookieHeaders = typeof headers.getSetCookie === "function"
|
|
172
|
+
? headers.getSetCookie()
|
|
173
|
+
: undefined;
|
|
174
|
+
if (cookieHeaders?.length)
|
|
175
|
+
output["set-cookie"] = cookieHeaders;
|
|
168
176
|
headers.forEach((value, key) => {
|
|
169
|
-
if (key === "set-cookie") {
|
|
177
|
+
if (key.toLowerCase() === "set-cookie") {
|
|
178
|
+
if (cookieHeaders?.length)
|
|
179
|
+
return;
|
|
170
180
|
output[key] ??= [];
|
|
171
|
-
output[key].push(
|
|
181
|
+
output[key].push(value);
|
|
172
182
|
}
|
|
173
183
|
else
|
|
174
184
|
output[key] = value;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FetcherBase.mjs","sources":["../../src/internal/FetcherBase.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FetcherBase.mjs","sources":["../../src/internal/FetcherBase.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAOA;AACM,IAAW;AAAjB,CAAA,UAAiB,WAAW,EAAA;AAab,IAAA,WAAA,CAAA,OAAO,GAClB,CAAC,KAAa,KACd,OACE,UAAuB,EACvB,KAAwE,EACxE,KAAa,EACb,SAAoC,KACjB;AACnB,QAAA,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAC7C,UAAU,EACV,KAAK,EACL,KAAK,EACL,SAAS,CACV;AACD,QAAA,IAAK,MAAc,CAAC,OAAO,KAAK,KAAK;YACnC,MAAM,IAAI,SAAS,CACjB,KAAK,CAAC,MAAM,EACZ,KAAK,CAAC,IAAI,EACV,MAAM,CAAC,MAAu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ACA,MAAM,0BAA0B,GAAG,CACjC,OAAgB,KACqB;IACrC,MAAM,MAAM,GAAsC,EAAE;AACpD,IAAA,MAAM,aAAa,GACjB,OAAQ,OAAe,CAAC,YAAY,KAAK;AACvC,UAAG,OAAe,CAAC,YAAY;UAC7B,SAAS;IACf,IAAI,aAAa,EAAE,MAAM;AAAE,QAAA,MAAM,CAAC,YAAY,CAAC,GAAG,aAAa;IAE/D,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,KAAI;AAC7B,QAAA,IAAI,GAAG,CAAC,WAAW,EAAE,KAAK,YAAY,EAAE;YACtC,IAAI,aAAa,EAAE,MAAM;gBAAE;AAC3B,YAAA,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE;YACjB,MAAM,CAAC,GAAG,CAAc,CAAC,IAAI,CAAC,KAAK,CAAC;QACvC;;AAAO,YAAA,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK;AAC5B,IAAA,CAAC,CAAC;AACF,IAAA,OAAO,MAAM;AACf,CAAC;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const is_binary_response_content_type: (input: string | null | undefined) => input is string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const is_binary_response_content_type = (input) => {
|
|
4
|
+
if (typeof input !== "string")
|
|
5
|
+
return false;
|
|
6
|
+
const value = input.split(";")[0].trim().toLowerCase();
|
|
7
|
+
return (value.startsWith("image/") ||
|
|
8
|
+
value.startsWith("video/") ||
|
|
9
|
+
value.startsWith("audio/") ||
|
|
10
|
+
value === "application/octet-stream" ||
|
|
11
|
+
value === "application/pdf");
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
exports.is_binary_response_content_type = is_binary_response_content_type;
|
|
15
|
+
//# sourceMappingURL=is_binary_response_content_type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is_binary_response_content_type.js","sources":["../../src/internal/is_binary_response_content_type.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAO,MAAM,+BAA+B,GAAG,CAC7C,KAAgC,KACb;IACnB,IAAI,OAAO,KAAK,KAAK,QAAQ;AAAE,QAAA,OAAO,KAAK;AAE3C,IAAA,MAAM,KAAK,GAAW,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE;AAC/D,IAAA,QACE,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC;AAC1B,QAAA,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC;AAC1B,QAAA,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC;AAC1B,QAAA,KAAK,KAAK,0BAA0B;QACpC,KAAK,KAAK,iBAAiB;AAE/B;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const is_binary_response_content_type = (input) => {
|
|
2
|
+
if (typeof input !== "string")
|
|
3
|
+
return false;
|
|
4
|
+
const value = input.split(";")[0].trim().toLowerCase();
|
|
5
|
+
return (value.startsWith("image/") ||
|
|
6
|
+
value.startsWith("video/") ||
|
|
7
|
+
value.startsWith("audio/") ||
|
|
8
|
+
value === "application/octet-stream" ||
|
|
9
|
+
value === "application/pdf");
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { is_binary_response_content_type };
|
|
13
|
+
//# sourceMappingURL=is_binary_response_content_type.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is_binary_response_content_type.mjs","sources":["../../src/internal/is_binary_response_content_type.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAO,MAAM,+BAA+B,GAAG,CAC7C,KAAgC,KACb;IACnB,IAAI,OAAO,KAAK,KAAK,QAAQ;AAAE,QAAA,OAAO,KAAK;AAE3C,IAAA,MAAM,KAAK,GAAW,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE;AAC/D,IAAA,QACE,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC;AAC1B,QAAA,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC;AAC1B,QAAA,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC;AAC1B,QAAA,KAAK,KAAK,0BAA0B;QACpC,KAAK,KAAK,iBAAiB;AAE/B;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestia/fetcher",
|
|
3
|
-
"version": "12.0.0-dev.
|
|
3
|
+
"version": "12.0.0-dev.20260612.1",
|
|
4
4
|
"description": "Fetcher library of Nestia SDK",
|
|
5
5
|
"types": "lib/index.d.ts",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://nestia.io",
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@typia/interface": "13.0.0-dev.
|
|
42
|
-
"@typia/utils": "13.0.0-dev.
|
|
41
|
+
"@typia/interface": "13.0.0-dev.20260612.1",
|
|
42
|
+
"@typia/utils": "13.0.0-dev.20260612.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@rollup/plugin-commonjs": "^29.0.0",
|
package/src/AesPkcs5.ts
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import crypto from "crypto";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Utility class for the AES-128/256 encryption.
|
|
5
|
-
*
|
|
6
|
-
* - AES-128/256
|
|
7
|
-
* - CBC mode
|
|
8
|
-
* - PKCS#5 Padding
|
|
9
|
-
* - Base64 Encoding
|
|
10
|
-
*
|
|
11
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
12
|
-
*/
|
|
13
|
-
export namespace AesPkcs5 {
|
|
14
|
-
/**
|
|
15
|
-
* Encrypt data
|
|
16
|
-
*
|
|
17
|
-
* @param data Target data
|
|
18
|
-
* @param key Key value of the encryption.
|
|
19
|
-
* @param iv Initializer Vector for the encryption
|
|
20
|
-
* @returns Encrypted data
|
|
21
|
-
*/
|
|
22
|
-
export function encrypt(data: string, key: string, iv: string): string {
|
|
23
|
-
const bytes: number = key.length * 8;
|
|
24
|
-
const cipher = crypto.createCipheriv(`AES-${bytes}-CBC`, key, iv);
|
|
25
|
-
return cipher.update(data, "utf8", "base64") + cipher.final("base64");
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Decrypt data.
|
|
30
|
-
*
|
|
31
|
-
* @param data Target data
|
|
32
|
-
* @param key Key value of the decryption.
|
|
33
|
-
* @param iv Initializer Vector for the decryption
|
|
34
|
-
* @returns Decrypted data.
|
|
35
|
-
*/
|
|
36
|
-
export function decrypt(data: string, key: string, iv: string): string {
|
|
37
|
-
const bytes: number = key.length * 8;
|
|
38
|
-
const decipher = crypto.createDecipheriv(`AES-${bytes}-CBC`, key, iv);
|
|
39
|
-
return decipher.update(data, "base64", "utf8") + decipher.final("utf8");
|
|
40
|
-
}
|
|
41
|
-
}
|
|
1
|
+
import crypto from "crypto";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Utility class for the AES-128/256 encryption.
|
|
5
|
+
*
|
|
6
|
+
* - AES-128/256
|
|
7
|
+
* - CBC mode
|
|
8
|
+
* - PKCS#5 Padding
|
|
9
|
+
* - Base64 Encoding
|
|
10
|
+
*
|
|
11
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
12
|
+
*/
|
|
13
|
+
export namespace AesPkcs5 {
|
|
14
|
+
/**
|
|
15
|
+
* Encrypt data
|
|
16
|
+
*
|
|
17
|
+
* @param data Target data
|
|
18
|
+
* @param key Key value of the encryption.
|
|
19
|
+
* @param iv Initializer Vector for the encryption
|
|
20
|
+
* @returns Encrypted data
|
|
21
|
+
*/
|
|
22
|
+
export function encrypt(data: string, key: string, iv: string): string {
|
|
23
|
+
const bytes: number = key.length * 8;
|
|
24
|
+
const cipher = crypto.createCipheriv(`AES-${bytes}-CBC`, key, iv);
|
|
25
|
+
return cipher.update(data, "utf8", "base64") + cipher.final("base64");
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Decrypt data.
|
|
30
|
+
*
|
|
31
|
+
* @param data Target data
|
|
32
|
+
* @param key Key value of the decryption.
|
|
33
|
+
* @param iv Initializer Vector for the decryption
|
|
34
|
+
* @returns Decrypted data.
|
|
35
|
+
*/
|
|
36
|
+
export function decrypt(data: string, key: string, iv: string): string {
|
|
37
|
+
const bytes: number = key.length * 8;
|
|
38
|
+
const decipher = crypto.createDecipheriv(`AES-${bytes}-CBC`, key, iv);
|
|
39
|
+
return decipher.update(data, "base64", "utf8") + decipher.final("utf8");
|
|
40
|
+
}
|
|
41
|
+
}
|