@venizia/ardor-kernel 0.5.0-0 → 0.5.0-10
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/README.md +3 -3
- package/dist/base/applications/abstract.d.ts +5 -3
- package/dist/base/applications/abstract.js +44 -35
- package/dist/base/services/auth.js +3 -3
- package/dist/base/services/network-request.d.ts +6 -8
- package/dist/base/services/network-request.js +58 -60
- package/dist/common/constants.d.ts +9 -78
- package/dist/common/constants.js +9 -123
- package/dist/common/types.d.ts +2 -0
- package/dist/helpers/index.d.ts +0 -1
- package/dist/helpers/index.js +0 -1
- package/dist/helpers/networks/auth-recovery.d.ts +2 -3
- package/dist/helpers/networks/auth-recovery.js +6 -4
- package/dist/helpers/networks/index.d.ts +0 -3
- package/dist/helpers/networks/index.js +0 -3
- package/dist/utilities/file.d.ts +16 -0
- package/dist/utilities/file.js +30 -0
- package/dist/utilities/index.d.ts +3 -0
- package/dist/utilities/index.js +3 -0
- package/dist/{helpers/networks → utilities}/network-response-reader.d.ts +3 -11
- package/dist/{helpers/networks → utilities}/network-response-reader.js +18 -67
- package/dist/{helpers/networks → utilities}/request-body-encoder.d.ts +1 -1
- package/dist/{helpers/networks → utilities}/request-body-encoder.js +2 -2
- package/dist/utilities/value.d.ts +0 -8
- package/dist/utilities/value.js +0 -10
- package/package.json +14 -14
- package/dist/helpers/networks/headers.d.ts +0 -16
- package/dist/helpers/networks/headers.js +0 -32
- /package/dist/{helpers → utilities}/auth-token-store.d.ts +0 -0
- /package/dist/{helpers → utilities}/auth-token-store.js +0 -0
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/** The one reading of `HeadersInit` the network layer uses. */
|
|
2
|
-
export class NetworkHeaders {
|
|
3
|
-
/**
|
|
4
|
-
* `HeadersInit` (or a record with number values) as a plain record, keys lowercased: header names
|
|
5
|
-
* are case-insensitive but object keys are not, and two spellings of one name would reach the wire
|
|
6
|
-
* joined as `"1, 0"`.
|
|
7
|
-
*/
|
|
8
|
-
static toRecord(opts) {
|
|
9
|
-
const { headers } = opts;
|
|
10
|
-
if (!headers) {
|
|
11
|
-
return {};
|
|
12
|
-
}
|
|
13
|
-
const entries = (() => {
|
|
14
|
-
if (headers instanceof Headers) {
|
|
15
|
-
return [...headers.entries()];
|
|
16
|
-
}
|
|
17
|
-
return Array.isArray(headers) ? headers : Object.entries(headers);
|
|
18
|
-
})();
|
|
19
|
-
const rs = {};
|
|
20
|
-
for (const [key, value] of entries) {
|
|
21
|
-
rs[key.toLowerCase()] = String(value);
|
|
22
|
-
}
|
|
23
|
-
return rs;
|
|
24
|
-
}
|
|
25
|
-
/** Merge header sources so a later source REPLACES an earlier one, whatever case either used. */
|
|
26
|
-
static merge(opts) {
|
|
27
|
-
return opts.sources.reduce((acc, headers) => {
|
|
28
|
-
return Object.assign(acc, NetworkHeaders.toRecord({ headers }));
|
|
29
|
-
}, {});
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=headers.js.map
|
|
File without changes
|
|
File without changes
|