@nestia/fetcher 12.0.0-dev.20260521.3 → 12.0.0-dev.20260521.5

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.
@@ -0,0 +1,46 @@
1
+ 'use strict';
2
+
3
+ var crypto = require('crypto');
4
+
5
+ /**
6
+ * Utility class for the AES-128/256 encryption.
7
+ *
8
+ * - AES-128/256
9
+ * - CBC mode
10
+ * - PKCS#5 Padding
11
+ * - Base64 Encoding
12
+ *
13
+ * @author Jeongho Nam - https://github.com/samchon
14
+ */
15
+ exports.AesPkcs5 = void 0;
16
+ (function (AesPkcs5) {
17
+ /**
18
+ * Encrypt data
19
+ *
20
+ * @param data Target data
21
+ * @param key Key value of the encryption.
22
+ * @param iv Initializer Vector for the encryption
23
+ * @returns Encrypted data
24
+ */
25
+ function encrypt(data, key, iv) {
26
+ const bytes = key.length * 8;
27
+ const cipher = crypto.createCipheriv(`AES-${bytes}-CBC`, key, iv);
28
+ return cipher.update(data, "utf8", "base64") + cipher.final("base64");
29
+ }
30
+ AesPkcs5.encrypt = encrypt;
31
+ /**
32
+ * Decrypt data.
33
+ *
34
+ * @param data Target data
35
+ * @param key Key value of the decryption.
36
+ * @param iv Initializer Vector for the decryption
37
+ * @returns Decrypted data.
38
+ */
39
+ function decrypt(data, key, iv) {
40
+ const bytes = key.length * 8;
41
+ const decipher = crypto.createDecipheriv(`AES-${bytes}-CBC`, key, iv);
42
+ return decipher.update(data, "base64", "utf8") + decipher.final("utf8");
43
+ }
44
+ AesPkcs5.decrypt = decrypt;
45
+ })(exports.AesPkcs5 || (exports.AesPkcs5 = {}));
46
+ //# sourceMappingURL=AesPkcs5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AesPkcs5.js","sources":["../src/AesPkcs5.ts"],"sourcesContent":[null],"names":["AesPkcs5"],"mappings":";;;;AAEA;;;;;;;;;AASG;AACcA;AAAjB,CAAA,UAAiB,QAAQ,EAAA;AACvB;;;;;;;AAOG;AACH,IAAA,SAAgB,OAAO,CAAC,IAAY,EAAE,GAAW,EAAE,EAAU,EAAA;AAC3D,QAAA,MAAM,KAAK,GAAW,GAAG,CAAC,MAAM,GAAG,CAAC;AACpC,QAAA,MAAM,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC,CAAA,IAAA,EAAO,KAAK,CAAA,IAAA,CAAM,EAAE,GAAG,EAAE,EAAE,CAAC;AACjE,QAAA,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC;IACvE;AAJgB,IAAA,QAAA,CAAA,OAAO,UAItB;AAED;;;;;;;AAOG;AACH,IAAA,SAAgB,OAAO,CAAC,IAAY,EAAE,GAAW,EAAE,EAAU,EAAA;AAC3D,QAAA,MAAM,KAAK,GAAW,GAAG,CAAC,MAAM,GAAG,CAAC;AACpC,QAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAA,IAAA,EAAO,KAAK,CAAA,IAAA,CAAM,EAAE,GAAG,EAAE,EAAE,CAAC;AACrE,QAAA,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC;IACzE;AAJgB,IAAA,QAAA,CAAA,OAAO,UAItB;AACH,CAAC,EA5BgBA,gBAAQ,KAARA,gBAAQ,GAAA,EAAA,CAAA,CAAA;;"}
@@ -0,0 +1,83 @@
1
+ 'use strict';
2
+
3
+ var AesPkcs5 = require('./AesPkcs5.js');
4
+ var FetcherBase = require('./internal/FetcherBase.js');
5
+
6
+ /**
7
+ * Utility class for `fetch` functions used in `@nestia/sdk` with encryption.
8
+ *
9
+ * `EncryptedFetcher` is a utility class designed for SDK functions generated by
10
+ * [`@nestia/sdk`](https://nestia.io/docs/sdk/sdk), interacting with the remote
11
+ * HTTP API encrypted by AES-PKCS algorithm. In other words, this is a
12
+ * collection of dedicated `fetch()` functions for `@nestia/sdk` with
13
+ * encryption.
14
+ *
15
+ * For reference, `EncryptedFetcher` class being used only when target
16
+ * controller method is encrypting body data by `@EncryptedRoute` or
17
+ * `@EncryptedBody` decorators. If those decorators are not used,
18
+ * {@link PlainFetcher} class would be used instead.
19
+ *
20
+ * @author Jeongho Nam - https://github.com/samchon
21
+ */
22
+ exports.EncryptedFetcher = void 0;
23
+ (function (EncryptedFetcher) {
24
+ async function fetch(connection, route, input, stringify) {
25
+ if ((route.request?.encrypted === true || route.response?.encrypted) &&
26
+ connection.encryption === undefined)
27
+ throw new Error("Error on EncryptedFetcher.fetch(): the encryption password has not been configured.");
28
+ const closure = typeof connection.encryption === "function"
29
+ ? (direction) => (headers, body) => connection.encryption({
30
+ headers,
31
+ body,
32
+ direction,
33
+ })
34
+ : () => () => connection.encryption;
35
+ return FetcherBase.FetcherBase.request({
36
+ className: "EncryptedFetcher",
37
+ encode: route.request?.encrypted === true
38
+ ? (input, headers) => {
39
+ const p = closure("encode")(headers, input);
40
+ return AesPkcs5.AesPkcs5.encrypt((stringify ?? JSON.stringify)(input), p.key, p.iv);
41
+ }
42
+ : (input) => input,
43
+ decode: route.response?.encrypted === true
44
+ ? (input, headers) => {
45
+ const p = closure("decode")(headers, input);
46
+ const s = AesPkcs5.AesPkcs5.decrypt(input, p.key, p.iv);
47
+ return s.length ? JSON.parse(s) : s;
48
+ }
49
+ : (input) => input,
50
+ })(connection, route, input, stringify);
51
+ }
52
+ EncryptedFetcher.fetch = fetch;
53
+ async function propagate(connection, route, input, stringify) {
54
+ if ((route.request?.encrypted === true || route.response?.encrypted) &&
55
+ connection.encryption === undefined)
56
+ throw new Error("Error on EncryptedFetcher.propagate(): the encryption password has not been configured.");
57
+ const closure = typeof connection.encryption === "function"
58
+ ? (direction) => (headers, body) => connection.encryption({
59
+ headers,
60
+ body,
61
+ direction,
62
+ })
63
+ : () => () => connection.encryption;
64
+ return FetcherBase.FetcherBase.propagate({
65
+ className: "EncryptedFetcher",
66
+ encode: route.request?.encrypted === true
67
+ ? (input, headers) => {
68
+ const p = closure("encode")(headers, input);
69
+ return AesPkcs5.AesPkcs5.encrypt((stringify ?? JSON.stringify)(input), p.key, p.iv);
70
+ }
71
+ : (input) => input,
72
+ decode: route.response?.encrypted === true
73
+ ? (input, headers) => {
74
+ const p = closure("decode")(headers, input);
75
+ const s = AesPkcs5.AesPkcs5.decrypt(input, p.key, p.iv);
76
+ return s.length ? JSON.parse(s) : s;
77
+ }
78
+ : (input) => input,
79
+ })(connection, route, input, stringify);
80
+ }
81
+ EncryptedFetcher.propagate = propagate;
82
+ })(exports.EncryptedFetcher || (exports.EncryptedFetcher = {}));
83
+ //# sourceMappingURL=EncryptedFetcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EncryptedFetcher.js","sources":["../src/EncryptedFetcher.ts"],"sourcesContent":[null],"names":["EncryptedFetcher","FetcherBase","AesPkcs5"],"mappings":";;;;;AAOA;;;;;;;;;;;;;;;AAeG;AACcA;AAAjB,CAAA,UAAiB,gBAAgB,EAAA;IAuCxB,eAAe,KAAK,CACzB,UAAuB,EACvB,KAAwE,EACxE,KAAa,EACb,SAAoC,EAAA;AAEpC,QAAA,IACE,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,KAAK,IAAI,IAAI,KAAK,CAAC,QAAQ,EAAE,SAAS;YAC/D,UAAU,CAAC,UAAU,KAAK,SAAS;AAEnC,YAAA,MAAM,IAAI,KAAK,CACb,qFAAqF,CACtF;AACH,QAAA,MAAM,OAAO,GACX,OAAO,UAAU,CAAC,UAAU,KAAK;AAC/B,cAAE,CAAC,SAA8B,KAC7B,CACE,OAA4D,EAC5D,IAAY,KAEX,UAAU,CAAC,UAA0C,CAAC;gBACrD,OAAO;gBACP,IAAI;gBACJ,SAAS;aACV;cACL,MAAM,MAAM,UAAU,CAAC,UAAiC;QAE9D,OAAOC,uBAAW,CAAC,OAAO,CAAC;AACzB,YAAA,SAAS,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xJgBF,wBAAgB,KAAhBA,wBAAgB,GAAA,EAAA,CAAA,CAAA;;"}
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ //# sourceMappingURL=FormDataInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormDataInput.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -0,0 +1,11 @@
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HttpError.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ //# sourceMappingURL=IConnection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IConnection.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ //# sourceMappingURL=IEncryptionPassword.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IEncryptionPassword.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ //# sourceMappingURL=IFetchEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IFetchEvent.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ //# sourceMappingURL=IFetchRoute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IFetchRoute.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ //# sourceMappingURL=IPropagation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IPropagation.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -0,0 +1,44 @@
1
+ 'use strict';
2
+
3
+ var utils = require('@typia/utils');
4
+
5
+ exports.NestiaSimulator = void 0;
6
+ (function (NestiaSimulator) {
7
+ NestiaSimulator.assert = (props) => {
8
+ return {
9
+ param: param(props),
10
+ query: query(props),
11
+ body: body(props),
12
+ };
13
+ };
14
+ const param = (props) => (name) => (task) => {
15
+ validate((exp) => `URL parameter "${name}" is not ${exp.expected} type.`)(props)(task);
16
+ };
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 utils.HttpError(props.method, props.host + props.path, 400, {
26
+ "Content-Type": props.contentType,
27
+ }, JSON.stringify({
28
+ method: exp.method,
29
+ path: exp.path,
30
+ expected: exp.expected,
31
+ value: exp.value,
32
+ message: message(exp),
33
+ }));
34
+ throw exp;
35
+ }
36
+ };
37
+ })(exports.NestiaSimulator || (exports.NestiaSimulator = {}));
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);
44
+ //# sourceMappingURL=NestiaSimulator.js.map
@@ -0,0 +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,IAA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AC;AACL,CAAC,EAhEgBD,uBAAe,KAAfA,uBAAe,GAAA,EAAA,CAAA,CAAA;AAkEhC,MAAM,gBAAgB,GAAG,CAAC,KAAU,KAClC,QAAQ,KAAK,OAAO,KAAK,CAAC,MAAM;AAChC,KAAC,SAAS,KAAK,KAAK,CAAC,IAAI,IAAI,QAAQ,KAAK,OAAO,KAAK,CAAC,IAAI,CAAC;AAC5D,IAAA,QAAQ,KAAK,OAAO,KAAK,CAAC,QAAQ;AAClC,IAAA,QAAQ,KAAK,OAAO,KAAK,CAAC,IAAI;AAC9B,IAAA,QAAQ,KAAK,OAAO,KAAK,CAAC,OAAO;AACjC,KAAC,SAAS,KAAK,KAAK,CAAC,KAAK,IAAI,QAAQ,KAAK,OAAO,KAAK,CAAC,KAAK,CAAC;;"}
@@ -0,0 +1,43 @@
1
+ 'use strict';
2
+
3
+ var FetcherBase = require('./internal/FetcherBase.js');
4
+
5
+ /**
6
+ * Utility class for `fetch` functions used in `@nestia/sdk`.
7
+ *
8
+ * `PlainFetcher` is a utility class designed for SDK functions generated by
9
+ * [`@nestia/sdk`](https://nestia.io/docs/sdk/sdk), interacting with the remote
10
+ * HTTP sever API. In other words, this is a collection of dedicated `fetch()`
11
+ * functions for `@nestia/sdk`.
12
+ *
13
+ * For reference, `PlainFetcher` class does not encrypt or decrypt the body data
14
+ * at all. It just delivers plain data without any post processing. If you've
15
+ * defined a controller method through `@EncryptedRoute` or `@EncryptedBody`
16
+ * decorator, then {@liink EncryptedFetcher} class would be used instead.
17
+ *
18
+ * @author Jeongho Nam - https://github.com/samchon
19
+ */
20
+ exports.PlainFetcher = void 0;
21
+ (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);
30
+ }
31
+ 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);
40
+ }
41
+ PlainFetcher.propagate = propagate;
42
+ })(exports.PlainFetcher || (exports.PlainFetcher = {}));
43
+ //# sourceMappingURL=PlainFetcher.js.map
@@ -0,0 +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,YAAA,MAAM,IAAI,KAAK,CACb,gHAAgH,CACjH;QACH,OAAOA,uBAAW,CAAC,SAAS,CAAC;AAC3B,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,CAAoB;IAC5D;AAfsB,IAAA,YAAA,CAAA,SAAS,YAe9B;AACH,CAAC,EApFgBD,oBAAY,KAAZA,oBAAY,GAAA,EAAA,CAAA,CAAA;;"}
package/lib/index.js ADDED
@@ -0,0 +1,21 @@
1
+ 'use strict';
2
+
3
+ var utils = require('@typia/utils');
4
+ var NestiaSimulator = require('./NestiaSimulator.js');
5
+ var PlainFetcher = require('./PlainFetcher.js');
6
+
7
+
8
+
9
+ Object.defineProperty(exports, "HttpError", {
10
+ enumerable: true,
11
+ get: function () { return utils.HttpError; }
12
+ });
13
+ Object.defineProperty(exports, "NestiaSimulator", {
14
+ enumerable: true,
15
+ get: function () { return NestiaSimulator.NestiaSimulator; }
16
+ });
17
+ Object.defineProperty(exports, "PlainFetcher", {
18
+ enumerable: true,
19
+ get: function () { return PlainFetcher.PlainFetcher; }
20
+ });
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,180 @@
1
+ 'use strict';
2
+
3
+ var utils = require('@typia/utils');
4
+
5
+ /** @internal */
6
+ exports.FetcherBase = void 0;
7
+ (function (FetcherBase) {
8
+ FetcherBase.request = (props) => async (connection, route, input, stringify) => {
9
+ const result = await _Propagate("fetch")(props)(connection, route, input, stringify);
10
+ if (result.success === false)
11
+ throw new utils.HttpError(route.method, route.path, result.status, result.headers, result.data);
12
+ return result.data;
13
+ };
14
+ FetcherBase.propagate = (props) => async (connection, route, input, stringify) => _Propagate("propagate")(props)(connection, route, input, stringify);
15
+ /** @internal */
16
+ const _Propagate = (method) => (props) => async (connection, route, input, stringify) => {
17
+ //----
18
+ // REQUEST MESSAGE
19
+ //----
20
+ // METHOD & HEADERS
21
+ const headers = {
22
+ ...(connection.headers ?? {}),
23
+ };
24
+ if (input !== undefined) {
25
+ if (route.request?.type === undefined)
26
+ throw new Error(`Error on ${props.className}.fetch(): no content-type being configured.`);
27
+ else if (route.request.type !== "multipart/form-data")
28
+ headers["Content-Type"] = route.request.type;
29
+ }
30
+ else if (input === undefined && headers["Content-Type"] !== undefined)
31
+ delete headers["Content-Type"];
32
+ // INIT REQUEST DATA
33
+ const init = {
34
+ ...(connection.options ?? {}),
35
+ method: route.method,
36
+ headers: (() => {
37
+ const output = [];
38
+ for (const [key, value] of Object.entries(headers))
39
+ if (value === undefined)
40
+ continue;
41
+ else if (Array.isArray(value))
42
+ for (const v of value)
43
+ output.push([key, String(v)]);
44
+ else
45
+ output.push([key, String(value)]);
46
+ return output;
47
+ })(),
48
+ };
49
+ // CONSTRUCT BODY DATA
50
+ if (input !== undefined)
51
+ init.body = props.encode(
52
+ // BODY TRANSFORM
53
+ route.request?.type === "application/x-www-form-urlencoded"
54
+ ? request_query_body(input)
55
+ : route.request?.type === "multipart/form-data"
56
+ ? request_form_data_body(input)
57
+ : route.request?.type !== "text/plain"
58
+ ? (stringify ?? JSON.stringify)(input)
59
+ : input, headers);
60
+ //----
61
+ // RESPONSE MESSAGE
62
+ //----
63
+ // URL SPECIFICATION
64
+ const path = connection.host[connection.host.length - 1] !== "/" &&
65
+ route.path[0] !== "/"
66
+ ? `/${route.path}`
67
+ : route.path;
68
+ const url = new URL(`${connection.host}${path}`);
69
+ // DO FETCH
70
+ const event = {
71
+ route,
72
+ path,
73
+ status: null,
74
+ input,
75
+ output: undefined,
76
+ started_at: new Date(),
77
+ respond_at: null,
78
+ completed_at: null,
79
+ };
80
+ try {
81
+ // TRY FETCH
82
+ const response = await (connection.fetch ?? fetch)(url.href, init);
83
+ event.respond_at = new Date();
84
+ event.status = response.status;
85
+ // CONSTRUCT RESULT DATA
86
+ const result = {
87
+ success: response.status === 200 ||
88
+ response.status === 201 ||
89
+ response.status === route.status,
90
+ status: response.status,
91
+ headers: response_headers_to_object(response.headers),
92
+ data: undefined,
93
+ };
94
+ if (result.success === false) {
95
+ // WHEN FAILED
96
+ result.data = await response.text();
97
+ const type = response.headers.get("content-type");
98
+ if (method !== "fetch" &&
99
+ type &&
100
+ type.indexOf("application/json") !== -1)
101
+ try {
102
+ result.data = JSON.parse(result.data);
103
+ }
104
+ catch { }
105
+ }
106
+ else {
107
+ // WHEN SUCCESS
108
+ if (route.method === "HEAD")
109
+ result.data = undefined;
110
+ else if (route.response?.type === "application/json") {
111
+ const text = await response.text();
112
+ result.data = text.length ? JSON.parse(text) : undefined;
113
+ }
114
+ else if (route.response?.type === "application/x-www-form-urlencoded") {
115
+ const query = new URLSearchParams(await response.text());
116
+ result.data = route.parseQuery ? route.parseQuery(query) : query;
117
+ }
118
+ else
119
+ result.data = props.decode(await response.text(), result.headers);
120
+ }
121
+ event.output = result.data;
122
+ return result;
123
+ }
124
+ catch (exp) {
125
+ throw exp;
126
+ }
127
+ finally {
128
+ event.completed_at = new Date();
129
+ if (connection.logger)
130
+ try {
131
+ await connection.logger(event);
132
+ }
133
+ catch { }
134
+ }
135
+ };
136
+ })(exports.FetcherBase || (exports.FetcherBase = {}));
137
+ /** @internal */
138
+ const request_query_body = (input) => {
139
+ const q = new URLSearchParams();
140
+ for (const [key, value] of Object.entries(input))
141
+ if (value === undefined)
142
+ continue;
143
+ else if (Array.isArray(value))
144
+ value.forEach((elem) => q.append(key, String(elem)));
145
+ else
146
+ q.set(key, String(value));
147
+ return q;
148
+ };
149
+ /** @internal */
150
+ const request_form_data_body = (input) => {
151
+ const encoded = new FormData();
152
+ const append = (key) => (value) => {
153
+ if (value === undefined)
154
+ return;
155
+ else if (typeof File === "function" && value instanceof File)
156
+ encoded.append(key, value, value.name);
157
+ else
158
+ encoded.append(key, value);
159
+ };
160
+ for (const [key, value] of Object.entries(input))
161
+ if (Array.isArray(value))
162
+ value.map(append(key));
163
+ else
164
+ append(key)(value);
165
+ return encoded;
166
+ };
167
+ /** @internal */
168
+ const response_headers_to_object = (headers) => {
169
+ const output = {};
170
+ headers.forEach((value, key) => {
171
+ if (key === "set-cookie") {
172
+ output[key] ??= [];
173
+ output[key].push(...value.split(";").map((str) => str.trim()));
174
+ }
175
+ else
176
+ output[key] = value;
177
+ });
178
+ return output;
179
+ };
180
+ //# sourceMappingURL=FetcherBase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FetcherBase.js","sources":["../../src/internal/FetcherBase.ts"],"sourcesContent":[null],"names":["FetcherBase","HttpError"],"mappings":";;;;AAMA;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,OAAO,CAAC,CAAC,KAAK,CAAC,CAC7C,UAAU,EACV,KAAK,EACL,KAAK,EACL,SAAS,CACV;AACD,QAAA,IAAK,MAAc,CAAC,OAAO,KAAK,KAAK;YACnC,MAAM,IAAIC,eAAS,CACjB,KAAK,CAAC,MAAM,EACZ,KAAK,CAAC,IAAI,EACV,MAAM,CAAC,MAAuB,EAC9B,MAAM,CAAC,OAAO,EACd,MAAM,CAAC,IAAc,CACtB;QACH,OAAO,MAAM,CAAC,IAAc;AAC9B,IAAA,CAAC;AAEU,IAAA,WAAA,CAAA,SAAS,GACpB,CAAC,KAAa,KACd,OACE,UAAuB,EACvB,KAAwE,EACxE,KAAa,EACb,SAAoC,KAEpC,UAAU,CAAC,WAAW,CAAC,CAAC,KAA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ACH;;AAAO,YAAA,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK;AAC5B,IAAA,CAAC,CAAC;AACF,IAAA,OAAO,MAAM;AACf,CAAC;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestia/fetcher",
3
- "version": "12.0.0-dev.20260521.3",
3
+ "version": "12.0.0-dev.20260521.5",
4
4
  "description": "Fetcher library of Nestia SDK",
5
5
  "types": "lib/index.d.ts",
6
6
  "main": "lib/index.js",
@@ -63,7 +63,7 @@
63
63
  "access": "public"
64
64
  },
65
65
  "scripts": {
66
- "build": "rimraf lib && ttsc && rollup -c rollup.config.mjs",
66
+ "build": "rimraf lib && ttsc && rollup -c rollup.config.mjs && node ../../deploy/verify-package-exports.cjs --require-main",
67
67
  "dev": "rimraf lib && ttsc --watch"
68
68
  }
69
69
  }