@nestia/fetcher 12.0.0-dev.20260612.2 → 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.
- package/lib/AesPkcs5.js +12 -9
- package/lib/AesPkcs5.js.map +1 -1
- package/lib/AesPkcs5.mjs +2 -45
- package/lib/AesPkcs5.mjs.map +1 -1
- package/lib/AesPkcs52.mjs +53 -0
- package/lib/AesPkcs52.mjs.map +1 -0
- package/lib/EncryptedFetcher.js +77 -62
- package/lib/EncryptedFetcher.js.map +1 -1
- package/lib/EncryptedFetcher.mjs +2 -82
- package/lib/EncryptedFetcher.mjs.map +1 -1
- package/lib/EncryptedFetcher2.mjs +105 -0
- package/lib/EncryptedFetcher2.mjs.map +1 -0
- package/lib/FormDataInput.js +3 -3
- package/lib/FormDataInput.js.map +1 -1
- package/lib/FormDataInput.mjs +2 -1
- package/lib/FormDataInput.mjs.map +1 -1
- package/lib/FormDataInput2.mjs +6 -0
- package/lib/FormDataInput2.mjs.map +1 -0
- package/lib/HttpError.js +6 -11
- package/lib/HttpError.js.map +1 -1
- package/lib/HttpError.mjs +1 -1
- package/lib/HttpError2.mjs +16 -0
- package/lib/HttpError2.mjs.map +1 -0
- package/lib/IConnection.js +3 -3
- package/lib/IConnection.js.map +1 -1
- package/lib/IConnection.mjs +2 -1
- package/lib/IConnection.mjs.map +1 -1
- package/lib/IConnection2.mjs +6 -0
- package/lib/IConnection2.mjs.map +1 -0
- package/lib/IEncryptionPassword.js +3 -3
- package/lib/IEncryptionPassword.js.map +1 -1
- package/lib/IEncryptionPassword.mjs +2 -1
- package/lib/IEncryptionPassword.mjs.map +1 -1
- package/lib/IEncryptionPassword2.mjs +6 -0
- package/lib/IEncryptionPassword2.mjs.map +1 -0
- package/lib/IFetchEvent.js +21 -3
- package/lib/IFetchEvent.js.map +1 -1
- package/lib/IFetchEvent.mjs +2 -1
- package/lib/IFetchEvent.mjs.map +1 -1
- package/lib/IFetchEvent2.mjs +6 -0
- package/lib/IFetchEvent2.mjs.map +1 -0
- package/lib/IFetchRoute.js +3 -3
- package/lib/IFetchRoute.js.map +1 -1
- package/lib/IFetchRoute.mjs +2 -1
- package/lib/IFetchRoute.mjs.map +1 -1
- package/lib/IFetchRoute2.mjs +6 -0
- package/lib/IFetchRoute2.mjs.map +1 -0
- package/lib/IPropagation.js +3 -3
- package/lib/IPropagation.js.map +1 -1
- package/lib/IPropagation.mjs +2 -1
- package/lib/IPropagation.mjs.map +1 -1
- package/lib/IPropagation2.mjs +6 -0
- package/lib/IPropagation2.mjs.map +1 -0
- package/lib/NestiaSimulator.js +8 -8
- package/lib/NestiaSimulator.js.map +1 -1
- package/lib/NestiaSimulator.mjs +2 -43
- package/lib/NestiaSimulator.mjs.map +1 -1
- package/lib/NestiaSimulator2.mjs +49 -0
- package/lib/NestiaSimulator2.mjs.map +1 -0
- package/lib/PlainFetcher.js +38 -23
- package/lib/PlainFetcher.js.map +1 -1
- package/lib/PlainFetcher.mjs +2 -42
- package/lib/PlainFetcher.mjs.map +1 -1
- package/lib/PlainFetcher2.mjs +63 -0
- package/lib/PlainFetcher2.mjs.map +1 -0
- package/lib/_virtual/AesPkcs5.mjs +4 -0
- package/lib/_virtual/AesPkcs5.mjs.map +1 -0
- package/lib/_virtual/EncryptedFetcher.mjs +4 -0
- package/lib/_virtual/EncryptedFetcher.mjs.map +1 -0
- package/lib/_virtual/FetcherBase.mjs +4 -0
- package/lib/_virtual/FetcherBase.mjs.map +1 -0
- package/lib/_virtual/FormDataInput.mjs +4 -0
- package/lib/_virtual/FormDataInput.mjs.map +1 -0
- package/lib/_virtual/HttpError.mjs +4 -0
- package/lib/_virtual/HttpError.mjs.map +1 -0
- package/lib/_virtual/IConnection.mjs +4 -0
- package/lib/_virtual/IConnection.mjs.map +1 -0
- package/lib/_virtual/IEncryptionPassword.mjs +4 -0
- package/lib/_virtual/IEncryptionPassword.mjs.map +1 -0
- package/lib/_virtual/IFetchEvent.mjs +4 -0
- package/lib/_virtual/IFetchEvent.mjs.map +1 -0
- package/lib/_virtual/IFetchRoute.mjs +4 -0
- package/lib/_virtual/IFetchRoute.mjs.map +1 -0
- package/lib/_virtual/IPropagation.mjs +4 -0
- package/lib/_virtual/IPropagation.mjs.map +1 -0
- package/lib/_virtual/NestiaSimulator.mjs +4 -0
- package/lib/_virtual/NestiaSimulator.mjs.map +1 -0
- package/lib/_virtual/PlainFetcher.mjs +4 -0
- package/lib/_virtual/PlainFetcher.mjs.map +1 -0
- package/lib/_virtual/_commonjsHelpers.mjs +35 -0
- package/lib/_virtual/_commonjsHelpers.mjs.map +1 -0
- package/lib/_virtual/_node_crypto.mjs +7 -0
- package/lib/_virtual/_node_crypto.mjs.map +1 -0
- package/lib/_virtual/index.mjs +4 -0
- package/lib/_virtual/index.mjs.map +1 -0
- package/lib/_virtual/is_binary_response_content_type.mjs +4 -0
- package/lib/_virtual/is_binary_response_content_type.mjs.map +1 -0
- package/lib/_virtual/utils.mjs +7 -0
- package/lib/_virtual/utils.mjs.map +1 -0
- package/lib/index.js +26 -21
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +1 -3
- package/lib/index.mjs.map +1 -1
- package/lib/index2.mjs +53 -0
- package/lib/index2.mjs.map +1 -0
- package/lib/internal/FetcherBase.js +50 -44
- package/lib/internal/FetcherBase.js.map +1 -1
- package/lib/internal/FetcherBase.mjs +2 -189
- package/lib/internal/FetcherBase.mjs.map +1 -1
- package/lib/internal/FetcherBase2.mjs +203 -0
- package/lib/internal/FetcherBase2.mjs.map +1 -0
- package/lib/internal/is_binary_response_content_type.js +4 -4
- package/lib/internal/is_binary_response_content_type.js.map +1 -1
- package/lib/internal/is_binary_response_content_type.mjs +2 -12
- package/lib/internal/is_binary_response_content_type.mjs.map +1 -1
- package/lib/internal/is_binary_response_content_type2.mjs +18 -0
- package/lib/internal/is_binary_response_content_type2.mjs.map +1 -0
- package/package.json +5 -7
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { __exports as PlainFetcher$1 } from './_virtual/PlainFetcher.mjs';
|
|
2
|
+
import './internal/FetcherBase2.mjs';
|
|
3
|
+
import { __exports as FetcherBase } from './_virtual/FetcherBase.mjs';
|
|
4
|
+
|
|
5
|
+
var __awaiter = (PlainFetcher$1 && PlainFetcher$1.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
6
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
7
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
8
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
9
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
10
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
11
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(PlainFetcher$1, "__esModule", { value: true });
|
|
15
|
+
var PlainFetcher_2 = PlainFetcher$1.PlainFetcher = void 0;
|
|
16
|
+
const FetcherBase_1 = FetcherBase;
|
|
17
|
+
/**
|
|
18
|
+
* Utility class for `fetch` functions used in `@nestia/sdk`.
|
|
19
|
+
*
|
|
20
|
+
* `PlainFetcher` is a utility class designed for SDK functions generated by
|
|
21
|
+
* [`@nestia/sdk`](https://nestia.io/docs/sdk/sdk), interacting with the remote
|
|
22
|
+
* HTTP sever API. In other words, this is a collection of dedicated `fetch()`
|
|
23
|
+
* functions for `@nestia/sdk`.
|
|
24
|
+
*
|
|
25
|
+
* For reference, `PlainFetcher` class does not encrypt or decrypt the body data
|
|
26
|
+
* at all. It just delivers plain data without any post processing. If you've
|
|
27
|
+
* defined a controller method through `@EncryptedRoute` or `@EncryptedBody`
|
|
28
|
+
* decorator, then {@liink EncryptedFetcher} class would be used instead.
|
|
29
|
+
*
|
|
30
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
31
|
+
*/
|
|
32
|
+
var PlainFetcher;
|
|
33
|
+
(function (PlainFetcher) {
|
|
34
|
+
function fetch(connection, route, input, stringify) {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
var _a, _b;
|
|
37
|
+
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)
|
|
38
|
+
throw new Error("Error on PlainFetcher.fetch(): PlainFetcher doesn't have encryption ability. Use EncryptedFetcher instead.");
|
|
39
|
+
return FetcherBase_1.FetcherBase.request({
|
|
40
|
+
className: "PlainFetcher",
|
|
41
|
+
encode: (input) => input,
|
|
42
|
+
decode: (input) => input,
|
|
43
|
+
})(connection, route, input, stringify);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
PlainFetcher.fetch = fetch;
|
|
47
|
+
function propagate(connection, route, input, stringify) {
|
|
48
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
var _a, _b;
|
|
50
|
+
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)
|
|
51
|
+
throw new Error("Error on PlainFetcher.propagate(): PlainFetcher doesn't have encryption ability. Use EncryptedFetcher instead.");
|
|
52
|
+
return FetcherBase_1.FetcherBase.propagate({
|
|
53
|
+
className: "PlainFetcher",
|
|
54
|
+
encode: (input) => input,
|
|
55
|
+
decode: (input) => input,
|
|
56
|
+
})(connection, route, input, stringify);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
PlainFetcher.propagate = propagate;
|
|
60
|
+
})(PlainFetcher || (PlainFetcher_2 = PlainFetcher$1.PlainFetcher = PlainFetcher = {}));
|
|
61
|
+
|
|
62
|
+
export { PlainFetcher_2 as PlainFetcher, PlainFetcher$1 as default };
|
|
63
|
+
//# sourceMappingURL=PlainFetcher2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlainFetcher2.mjs","sources":["PlainFetcher.js"],"sourcesContent":["\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PlainFetcher = void 0;\nconst FetcherBase_1 = require(\"./internal/FetcherBase\");\n/**\n * Utility class for `fetch` functions used in `@nestia/sdk`.\n *\n * `PlainFetcher` is a utility class designed for SDK functions generated by\n * [`@nestia/sdk`](https://nestia.io/docs/sdk/sdk), interacting with the remote\n * HTTP sever API. In other words, this is a collection of dedicated `fetch()`\n * functions for `@nestia/sdk`.\n *\n * For reference, `PlainFetcher` class does not encrypt or decrypt the body data\n * at all. It just delivers plain data without any post processing. If you've\n * defined a controller method through `@EncryptedRoute` or `@EncryptedBody`\n * decorator, then {@liink EncryptedFetcher} class would be used instead.\n *\n * @author Jeongho Nam - https://github.com/samchon\n */\nvar PlainFetcher;\n(function (PlainFetcher) {\n function fetch(connection, route, input, stringify) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n 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)\n throw new Error(\"Error on PlainFetcher.fetch(): PlainFetcher doesn't have encryption ability. Use EncryptedFetcher instead.\");\n return FetcherBase_1.FetcherBase.request({\n className: \"PlainFetcher\",\n encode: (input) => input,\n decode: (input) => input,\n })(connection, route, input, stringify);\n });\n }\n PlainFetcher.fetch = fetch;\n function propagate(connection, route, input, stringify) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n 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)\n throw new Error(\"Error on PlainFetcher.propagate(): PlainFetcher doesn't have encryption ability. Use EncryptedFetcher instead.\");\n return FetcherBase_1.FetcherBase.propagate({\n className: \"PlainFetcher\",\n encode: (input) => input,\n decode: (input) => input,\n })(connection, route, input, stringify);\n });\n }\n PlainFetcher.propagate = propagate;\n})(PlainFetcher || (exports.PlainFetcher = PlainFetcher = {}));\n//# sourceMappingURL=PlainFetcher.js.map"],"names":["this","PlainFetcher_1","require$$0"],"mappings":";;;;AACA,IAAI,SAAS,GAAG,CAACA,cAAI,IAAIA,cAAI,CAAC,SAAS,KAAK,UAAU,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE;AACzF,IAAI,SAAS,KAAK,CAAC,KAAK,EAAE,EAAE,OAAO,KAAK,YAAY,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,CAAC,UAAU,OAAO,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAA,CAAE,CAAC,CAAC,CAAA;AAC9G,IAAI,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,EAAE,UAAU,OAAO,EAAE,MAAM,EAAE;AAC/D,QAAQ,SAAS,SAAS,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA,CAAE,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA,CAAE,CAAA;AACjG,QAAQ,SAAS,QAAQ,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA,CAAE,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC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oB,GAAG,YAAY,GAAG,EAAE,CAAC,CAAC;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AesPkcs5.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EncryptedFetcher.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FetcherBase.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormDataInput.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HttpError.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IConnection.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IEncryptionPassword.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IFetchEvent.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IFetchRoute.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IPropagation.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NestiaSimulator.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlainFetcher.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
function getDefaultExportFromCjs (x) {
|
|
2
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
function getAugmentedNamespace(n) {
|
|
6
|
+
if (Object.prototype.hasOwnProperty.call(n, '__esModule')) return n;
|
|
7
|
+
var f = n.default;
|
|
8
|
+
if (typeof f == "function") {
|
|
9
|
+
var a = function a () {
|
|
10
|
+
var isInstance = false;
|
|
11
|
+
try {
|
|
12
|
+
isInstance = this instanceof a;
|
|
13
|
+
} catch {}
|
|
14
|
+
if (isInstance) {
|
|
15
|
+
return Reflect.construct(f, arguments, this.constructor);
|
|
16
|
+
}
|
|
17
|
+
return f.apply(this, arguments);
|
|
18
|
+
};
|
|
19
|
+
a.prototype = f.prototype;
|
|
20
|
+
} else a = {};
|
|
21
|
+
Object.defineProperty(a, '__esModule', {value: true});
|
|
22
|
+
Object.keys(n).forEach(function (k) {
|
|
23
|
+
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
24
|
+
Object.defineProperty(a, k, d.get ? d : {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return n[k];
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
return a;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { getAugmentedNamespace, getDefaultExportFromCjs };
|
|
35
|
+
//# sourceMappingURL=_commonjsHelpers.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_commonjsHelpers.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_node_crypto.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is_binary_response_content_type.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
package/lib/index.js
CHANGED
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./IConnection"), exports);
|
|
18
|
+
__exportStar(require("./IEncryptionPassword"), exports);
|
|
19
|
+
__exportStar(require("./IFetchEvent"), exports);
|
|
20
|
+
__exportStar(require("./IFetchRoute"), exports);
|
|
21
|
+
__exportStar(require("./IPropagation"), exports);
|
|
22
|
+
__exportStar(require("./FormDataInput"), exports);
|
|
23
|
+
__exportStar(require("./HttpError"), exports);
|
|
24
|
+
__exportStar(require("./NestiaSimulator"), exports);
|
|
25
|
+
__exportStar(require("./PlainFetcher"), exports);
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,wDAAsC;AACtC,gDAA8B;AAC9B,gDAA8B;AAC9B,iDAA+B;AAC/B,kDAAgC;AAEhC,8CAA4B;AAC5B,oDAAkC;AAClC,iDAA+B"}
|
package/lib/index.mjs
CHANGED
package/lib/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/lib/index2.mjs
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { getDefaultExportFromCjs } from './_virtual/_commonjsHelpers.mjs';
|
|
2
|
+
import { __exports as lib } from './_virtual/index.mjs';
|
|
3
|
+
import './IConnection2.mjs';
|
|
4
|
+
import './IEncryptionPassword2.mjs';
|
|
5
|
+
import './IFetchEvent2.mjs';
|
|
6
|
+
import './IFetchRoute2.mjs';
|
|
7
|
+
import './IPropagation2.mjs';
|
|
8
|
+
import './FormDataInput2.mjs';
|
|
9
|
+
import './HttpError2.mjs';
|
|
10
|
+
import './NestiaSimulator2.mjs';
|
|
11
|
+
import './PlainFetcher2.mjs';
|
|
12
|
+
import { __exports as IConnection } from './_virtual/IConnection.mjs';
|
|
13
|
+
import { __exports as IEncryptionPassword } from './_virtual/IEncryptionPassword.mjs';
|
|
14
|
+
import { __exports as IFetchEvent } from './_virtual/IFetchEvent.mjs';
|
|
15
|
+
import { __exports as IFetchRoute } from './_virtual/IFetchRoute.mjs';
|
|
16
|
+
import { __exports as IPropagation } from './_virtual/IPropagation.mjs';
|
|
17
|
+
import { __exports as FormDataInput } from './_virtual/FormDataInput.mjs';
|
|
18
|
+
import { __exports as HttpError } from './_virtual/HttpError.mjs';
|
|
19
|
+
import { __exports as NestiaSimulator } from './_virtual/NestiaSimulator.mjs';
|
|
20
|
+
import { __exports as PlainFetcher } from './_virtual/PlainFetcher.mjs';
|
|
21
|
+
|
|
22
|
+
(function (exports) {
|
|
23
|
+
var __createBinding = (lib && lib.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
24
|
+
if (k2 === undefined) k2 = k;
|
|
25
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
26
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
27
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
28
|
+
}
|
|
29
|
+
Object.defineProperty(o, k2, desc);
|
|
30
|
+
}) : (function(o, m, k, k2) {
|
|
31
|
+
if (k2 === undefined) k2 = k;
|
|
32
|
+
o[k2] = m[k];
|
|
33
|
+
}));
|
|
34
|
+
var __exportStar = (lib && lib.__exportStar) || function(m, exports) {
|
|
35
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
__exportStar(IConnection, exports);
|
|
39
|
+
__exportStar(IEncryptionPassword, exports);
|
|
40
|
+
__exportStar(IFetchEvent, exports);
|
|
41
|
+
__exportStar(IFetchRoute, exports);
|
|
42
|
+
__exportStar(IPropagation, exports);
|
|
43
|
+
__exportStar(FormDataInput, exports);
|
|
44
|
+
__exportStar(HttpError, exports);
|
|
45
|
+
__exportStar(NestiaSimulator, exports);
|
|
46
|
+
__exportStar(PlainFetcher, exports);
|
|
47
|
+
|
|
48
|
+
} (lib));
|
|
49
|
+
|
|
50
|
+
var index = /*@__PURE__*/getDefaultExportFromCjs(lib);
|
|
51
|
+
|
|
52
|
+
export { index as default };
|
|
53
|
+
//# sourceMappingURL=index2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index2.mjs","sources":["index.js"],"sourcesContent":["\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./IConnection\"), exports);\n__exportStar(require(\"./IEncryptionPassword\"), exports);\n__exportStar(require(\"./IFetchEvent\"), exports);\n__exportStar(require(\"./IFetchRoute\"), exports);\n__exportStar(require(\"./IPropagation\"), exports);\n__exportStar(require(\"./FormDataInput\"), exports);\n__exportStar(require(\"./HttpError\"), exports);\n__exportStar(require(\"./NestiaSimulator\"), exports);\n__exportStar(require(\"./PlainFetcher\"), exports);\n//# sourceMappingURL=index.js.map"],"names":["this","require$$0","require$$1","require$$2","require$$3","require$$4","require$$5","require$$6","require$$7","require$$8"],"mappings":";;;;;;;;;;;;;;;;;;;;;;CACA,IAAI,eAAe,GAAG,CAACA,GAAI,IAAIA,GAAI,CA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CAACC,WAAwB,EAAE,OAAO,CAAC;AAC/C,CAAA,YAAY,CAACC,mBAAgC,EAAE,OAAO,CAAC;AACvD,CAAA,YAAY,CAACC,WAAwB,EAAE,OAAO,CAAC;AAC/C,CAAA,YAAY,CAACC,WAAwB,EAAE,OAAO,CAAC;AAC/C,CAAA,YAAY,CAACC,YAAyB,EAAE,OAAO,CAAC;AAChD,CAAA,YAAY,CAACC,aAA0B,EAAE,OAAO,CAAC;AACjD,CAAA,YAAY,CAACC,SAAsB,EAAE,OAAO,CAAC;AAC7C,CAAA,YAAY,CAACC,eAA4B,EAAE,OAAO,CAAC;AACnD,CAAA,YAAY,CAACC,YAAyB,EAAE,OAAO,CAAC;AAChD;;;;;;;"}
|
|
@@ -1,29 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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 });
|
|
7
12
|
exports.FetcherBase = void 0;
|
|
13
|
+
const HttpError_1 = require("../HttpError");
|
|
14
|
+
const is_binary_response_content_type_1 = require("./is_binary_response_content_type");
|
|
15
|
+
/** @internal */
|
|
16
|
+
var FetcherBase;
|
|
8
17
|
(function (FetcherBase) {
|
|
9
|
-
FetcherBase.request = (props) =>
|
|
10
|
-
const result =
|
|
18
|
+
FetcherBase.request = (props) => (connection, route, input, stringify) => __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
const result = yield _Propagate("fetch")(props)(connection, route, input, stringify);
|
|
11
20
|
if (result.success === false)
|
|
12
|
-
throw new
|
|
21
|
+
throw new HttpError_1.HttpError(route.method, route.path, result.status, result.headers, result.data);
|
|
13
22
|
return result.data;
|
|
14
|
-
};
|
|
15
|
-
FetcherBase.propagate = (props) =>
|
|
23
|
+
});
|
|
24
|
+
FetcherBase.propagate = (props) => (connection, route, input, stringify) => __awaiter(this, void 0, void 0, function* () { return _Propagate("propagate")(props)(connection, route, input, stringify); });
|
|
16
25
|
/** @internal */
|
|
17
|
-
const _Propagate = (method) => (props) =>
|
|
26
|
+
const _Propagate = (method) => (props) => (connection, route, input, stringify) => __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
28
|
+
var _h, _j, _k, _l;
|
|
18
29
|
//----
|
|
19
30
|
// REQUEST MESSAGE
|
|
20
31
|
//----
|
|
21
32
|
// METHOD & HEADERS
|
|
22
|
-
const headers = {
|
|
23
|
-
...(connection.headers ?? {}),
|
|
24
|
-
};
|
|
33
|
+
const headers = Object.assign({}, ((_h = connection.headers) !== null && _h !== void 0 ? _h : {}));
|
|
25
34
|
if (input !== undefined) {
|
|
26
|
-
if (route.request
|
|
35
|
+
if (((_a = route.request) === null || _a === void 0 ? void 0 : _a.type) === undefined)
|
|
27
36
|
throw new Error(`Error on ${props.className}.fetch(): no content-type being configured.`);
|
|
28
37
|
else if (route.request.type !== "multipart/form-data")
|
|
29
38
|
headers["Content-Type"] = route.request.type;
|
|
@@ -31,10 +40,7 @@ exports.FetcherBase = void 0;
|
|
|
31
40
|
else if (input === undefined && headers["Content-Type"] !== undefined)
|
|
32
41
|
delete headers["Content-Type"];
|
|
33
42
|
// INIT REQUEST DATA
|
|
34
|
-
const init = {
|
|
35
|
-
...(connection.options ?? {}),
|
|
36
|
-
method: route.method,
|
|
37
|
-
headers: (() => {
|
|
43
|
+
const init = Object.assign(Object.assign({}, ((_j = connection.options) !== null && _j !== void 0 ? _j : {})), { method: route.method, headers: (() => {
|
|
38
44
|
const output = [];
|
|
39
45
|
for (const [key, value] of Object.entries(headers))
|
|
40
46
|
if (value === undefined)
|
|
@@ -45,18 +51,17 @@ exports.FetcherBase = void 0;
|
|
|
45
51
|
else
|
|
46
52
|
output.push([key, String(value)]);
|
|
47
53
|
return output;
|
|
48
|
-
})()
|
|
49
|
-
};
|
|
54
|
+
})() });
|
|
50
55
|
// CONSTRUCT BODY DATA
|
|
51
56
|
if (input !== undefined)
|
|
52
57
|
init.body = props.encode(
|
|
53
58
|
// BODY TRANSFORM
|
|
54
|
-
route.request
|
|
59
|
+
((_b = route.request) === null || _b === void 0 ? void 0 : _b.type) === "application/x-www-form-urlencoded"
|
|
55
60
|
? request_query_body(input)
|
|
56
|
-
: route.request
|
|
61
|
+
: ((_c = route.request) === null || _c === void 0 ? void 0 : _c.type) === "multipart/form-data"
|
|
57
62
|
? request_form_data_body(input)
|
|
58
|
-
: route.request
|
|
59
|
-
? (stringify
|
|
63
|
+
: ((_d = route.request) === null || _d === void 0 ? void 0 : _d.type) !== "text/plain"
|
|
64
|
+
? (stringify !== null && stringify !== void 0 ? stringify : JSON.stringify)(input)
|
|
60
65
|
: input, headers);
|
|
61
66
|
//----
|
|
62
67
|
// RESPONSE MESSAGE
|
|
@@ -80,7 +85,7 @@ exports.FetcherBase = void 0;
|
|
|
80
85
|
};
|
|
81
86
|
try {
|
|
82
87
|
// TRY FETCH
|
|
83
|
-
const response =
|
|
88
|
+
const response = yield ((_k = connection.fetch) !== null && _k !== void 0 ? _k : fetch)(url.href, init);
|
|
84
89
|
event.respond_at = new Date();
|
|
85
90
|
event.status = response.status;
|
|
86
91
|
// CONSTRUCT RESULT DATA
|
|
@@ -94,7 +99,7 @@ exports.FetcherBase = void 0;
|
|
|
94
99
|
};
|
|
95
100
|
if (result.success === false) {
|
|
96
101
|
// WHEN FAILED
|
|
97
|
-
result.data =
|
|
102
|
+
result.data = yield response.text();
|
|
98
103
|
const type = response.headers.get("content-type");
|
|
99
104
|
if (method !== "fetch" &&
|
|
100
105
|
type &&
|
|
@@ -102,24 +107,24 @@ exports.FetcherBase = void 0;
|
|
|
102
107
|
try {
|
|
103
108
|
result.data = JSON.parse(result.data);
|
|
104
109
|
}
|
|
105
|
-
catch { }
|
|
110
|
+
catch (_m) { }
|
|
106
111
|
}
|
|
107
112
|
else {
|
|
108
113
|
// WHEN SUCCESS
|
|
109
114
|
if (route.method === "HEAD")
|
|
110
115
|
result.data = undefined;
|
|
111
|
-
else if (route.response
|
|
112
|
-
const text =
|
|
116
|
+
else if (((_e = route.response) === null || _e === void 0 ? void 0 : _e.type) === "application/json") {
|
|
117
|
+
const text = yield response.text();
|
|
113
118
|
result.data = text.length ? JSON.parse(text) : undefined;
|
|
114
119
|
}
|
|
115
|
-
else if (route.response
|
|
116
|
-
const query = new URLSearchParams(
|
|
120
|
+
else if (((_f = route.response) === null || _f === void 0 ? void 0 : _f.type) === "application/x-www-form-urlencoded") {
|
|
121
|
+
const query = new URLSearchParams(yield response.text());
|
|
117
122
|
result.data = route.parseQuery ? route.parseQuery(query) : query;
|
|
118
123
|
}
|
|
119
|
-
else if (
|
|
120
|
-
result.data = response.body
|
|
124
|
+
else if ((0, is_binary_response_content_type_1.is_binary_response_content_type)((_g = route.response) === null || _g === void 0 ? void 0 : _g.type))
|
|
125
|
+
result.data = (_l = response.body) !== null && _l !== void 0 ? _l : new ReadableStream();
|
|
121
126
|
else
|
|
122
|
-
result.data = props.decode(
|
|
127
|
+
result.data = props.decode(yield response.text(), result.headers);
|
|
123
128
|
}
|
|
124
129
|
event.output = result.data;
|
|
125
130
|
return result;
|
|
@@ -131,12 +136,12 @@ exports.FetcherBase = void 0;
|
|
|
131
136
|
event.completed_at = new Date();
|
|
132
137
|
if (connection.logger)
|
|
133
138
|
try {
|
|
134
|
-
|
|
139
|
+
yield connection.logger(event);
|
|
135
140
|
}
|
|
136
|
-
catch { }
|
|
141
|
+
catch (_o) { }
|
|
137
142
|
}
|
|
138
|
-
};
|
|
139
|
-
})(
|
|
143
|
+
});
|
|
144
|
+
})(FetcherBase || (exports.FetcherBase = FetcherBase = {}));
|
|
140
145
|
/** @internal */
|
|
141
146
|
const request_query_body = (input) => {
|
|
142
147
|
const q = new URLSearchParams();
|
|
@@ -173,13 +178,14 @@ const response_headers_to_object = (headers) => {
|
|
|
173
178
|
const cookieHeaders = typeof headers.getSetCookie === "function"
|
|
174
179
|
? headers.getSetCookie()
|
|
175
180
|
: undefined;
|
|
176
|
-
if (cookieHeaders
|
|
181
|
+
if (cookieHeaders === null || cookieHeaders === void 0 ? void 0 : cookieHeaders.length)
|
|
177
182
|
output["set-cookie"] = cookieHeaders;
|
|
178
183
|
headers.forEach((value, key) => {
|
|
184
|
+
var _a;
|
|
179
185
|
if (key.toLowerCase() === "set-cookie") {
|
|
180
|
-
if (cookieHeaders
|
|
186
|
+
if (cookieHeaders === null || cookieHeaders === void 0 ? void 0 : cookieHeaders.length)
|
|
181
187
|
return;
|
|
182
|
-
output[key]
|
|
188
|
+
(_a = output[key]) !== null && _a !== void 0 ? _a : (output[key] = []);
|
|
183
189
|
output[key].push(value);
|
|
184
190
|
}
|
|
185
191
|
else
|
|
@@ -187,4 +193,4 @@ const response_headers_to_object = (headers) => {
|
|
|
187
193
|
});
|
|
188
194
|
return output;
|
|
189
195
|
};
|
|
190
|
-
//# sourceMappingURL=FetcherBase.js.map
|
|
196
|
+
//# sourceMappingURL=FetcherBase.js.map
|