@nmshd/transport 2.0.0-alpha.1 → 2.0.0-alpha.2

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.
Files changed (26) hide show
  1. package/dist/buildInformation.js +5 -5
  2. package/dist/core/CoreCrypto.js +8 -8
  3. package/dist/core/CoreCrypto.js.map +1 -1
  4. package/dist/core/Transport.d.ts +1 -0
  5. package/dist/core/backbone/RESTClient.d.ts +1 -0
  6. package/dist/core/types/CoreHash.js +2 -2
  7. package/dist/core/types/CoreHash.js.map +1 -1
  8. package/dist/modules/accounts/IdentityUtil.js +8 -8
  9. package/dist/modules/accounts/IdentityUtil.js.map +1 -1
  10. package/dist/modules/files/FileController.js +4 -4
  11. package/dist/modules/files/FileController.js.map +1 -1
  12. package/dist/modules/relationshipTemplates/RelationshipTemplateController.js +9 -4
  13. package/dist/modules/relationshipTemplates/RelationshipTemplateController.js.map +1 -1
  14. package/dist/modules/relationshipTemplates/backbone/BackboneGetRelationshipTemplates.d.ts +1 -0
  15. package/dist/modules/relationshipTemplates/backbone/BackbonePostRelationshipTemplates.d.ts +6 -1
  16. package/dist/modules/relationshipTemplates/local/CachedRelationshipTemplate.d.ts +13 -2
  17. package/dist/modules/relationshipTemplates/local/CachedRelationshipTemplate.js +27 -14
  18. package/dist/modules/relationshipTemplates/local/CachedRelationshipTemplate.js.map +1 -1
  19. package/dist/modules/relationshipTemplates/local/SendRelationshipTemplateParameters.d.ts +11 -0
  20. package/dist/modules/relationshipTemplates/local/SendRelationshipTemplateParameters.js +18 -3
  21. package/dist/modules/relationshipTemplates/local/SendRelationshipTemplateParameters.js.map +1 -1
  22. package/lib-web/nmshd.transport.js +614 -255
  23. package/lib-web/nmshd.transport.js.map +1 -1
  24. package/lib-web/nmshd.transport.min.js +1 -1
  25. package/lib-web/nmshd.transport.min.js.map +1 -1
  26. package/package.json +16 -16
