@nmshd/transport 2.0.2 → 2.0.4
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 +2 -0
- package/dist/buildInformation.js +5 -5
- package/dist/core/backbone/RESTClient.d.ts +0 -8
- package/dist/core/backbone/RESTClient.js +13 -19
- package/dist/core/backbone/RESTClient.js.map +1 -1
- package/dist/modules/sync/SyncController.js +5 -2
- package/dist/modules/sync/SyncController.js.map +1 -1
- package/lib-web/nmshd.transport.js +159 -91
- package/lib-web/nmshd.transport.js.map +1 -1
- package/lib-web/nmshd.transport.min.js +1 -1
- package/lib-web/nmshd.transport.min.js.map +1 -1
- package/package.json +18 -18
- package/ui5.yaml +1 -1
|
@@ -15,11 +15,11 @@ exports.buildInformation = void 0;
|
|
|
15
15
|
const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
|
|
16
16
|
const crypto_1 = __webpack_require__(/*! @nmshd/crypto */ "@nmshd/crypto");
|
|
17
17
|
exports.buildInformation = {
|
|
18
|
-
version: "2.0.
|
|
19
|
-
build: "
|
|
20
|
-
date: "2023-
|
|
21
|
-
commit: "
|
|
22
|
-
dependencies: {"@js-soft/docdb-access-abstractions":"1.0.1","@js-soft/logging-abstractions":"1.0.0","@js-soft/simple-logger":"1.0.2","@js-soft/ts-utils":"2.3.
|
|
18
|
+
version: "2.0.4",
|
|
19
|
+
build: "54",
|
|
20
|
+
date: "2023-03-10T13:21:02+00:00",
|
|
21
|
+
commit: "c5397aceb90d4b141e9232fdd0b5c2baeaf69606",
|
|
22
|
+
dependencies: {"@js-soft/docdb-access-abstractions":"1.0.1","@js-soft/logging-abstractions":"1.0.0","@js-soft/simple-logger":"1.0.2","@js-soft/ts-utils":"2.3.1","axios":"^1.3.4","deep-equal":"^2.2.0","fast-json-patch":"^3.1.1","form-data":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","luxon":"^3.3.0","qs":"^6.11.1","reflect-metadata":"^0.1.13","ts-simple-nameof":"^1.3.1","uuid":"^9.0.0"},
|
|
23
23
|
libraries: {
|
|
24
24
|
crypto: crypto_1.buildInformation,
|
|
25
25
|
serval: ts_serval_1.buildInformation
|
|
@@ -1475,8 +1475,6 @@ exports.RESTClient = exports.RESTClientLogDirective = exports.RestPaginationData
|
|
|
1475
1475
|
const crypto_1 = __webpack_require__(/*! @nmshd/crypto */ "@nmshd/crypto");
|
|
1476
1476
|
const axios_1 = __importDefault(__webpack_require__(/*! axios */ "./node_modules/axios/dist/browser/axios.cjs"));
|
|
1477
1477
|
const form_data_1 = __importDefault(__webpack_require__(/*! form-data */ "./node_modules/form-data/lib/browser.js"));
|
|
1478
|
-
const http_1 = __webpack_require__(/*! http */ "@nmshd/crypto");
|
|
1479
|
-
const https_1 = __webpack_require__(/*! https */ "@nmshd/crypto");
|
|
1480
1478
|
const lodash_1 = __importDefault(__webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js"));
|
|
1481
1479
|
const TransportLoggerFactory_1 = __webpack_require__(/*! ../TransportLoggerFactory */ "./dist/core/TransportLoggerFactory.js");
|
|
1482
1480
|
const types_1 = __webpack_require__(/*! ../types */ "./dist/core/types/index.js");
|
|
@@ -1511,25 +1509,12 @@ class RESTClient {
|
|
|
1511
1509
|
return (this._logDirective === RESTClientLogDirective.LogResponse ||
|
|
1512
1510
|
this._logDirective === RESTClientLogDirective.LogAll);
|
|
1513
1511
|
}
|
|
1514
|
-
createHTTPAgent() {
|
|
1515
|
-
if (this._httpAgent) {
|
|
1516
|
-
return this._httpAgent;
|
|
1517
|
-
}
|
|
1518
|
-
this._httpAgent = new http_1.Agent(this.config.httpAgent);
|
|
1519
|
-
return this._httpAgent;
|
|
1520
|
-
}
|
|
1521
|
-
createHTTPSAgent() {
|
|
1522
|
-
if (this._httpsAgent) {
|
|
1523
|
-
return this._httpsAgent;
|
|
1524
|
-
}
|
|
1525
|
-
this._httpsAgent = new https_1.Agent(this.config.httpsAgent);
|
|
1526
|
-
return this._httpsAgent;
|
|
1527
|
-
}
|
|
1528
1512
|
async generateRequestId() {
|
|
1529
1513
|
const id = await types_1.CoreId.generate("HTTP");
|
|
1530
1514
|
return id.toString();
|
|
1531
1515
|
}
|
|
1532
1516
|
constructor(config, requestConfig = {}) {
|
|
1517
|
+
var _a, _b;
|
|
1533
1518
|
this.config = config;
|
|
1534
1519
|
this.requestConfig = requestConfig;
|
|
1535
1520
|
this._logDirective = RESTClientLogDirective.LogAll;
|
|
@@ -1545,9 +1530,18 @@ class RESTClient {
|
|
|
1545
1530
|
if (this.config.platformAdditionalHeaders) {
|
|
1546
1531
|
defaults.headers = lodash_1.default.defaultsDeep({}, defaults.headers, this.config.platformAdditionalHeaders);
|
|
1547
1532
|
}
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1533
|
+
try {
|
|
1534
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
1535
|
+
const agent = (_a = __webpack_require__(/*! http */ "@nmshd/crypto")) === null || _a === void 0 ? void 0 : _a.Agent;
|
|
1536
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
1537
|
+
const httpsAgent = (_b = __webpack_require__(/*! https */ "@nmshd/crypto")) === null || _b === void 0 ? void 0 : _b.Agent;
|
|
1538
|
+
if (typeof agent !== "undefined" && typeof httpsAgent !== "undefined") {
|
|
1539
|
+
defaults.httpAgent = new agent(this.config.httpAgent);
|
|
1540
|
+
defaults.httpsAgent = new httpsAgent(this.config.httpsAgent);
|
|
1541
|
+
}
|
|
1542
|
+
}
|
|
1543
|
+
catch (e) {
|
|
1544
|
+
// ignore
|
|
1551
1545
|
}
|
|
1552
1546
|
this.requestConfig = lodash_1.default.defaultsDeep(this.requestConfig, defaults);
|
|
1553
1547
|
this._logger = TransportLoggerFactory_1.TransportLoggerFactory.getLogger(RESTClient);
|
|
@@ -10696,7 +10690,7 @@ class SyncController extends core_1.TransportController {
|
|
|
10696
10690
|
const identityDatawalletVersion = await this.getIdentityDatawalletVersion();
|
|
10697
10691
|
if (this.config.supportedDatawalletVersion < identityDatawalletVersion) {
|
|
10698
10692
|
// This means that the datawallet of the identity was upgraded by another device with a higher version.
|
|
10699
|
-
// It is
|
|
10693
|
+
// It is necessary to update the current device.
|
|
10700
10694
|
throw core_1.CoreErrors.datawallet.insufficientSupportedDatawalletVersion(this.config.supportedDatawalletVersion, identityDatawalletVersion);
|
|
10701
10695
|
}
|
|
10702
10696
|
this.log.trace("Synchronization of Datawallet events started...");
|
|
@@ -10899,10 +10893,13 @@ class SyncController extends core_1.TransportController {
|
|
|
10899
10893
|
throw new core_1.TransportError("There is no active sync run to finalize");
|
|
10900
10894
|
}
|
|
10901
10895
|
const { backboneModifications, localModificationIds } = await this.prepareLocalDatawalletModificationsForPush();
|
|
10902
|
-
await this.client.finalizeDatawalletVersionUpgrade(this.currentSyncRun.id.toString(), {
|
|
10896
|
+
const response = await this.client.finalizeDatawalletVersionUpgrade(this.currentSyncRun.id.toString(), {
|
|
10903
10897
|
newDatawalletVersion,
|
|
10904
10898
|
datawalletModifications: backboneModifications
|
|
10905
10899
|
});
|
|
10900
|
+
if (response.isError) {
|
|
10901
|
+
throw response.error;
|
|
10902
|
+
}
|
|
10906
10903
|
await this.deleteUnpushedDatawalletModifications(localModificationIds);
|
|
10907
10904
|
const oldDatawalletModificationIndex = await this.getLocalDatawalletModificationIndex();
|
|
10908
10905
|
const newDatawalletModificationIndex = (oldDatawalletModificationIndex || -1) + backboneModifications.length;
|
|
@@ -33430,8 +33427,12 @@ class PolyNumberFormatter {
|
|
|
33430
33427
|
class PolyDateFormatter {
|
|
33431
33428
|
constructor(dt, intl, opts) {
|
|
33432
33429
|
this.opts = opts;
|
|
33430
|
+
this.originalZone = undefined;
|
|
33433
33431
|
let z = undefined;
|
|
33434
|
-
if (
|
|
33432
|
+
if (this.opts.timeZone) {
|
|
33433
|
+
// Don't apply any workarounds if a timeZone is explicitly provided in opts
|
|
33434
|
+
this.dt = dt;
|
|
33435
|
+
} else if (dt.zone.type === "fixed") {
|
|
33435
33436
|
// UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like.
|
|
33436
33437
|
// That is why fixed-offset TZ is set to that unless it is:
|
|
33437
33438
|
// 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT.
|
|
@@ -33444,25 +33445,27 @@ class PolyDateFormatter {
|
|
|
33444
33445
|
z = offsetZ;
|
|
33445
33446
|
this.dt = dt;
|
|
33446
33447
|
} else {
|
|
33447
|
-
// Not all fixed-offset zones like Etc/+4:30 are present in tzdata
|
|
33448
|
-
//
|
|
33449
|
-
// 1. The format options tell us to show the zone. We can't do that, so the best
|
|
33450
|
-
// we can do is format the date in UTC.
|
|
33451
|
-
// 2. The format options don't tell us to show the zone. Then we can adjust them
|
|
33452
|
-
// the time and tell the formatter to show it to us in UTC, so that the time is right
|
|
33453
|
-
// and the bad zone doesn't show up.
|
|
33448
|
+
// Not all fixed-offset zones like Etc/+4:30 are present in tzdata so
|
|
33449
|
+
// we manually apply the offset and substitute the zone as needed.
|
|
33454
33450
|
z = "UTC";
|
|
33455
|
-
|
|
33456
|
-
|
|
33457
|
-
}
|
|
33458
|
-
|
|
33459
|
-
}
|
|
33451
|
+
this.dt = dt.offset === 0 ? dt : dt.setZone("UTC").plus({
|
|
33452
|
+
minutes: dt.offset
|
|
33453
|
+
});
|
|
33454
|
+
this.originalZone = dt.zone;
|
|
33460
33455
|
}
|
|
33461
33456
|
} else if (dt.zone.type === "system") {
|
|
33462
33457
|
this.dt = dt;
|
|
33463
|
-
} else {
|
|
33458
|
+
} else if (dt.zone.type === "iana") {
|
|
33464
33459
|
this.dt = dt;
|
|
33465
33460
|
z = dt.zone.name;
|
|
33461
|
+
} else {
|
|
33462
|
+
// Custom zones can have any offset / offsetName so we just manually
|
|
33463
|
+
// apply the offset and substitute the zone as needed.
|
|
33464
|
+
z = "UTC";
|
|
33465
|
+
this.dt = dt.setZone("UTC").plus({
|
|
33466
|
+
minutes: dt.offset
|
|
33467
|
+
});
|
|
33468
|
+
this.originalZone = dt.zone;
|
|
33466
33469
|
}
|
|
33467
33470
|
const intlOpts = {
|
|
33468
33471
|
...this.opts
|
|
@@ -33471,10 +33474,34 @@ class PolyDateFormatter {
|
|
|
33471
33474
|
this.dtf = getCachedDTF(intl, intlOpts);
|
|
33472
33475
|
}
|
|
33473
33476
|
format() {
|
|
33477
|
+
if (this.originalZone) {
|
|
33478
|
+
// If we have to substitute in the actual zone name, we have to use
|
|
33479
|
+
// formatToParts so that the timezone can be replaced.
|
|
33480
|
+
return this.formatToParts().map(({
|
|
33481
|
+
value
|
|
33482
|
+
}) => value).join("");
|
|
33483
|
+
}
|
|
33474
33484
|
return this.dtf.format(this.dt.toJSDate());
|
|
33475
33485
|
}
|
|
33476
33486
|
formatToParts() {
|
|
33477
|
-
|
|
33487
|
+
const parts = this.dtf.formatToParts(this.dt.toJSDate());
|
|
33488
|
+
if (this.originalZone) {
|
|
33489
|
+
return parts.map(part => {
|
|
33490
|
+
if (part.type === "timeZoneName") {
|
|
33491
|
+
const offsetName = this.originalZone.offsetName(this.dt.ts, {
|
|
33492
|
+
locale: this.dt.locale,
|
|
33493
|
+
format: this.opts.timeZoneName
|
|
33494
|
+
});
|
|
33495
|
+
return {
|
|
33496
|
+
...part,
|
|
33497
|
+
value: offsetName
|
|
33498
|
+
};
|
|
33499
|
+
} else {
|
|
33500
|
+
return part;
|
|
33501
|
+
}
|
|
33502
|
+
});
|
|
33503
|
+
}
|
|
33504
|
+
return parts;
|
|
33478
33505
|
}
|
|
33479
33506
|
resolvedOptions() {
|
|
33480
33507
|
return this.dtf.resolvedOptions();
|
|
@@ -34133,7 +34160,10 @@ function objToLocalTS(obj) {
|
|
|
34133
34160
|
// for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that
|
|
34134
34161
|
if (obj.year < 100 && obj.year >= 0) {
|
|
34135
34162
|
d = new Date(d);
|
|
34136
|
-
|
|
34163
|
+
// set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not
|
|
34164
|
+
// so if obj.year is in 99, but obj.day makes it roll over into year 100,
|
|
34165
|
+
// the calculations done by Date.UTC are using year 2000 - which is incorrect
|
|
34166
|
+
d.setUTCFullYear(obj.year, obj.month - 1, obj.day);
|
|
34137
34167
|
}
|
|
34138
34168
|
return +d;
|
|
34139
34169
|
}
|
|
@@ -34365,6 +34395,9 @@ class Formatter {
|
|
|
34365
34395
|
return new Formatter(locale, opts);
|
|
34366
34396
|
}
|
|
34367
34397
|
static parseFormat(fmt) {
|
|
34398
|
+
// white-space is always considered a literal in user-provided formats
|
|
34399
|
+
// the " " token has a special meaning (see unitForToken)
|
|
34400
|
+
|
|
34368
34401
|
let current = null,
|
|
34369
34402
|
currentFull = "",
|
|
34370
34403
|
bracketed = false;
|
|
@@ -34374,7 +34407,7 @@ class Formatter {
|
|
|
34374
34407
|
if (c === "'") {
|
|
34375
34408
|
if (currentFull.length > 0) {
|
|
34376
34409
|
splits.push({
|
|
34377
|
-
literal: bracketed,
|
|
34410
|
+
literal: bracketed || /^\s+$/.test(currentFull),
|
|
34378
34411
|
val: currentFull
|
|
34379
34412
|
});
|
|
34380
34413
|
}
|
|
@@ -34388,7 +34421,7 @@ class Formatter {
|
|
|
34388
34421
|
} else {
|
|
34389
34422
|
if (currentFull.length > 0) {
|
|
34390
34423
|
splits.push({
|
|
34391
|
-
literal:
|
|
34424
|
+
literal: /^\s+$/.test(currentFull),
|
|
34392
34425
|
val: currentFull
|
|
34393
34426
|
});
|
|
34394
34427
|
}
|
|
@@ -34398,7 +34431,7 @@ class Formatter {
|
|
|
34398
34431
|
}
|
|
34399
34432
|
if (currentFull.length > 0) {
|
|
34400
34433
|
splits.push({
|
|
34401
|
-
literal: bracketed,
|
|
34434
|
+
literal: bracketed || /^\s+$/.test(currentFull),
|
|
34402
34435
|
val: currentFull
|
|
34403
34436
|
});
|
|
34404
34437
|
}
|
|
@@ -36126,7 +36159,7 @@ class Interval {
|
|
|
36126
36159
|
if (!this.isValid) return NaN;
|
|
36127
36160
|
const start = this.start.startOf(unit),
|
|
36128
36161
|
end = this.end.startOf(unit);
|
|
36129
|
-
return Math.floor(end.diff(start, unit).get(unit)) +
|
|
36162
|
+
return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf());
|
|
36130
36163
|
}
|
|
36131
36164
|
|
|
36132
36165
|
/**
|
|
@@ -36992,6 +37025,10 @@ function unitForToken(token, loc) {
|
|
|
36992
37025
|
// because we don't have any way to figure out what they are
|
|
36993
37026
|
case "z":
|
|
36994
37027
|
return simple(/[a-z_+-/]{1,256}?/i);
|
|
37028
|
+
// this special-case "token" represents a place where a macro-token expanded into a white-space literal
|
|
37029
|
+
// in this case we accept any non-newline white-space
|
|
37030
|
+
case " ":
|
|
37031
|
+
return simple(/[^\S\n\r]/);
|
|
36995
37032
|
default:
|
|
36996
37033
|
return literal(t);
|
|
36997
37034
|
}
|
|
@@ -37046,9 +37083,10 @@ function tokenForPart(part, formatOpts) {
|
|
|
37046
37083
|
value
|
|
37047
37084
|
} = part;
|
|
37048
37085
|
if (type === "literal") {
|
|
37086
|
+
const isSpace = /^\s+$/.test(value);
|
|
37049
37087
|
return {
|
|
37050
|
-
literal:
|
|
37051
|
-
val: value
|
|
37088
|
+
literal: !isSpace,
|
|
37089
|
+
val: isSpace ? " " : value
|
|
37052
37090
|
};
|
|
37053
37091
|
}
|
|
37054
37092
|
const style = formatOpts[type];
|
|
@@ -37523,7 +37561,7 @@ function parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOff
|
|
|
37523
37561
|
setZone,
|
|
37524
37562
|
zone
|
|
37525
37563
|
} = opts;
|
|
37526
|
-
if (parsed && Object.keys(parsed).length !== 0) {
|
|
37564
|
+
if (parsed && Object.keys(parsed).length !== 0 || parsedZone) {
|
|
37527
37565
|
const interpretationZone = parsedZone || zone,
|
|
37528
37566
|
inst = DateTime.fromObject(parsed, {
|
|
37529
37567
|
...opts,
|
|
@@ -39570,7 +39608,7 @@ function friendlyDateTime(dateTimeish) {
|
|
|
39570
39608
|
}
|
|
39571
39609
|
}
|
|
39572
39610
|
|
|
39573
|
-
const VERSION = "3.
|
|
39611
|
+
const VERSION = "3.3.0";
|
|
39574
39612
|
|
|
39575
39613
|
exports.DateTime = DateTime;
|
|
39576
39614
|
exports.Duration = Duration;
|
|
@@ -40468,7 +40506,6 @@ var arrayPrefixGenerators = {
|
|
|
40468
40506
|
};
|
|
40469
40507
|
|
|
40470
40508
|
var isArray = Array.isArray;
|
|
40471
|
-
var split = String.prototype.split;
|
|
40472
40509
|
var push = Array.prototype.push;
|
|
40473
40510
|
var pushToArray = function (arr, valueOrArray) {
|
|
40474
40511
|
push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
|
|
@@ -40570,14 +40607,6 @@ var stringify = function stringify(
|
|
|
40570
40607
|
if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
|
|
40571
40608
|
if (encoder) {
|
|
40572
40609
|
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);
|
|
40573
|
-
if (generateArrayPrefix === 'comma' && encodeValuesOnly) {
|
|
40574
|
-
var valuesArray = split.call(String(obj), ',');
|
|
40575
|
-
var valuesJoined = '';
|
|
40576
|
-
for (var i = 0; i < valuesArray.length; ++i) {
|
|
40577
|
-
valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults.encoder, charset, 'value', format));
|
|
40578
|
-
}
|
|
40579
|
-
return [formatter(keyValue) + (commaRoundTrip && isArray(obj) && valuesArray.length === 1 ? '[]' : '') + '=' + valuesJoined];
|
|
40580
|
-
}
|
|
40581
40610
|
return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];
|
|
40582
40611
|
}
|
|
40583
40612
|
return [formatter(prefix) + '=' + formatter(String(obj))];
|
|
@@ -40592,6 +40621,9 @@ var stringify = function stringify(
|
|
|
40592
40621
|
var objKeys;
|
|
40593
40622
|
if (generateArrayPrefix === 'comma' && isArray(obj)) {
|
|
40594
40623
|
// we need to join elements in
|
|
40624
|
+
if (encodeValuesOnly && encoder) {
|
|
40625
|
+
obj = utils.maybeMap(obj, encoder);
|
|
40626
|
+
}
|
|
40595
40627
|
objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
|
|
40596
40628
|
} else if (isArray(filter)) {
|
|
40597
40629
|
objKeys = filter;
|
|
@@ -40624,7 +40656,7 @@ var stringify = function stringify(
|
|
|
40624
40656
|
commaRoundTrip,
|
|
40625
40657
|
strictNullHandling,
|
|
40626
40658
|
skipNulls,
|
|
40627
|
-
encoder,
|
|
40659
|
+
generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder,
|
|
40628
40660
|
filter,
|
|
40629
40661
|
sort,
|
|
40630
40662
|
allowDots,
|
|
@@ -45150,7 +45182,7 @@ module.exports = TSServal;
|
|
|
45150
45182
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
45151
45183
|
|
|
45152
45184
|
"use strict";
|
|
45153
|
-
// Axios v1.
|
|
45185
|
+
// Axios v1.3.4 Copyright (c) 2023 Matt Zabriskie and contributors
|
|
45154
45186
|
|
|
45155
45187
|
|
|
45156
45188
|
function bind(fn, thisArg) {
|
|
@@ -45669,7 +45701,7 @@ const matchAll = (regExp, str) => {
|
|
|
45669
45701
|
const isHTMLForm = kindOfTest('HTMLFormElement');
|
|
45670
45702
|
|
|
45671
45703
|
const toCamelCase = str => {
|
|
45672
|
-
return str.toLowerCase().replace(/[_
|
|
45704
|
+
return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,
|
|
45673
45705
|
function replacer(m, p1, p2) {
|
|
45674
45706
|
return p1.toUpperCase() + p2;
|
|
45675
45707
|
}
|
|
@@ -45753,6 +45785,37 @@ const toFiniteNumber = (value, defaultValue) => {
|
|
|
45753
45785
|
return Number.isFinite(value) ? value : defaultValue;
|
|
45754
45786
|
};
|
|
45755
45787
|
|
|
45788
|
+
const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
|
|
45789
|
+
|
|
45790
|
+
const DIGIT = '0123456789';
|
|
45791
|
+
|
|
45792
|
+
const ALPHABET = {
|
|
45793
|
+
DIGIT,
|
|
45794
|
+
ALPHA,
|
|
45795
|
+
ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
|
|
45796
|
+
};
|
|
45797
|
+
|
|
45798
|
+
const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
|
|
45799
|
+
let str = '';
|
|
45800
|
+
const {length} = alphabet;
|
|
45801
|
+
while (size--) {
|
|
45802
|
+
str += alphabet[Math.random() * length|0];
|
|
45803
|
+
}
|
|
45804
|
+
|
|
45805
|
+
return str;
|
|
45806
|
+
};
|
|
45807
|
+
|
|
45808
|
+
/**
|
|
45809
|
+
* If the thing is a FormData object, return true, otherwise return false.
|
|
45810
|
+
*
|
|
45811
|
+
* @param {unknown} thing - The thing to check.
|
|
45812
|
+
*
|
|
45813
|
+
* @returns {boolean}
|
|
45814
|
+
*/
|
|
45815
|
+
function isSpecCompliantForm(thing) {
|
|
45816
|
+
return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
|
|
45817
|
+
}
|
|
45818
|
+
|
|
45756
45819
|
const toJSONObject = (obj) => {
|
|
45757
45820
|
const stack = new Array(10);
|
|
45758
45821
|
|
|
@@ -45830,6 +45893,9 @@ var utils = {
|
|
|
45830
45893
|
findKey,
|
|
45831
45894
|
global: _global,
|
|
45832
45895
|
isContextDefined,
|
|
45896
|
+
ALPHABET,
|
|
45897
|
+
generateString,
|
|
45898
|
+
isSpecCompliantForm,
|
|
45833
45899
|
toJSONObject
|
|
45834
45900
|
};
|
|
45835
45901
|
|
|
@@ -45928,10 +45994,8 @@ AxiosError.from = (error, code, config, request, response, customProps) => {
|
|
|
45928
45994
|
return axiosError;
|
|
45929
45995
|
};
|
|
45930
45996
|
|
|
45931
|
-
|
|
45932
|
-
var
|
|
45933
|
-
|
|
45934
|
-
var FormData$2 = browser;
|
|
45997
|
+
// eslint-disable-next-line strict
|
|
45998
|
+
var httpAdapter = null;
|
|
45935
45999
|
|
|
45936
46000
|
/**
|
|
45937
46001
|
* Determines if the given thing is a array or js object.
|
|
@@ -45988,17 +46052,6 @@ const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
|
|
|
45988
46052
|
return /^is[A-Z]/.test(prop);
|
|
45989
46053
|
});
|
|
45990
46054
|
|
|
45991
|
-
/**
|
|
45992
|
-
* If the thing is a FormData object, return true, otherwise return false.
|
|
45993
|
-
*
|
|
45994
|
-
* @param {unknown} thing - The thing to check.
|
|
45995
|
-
*
|
|
45996
|
-
* @returns {boolean}
|
|
45997
|
-
*/
|
|
45998
|
-
function isSpecCompliant(thing) {
|
|
45999
|
-
return thing && utils.isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator];
|
|
46000
|
-
}
|
|
46001
|
-
|
|
46002
46055
|
/**
|
|
46003
46056
|
* Convert a data object to FormData
|
|
46004
46057
|
*
|
|
@@ -46028,7 +46081,7 @@ function toFormData(obj, formData, options) {
|
|
|
46028
46081
|
}
|
|
46029
46082
|
|
|
46030
46083
|
// eslint-disable-next-line no-param-reassign
|
|
46031
|
-
formData = formData || new (FormData
|
|
46084
|
+
formData = formData || new (FormData)();
|
|
46032
46085
|
|
|
46033
46086
|
// eslint-disable-next-line no-param-reassign
|
|
46034
46087
|
options = utils.toFlatObject(options, {
|
|
@@ -46046,7 +46099,7 @@ function toFormData(obj, formData, options) {
|
|
|
46046
46099
|
const dots = options.dots;
|
|
46047
46100
|
const indexes = options.indexes;
|
|
46048
46101
|
const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
|
|
46049
|
-
const useBlob = _Blob &&
|
|
46102
|
+
const useBlob = _Blob && utils.isSpecCompliantForm(formData);
|
|
46050
46103
|
|
|
46051
46104
|
if (!utils.isFunction(visitor)) {
|
|
46052
46105
|
throw new TypeError('visitor must be a function');
|
|
@@ -46091,7 +46144,7 @@ function toFormData(obj, formData, options) {
|
|
|
46091
46144
|
value = JSON.stringify(value);
|
|
46092
46145
|
} else if (
|
|
46093
46146
|
(utils.isArray(value) && isFlatArray(value)) ||
|
|
46094
|
-
(utils.isFileList(value) || utils.endsWith(key, '[]') && (arr = utils.toArray(value))
|
|
46147
|
+
((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))
|
|
46095
46148
|
)) {
|
|
46096
46149
|
// eslint-disable-next-line no-param-reassign
|
|
46097
46150
|
key = removeBrackets(key);
|
|
@@ -46343,7 +46396,9 @@ var transitionalDefaults = {
|
|
|
46343
46396
|
|
|
46344
46397
|
var URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
|
|
46345
46398
|
|
|
46346
|
-
var FormData$1 = FormData;
|
|
46399
|
+
var FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
|
|
46400
|
+
|
|
46401
|
+
var Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
|
|
46347
46402
|
|
|
46348
46403
|
/**
|
|
46349
46404
|
* Determine if we're running in a standard browser environment
|
|
@@ -46399,7 +46454,7 @@ var platform = {
|
|
|
46399
46454
|
classes: {
|
|
46400
46455
|
URLSearchParams: URLSearchParams$1,
|
|
46401
46456
|
FormData: FormData$1,
|
|
46402
|
-
Blob
|
|
46457
|
+
Blob: Blob$1
|
|
46403
46458
|
},
|
|
46404
46459
|
isStandardBrowserEnv,
|
|
46405
46460
|
isStandardBrowserWebWorkerEnv,
|
|
@@ -46745,11 +46800,15 @@ function isValidHeaderName(str) {
|
|
|
46745
46800
|
return /^[-_a-zA-Z]+$/.test(str.trim());
|
|
46746
46801
|
}
|
|
46747
46802
|
|
|
46748
|
-
function matchHeaderValue(context, value, header, filter) {
|
|
46803
|
+
function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
|
46749
46804
|
if (utils.isFunction(filter)) {
|
|
46750
46805
|
return filter.call(this, value, header);
|
|
46751
46806
|
}
|
|
46752
46807
|
|
|
46808
|
+
if (isHeaderNameFilter) {
|
|
46809
|
+
value = header;
|
|
46810
|
+
}
|
|
46811
|
+
|
|
46753
46812
|
if (!utils.isString(value)) return;
|
|
46754
46813
|
|
|
46755
46814
|
if (utils.isString(filter)) {
|
|
@@ -46853,7 +46912,7 @@ class AxiosHeaders {
|
|
|
46853
46912
|
if (header) {
|
|
46854
46913
|
const key = utils.findKey(this, header);
|
|
46855
46914
|
|
|
46856
|
-
return !!(key && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
|
|
46915
|
+
return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
|
|
46857
46916
|
}
|
|
46858
46917
|
|
|
46859
46918
|
return false;
|
|
@@ -46886,8 +46945,20 @@ class AxiosHeaders {
|
|
|
46886
46945
|
return deleted;
|
|
46887
46946
|
}
|
|
46888
46947
|
|
|
46889
|
-
clear() {
|
|
46890
|
-
|
|
46948
|
+
clear(matcher) {
|
|
46949
|
+
const keys = Object.keys(this);
|
|
46950
|
+
let i = keys.length;
|
|
46951
|
+
let deleted = false;
|
|
46952
|
+
|
|
46953
|
+
while (i--) {
|
|
46954
|
+
const key = keys[i];
|
|
46955
|
+
if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
|
46956
|
+
delete this[key];
|
|
46957
|
+
deleted = true;
|
|
46958
|
+
}
|
|
46959
|
+
}
|
|
46960
|
+
|
|
46961
|
+
return deleted;
|
|
46891
46962
|
}
|
|
46892
46963
|
|
|
46893
46964
|
normalize(format) {
|
|
@@ -46978,7 +47049,7 @@ class AxiosHeaders {
|
|
|
46978
47049
|
}
|
|
46979
47050
|
}
|
|
46980
47051
|
|
|
46981
|
-
AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent']);
|
|
47052
|
+
AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
|
|
46982
47053
|
|
|
46983
47054
|
utils.freezeMethods(AxiosHeaders.prototype);
|
|
46984
47055
|
utils.freezeMethods(AxiosHeaders);
|
|
@@ -47031,9 +47102,6 @@ utils.inherits(CanceledError, AxiosError, {
|
|
|
47031
47102
|
__CANCEL__: true
|
|
47032
47103
|
});
|
|
47033
47104
|
|
|
47034
|
-
// eslint-disable-next-line strict
|
|
47035
|
-
var httpAdapter = null;
|
|
47036
|
-
|
|
47037
47105
|
/**
|
|
47038
47106
|
* Resolve or reject a Promise based on response status.
|
|
47039
47107
|
*
|
|
@@ -47734,7 +47802,7 @@ function mergeConfig(config1, config2) {
|
|
|
47734
47802
|
return config;
|
|
47735
47803
|
}
|
|
47736
47804
|
|
|
47737
|
-
const VERSION = "1.
|
|
47805
|
+
const VERSION = "1.3.4";
|
|
47738
47806
|
|
|
47739
47807
|
const validators$1 = {};
|
|
47740
47808
|
|