@@ -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.0-alpha.1",
19
- build: "27",
20
- date: "2022-04-22T14:08:07+00:00",
21
- commit: "adde3c91dad71d47d3d3abd430896cfb3be114d9",
22
- dependencies: {"@js-soft/docdb-access-abstractions":"1.0.1","@js-soft/logging-abstractions":"1.0.0","@js-soft/simple-logger":"1.0.1","@js-soft/ts-utils":"1.1.1","axios":"^0.26.1","deep-equal":"^2.0.5","fast-json-patch":"^3.1.1","form-data":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","luxon":"^2.3.2","qs":"^6.10.3","reflect-metadata":"^0.1.13","ts-simple-nameof":"^1.3.1","uuid":"^8.3.2"},
18
+ version: "2.0.0-alpha.2",
19
+ build: "28",
20
+ date: "2022-06-14T07:48:11+00:00",
21
+ commit: "50fc95042643bfc779e34b2ff4e6a1c5495264c3",
22
+ dependencies: {"@js-soft/docdb-access-abstractions":"1.0.1","@js-soft/logging-abstractions":"1.0.0","@js-soft/simple-logger":"1.0.1","@js-soft/ts-utils":"1.1.2","axios":"^0.27.2","deep-equal":"^2.0.5","fast-json-patch":"^3.1.1","form-data":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","luxon":"^2.4.0","qs":"^6.10.5","reflect-metadata":"^0.1.13","ts-simple-nameof":"^1.3.1","uuid":"^8.3.2"},
23
23
  libraries: {
24
24
  crypto: crypto_1.buildInformation,
25
25
  serval: ts_serval_1.buildInformation
@@ -55,7 +55,7 @@ class CoreCrypto {
55
55
  static async generateSignatureKeypair(version = TransportVersion_1.TransportVersion.Latest) {
56
56
  switch (version) {
57
57
  case TransportVersion_1.TransportVersion.V1:
58
- return await crypto_1.CryptoSignatures.generateKeypair(3 /* ECDSA_ED25519 */);
58
+ return await crypto_1.CryptoSignatures.generateKeypair(3 /* CryptoSignatureAlgorithm.ECDSA_ED25519 */);
59
59
  default:
60
60
  throw TransportErrors_1.TransportErrors.util.crypto.invalidVersion(version);
61
61
  }
@@ -72,7 +72,7 @@ class CoreCrypto {
72
72
  static async generateExchangeKeypair(version = TransportVersion_1.TransportVersion.Latest) {
73
73
  switch (version) {
74
74
  case TransportVersion_1.TransportVersion.V1:
75
- return await crypto_1.CryptoExchange.generateKeypair(3 /* ECDH_X25519 */);
75
+ return await crypto_1.CryptoExchange.generateKeypair(3 /* CryptoExchangeAlgorithm.ECDH_X25519 */);
76
76
  default:
77
77
  throw TransportErrors_1.TransportErrors.util.crypto.invalidVersion(version);
78
78
  }
@@ -88,7 +88,7 @@ class CoreCrypto {
88
88
  static async generateSecretKey(version = TransportVersion_1.TransportVersion.Latest) {
89
89
  switch (version) {
90
90
  case TransportVersion_1.TransportVersion.V1:
91
- return await crypto_1.CryptoEncryption.generateKey(3 /* XCHACHA20_POLY1305 */);
91
+ return await crypto_1.CryptoEncryption.generateKey(3 /* CryptoEncryptionAlgorithm.XCHACHA20_POLY1305 */);
92
92
  default:
93
93
  throw TransportErrors_1.TransportErrors.util.crypto.invalidVersion(version);
94
94
  }
@@ -108,7 +108,7 @@ class CoreCrypto {
108
108
  * @param version The version which should be used, "latest" is the default.
109
109
  * @returns A Promise object resolving in a [[CryptoSecretKey]].
110
110
  */
111
- static async generatePassword(master, salt = "enmeshed", keyAlgorithm = 3 /* XCHACHA20_POLY1305 */, version = TransportVersion_1.TransportVersion.Latest) {
111
+ static async generatePassword(master, salt = "enmeshed", keyAlgorithm = 3 /* CryptoEncryptionAlgorithm.XCHACHA20_POLY1305 */, version = TransportVersion_1.TransportVersion.Latest) {
112
112
  const masterBuffer = crypto_1.CoreBuffer.fromString(master, crypto_1.Encoding.Utf8);
113
113
  const saltBuffer = crypto_1.CoreBuffer.fromString(salt, crypto_1.Encoding.Utf8);
114
114
  switch (version) {
@@ -118,7 +118,7 @@ class CoreCrypto {
118
118
  throw TransportErrors_1.TransportErrors.util.crypto.invalidVersion(version);
119
119
  }
120
120
  }
121
- static async deriveKeyFromBase(secret, keyId, context, keyAlgorithm = 3 /* XCHACHA20_POLY1305 */) {
121
+ static async deriveKeyFromBase(secret, keyId, context, keyAlgorithm = 3 /* CryptoEncryptionAlgorithm.XCHACHA20_POLY1305 */) {
122
122
  let buffer;
123
123
  if (secret instanceof crypto_1.CryptoSecretKey) {
124
124
  buffer = secret.secretKey;
@@ -131,7 +131,7 @@ class CoreCrypto {
131
131
  }
132
132
  return await crypto_1.CryptoDerivation.deriveKeyFromBase(buffer, keyId, context, keyAlgorithm);
133
133
  }
134
- static async deriveClient(client, serverPublicKey, keyAlgorithm = 3 /* XCHACHA20_POLY1305 */, version = TransportVersion_1.TransportVersion.Latest) {
134
+ static async deriveClient(client, serverPublicKey, keyAlgorithm = 3 /* CryptoEncryptionAlgorithm.XCHACHA20_POLY1305 */, version = TransportVersion_1.TransportVersion.Latest) {
135
135
  switch (version) {
136
136
  case TransportVersion_1.TransportVersion.V1:
137
137
  const base = await crypto_1.CryptoExchange.deriveTemplator(client, serverPublicKey, keyAlgorithm);
@@ -140,7 +140,7 @@ class CoreCrypto {
140
140
  throw TransportErrors_1.TransportErrors.util.crypto.invalidVersion(version);
141
141
  }
142
142
  }
143
- static async deriveServer(server, clientPublicKey, keyAlgorithm = 3 /* XCHACHA20_POLY1305 */, version = TransportVersion_1.TransportVersion.Latest) {
143
+ static async deriveServer(server, clientPublicKey, keyAlgorithm = 3 /* CryptoEncryptionAlgorithm.XCHACHA20_POLY1305 */, version = TransportVersion_1.TransportVersion.Latest) {
144
144
  switch (version) {
145
145
  case TransportVersion_1.TransportVersion.V1:
146
146
  const base = await crypto_1.CryptoExchange.deriveRequestor(server, clientPublicKey, keyAlgorithm);
@@ -162,7 +162,7 @@ class CoreCrypto {
162
162
  static async sign(content, privateKey, version = TransportVersion_1.TransportVersion.Latest) {
163
163
  switch (version) {
164
164
  case TransportVersion_1.TransportVersion.V1:
165
- return await crypto_1.CryptoSignatures.sign(content, privateKey, 2 /* SHA512 */);
165
+ return await crypto_1.CryptoSignatures.sign(content, privateKey, 2 /* CryptoHashAlgorithm.SHA512 */);
166
166
  default:
167
167
  throw TransportErrors_1.TransportErrors.util.crypto.invalidVersion(version);
168
168
  }
@@ -2463,7 +2463,7 @@ let CoreHash = CoreHash_1 = class CoreHash extends CoreSerializable_1.CoreSerial
2463
2463
  * @param algorithm The CryptoHashAlgorithm, defaults to SHA512
2464
2464
  * @returns A Promise resolving to the Hash object
2465
2465
  */
2466
- static async hash(content, algorithm = 2 /* SHA512 */) {
2466
+ static async hash(content, algorithm = 2 /* CryptoHashAlgorithm.SHA512 */) {
2467
2467
  const hash = await crypto_1.CryptoHash.hash(crypto_1.CoreBuffer.fromString(content, crypto_1.Encoding.Base64_UrlSafe_NoPadding), algorithm);
2468
2468
  return CoreHash_1.from(hash.toBase64());
2469
2469
  }
@@ -2475,7 +2475,7 @@ let CoreHash = CoreHash_1 = class CoreHash extends CoreSerializable_1.CoreSerial
2475
2475
  * @param algorithm The CryptoHashAlgorithm, defaults to SHA512
2476
2476
  * @returns A Promise resolving to true if the content equals to the hash, or false otherwise
2477
2477
  */
2478
- async verify(content, algorithm = 2 /* SHA512 */) {
2478
+ async verify(content, algorithm = 2 /* CryptoHashAlgorithm.SHA512 */) {
2479
2479
  return await crypto_1.CryptoHash.verify(content, crypto_1.CoreBuffer.fromString(this.hash, crypto_1.Encoding.Base64_UrlSafe_NoPadding), algorithm);
2480
2480
  }
2481
2481
  static preFrom(value) {
@@ -3088,13 +3088,13 @@ class IdentityUtil {
3088
3088
  if (realm && realm.length !== 3) {
3089
3089
  throw core_1.TransportErrors.identity.realmLength();
3090
3090
  }
3091
- const sha512buffer = await crypto_1.CryptoHash.hash(publicKey.publicKey, 2 /* SHA512 */);
3092
- const hash = await crypto_1.CryptoHash.hash(sha512buffer, 1 /* SHA256 */);
3091
+ const sha512buffer = await crypto_1.CryptoHash.hash(publicKey.publicKey, 2 /* CryptoHashAlgorithm.SHA512 */);
3092
+ const hash = await crypto_1.CryptoHash.hash(sha512buffer, 1 /* CryptoHashAlgorithm.SHA256 */);
3093
3093
  const hashedPublicKey = new crypto_1.CoreBuffer(hash.buffer.slice(0, 20));
3094
3094
  const checksumSource = crypto_1.CoreBuffer.fromUtf8(realm);
3095
3095
  checksumSource.append(hashedPublicKey);
3096
- const addressChecksum1 = await crypto_1.CryptoHash.hash(checksumSource, 2 /* SHA512 */);
3097
- const checksumHash = await crypto_1.CryptoHash.hash(addressChecksum1, 1 /* SHA256 */);
3096
+ const addressChecksum1 = await crypto_1.CryptoHash.hash(checksumSource, 2 /* CryptoHashAlgorithm.SHA512 */);
3097
+ const checksumHash = await crypto_1.CryptoHash.hash(addressChecksum1, 1 /* CryptoHashAlgorithm.SHA256 */);
3098
3098
  const checksum = new crypto_1.CoreBuffer(checksumHash.buffer.slice(0, 4));
3099
3099
  const concatenation = hashedPublicKey;
3100
3100
  concatenation.append(checksum);
@@ -3114,15 +3114,15 @@ class IdentityUtil {
3114
3114
  const checksumArray = addressBuffer.slice(addressBuffer.byteLength - 4, addressBuffer.byteLength);
3115
3115
  const checksumBuffer = crypto_1.CoreBuffer.fromUtf8(strRealm);
3116
3116
  checksumBuffer.append(new crypto_1.CoreBuffer(sha256Array));
3117
- const addressChecksum1 = await crypto_1.CryptoHash.hash(checksumBuffer, 2 /* SHA512 */);
3118
- const addressChecksum2 = await crypto_1.CryptoHash.hash(addressChecksum1, 1 /* SHA256 */);
3117
+ const addressChecksum1 = await crypto_1.CryptoHash.hash(checksumBuffer, 2 /* CryptoHashAlgorithm.SHA512 */);
3118
+ const addressChecksum2 = await crypto_1.CryptoHash.hash(addressChecksum1, 1 /* CryptoHashAlgorithm.SHA256 */);
3119
3119
  const firstBytesOfChecksum = new crypto_1.CoreBuffer(addressChecksum2.buffer.slice(0, 4));
3120
3120
  if (!firstBytesOfChecksum.equals(new crypto_1.CoreBuffer(checksumArray))) {
3121
3121
  return false;
3122
3122
  }
3123
3123
  if (publicKey) {
3124
- const sha512buffer = await crypto_1.CryptoHash.hash(publicKey.publicKey, 2 /* SHA512 */);
3125
- let sha256buffer = await crypto_1.CryptoHash.hash(sha512buffer, 1 /* SHA256 */);
3124
+ const sha512buffer = await crypto_1.CryptoHash.hash(publicKey.publicKey, 2 /* CryptoHashAlgorithm.SHA512 */);
3125
+ let sha256buffer = await crypto_1.CryptoHash.hash(sha512buffer, 1 /* CryptoHashAlgorithm.SHA256 */);
3126
3126
  sha256buffer = new crypto_1.CoreBuffer(sha256buffer.buffer.slice(0, 20));
3127
3127
  if (!sha256buffer.equals(new crypto_1.CoreBuffer(sha256Array))) {
3128
3128
  // Hash doesn't match with given public key.
@@ -5352,14 +5352,14 @@ class FileController extends TransportController_1.TransportController {
5352
5352
  if (fileSize > this.config.platformMaxUnencryptedFileSize) {
5353
5353
  throw core_1.TransportErrors.files.maxFileSizeExceeded(fileSize, this.config.platformMaxUnencryptedFileSize);
5354
5354
  }
5355
- const plaintextHashBuffer = await crypto_1.CryptoHash.hash(content, 2 /* SHA512 */);
5355
+ const plaintextHashBuffer = await crypto_1.CryptoHash.hash(content, 2 /* CryptoHashAlgorithm.SHA512 */);
5356
5356
  const plaintextHash = core_1.CoreHash.from(plaintextHashBuffer.toBase64URL());
5357
5357
  const signature = await this.parent.activeDevice.sign(plaintextHashBuffer);
5358
5358
  const signatureB64 = signature.toBase64();
5359
5359
  const fileDownloadSecretKey = await core_1.CoreCrypto.generateSecretKey();
5360
5360
  const cipher = await core_1.CoreCrypto.encrypt(content, fileDownloadSecretKey);
5361
5361
  const cipherBuffer = crypto_1.CoreBuffer.fromBase64URL(cipher.toBase64());
5362
- const cipherHash = await crypto_1.CryptoHash.hash(cipherBuffer, 2 /* SHA512 */);
5362
+ const cipherHash = await crypto_1.CryptoHash.hash(cipherBuffer, 2 /* CryptoHashAlgorithm.SHA512 */);
5363
5363
  const cipherCoreHash = core_1.CoreHash.from(cipherHash.toBase64URL());
5364
5364
  const metadata = FileMetadata_1.FileMetadata.from({
5365
5365
  title: input.title,
@@ -5420,7 +5420,7 @@ class FileController extends TransportController_1.TransportController {
5420
5420
  }
5421
5421
  const downloadResponse = (await this.client.downloadFile(file.id.toString())).value;
5422
5422
  const buffer = crypto_1.CoreBuffer.fromObject(downloadResponse);
5423
- const hash = await crypto_1.CryptoHash.hash(buffer, 2 /* SHA512 */);
5423
+ const hash = await crypto_1.CryptoHash.hash(buffer, 2 /* CryptoHashAlgorithm.SHA512 */);
5424
5424
  const hashb64 = hash.toBase64URL();
5425
5425
  if (hashb64 !== file.cache.cipherHash.hash) {
5426
5426
  throw core_1.TransportErrors.files.cipherMismatch().logWith(this._log);
@@ -5434,7 +5434,7 @@ class FileController extends TransportController_1.TransportController {
5434
5434
  */
5435
5435
  const cipher = crypto_1.CryptoCipher.fromBase64(buffer.toBase64URL());
5436
5436
  const decrypt = await core_1.CoreCrypto.decrypt(cipher, file.cache.cipherKey);
5437
- const plaintextHashesMatch = await file.cache.plaintextHash.verify(decrypt, 2 /* SHA512 */);
5437
+ const plaintextHashesMatch = await file.cache.plaintextHash.verify(decrypt, 2 /* CryptoHashAlgorithm.SHA512 */);
5438
5438
  if (!plaintextHashesMatch) {
5439
5439
  throw core_1.TransportErrors.files.plaintextHashMismatch().logWith(this._log);
5440
5440
  }
@@ -7090,8 +7090,10 @@ class RelationshipTemplateController extends TransportController_1.TransportCont
7090
7090
  return this;
7091
7091
  }
7092
7092
  async sendRelationshipTemplate(parameters) {
7093
- var _a;
7094
7093
  parameters = SendRelationshipTemplateParameters_1.SendRelationshipTemplateParameters.from(parameters);
7094
+ if (parameters.maxNumberOfRelationships) {
7095
+ this.log.warn("`maxNumberOfRelationships` is deprecated and will be removed in the future. Please use `maxNumberOfAllocations` instead.");
7096
+ }
7095
7097
  const templateKey = await this.secrets.createTemplateKey();
7096
7098
  const templateContent = RelationshipTemplateContent_1.RelationshipTemplateContent.from({
7097
7099
  content: parameters.content,
@@ -7110,6 +7112,7 @@ class RelationshipTemplateController extends TransportController_1.TransportCont
7110
7112
  const cipher = await core_1.CoreCrypto.encrypt(signedTemplateBuffer, secretKey);
7111
7113
  const backboneResponse = (await this.client.createRelationshipTemplate({
7112
7114
  expiresAt: parameters.expiresAt.toString(),
7115
+ maxNumberOfAllocations: parameters.maxNumberOfAllocations,
7113
7116
  maxNumberOfRelationships: parameters.maxNumberOfRelationships,
7114
7117
  content: cipher.toBase64()
7115
7118
  })).value;
@@ -7120,7 +7123,8 @@ class RelationshipTemplateController extends TransportController_1.TransportCont
7120
7123
  createdByDevice: this.parent.activeDevice.id,
7121
7124
  expiresAt: parameters.expiresAt,
7122
7125
  identity: this.parent.identity.identity,
7123
- maxNumberOfRelationships: (_a = parameters.maxNumberOfRelationships) !== null && _a !== void 0 ? _a : undefined,
7126
+ maxNumberOfAllocations: parameters.maxNumberOfAllocations,
7127
+ maxNumberOfRelationships: parameters.maxNumberOfRelationships,
7124
7128
  templateKey: templateKey
7125
7129
  });
7126
7130
  const template = RelationshipTemplate_1.RelationshipTemplate.from({
@@ -7184,7 +7188,7 @@ class RelationshipTemplateController extends TransportController_1.TransportCont
7184
7188
  template.isOwn = this.parent.identity.isMe(cachedTemplate.createdBy);
7185
7189
  }
7186
7190
  async decryptRelationshipTemplate(response, secretKey) {
7187
- var _a;
7191
+ var _a, _b;
7188
7192
  const cipher = crypto_1.CryptoCipher.fromBase64(response.content);
7189
7193
  const signedTemplateBuffer = await this.secrets.decryptTemplate(cipher, secretKey);
7190
7194
  const signedTemplate = RelationshipTemplateSigned_1.RelationshipTemplateSigned.deserialize(signedTemplateBuffer.toUtf8());
@@ -7200,7 +7204,8 @@ class RelationshipTemplateController extends TransportController_1.TransportCont
7200
7204
  createdAt: core_1.CoreDate.from(response.createdAt),
7201
7205
  expiresAt: response.expiresAt ? core_1.CoreDate.from(response.expiresAt) : undefined,
7202
7206
  identity: templateContent.identity,
7203
- maxNumberOfRelationships: (_a = response.maxNumberOfRelationships) !== null && _a !== void 0 ? _a : undefined,
7207
+ maxNumberOfAllocations: (_a = response.maxNumberOfAllocations) !== null && _a !== void 0 ? _a : undefined,
7208
+ maxNumberOfRelationships: (_b = response.maxNumberOfRelationships) !== null && _b !== void 0 ? _b : undefined,
7204
7209
  templateKey: templateContent.templateKey
7205
7210
  });
7206
7211
  return cachedTemplate;
@@ -7316,27 +7321,17 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7316
7321
  var __metadata = (this && this.__metadata) || function (k, v) {
7317
7322
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
7318
7323
  };
7319
- var CachedRelationshipTemplate_1;
7320
7324
  Object.defineProperty(exports, "__esModule", ({ value: true }));
7321
- exports.CachedRelationshipTemplate = void 0;
7325
+ exports.validateMaxNumberOfAllocations = exports.validateMaxNumberOfRelationships = exports.CachedRelationshipTemplate = void 0;
7322
7326
  const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
7323
7327
  const core_1 = __webpack_require__(/*! ../../../core */ "./dist/core/index.js");
7324
7328
  const CoreId_1 = __webpack_require__(/*! ../../../core/types/CoreId */ "./dist/core/types/CoreId.js");
7325
7329
  const Identity_1 = __webpack_require__(/*! ../../accounts/data/Identity */ "./dist/modules/accounts/data/Identity.js");
7326
7330
  const RelationshipTemplatePublicKey_1 = __webpack_require__(/*! ../transmission/RelationshipTemplatePublicKey */ "./dist/modules/relationshipTemplates/transmission/RelationshipTemplatePublicKey.js");
7327
- let CachedRelationshipTemplate = CachedRelationshipTemplate_1 = class CachedRelationshipTemplate extends core_1.CoreSerializable {
7331
+ let CachedRelationshipTemplate = class CachedRelationshipTemplate extends core_1.CoreSerializable {
7328
7332
  static from(value) {
7329
7333
  return this.fromAny(value);
7330
7334
  }
7331
- static validateMaxNumberOfRelationships(value) {
7332
- if (value === undefined) {
7333
- return "";
7334
- }
7335
- if (value <= 0) {
7336
- return "maxNumberOfRelationships must be greater than 0";
7337
- }
7338
- return "";
7339
- }
7340
7335
  };
7341
7336
  __decorate([
7342
7337
  (0, ts_serval_1.validate)(),
@@ -7374,14 +7369,37 @@ __decorate([
7374
7369
  __metadata("design:type", core_1.CoreDate)
7375
7370
  ], CachedRelationshipTemplate.prototype, "expiresAt", void 0);
7376
7371
  __decorate([
7377
- (0, ts_serval_1.validate)({ nullable: true, customValidator: CachedRelationshipTemplate_1.validateMaxNumberOfRelationships }),
7372
+ (0, ts_serval_1.validate)({ nullable: true, customValidator: validateMaxNumberOfAllocations }),
7373
+ (0, ts_serval_1.serialize)(),
7374
+ __metadata("design:type", Number)
7375
+ ], CachedRelationshipTemplate.prototype, "maxNumberOfAllocations", void 0);
7376
+ __decorate([
7377
+ (0, ts_serval_1.validate)({ nullable: true, customValidator: validateMaxNumberOfRelationships }),
7378
7378
  (0, ts_serval_1.serialize)(),
7379
7379
  __metadata("design:type", Number)
7380
7380
  ], CachedRelationshipTemplate.prototype, "maxNumberOfRelationships", void 0);
7381
- CachedRelationshipTemplate = CachedRelationshipTemplate_1 = __decorate([
7381
+ CachedRelationshipTemplate = __decorate([
7382
7382
  (0, ts_serval_1.type)("CachedRelationshipTemplate")
7383
7383
  ], CachedRelationshipTemplate);
7384
7384
  exports.CachedRelationshipTemplate = CachedRelationshipTemplate;
7385
+ function validateMaxNumberOfRelationships(value) {
7386
+ if (value === undefined)
7387
+ return;
7388
+ if (value <= 0) {
7389
+ return "maxNumberOfRelationships must be greater than 0";
7390
+ }
7391
+ return;
7392
+ }
7393
+ exports.validateMaxNumberOfRelationships = validateMaxNumberOfRelationships;
7394
+ function validateMaxNumberOfAllocations(value) {
7395
+ if (value === undefined)
7396
+ return;
7397
+ if (value <= 0) {
7398
+ return "maxNumberOfAllocations must be greater than 0";
7399
+ }
7400
+ return;
7401
+ }
7402
+ exports.validateMaxNumberOfAllocations = validateMaxNumberOfAllocations;
7385
7403
  //# sourceMappingURL=CachedRelationshipTemplate.js.map
7386
7404
 
7387
7405
  /***/ }),
@@ -7494,12 +7512,22 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7494
7512
  var __metadata = (this && this.__metadata) || function (k, v) {
7495
7513
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
7496
7514
  };
7515
+ var SendRelationshipTemplateParameters_1;
7497
7516
  Object.defineProperty(exports, "__esModule", ({ value: true }));
7498
7517
  exports.SendRelationshipTemplateParameters = void 0;
7499
7518
  const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
7519
+ const ts_simple_nameof_1 = __webpack_require__(/*! ts-simple-nameof */ "./node_modules/ts-simple-nameof/index.js");
7500
7520
  const core_1 = __webpack_require__(/*! ../../../core */ "./dist/core/index.js");
7501
7521
  const CachedRelationshipTemplate_1 = __webpack_require__(/*! ./CachedRelationshipTemplate */ "./dist/modules/relationshipTemplates/local/CachedRelationshipTemplate.js");
7502
- let SendRelationshipTemplateParameters = class SendRelationshipTemplateParameters extends core_1.CoreSerializable {
7522
+ let SendRelationshipTemplateParameters = SendRelationshipTemplateParameters_1 = class SendRelationshipTemplateParameters extends core_1.CoreSerializable {
7523
+ static postFrom(value) {
7524
+ if (!(value instanceof SendRelationshipTemplateParameters_1))
7525
+ throw new Error("this should never happen");
7526
+ if (value.maxNumberOfAllocations && value.maxNumberOfRelationships) {
7527
+ throw new ts_serval_1.ValidationError(SendRelationshipTemplateParameters_1.name, (0, ts_simple_nameof_1.nameof)((x) => x.maxNumberOfAllocations), `You cannot specify both ${(0, ts_simple_nameof_1.nameof)((x) => x.maxNumberOfAllocations)} and ${(0, ts_simple_nameof_1.nameof)((x) => x.maxNumberOfRelationships)}.`);
7528
+ }
7529
+ return value;
7530
+ }
7503
7531
  static from(value) {
7504
7532
  return this.fromAny(value);
7505
7533
  }
@@ -7515,11 +7543,16 @@ __decorate([
7515
7543
  __metadata("design:type", core_1.CoreDate)
7516
7544
  ], SendRelationshipTemplateParameters.prototype, "expiresAt", void 0);
7517
7545
  __decorate([
7518
- (0, ts_serval_1.validate)({ nullable: true, customValidator: CachedRelationshipTemplate_1.CachedRelationshipTemplate.validateMaxNumberOfRelationships }),
7546
+ (0, ts_serval_1.validate)({ nullable: true, customValidator: CachedRelationshipTemplate_1.validateMaxNumberOfAllocations }),
7547
+ (0, ts_serval_1.serialize)(),
7548
+ __metadata("design:type", Number)
7549
+ ], SendRelationshipTemplateParameters.prototype, "maxNumberOfAllocations", void 0);
7550
+ __decorate([
7551
+ (0, ts_serval_1.validate)({ nullable: true, customValidator: CachedRelationshipTemplate_1.validateMaxNumberOfRelationships }),
7519
7552
  (0, ts_serval_1.serialize)(),
7520
7553
  __metadata("design:type", Number)
7521
7554
  ], SendRelationshipTemplateParameters.prototype, "maxNumberOfRelationships", void 0);
7522
- SendRelationshipTemplateParameters = __decorate([
7555
+ SendRelationshipTemplateParameters = SendRelationshipTemplateParameters_1 = __decorate([
7523
7556
  (0, ts_serval_1.type)("SendRelationshipTemplateParameters")
7524
7557
  ], SendRelationshipTemplateParameters);
7525
7558
  exports.SendRelationshipTemplateParameters = SendRelationshipTemplateParameters;
@@ -12604,9 +12637,10 @@ var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "./node_modules/
12604
12637
  var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "./node_modules/axios/lib/core/buildFullPath.js");
12605
12638
  var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./node_modules/axios/lib/helpers/parseHeaders.js");
12606
12639
  var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "./node_modules/axios/lib/helpers/isURLSameOrigin.js");
12607
- var createError = __webpack_require__(/*! ../core/createError */ "./node_modules/axios/lib/core/createError.js");
12608
12640
  var transitionalDefaults = __webpack_require__(/*! ../defaults/transitional */ "./node_modules/axios/lib/defaults/transitional.js");
12609
- var Cancel = __webpack_require__(/*! ../cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js");
12641
+ var AxiosError = __webpack_require__(/*! ../core/AxiosError */ "./node_modules/axios/lib/core/AxiosError.js");
12642
+ var CanceledError = __webpack_require__(/*! ../cancel/CanceledError */ "./node_modules/axios/lib/cancel/CanceledError.js");
12643
+ var parseProtocol = __webpack_require__(/*! ../helpers/parseProtocol */ "./node_modules/axios/lib/helpers/parseProtocol.js");
12610
12644
 
12611
12645
  module.exports = function xhrAdapter(config) {
12612
12646
  return new Promise(function dispatchXhrRequest(resolve, reject) {
@@ -12624,7 +12658,7 @@ module.exports = function xhrAdapter(config) {
12624
12658
  }
12625
12659
  }
12626
12660
 
12627
- if (utils.isFormData(requestData)) {
12661
+ if (utils.isFormData(requestData) && utils.isStandardBrowserEnv()) {
12628
12662
  delete requestHeaders['Content-Type']; // Let the browser set it
12629
12663
  }
12630
12664
 
@@ -12638,6 +12672,7 @@ module.exports = function xhrAdapter(config) {
12638
12672
  }
12639
12673
 
12640
12674
  var fullPath = buildFullPath(config.baseURL, config.url);
12675
+
12641
12676
  request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
12642
12677
 
12643
12678
  // Set the request timeout in MS
@@ -12701,7 +12736,7 @@ module.exports = function xhrAdapter(config) {
12701
12736
  return;
12702
12737
  }
12703
12738
 
12704
- reject(createError('Request aborted', config, 'ECONNABORTED', request));
12739
+ reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
12705
12740
 
12706
12741
  // Clean up request
12707
12742
  request = null;
@@ -12711,7 +12746,7 @@ module.exports = function xhrAdapter(config) {
12711
12746
  request.onerror = function handleError() {
12712
12747
  // Real errors are hidden from us by the browser
12713
12748
  // onerror should only fire if it's a network error
12714
- reject(createError('Network Error', config, null, request));
12749
+ reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, request));
12715
12750
 
12716
12751
  // Clean up request
12717
12752
  request = null;
@@ -12724,10 +12759,10 @@ module.exports = function xhrAdapter(config) {
12724
12759
  if (config.timeoutErrorMessage) {
12725
12760
  timeoutErrorMessage = config.timeoutErrorMessage;
12726
12761
  }
12727
- reject(createError(
12762
+ reject(new AxiosError(
12728
12763
  timeoutErrorMessage,
12764
+ transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
12729
12765
  config,
12730
- transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',
12731
12766
  request));
12732
12767
 
12733
12768
  // Clean up request
@@ -12788,7 +12823,7 @@ module.exports = function xhrAdapter(config) {
12788
12823
  if (!request) {
12789
12824
  return;
12790
12825
  }
12791
- reject(!cancel || (cancel && cancel.type) ? new Cancel('canceled') : cancel);
12826
+ reject(!cancel || (cancel && cancel.type) ? new CanceledError() : cancel);
12792
12827
  request.abort();
12793
12828
  request = null;
12794
12829
  };
@@ -12803,6 +12838,14 @@ module.exports = function xhrAdapter(config) {
12803
12838
  requestData = null;
12804
12839
  }
12805
12840
 
12841
+ var protocol = parseProtocol(fullPath);
12842
+
12843
+ if (protocol && [ 'http', 'https', 'file' ].indexOf(protocol) === -1) {
12844
+ reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
12845
+ return;
12846
+ }
12847
+
12848
+
12806
12849
  // Send the request
12807
12850
  request.send(requestData);
12808
12851
  });
@@ -12857,10 +12900,17 @@ var axios = createInstance(defaults);
12857
12900
  axios.Axios = Axios;
12858
12901
 
12859
12902
  // Expose Cancel & CancelToken
12860
- axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js");
12903
+ axios.CanceledError = __webpack_require__(/*! ./cancel/CanceledError */ "./node_modules/axios/lib/cancel/CanceledError.js");
12861
12904
  axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "./node_modules/axios/lib/cancel/CancelToken.js");
12862
12905
  axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js");
12863
12906
  axios.VERSION = (__webpack_require__(/*! ./env/data */ "./node_modules/axios/lib/env/data.js").version);
12907
+ axios.toFormData = __webpack_require__(/*! ./helpers/toFormData */ "./node_modules/axios/lib/helpers/toFormData.js");
12908
+
12909
+ // Expose AxiosError class
12910
+ axios.AxiosError = __webpack_require__(/*! ../lib/core/AxiosError */ "./node_modules/axios/lib/core/AxiosError.js");
12911
+
12912
+ // alias for CanceledError for backward compatibility
12913
+ axios.Cancel = axios.CanceledError;
12864
12914
 
12865
12915
  // Expose all/spread
12866
12916
  axios.all = function all(promises) {
@@ -12877,36 +12927,6 @@ module.exports = axios;
12877
12927
  module.exports["default"] = axios;
12878
12928
 
12879
12929
 
12880
- /***/ }),
12881
-
12882
- /***/ "./node_modules/axios/lib/cancel/Cancel.js":
12883
- /*!*************************************************!*\
12884
- !*** ./node_modules/axios/lib/cancel/Cancel.js ***!
12885
- \*************************************************/
12886
- /***/ ((module) => {
12887
-
12888
- "use strict";
12889
-
12890
-
12891
- /**
12892
- * A `Cancel` is an object that is thrown when an operation is canceled.
12893
- *
12894
- * @class
12895
- * @param {string=} message The message.
12896
- */
12897
- function Cancel(message) {
12898
- this.message = message;
12899
- }
12900
-
12901
- Cancel.prototype.toString = function toString() {
12902
- return 'Cancel' + (this.message ? ': ' + this.message : '');
12903
- };
12904
-
12905
- Cancel.prototype.__CANCEL__ = true;
12906
-
12907
- module.exports = Cancel;
12908
-
12909
-
12910
12930
  /***/ }),
12911
12931
 
12912
12932
  /***/ "./node_modules/axios/lib/cancel/CancelToken.js":
@@ -12918,7 +12938,7 @@ module.exports = Cancel;
12918
12938
  "use strict";
12919
12939
 
12920
12940
 
12921
- var Cancel = __webpack_require__(/*! ./Cancel */ "./node_modules/axios/lib/cancel/Cancel.js");
12941
+ var CanceledError = __webpack_require__(/*! ./CanceledError */ "./node_modules/axios/lib/cancel/CanceledError.js");
12922
12942
 
12923
12943
  /**
12924
12944
  * A `CancelToken` is an object that can be used to request cancellation of an operation.
@@ -12974,13 +12994,13 @@ function CancelToken(executor) {
12974
12994
  return;
12975
12995
  }
12976
12996
 
12977
- token.reason = new Cancel(message);
12997
+ token.reason = new CanceledError(message);
12978
12998
  resolvePromise(token.reason);
12979
12999
  });
12980
13000
  }
12981
13001
 
12982
13002
  /**
12983
- * Throws a `Cancel` if cancellation has been requested.
13003
+ * Throws a `CanceledError` if cancellation has been requested.
12984
13004
  */
12985
13005
  CancelToken.prototype.throwIfRequested = function throwIfRequested() {
12986
13006
  if (this.reason) {
@@ -13037,6 +13057,39 @@ CancelToken.source = function source() {
13037
13057
  module.exports = CancelToken;
13038
13058
 
13039
13059
 
13060
+ /***/ }),
13061
+
13062
+ /***/ "./node_modules/axios/lib/cancel/CanceledError.js":
13063
+ /*!********************************************************!*\
13064
+ !*** ./node_modules/axios/lib/cancel/CanceledError.js ***!
13065
+ \********************************************************/
13066
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
13067
+
13068
+ "use strict";
13069
+
13070
+
13071
+ var AxiosError = __webpack_require__(/*! ../core/AxiosError */ "./node_modules/axios/lib/core/AxiosError.js");
13072
+ var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js");
13073
+
13074
+ /**
13075
+ * A `CanceledError` is an object that is thrown when an operation is canceled.
13076
+ *
13077
+ * @class
13078
+ * @param {string=} message The message.
13079
+ */
13080
+ function CanceledError(message) {
13081
+ // eslint-disable-next-line no-eq-null,eqeqeq
13082
+ AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED);
13083
+ this.name = 'CanceledError';
13084
+ }
13085
+
13086
+ utils.inherits(CanceledError, AxiosError, {
13087
+ __CANCEL__: true
13088
+ });
13089
+
13090
+ module.exports = CanceledError;
13091
+
13092
+
13040
13093
  /***/ }),
13041
13094
 
13042
13095
  /***/ "./node_modules/axios/lib/cancel/isCancel.js":
@@ -13069,6 +13122,7 @@ var buildURL = __webpack_require__(/*! ../helpers/buildURL */ "./node_modules/ax
13069
13122
  var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "./node_modules/axios/lib/core/InterceptorManager.js");
13070
13123
  var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "./node_modules/axios/lib/core/dispatchRequest.js");
13071
13124
  var mergeConfig = __webpack_require__(/*! ./mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js");
13125
+ var buildFullPath = __webpack_require__(/*! ./buildFullPath */ "./node_modules/axios/lib/core/buildFullPath.js");
13072
13126
  var validator = __webpack_require__(/*! ../helpers/validator */ "./node_modules/axios/lib/helpers/validator.js");
13073
13127
 
13074
13128
  var validators = validator.validators;
@@ -13183,7 +13237,8 @@ Axios.prototype.request = function request(configOrUrl, config) {
13183
13237
 
13184
13238
  Axios.prototype.getUri = function getUri(config) {
13185
13239
  config = mergeConfig(this.defaults, config);
13186
- return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
13240
+ var fullPath = buildFullPath(config.baseURL, config.url);
13241
+ return buildURL(fullPath, config.params, config.paramsSerializer);
13187
13242
  };
13188
13243
 
13189
13244
  // Provide aliases for supported request methods
@@ -13200,18 +13255,125 @@ utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData
13200
13255
 
13201
13256
  utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
13202
13257
  /*eslint func-names:0*/
13203
- Axios.prototype[method] = function(url, data, config) {
13204
- return this.request(mergeConfig(config || {}, {
13205
- method: method,
13206
- url: url,
13207
- data: data
13208
- }));
13209
- };
13258
+
13259
+ function generateHTTPMethod(isForm) {
13260
+ return function httpMethod(url, data, config) {
13261
+ return this.request(mergeConfig(config || {}, {
13262
+ method: method,
13263
+ headers: isForm ? {
13264
+ 'Content-Type': 'multipart/form-data'
13265
+ } : {},
13266
+ url: url,
13267
+ data: data
13268
+ }));
13269
+ };
13270
+ }
13271
+
13272
+ Axios.prototype[method] = generateHTTPMethod();
13273
+
13274
+ Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
13210
13275
  });
13211
13276
 
13212
13277
  module.exports = Axios;
13213
13278
 
13214
13279
 
13280
+ /***/ }),
13281
+
13282
+ /***/ "./node_modules/axios/lib/core/AxiosError.js":
13283
+ /*!***************************************************!*\
13284
+ !*** ./node_modules/axios/lib/core/AxiosError.js ***!
13285
+ \***************************************************/
13286
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
13287
+
13288
+ "use strict";
13289
+
13290
+
13291
+ var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js");
13292
+
13293
+ /**
13294
+ * Create an Error with the specified message, config, error code, request and response.
13295
+ *
13296
+ * @param {string} message The error message.
13297
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
13298
+ * @param {Object} [config] The config.
13299
+ * @param {Object} [request] The request.
13300
+ * @param {Object} [response] The response.
13301
+ * @returns {Error} The created error.
13302
+ */
13303
+ function AxiosError(message, code, config, request, response) {
13304
+ Error.call(this);
13305
+ this.message = message;
13306
+ this.name = 'AxiosError';
13307
+ code && (this.code = code);
13308
+ config && (this.config = config);
13309
+ request && (this.request = request);
13310
+ response && (this.response = response);
13311
+ }
13312
+
13313
+ utils.inherits(AxiosError, Error, {
13314
+ toJSON: function toJSON() {
13315
+ return {
13316
+ // Standard
13317
+ message: this.message,
13318
+ name: this.name,
13319
+ // Microsoft
13320
+ description: this.description,
13321
+ number: this.number,
13322
+ // Mozilla
13323
+ fileName: this.fileName,
13324
+ lineNumber: this.lineNumber,
13325
+ columnNumber: this.columnNumber,
13326
+ stack: this.stack,
13327
+ // Axios
13328
+ config: this.config,
13329
+ code: this.code,
13330
+ status: this.response && this.response.status ? this.response.status : null
13331
+ };
13332
+ }
13333
+ });
13334
+
13335
+ var prototype = AxiosError.prototype;
13336
+ var descriptors = {};
13337
+
13338
+ [
13339
+ 'ERR_BAD_OPTION_VALUE',
13340
+ 'ERR_BAD_OPTION',
13341
+ 'ECONNABORTED',
13342
+ 'ETIMEDOUT',
13343
+ 'ERR_NETWORK',
13344
+ 'ERR_FR_TOO_MANY_REDIRECTS',
13345
+ 'ERR_DEPRECATED',
13346
+ 'ERR_BAD_RESPONSE',
13347
+ 'ERR_BAD_REQUEST',
13348
+ 'ERR_CANCELED'
13349
+ // eslint-disable-next-line func-names
13350
+ ].forEach(function(code) {
13351
+ descriptors[code] = {value: code};
13352
+ });
13353
+
13354
+ Object.defineProperties(AxiosError, descriptors);
13355
+ Object.defineProperty(prototype, 'isAxiosError', {value: true});
13356
+
13357
+ // eslint-disable-next-line func-names
13358
+ AxiosError.from = function(error, code, config, request, response, customProps) {
13359
+ var axiosError = Object.create(prototype);
13360
+
13361
+ utils.toFlatObject(error, axiosError, function filter(obj) {
13362
+ return obj !== Error.prototype;
13363
+ });
13364
+
13365
+ AxiosError.call(axiosError, error.message, code, config, request, response);
13366
+
13367
+ axiosError.name = error.name;
13368
+
13369
+ customProps && Object.assign(axiosError, customProps);
13370
+
13371
+ return axiosError;
13372
+ };
13373
+
13374
+ module.exports = AxiosError;
13375
+
13376
+
13215
13377
  /***/ }),
13216
13378
 
13217
13379
  /***/ "./node_modules/axios/lib/core/InterceptorManager.js":
@@ -13308,35 +13470,6 @@ module.exports = function buildFullPath(baseURL, requestedURL) {
13308
13470
  };
13309
13471
 
13310
13472
 
13311
- /***/ }),
13312
-
13313
- /***/ "./node_modules/axios/lib/core/createError.js":
13314
- /*!****************************************************!*\
13315
- !*** ./node_modules/axios/lib/core/createError.js ***!
13316
- \****************************************************/
13317
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
13318
-
13319
- "use strict";
13320
-
13321
-
13322
- var enhanceError = __webpack_require__(/*! ./enhanceError */ "./node_modules/axios/lib/core/enhanceError.js");
13323
-
13324
- /**
13325
- * Create an Error with the specified message, config, error code, request and response.
13326
- *
13327
- * @param {string} message The error message.
13328
- * @param {Object} config The config.
13329
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
13330
- * @param {Object} [request] The request.
13331
- * @param {Object} [response] The response.
13332
- * @returns {Error} The created error.
13333
- */
13334
- module.exports = function createError(message, config, code, request, response) {
13335
- var error = new Error(message);
13336
- return enhanceError(error, config, code, request, response);
13337
- };
13338
-
13339
-
13340
13473
  /***/ }),
13341
13474
 
13342
13475
  /***/ "./node_modules/axios/lib/core/dispatchRequest.js":
@@ -13352,10 +13485,10 @@ var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/util
13352
13485
  var transformData = __webpack_require__(/*! ./transformData */ "./node_modules/axios/lib/core/transformData.js");
13353
13486
  var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js");
13354
13487
  var defaults = __webpack_require__(/*! ../defaults */ "./node_modules/axios/lib/defaults/index.js");
13355
- var Cancel = __webpack_require__(/*! ../cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js");
13488
+ var CanceledError = __webpack_require__(/*! ../cancel/CanceledError */ "./node_modules/axios/lib/cancel/CanceledError.js");
13356
13489
 
13357
13490
  /**
13358
- * Throws a `Cancel` if cancellation has been requested.
13491
+ * Throws a `CanceledError` if cancellation has been requested.
13359
13492
  */
13360
13493
  function throwIfCancellationRequested(config) {
13361
13494
  if (config.cancelToken) {
@@ -13363,7 +13496,7 @@ function throwIfCancellationRequested(config) {
13363
13496
  }
13364
13497
 
13365
13498
  if (config.signal && config.signal.aborted) {
13366
- throw new Cancel('canceled');
13499
+ throw new CanceledError();
13367
13500
  }
13368
13501
  }
13369
13502
 
@@ -13435,60 +13568,6 @@ module.exports = function dispatchRequest(config) {
13435
13568
  };
13436
13569
 
13437
13570
 
13438
- /***/ }),
13439
-
13440
- /***/ "./node_modules/axios/lib/core/enhanceError.js":
13441
- /*!*****************************************************!*\
13442
- !*** ./node_modules/axios/lib/core/enhanceError.js ***!
13443
- \*****************************************************/
13444
- /***/ ((module) => {
13445
-
13446
- "use strict";
13447
-
13448
-
13449
- /**
13450
- * Update an Error with the specified config, error code, and response.
13451
- *
13452
- * @param {Error} error The error to update.
13453
- * @param {Object} config The config.
13454
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
13455
- * @param {Object} [request] The request.
13456
- * @param {Object} [response] The response.
13457
- * @returns {Error} The error.
13458
- */
13459
- module.exports = function enhanceError(error, config, code, request, response) {
13460
- error.config = config;
13461
- if (code) {
13462
- error.code = code;
13463
- }
13464
-
13465
- error.request = request;
13466
- error.response = response;
13467
- error.isAxiosError = true;
13468
-
13469
- error.toJSON = function toJSON() {
13470
- return {
13471
- // Standard
13472
- message: this.message,
13473
- name: this.name,
13474
- // Microsoft
13475
- description: this.description,
13476
- number: this.number,
13477
- // Mozilla
13478
- fileName: this.fileName,
13479
- lineNumber: this.lineNumber,
13480
- columnNumber: this.columnNumber,
13481
- stack: this.stack,
13482
- // Axios
13483
- config: this.config,
13484
- code: this.code,
13485
- status: this.response && this.response.status ? this.response.status : null
13486
- };
13487
- };
13488
- return error;
13489
- };
13490
-
13491
-
13492
13571
  /***/ }),
13493
13572
 
13494
13573
  /***/ "./node_modules/axios/lib/core/mergeConfig.js":
@@ -13580,6 +13659,7 @@ module.exports = function mergeConfig(config1, config2) {
13580
13659
  'decompress': defaultToConfig2,
13581
13660
  'maxContentLength': defaultToConfig2,
13582
13661
  'maxBodyLength': defaultToConfig2,
13662
+ 'beforeRedirect': defaultToConfig2,
13583
13663
  'transport': defaultToConfig2,
13584
13664
  'httpAgent': defaultToConfig2,
13585
13665
  'httpsAgent': defaultToConfig2,
@@ -13610,7 +13690,7 @@ module.exports = function mergeConfig(config1, config2) {
13610
13690
  "use strict";
13611
13691
 
13612
13692
 
13613
- var createError = __webpack_require__(/*! ./createError */ "./node_modules/axios/lib/core/createError.js");
13693
+ var AxiosError = __webpack_require__(/*! ./AxiosError */ "./node_modules/axios/lib/core/AxiosError.js");
13614
13694
 
13615
13695
  /**
13616
13696
  * Resolve or reject a Promise based on response status.
@@ -13624,10 +13704,10 @@ module.exports = function settle(resolve, reject, response) {
13624
13704
  if (!response.status || !validateStatus || validateStatus(response.status)) {
13625
13705
  resolve(response);
13626
13706
  } else {
13627
- reject(createError(
13707
+ reject(new AxiosError(
13628
13708
  'Request failed with status code ' + response.status,
13709
+ [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
13629
13710
  response.config,
13630
- null,
13631
13711
  response.request,
13632
13712
  response
13633
13713
  ));
@@ -13681,8 +13761,9 @@ module.exports = function transformData(data, headers, fns) {
13681
13761
 
13682
13762
  var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js");
13683
13763
  var normalizeHeaderName = __webpack_require__(/*! ../helpers/normalizeHeaderName */ "./node_modules/axios/lib/helpers/normalizeHeaderName.js");
13684
- var enhanceError = __webpack_require__(/*! ../core/enhanceError */ "./node_modules/axios/lib/core/enhanceError.js");
13764
+ var AxiosError = __webpack_require__(/*! ../core/AxiosError */ "./node_modules/axios/lib/core/AxiosError.js");
13685
13765
  var transitionalDefaults = __webpack_require__(/*! ./transitional */ "./node_modules/axios/lib/defaults/transitional.js");
13766
+ var toFormData = __webpack_require__(/*! ../helpers/toFormData */ "./node_modules/axios/lib/helpers/toFormData.js");
13686
13767
 
13687
13768
  var DEFAULT_CONTENT_TYPE = {
13688
13769
  'Content-Type': 'application/x-www-form-urlencoded'
@@ -13747,10 +13828,20 @@ var defaults = {
13747
13828
  setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
13748
13829
  return data.toString();
13749
13830
  }
13750
- if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {
13831
+
13832
+ var isObjectPayload = utils.isObject(data);
13833
+ var contentType = headers && headers['Content-Type'];
13834
+
13835
+ var isFileList;
13836
+
13837
+ if ((isFileList = utils.isFileList(data)) || (isObjectPayload && contentType === 'multipart/form-data')) {
13838
+ var _FormData = this.env && this.env.FormData;
13839
+ return toFormData(isFileList ? {'files[]': data} : data, _FormData && new _FormData());
13840
+ } else if (isObjectPayload || contentType === 'application/json') {
13751
13841
  setContentTypeIfUnset(headers, 'application/json');
13752
13842
  return stringifySafely(data);
13753
13843
  }
13844
+
13754
13845
  return data;
13755
13846
  }],
13756
13847
 
@@ -13766,7 +13857,7 @@ var defaults = {
13766
13857
  } catch (e) {
13767
13858
  if (strictJSONParsing) {
13768
13859
  if (e.name === 'SyntaxError') {
13769
- throw enhanceError(e, this, 'E_JSON_PARSE');
13860
+ throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
13770
13861
  }
13771
13862
  throw e;
13772
13863
  }
@@ -13788,6 +13879,10 @@ var defaults = {
13788
13879
  maxContentLength: -1,
13789
13880
  maxBodyLength: -1,
13790
13881
 
13882
+ env: {
13883
+ FormData: __webpack_require__(/*! ./env/FormData */ "./node_modules/axios/lib/helpers/null.js")
13884
+ },
13885
+
13791
13886
  validateStatus: function validateStatus(status) {
13792
13887
  return status >= 200 && status < 300;
13793
13888
  },
@@ -13837,7 +13932,7 @@ module.exports = {
13837
13932
  /***/ ((module) => {
13838
13933
 
13839
13934
  module.exports = {
13840
- "version": "0.26.1"
13935
+ "version": "0.27.2"
13841
13936
  };
13842
13937
 
13843
13938
  /***/ }),
@@ -14183,6 +14278,18 @@ module.exports = function normalizeHeaderName(headers, normalizedName) {
14183
14278
  };
14184
14279
 
14185
14280
 
14281
+ /***/ }),
14282
+
14283
+ /***/ "./node_modules/axios/lib/helpers/null.js":
14284
+ /*!************************************************!*\
14285
+ !*** ./node_modules/axios/lib/helpers/null.js ***!
14286
+ \************************************************/
14287
+ /***/ ((module) => {
14288
+
14289
+ // eslint-disable-next-line strict
14290
+ module.exports = null;
14291
+
14292
+
14186
14293
  /***/ }),
14187
14294
 
14188
14295
  /***/ "./node_modules/axios/lib/helpers/parseHeaders.js":
@@ -14247,6 +14354,23 @@ module.exports = function parseHeaders(headers) {
14247
14354
  };
14248
14355
 
14249
14356
 
14357
+ /***/ }),
14358
+
14359
+ /***/ "./node_modules/axios/lib/helpers/parseProtocol.js":
14360
+ /*!*********************************************************!*\
14361
+ !*** ./node_modules/axios/lib/helpers/parseProtocol.js ***!
14362
+ \*********************************************************/
14363
+ /***/ ((module) => {
14364
+
14365
+ "use strict";
14366
+
14367
+
14368
+ module.exports = function parseProtocol(url) {
14369
+ var match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
14370
+ return match && match[1] || '';
14371
+ };
14372
+
14373
+
14250
14374
  /***/ }),
14251
14375
 
14252
14376
  /***/ "./node_modules/axios/lib/helpers/spread.js":
@@ -14285,6 +14409,89 @@ module.exports = function spread(callback) {
14285
14409
  };
14286
14410
 
14287
14411
 
14412
+ /***/ }),
14413
+
14414
+ /***/ "./node_modules/axios/lib/helpers/toFormData.js":
14415
+ /*!******************************************************!*\
14416
+ !*** ./node_modules/axios/lib/helpers/toFormData.js ***!
14417
+ \******************************************************/
14418
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
14419
+
14420
+ "use strict";
14421
+
14422
+
14423
+ var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js");
14424
+
14425
+ /**
14426
+ * Convert a data object to FormData
14427
+ * @param {Object} obj
14428
+ * @param {?Object} [formData]
14429
+ * @returns {Object}
14430
+ **/
14431
+
14432
+ function toFormData(obj, formData) {
14433
+ // eslint-disable-next-line no-param-reassign
14434
+ formData = formData || new FormData();
14435
+
14436
+ var stack = [];
14437
+
14438
+ function convertValue(value) {
14439
+ if (value === null) return '';
14440
+
14441
+ if (utils.isDate(value)) {
14442
+ return value.toISOString();
14443
+ }
14444
+
14445
+ if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
14446
+ return typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
14447
+ }
14448
+
14449
+ return value;
14450
+ }
14451
+
14452
+ function build(data, parentKey) {
14453
+ if (utils.isPlainObject(data) || utils.isArray(data)) {
14454
+ if (stack.indexOf(data) !== -1) {
14455
+ throw Error('Circular reference detected in ' + parentKey);
14456
+ }
14457
+
14458
+ stack.push(data);
14459
+
14460
+ utils.forEach(data, function each(value, key) {
14461
+ if (utils.isUndefined(value)) return;
14462
+ var fullKey = parentKey ? parentKey + '.' + key : key;
14463
+ var arr;
14464
+
14465
+ if (value && !parentKey && typeof value === 'object') {
14466
+ if (utils.endsWith(key, '{}')) {
14467
+ // eslint-disable-next-line no-param-reassign
14468
+ value = JSON.stringify(value);
14469
+ } else if (utils.endsWith(key, '[]') && (arr = utils.toArray(value))) {
14470
+ // eslint-disable-next-line func-names
14471
+ arr.forEach(function(el) {
14472
+ !utils.isUndefined(el) && formData.append(fullKey, convertValue(el));
14473
+ });
14474
+ return;
14475
+ }
14476
+ }
14477
+
14478
+ build(value, fullKey);
14479
+ });
14480
+
14481
+ stack.pop();
14482
+ } else {
14483
+ formData.append(parentKey, convertValue(data));
14484
+ }
14485
+ }
14486
+
14487
+ build(obj);
14488
+
14489
+ return formData;
14490
+ }
14491
+
14492
+ module.exports = toFormData;
14493
+
14494
+
14288
14495
  /***/ }),
14289
14496
 
14290
14497
  /***/ "./node_modules/axios/lib/helpers/validator.js":
@@ -14297,6 +14504,7 @@ module.exports = function spread(callback) {
14297
14504
 
14298
14505
 
14299
14506
  var VERSION = (__webpack_require__(/*! ../env/data */ "./node_modules/axios/lib/env/data.js").version);
14507
+ var AxiosError = __webpack_require__(/*! ../core/AxiosError */ "./node_modules/axios/lib/core/AxiosError.js");
14300
14508
 
14301
14509
  var validators = {};
14302
14510
 
@@ -14324,7 +14532,10 @@ validators.transitional = function transitional(validator, version, message) {
14324
14532
  // eslint-disable-next-line func-names
14325
14533
  return function(value, opt, opts) {
14326
14534
  if (validator === false) {
14327
- throw new Error(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')));
14535
+ throw new AxiosError(
14536
+ formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
14537
+ AxiosError.ERR_DEPRECATED
14538
+ );
14328
14539
  }
14329
14540
 
14330
14541
  if (version && !deprecatedWarnings[opt]) {
@@ -14351,7 +14562,7 @@ validators.transitional = function transitional(validator, version, message) {
14351
14562
 
14352
14563
  function assertOptions(options, schema, allowUnknown) {
14353
14564
  if (typeof options !== 'object') {
14354
- throw new TypeError('options must be an object');
14565
+ throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
14355
14566
  }
14356
14567
  var keys = Object.keys(options);
14357
14568
  var i = keys.length;
@@ -14362,12 +14573,12 @@ function assertOptions(options, schema, allowUnknown) {
14362
14573
  var value = options[opt];
14363
14574
  var result = value === undefined || validator(value, opt, options);
14364
14575
  if (result !== true) {
14365
- throw new TypeError('option ' + opt + ' must be ' + result);
14576
+ throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);
14366
14577
  }
14367
14578
  continue;
14368
14579
  }
14369
14580
  if (allowUnknown !== true) {
14370
- throw Error('Unknown option ' + opt);
14581
+ throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);
14371
14582
  }
14372
14583
  }
14373
14584
  }
@@ -14395,6 +14606,22 @@ var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/h
14395
14606
 
14396
14607
  var toString = Object.prototype.toString;
14397
14608
 
14609
+ // eslint-disable-next-line func-names
14610
+ var kindOf = (function(cache) {
14611
+ // eslint-disable-next-line func-names
14612
+ return function(thing) {
14613
+ var str = toString.call(thing);
14614
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
14615
+ };
14616
+ })(Object.create(null));
14617
+
14618
+ function kindOfTest(type) {
14619
+ type = type.toLowerCase();
14620
+ return function isKindOf(thing) {
14621
+ return kindOf(thing) === type;
14622
+ };
14623
+ }
14624
+
14398
14625
  /**
14399
14626
  * Determine if a value is an Array
14400
14627
  *
@@ -14429,22 +14656,12 @@ function isBuffer(val) {
14429
14656
  /**
14430
14657
  * Determine if a value is an ArrayBuffer
14431
14658
  *
14659
+ * @function
14432
14660
  * @param {Object} val The value to test
14433
14661
  * @returns {boolean} True if value is an ArrayBuffer, otherwise false
14434
14662
  */
14435
- function isArrayBuffer(val) {
14436
- return toString.call(val) === '[object ArrayBuffer]';
14437
- }
14663
+ var isArrayBuffer = kindOfTest('ArrayBuffer');
14438
14664
 
14439
- /**
14440
- * Determine if a value is a FormData
14441
- *
14442
- * @param {Object} val The value to test
14443
- * @returns {boolean} True if value is an FormData, otherwise false
14444
- */
14445
- function isFormData(val) {
14446
- return toString.call(val) === '[object FormData]';
14447
- }
14448
14665
 
14449
14666
  /**
14450
14667
  * Determine if a value is a view on an ArrayBuffer
@@ -14499,7 +14716,7 @@ function isObject(val) {
14499
14716
  * @return {boolean} True if value is a plain Object, otherwise false
14500
14717
  */
14501
14718
  function isPlainObject(val) {
14502
- if (toString.call(val) !== '[object Object]') {
14719
+ if (kindOf(val) !== 'object') {
14503
14720
  return false;
14504
14721
  }
14505
14722
 
@@ -14510,32 +14727,38 @@ function isPlainObject(val) {
14510
14727
  /**
14511
14728
  * Determine if a value is a Date
14512
14729
  *
14730
+ * @function
14513
14731
  * @param {Object} val The value to test
14514
14732
  * @returns {boolean} True if value is a Date, otherwise false
14515
14733
  */
14516
- function isDate(val) {
14517
- return toString.call(val) === '[object Date]';
14518
- }
14734
+ var isDate = kindOfTest('Date');
14519
14735
 
14520
14736
  /**
14521
14737
  * Determine if a value is a File
14522
14738
  *
14739
+ * @function
14523
14740
  * @param {Object} val The value to test
14524
14741
  * @returns {boolean} True if value is a File, otherwise false
14525
14742
  */
14526
- function isFile(val) {
14527
- return toString.call(val) === '[object File]';
14528
- }
14743
+ var isFile = kindOfTest('File');
14529
14744
 
14530
14745
  /**
14531
14746
  * Determine if a value is a Blob
14532
14747
  *
14748
+ * @function
14533
14749
  * @param {Object} val The value to test
14534
14750
  * @returns {boolean} True if value is a Blob, otherwise false
14535
14751
  */
14536
- function isBlob(val) {
14537
- return toString.call(val) === '[object Blob]';
14538
- }
14752
+ var isBlob = kindOfTest('Blob');
14753
+
14754
+ /**
14755
+ * Determine if a value is a FileList
14756
+ *
14757
+ * @function
14758
+ * @param {Object} val The value to test
14759
+ * @returns {boolean} True if value is a File, otherwise false
14760
+ */
14761
+ var isFileList = kindOfTest('FileList');
14539
14762
 
14540
14763
  /**
14541
14764
  * Determine if a value is a Function
@@ -14558,14 +14781,27 @@ function isStream(val) {
14558
14781
  }
14559
14782
 
14560
14783
  /**
14561
- * Determine if a value is a URLSearchParams object
14784
+ * Determine if a value is a FormData
14562
14785
  *
14786
+ * @param {Object} thing The value to test
14787
+ * @returns {boolean} True if value is an FormData, otherwise false
14788
+ */
14789
+ function isFormData(thing) {
14790
+ var pattern = '[object FormData]';
14791
+ return thing && (
14792
+ (typeof FormData === 'function' && thing instanceof FormData) ||
14793
+ toString.call(thing) === pattern ||
14794
+ (isFunction(thing.toString) && thing.toString() === pattern)
14795
+ );
14796
+ }
14797
+
14798
+ /**
14799
+ * Determine if a value is a URLSearchParams object
14800
+ * @function
14563
14801
  * @param {Object} val The value to test
14564
14802
  * @returns {boolean} True if value is a URLSearchParams object, otherwise false
14565
14803
  */
14566
- function isURLSearchParams(val) {
14567
- return toString.call(val) === '[object URLSearchParams]';
14568
- }
14804
+ var isURLSearchParams = kindOfTest('URLSearchParams');
14569
14805
 
14570
14806
  /**
14571
14807
  * Trim excess whitespace off the beginning and end of a string
@@ -14712,6 +14948,94 @@ function stripBOM(content) {
14712
14948
  return content;
14713
14949
  }
14714
14950
 
14951
+ /**
14952
+ * Inherit the prototype methods from one constructor into another
14953
+ * @param {function} constructor
14954
+ * @param {function} superConstructor
14955
+ * @param {object} [props]
14956
+ * @param {object} [descriptors]
14957
+ */
14958
+
14959
+ function inherits(constructor, superConstructor, props, descriptors) {
14960
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors);
14961
+ constructor.prototype.constructor = constructor;
14962
+ props && Object.assign(constructor.prototype, props);
14963
+ }
14964
+
14965
+ /**
14966
+ * Resolve object with deep prototype chain to a flat object
14967
+ * @param {Object} sourceObj source object
14968
+ * @param {Object} [destObj]
14969
+ * @param {Function} [filter]
14970
+ * @returns {Object}
14971
+ */
14972
+
14973
+ function toFlatObject(sourceObj, destObj, filter) {
14974
+ var props;
14975
+ var i;
14976
+ var prop;
14977
+ var merged = {};
14978
+
14979
+ destObj = destObj || {};
14980
+
14981
+ do {
14982
+ props = Object.getOwnPropertyNames(sourceObj);
14983
+ i = props.length;
14984
+ while (i-- > 0) {
14985
+ prop = props[i];
14986
+ if (!merged[prop]) {
14987
+ destObj[prop] = sourceObj[prop];
14988
+ merged[prop] = true;
14989
+ }
14990
+ }
14991
+ sourceObj = Object.getPrototypeOf(sourceObj);
14992
+ } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
14993
+
14994
+ return destObj;
14995
+ }
14996
+
14997
+ /*
14998
+ * determines whether a string ends with the characters of a specified string
14999
+ * @param {String} str
15000
+ * @param {String} searchString
15001
+ * @param {Number} [position= 0]
15002
+ * @returns {boolean}
15003
+ */
15004
+ function endsWith(str, searchString, position) {
15005
+ str = String(str);
15006
+ if (position === undefined || position > str.length) {
15007
+ position = str.length;
15008
+ }
15009
+ position -= searchString.length;
15010
+ var lastIndex = str.indexOf(searchString, position);
15011
+ return lastIndex !== -1 && lastIndex === position;
15012
+ }
15013
+
15014
+
15015
+ /**
15016
+ * Returns new array from array like object
15017
+ * @param {*} [thing]
15018
+ * @returns {Array}
15019
+ */
15020
+ function toArray(thing) {
15021
+ if (!thing) return null;
15022
+ var i = thing.length;
15023
+ if (isUndefined(i)) return null;
15024
+ var arr = new Array(i);
15025
+ while (i-- > 0) {
15026
+ arr[i] = thing[i];
15027
+ }
15028
+ return arr;
15029
+ }
15030
+
15031
+ // eslint-disable-next-line func-names
15032
+ var isTypedArray = (function(TypedArray) {
15033
+ // eslint-disable-next-line func-names
15034
+ return function(thing) {
15035
+ return TypedArray && thing instanceof TypedArray;
15036
+ };
15037
+ })(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array));
15038
+
14715
15039
  module.exports = {
14716
15040
  isArray: isArray,
14717
15041
  isArrayBuffer: isArrayBuffer,
@@ -14734,7 +15058,15 @@ module.exports = {
14734
15058
  merge: merge,
14735
15059
  extend: extend,
14736
15060
  trim: trim,
14737
- stripBOM: stripBOM
15061
+ stripBOM: stripBOM,
15062
+ inherits: inherits,
15063
+ toFlatObject: toFlatObject,
15064
+ kindOf: kindOf,
15065
+ kindOfTest: kindOfTest,
15066
+ endsWith: endsWith,
15067
+ toArray: toArray,
15068
+ isTypedArray: isTypedArray,
15069
+ isFileList: isFileList
14738
15070
  };
14739
15071
 
14740
15072
 
@@ -35141,7 +35473,7 @@ function formatOffset(offset, format) {
35141
35473
  function timeObject(obj) {
35142
35474
  return pick(obj, ["hour", "minute", "second", "millisecond"]);
35143
35475
  }
35144
- var ianaRegex = /[A-Za-z_+-]{1,256}(:?\/[A-Za-z0-9_+-]{1,256}(\/[A-Za-z0-9_+-]{1,256})?)?/;
35476
+ var ianaRegex = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;
35145
35477
 
35146
35478
  /**
35147
35479
  * @private
@@ -35915,6 +36247,11 @@ var Zone = /*#__PURE__*/function () {
35915
36247
  get: function get() {
35916
36248
  throw new ZoneIsAbstractError();
35917
36249
  }
36250
+ }, {
36251
+ key: "ianaName",
36252
+ get: function get() {
36253
+ return this.name;
36254
+ }
35918
36255
  /**
35919
36256
  * Returns whether the offset is known to be fixed for the whole year.
35920
36257
  * @abstract
@@ -36349,6 +36686,15 @@ var FixedOffsetZone = /*#__PURE__*/function (_Zone) {
36349
36686
  get: function get() {
36350
36687
  return this.fixed === 0 ? "UTC" : "UTC" + formatOffset(this.fixed, "narrow");
36351
36688
  }
36689
+ }, {
36690
+ key: "ianaName",
36691
+ get: function get() {
36692
+ if (this.fixed === 0) {
36693
+ return "Etc/UTC";
36694
+ } else {
36695
+ return "Etc/GMT" + formatOffset(-this.fixed, "narrow");
36696
+ }
36697
+ }
36352
36698
  }, {
36353
36699
  key: "isUniversal",
36354
36700
  get: function get() {
@@ -37258,7 +37604,7 @@ function combineExtractors() {
37258
37604
  zone = _ex[1],
37259
37605
  next = _ex[2];
37260
37606
 
37261
- return [_extends({}, mergedVals, val), mergedZone || zone, next];
37607
+ return [_extends({}, mergedVals, val), zone || mergedZone, next];
37262
37608
  }, [{}, null, 1]).slice(0, 2);
37263
37609
  };
37264
37610
  }
@@ -37304,19 +37650,20 @@ function simpleParse() {
37304
37650
  } // ISO and SQL parsing
37305
37651
 
37306
37652
 
37307
- var offsetRegex = /(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,
37308
- isoTimeBaseRegex = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,
37309
- isoTimeRegex = RegExp("" + isoTimeBaseRegex.source + offsetRegex.source + "?"),
37310
- isoTimeExtensionRegex = RegExp("(?:T" + isoTimeRegex.source + ")?"),
37311
- isoYmdRegex = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,
37312
- isoWeekRegex = /(\d{4})-?W(\d\d)(?:-?(\d))?/,
37313
- isoOrdinalRegex = /(\d{4})-?(\d{3})/,
37314
- extractISOWeekData = simpleParse("weekYear", "weekNumber", "weekDay"),
37315
- extractISOOrdinalData = simpleParse("year", "ordinal"),
37316
- sqlYmdRegex = /(\d{4})-(\d\d)-(\d\d)/,
37317
- // dumbed-down version of the ISO one
37318
- sqlTimeRegex = RegExp(isoTimeBaseRegex.source + " ?(?:" + offsetRegex.source + "|(" + ianaRegex.source + "))?"),
37319
- sqlTimeExtensionRegex = RegExp("(?: " + sqlTimeRegex.source + ")?");
37653
+ var offsetRegex = /(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/;
37654
+ var isoExtendedZone = "(?:" + offsetRegex.source + "?(?:\\[(" + ianaRegex.source + ")\\])?)?";
37655
+ var isoTimeBaseRegex = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/;
37656
+ var isoTimeRegex = RegExp("" + isoTimeBaseRegex.source + isoExtendedZone);
37657
+ var isoTimeExtensionRegex = RegExp("(?:T" + isoTimeRegex.source + ")?");
37658
+ var isoYmdRegex = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/;
37659
+ var isoWeekRegex = /(\d{4})-?W(\d\d)(?:-?(\d))?/;
37660
+ var isoOrdinalRegex = /(\d{4})-?(\d{3})/;
37661
+ var extractISOWeekData = simpleParse("weekYear", "weekNumber", "weekDay");
37662
+ var extractISOOrdinalData = simpleParse("year", "ordinal");
37663
+ var sqlYmdRegex = /(\d{4})-(\d\d)-(\d\d)/; // dumbed-down version of the ISO one
37664
+
37665
+ var sqlTimeRegex = RegExp(isoTimeBaseRegex.source + " ?(?:" + offsetRegex.source + "|(" + ianaRegex.source + "))?");
37666
+ var sqlTimeExtensionRegex = RegExp("(?: " + sqlTimeRegex.source + ")?");
37320
37667
 
37321
37668
  function int(match, pos, fallback) {
37322
37669
  var m = match[pos];
@@ -37491,11 +37838,11 @@ var isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionR
37491
37838
  var isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex);
37492
37839
  var isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex);
37493
37840
  var isoTimeCombinedRegex = combineRegexes(isoTimeRegex);
37494
- var extractISOYmdTimeAndOffset = combineExtractors(extractISOYmd, extractISOTime, extractISOOffset);
37495
- var extractISOWeekTimeAndOffset = combineExtractors(extractISOWeekData, extractISOTime, extractISOOffset);
37496
- var extractISOOrdinalDateAndTime = combineExtractors(extractISOOrdinalData, extractISOTime, extractISOOffset);
37497
- var extractISOTimeAndOffset = combineExtractors(extractISOTime, extractISOOffset);
37498
- /**
37841
+ var extractISOYmdTimeAndOffset = combineExtractors(extractISOYmd, extractISOTime, extractISOOffset, extractIANAZone);
37842
+ var extractISOWeekTimeAndOffset = combineExtractors(extractISOWeekData, extractISOTime, extractISOOffset, extractIANAZone);
37843
+ var extractISOOrdinalDateAndTime = combineExtractors(extractISOOrdinalData, extractISOTime, extractISOOffset, extractIANAZone);
37844
+ var extractISOTimeAndOffset = combineExtractors(extractISOTime, extractISOOffset, extractIANAZone);
37845
+ /*
37499
37846
  * @private
37500
37847
  */
37501
37848
 
@@ -37517,10 +37864,9 @@ function parseISOTimeOnly(s) {
37517
37864
  }
37518
37865
  var sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex);
37519
37866
  var sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex);
37520
- var extractISOYmdTimeOffsetAndIANAZone = combineExtractors(extractISOYmd, extractISOTime, extractISOOffset, extractIANAZone);
37521
37867
  var extractISOTimeOffsetAndIANAZone = combineExtractors(extractISOTime, extractISOOffset, extractIANAZone);
37522
37868
  function parseSQL(s) {
37523
- return parse(s, [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeOffsetAndIANAZone], [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]);
37869
+ return parse(s, [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset], [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]);
37524
37870
  }
37525
37871
 
37526
37872
  var INVALID$2 = "Invalid Duration"; // unit conversion constants
@@ -39668,7 +40014,7 @@ function intUnit(regex, post) {
39668
40014
  }
39669
40015
 
39670
40016
  var NBSP = String.fromCharCode(160);
39671
- var spaceOrNBSP = "( |" + NBSP + ")";
40017
+ var spaceOrNBSP = "[ " + NBSP + "]";
39672
40018
  var spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, "g");
39673
40019
 
39674
40020
  function fixListRegex(s) {
@@ -40552,7 +40898,7 @@ function _toISODate(o, extended) {
40552
40898
  return c;
40553
40899
  }
40554
40900
 
40555
- function _toISOTime(o, extended, suppressSeconds, suppressMilliseconds, includeOffset) {
40901
+ function _toISOTime(o, extended, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone) {
40556
40902
  var c = padStart(o.c.hour);
40557
40903
 
40558
40904
  if (extended) {
@@ -40576,7 +40922,7 @@ function _toISOTime(o, extended, suppressSeconds, suppressMilliseconds, includeO
40576
40922
  }
40577
40923
 
40578
40924
  if (includeOffset) {
40579
- if (o.isOffsetFixed && o.offset === 0) {
40925
+ if (o.isOffsetFixed && o.offset === 0 && !extendedZone) {
40580
40926
  c += "Z";
40581
40927
  } else if (o.o < 0) {
40582
40928
  c += "-";
@@ -40591,6 +40937,10 @@ function _toISOTime(o, extended, suppressSeconds, suppressMilliseconds, includeO
40591
40937
  }
40592
40938
  }
40593
40939
 
40940
+ if (extendedZone) {
40941
+ c += "[" + o.zone.ianaName + "]";
40942
+ }
40943
+
40594
40944
  return c;
40595
40945
  } // defaults for unspecified units in the supported calendars
40596
40946
 
@@ -41764,6 +42114,7 @@ var DateTime = /*#__PURE__*/function () {
41764
42114
  * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0
41765
42115
  * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0
41766
42116
  * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'
42117
+ * @param {boolean} [opts.extendedZone=true] - add the time zone format extension
41767
42118
  * @param {string} [opts.format='extended'] - choose between the basic and extended format
41768
42119
  * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z'
41769
42120
  * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00'
@@ -41782,7 +42133,9 @@ var DateTime = /*#__PURE__*/function () {
41782
42133
  _ref4$suppressMillise = _ref4.suppressMilliseconds,
41783
42134
  suppressMilliseconds = _ref4$suppressMillise === void 0 ? false : _ref4$suppressMillise,
41784
42135
  _ref4$includeOffset = _ref4.includeOffset,
41785
- includeOffset = _ref4$includeOffset === void 0 ? true : _ref4$includeOffset;
42136
+ includeOffset = _ref4$includeOffset === void 0 ? true : _ref4$includeOffset,
42137
+ _ref4$extendedZone = _ref4.extendedZone,
42138
+ extendedZone = _ref4$extendedZone === void 0 ? false : _ref4$extendedZone;
41786
42139
 
41787
42140
  if (!this.isValid) {
41788
42141
  return null;
@@ -41793,7 +42146,7 @@ var DateTime = /*#__PURE__*/function () {
41793
42146
  var c = _toISODate(this, ext);
41794
42147
 
41795
42148
  c += "T";
41796
- c += _toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset);
42149
+ c += _toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone);
41797
42150
  return c;
41798
42151
  }
41799
42152
  /**
@@ -41833,6 +42186,7 @@ var DateTime = /*#__PURE__*/function () {
41833
42186
  * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0
41834
42187
  * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0
41835
42188
  * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'
42189
+ * @param {boolean} [opts.extendedZone=true] - add the time zone format extension
41836
42190
  * @param {boolean} [opts.includePrefix=false] - include the `T` prefix
41837
42191
  * @param {string} [opts.format='extended'] - choose between the basic and extended format
41838
42192
  * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z'
@@ -41853,6 +42207,8 @@ var DateTime = /*#__PURE__*/function () {
41853
42207
  includeOffset = _ref6$includeOffset === void 0 ? true : _ref6$includeOffset,
41854
42208
  _ref6$includePrefix = _ref6.includePrefix,
41855
42209
  includePrefix = _ref6$includePrefix === void 0 ? false : _ref6$includePrefix,
42210
+ _ref6$extendedZone = _ref6.extendedZone,
42211
+ extendedZone = _ref6$extendedZone === void 0 ? false : _ref6$extendedZone,
41856
42212
  _ref6$format = _ref6.format,
41857
42213
  format = _ref6$format === void 0 ? "extended" : _ref6$format;
41858
42214
 
@@ -41861,7 +42217,7 @@ var DateTime = /*#__PURE__*/function () {
41861
42217
  }
41862
42218
 
41863
42219
  var c = includePrefix ? "T" : "";
41864
- return c + _toISOTime(this, format === "extended", suppressSeconds, suppressMilliseconds, includeOffset);
42220
+ return c + _toISOTime(this, format === "extended", suppressSeconds, suppressMilliseconds, includeOffset, extendedZone);
41865
42221
  }
41866
42222
  /**
41867
42223
  * Returns an RFC 2822-compatible string representation of this DateTime
@@ -42668,7 +43024,8 @@ var DateTime = /*#__PURE__*/function () {
42668
43024
  return false;
42669
43025
  } else {
42670
43026
  return this.offset > this.set({
42671
- month: 1
43027
+ month: 1,
43028
+ day: 1
42672
43029
  }).offset || this.offset > this.set({
42673
43030
  month: 5
42674
43031
  }).offset;
@@ -42954,7 +43311,7 @@ function friendlyDateTime(dateTimeish) {
42954
43311
  }
42955
43312
  }
42956
43313
 
42957
- var VERSION = "2.3.2";
43314
+ var VERSION = "2.4.0";
42958
43315
 
42959
43316
  exports.DateTime = DateTime;
42960
43317
  exports.Duration = Duration;
@@ -43958,7 +44315,7 @@ var stringify = function stringify(
43958
44315
  for (var i = 0; i < valuesArray.length; ++i) {
43959
44316
  valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults.encoder, charset, 'value', format));
43960
44317
  }
43961
- return [formatter(keyValue) + '=' + valuesJoined];
44318
+ return [formatter(keyValue) + (isArray(obj) && valuesArray.length === 1 ? '[]' : '') + '=' + valuesJoined];
43962
44319
  }
43963
44320
  return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];
43964
44321
  }
@@ -43982,6 +44339,8 @@ var stringify = function stringify(
43982
44339
  objKeys = sort ? keys.sort(sort) : keys;
43983
44340
  }
43984
44341
 
44342
+ var adjustedPrefix = generateArrayPrefix === 'comma' && isArray(obj) && obj.length === 1 ? prefix + '[]' : prefix;
44343
+
43985
44344
  for (var j = 0; j < objKeys.length; ++j) {
43986
44345
  var key = objKeys[j];
43987
44346
  var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
@@ -43991,8 +44350,8 @@ var stringify = function stringify(
43991
44350
  }
43992
44351
 
43993
44352
  var keyPrefix = isArray(obj)
43994
- ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix
43995
- : prefix + (allowDots ? '.' + key : '[' + key + ']');
44353
+ ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix
44354
+ : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']');
43996
44355
 
43997
44356
  sideChannel.set(object, step);
43998
44357
  var valueSideChannel = getSideChannel();