@blockchyp/blockchyp-ts 2.30.0 → 2.30.3
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 +30 -2
- package/_bundles/blockchyp.js +1416 -951
- package/_bundles/blockchyp.js.map +1 -1
- package/_bundles/blockchyp.min.js +1 -1
- package/_bundles/blockchyp.min.js.LICENSE.txt +1 -1
- package/_bundles/blockchyp.min.js.map +1 -1
- package/lib/src/client.d.ts +5 -1
- package/lib/src/client.js +6 -0
- package/lib/src/client.js.map +1 -1
- package/lib/src/models.d.ts +146 -115
- package/lib/src/models.js +133 -124
- package/lib/src/models.js.map +1 -1
- package/package.json +5 -2
- package/src/client.ts +8 -1
- package/src/models.ts +238 -186
package/_bundles/blockchyp.js
CHANGED
|
@@ -29603,6 +29603,12 @@ class BlockChypClient {
|
|
|
29603
29603
|
surchargeReview(request) {
|
|
29604
29604
|
return this._gatewayRequest('post', '/api/surcharge-review', request);
|
|
29605
29605
|
}
|
|
29606
|
+
/**
|
|
29607
|
+
* Generates a short-lived API key scoped to terminal and payment operations.
|
|
29608
|
+
*/
|
|
29609
|
+
transientKey(request) {
|
|
29610
|
+
return this._gatewayRequest('post', '/api/transient-credentials', request);
|
|
29611
|
+
}
|
|
29606
29612
|
/**
|
|
29607
29613
|
* Captures a preauthorization.
|
|
29608
29614
|
*/
|
|
@@ -30373,8 +30379,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
30373
30379
|
exports.TransactionStatus = exports.PaymentLinkStatusResponse = exports.PaymentLinkStatusRequest = exports.TransactionStatusRequest = exports.AuthorizationResponse = exports.TermsAndConditionsResponse = exports.TermsAndConditionsRequest = exports.CloseBatchResponse = exports.CloseBatchRequest = exports.GiftActivateResponse = exports.GiftActivateRequest = exports.ClearTerminalRequest = exports.EnrollResponse = exports.EnrollRequest = exports.VoidResponse = exports.VoidRequest = exports.CaptureResponse = exports.CaptureRequest = exports.RefundRequest = exports.BalanceResponse = exports.BalanceRequest = exports.CardMetadataResponse = exports.CardMetadataRequest = exports.CardMetadata = exports.AuthorizationRequest = exports.WhiteListedCard = exports.BooleanPromptResponse = exports.TextPromptResponse = exports.CustomerToken = exports.UpdateTokenResponse = exports.UpdateTokenRequest = exports.TokenMetadataResponse = exports.TokenMetadataRequest = exports.Customer = exports.CustomerSearchResponse = exports.UpdateCustomerRequest = exports.CustomerSearchRequest = exports.CustomerResponse = exports.CustomerRequest = exports.TextPromptRequest = exports.BooleanPromptRequest = exports.MessageRequest = exports.LocateResponse = exports.LocateRequest = exports.PingResponse = exports.PingRequest = exports.CaptureSignatureResponse = exports.CaptureSignatureRequest = exports.Acknowledgement = exports.ReceiptSuggestions = void 0;
|
|
30374
30380
|
exports.UpdateMerchantPlatformRequest = exports.MerchantPlatformsResponse = exports.MerchantUser = exports.MerchantUsersResponse = exports.GetMerchantsResponse = exports.GetMerchantsRequest = exports.HealthcareGroup = exports.HealthcareMetadata = exports.UnlinkTokenRequest = exports.LinkTokenRequest = exports.DeleteTokenResponse = exports.DeleteTokenRequest = exports.DeleteCustomerResponse = exports.DeleteCustomerRequest = exports.DeleteQueuedTransactionResponse = exports.DeleteQueuedTransactionRequest = exports.ListQueuedTransactionsResponse = exports.ListQueuedTransactionsRequest = exports.BankAccount = exports.MerchantProfileResponse = exports.MerchantProfile = exports.Address = exports.InviteMerchantUserRequest = exports.MerchantPlatformRequest = exports.MerchantProfileRequest = exports.AddGatewayMerchantRequest = exports.AddTestMerchantRequest = exports.TerminalVolume = exports.BatchDetailsResponse = exports.BatchDetailsRequest = exports.BatchSummary = exports.BatchHistoryResponse = exports.BatchHistoryRequest = exports.TransactionHistoryResponse = exports.TransactionHistoryRequest = exports.CashDiscountResponse = exports.CashDiscountRequest = exports.ResendPaymentLinkResponse = exports.ResendPaymentLinkRequest = exports.CancelPaymentLinkResponse = exports.CancelPaymentLinkRequest = exports.PaymentLinkResponse = exports.PaymentLinkRequest = exports.TerminalStatusResponse = exports.TerminalStatusRequest = exports.HeartbeatResponse = exports.TransactionDisplayRequest = exports.TransactionDisplayTransaction = exports.TransactionDisplayItem = exports.TransactionDisplayDiscount = void 0;
|
|
30375
30381
|
exports.StatementDeposit = exports.InvoicePayment = exports.InvoiceLineItem = exports.MerchantInvoiceDetailResponse = exports.MerchantInvoiceDetailRequest = exports.MerchantInvoiceSummary = exports.MerchantInvoiceListResponse = exports.MerchantInvoiceListRequest = exports.PartnerStatementAdjustment = exports.PartnerStatementDisbursement = exports.PartnerStatementLineItem = exports.PartnerStatementDetailResponse = exports.PartnerStatementDetailRequest = exports.PartnerStatementListResponse = exports.PartnerStatementSummary = exports.PartnerStatementListRequest = exports.PricingPolicyResponse = exports.PricePoint = exports.PricingPolicyRequest = exports.BrandingAssetResponse = exports.BrandingAsset = exports.BrandingAssetRequest = exports.SlideShowRequest = exports.SlideShowResponse = exports.SlideShow = exports.Slide = exports.MediaLibraryResponse = exports.MediaRequest = exports.UploadStatusRequest = exports.UploadStatus = exports.UploadMetadata = exports.MediaMetadata = exports.SurveyResultsRequest = exports.SurveyDataPoint = exports.SurveyQuestionResponse = exports.SurveyQuestionRequest = exports.SurveyQuestion = exports.TermsAndConditionsLogEntry = exports.TermsAndConditionsLogResponse = exports.TermsAndConditionsLogRequest = exports.TermsAndConditionsTemplateResponse = exports.TermsAndConditionsTemplateRequest = exports.TermsAndConditionsTemplate = exports.TerminalProfile = exports.TerminalActivationRequest = exports.TerminalDeactivationRequest = exports.TerminalProfileResponse = exports.TerminalProfileRequest = exports.MerchantPlatform = exports.UpdateMerchantPlatformResponse = void 0;
|
|
30376
|
-
exports.PaymentMethod = exports.PaymentAmounts = exports.CryptocurrencyResponse = exports.PaymentMethodResponse = exports.CoreRequest = exports.TimeoutRequest = exports.ApprovalResponse = exports.SignatureRequest = exports.SignatureResponse = exports.TerminalReference = exports.AbstractAcknowledgement = exports.TerminalDeleteQueuedTransactionRequest = exports.TerminalListQueuedTransactionsRequest = exports.TerminalTerminalStatusRequest = exports.TerminalTransactionDisplayRequest = exports.TerminalTermsAndConditionsResponse = exports.TerminalTermsAndConditionsRequest = exports.TerminalGiftActivateRequest = exports.TerminalClearTerminalRequest = exports.TerminalEnrollRequest = exports.TerminalRefundRequest = exports.TerminalBalanceRequest = exports.TerminalCardMetadataRequest = exports.TerminalAuthorizationRequest = exports.TerminalTextPromptRequest = exports.TerminalBooleanPromptRequest = exports.TerminalMessageRequest = exports.TerminalLocateRequest = exports.TerminalPingRequest = exports.TerminalCaptureSignatureRequest = exports.
|
|
30377
|
-
exports.CoreResponse =
|
|
30382
|
+
exports.PreviousTransaction = exports.Subtotals = exports.RequestAmount = exports.PaymentMethod = exports.PaymentAmounts = exports.CryptocurrencyResponse = exports.PaymentMethodResponse = exports.CoreRequest = exports.TimeoutRequest = exports.ApprovalResponse = exports.SignatureRequest = exports.SignatureResponse = exports.TerminalReference = exports.AbstractAcknowledgement = exports.TerminalDeleteQueuedTransactionRequest = exports.TerminalListQueuedTransactionsRequest = exports.TerminalTerminalStatusRequest = exports.TerminalTransactionDisplayRequest = exports.TerminalTermsAndConditionsResponse = exports.TerminalTermsAndConditionsRequest = exports.TerminalGiftActivateRequest = exports.TerminalClearTerminalRequest = exports.TerminalEnrollRequest = exports.TerminalRefundRequest = exports.TerminalBalanceRequest = exports.TerminalCardMetadataRequest = exports.TerminalAuthorizationRequest = exports.TerminalTextPromptRequest = exports.TerminalBooleanPromptRequest = exports.TerminalMessageRequest = exports.TerminalLocateRequest = exports.TerminalPingRequest = exports.TerminalCaptureSignatureRequest = exports.TransientKeyResponse = exports.TransientKeyRequest = exports.SurchargeReviewResponse = exports.SurchargeAttributeResponseData = exports.SurchargeReviewResponseData = exports.SurchargeReviewRequest = exports.SubmitApplicationRequest = exports.MerchantApplication = exports.ApplicationAccount = exports.Owner = exports.AggregateBillingLineItemStats = exports.AggregateBillingLineItem = exports.BuyRateLineItem = exports.MerchantCredentialGenerationResponse = exports.MerchantCredentialGenerationRequest = exports.PartnerCommissionBreakdownResponse = exports.PartnerCommissionBreakdownRequest = void 0;
|
|
30383
|
+
exports.CoreResponse = void 0;
|
|
30378
30384
|
// CardType is used to differentiate credit, debit, and EBT.
|
|
30379
30385
|
var CardType;
|
|
30380
30386
|
(function (CardType) {
|
|
@@ -31522,7 +31528,7 @@ exports.WhiteListedCard = WhiteListedCard;
|
|
|
31522
31528
|
*/
|
|
31523
31529
|
class AuthorizationRequest {
|
|
31524
31530
|
// Constructor with default values for optional fields
|
|
31525
|
-
constructor(timeout = null, test = null, transactionRef = undefined, autogeneratedRef = null, async = null, queue = null, waitForRemovedCard = false, force = false, orderRef = undefined, destinationAccount = undefined, testCase = undefined, token = undefined, track1 = undefined, track2 = undefined, pan = undefined, routingNumber = undefined, cardholderName = undefined, expMonth = undefined, expYear = undefined, cvv = undefined, address = undefined, postalCode = undefined, country = undefined, manualEntry = false, ksn = undefined, pinBlock = undefined, cardType = undefined, paymentType = undefined, currencyCode = null, amount = null, taxExempt = null, surcharge = null, cashDiscount = null, sigFile = undefined, sigFormat = undefined, sigWidth = 0, disableSignature = false, tipAmount = undefined, taxAmount = undefined, terminalName = undefined, resetConnection = null, transactionId = undefined, onlineAuthCode = undefined, enroll = false, bypassDupeFilter = false, description = undefined, promptForTip = false, cashBackEnabled = false, cardOnFile = false, recurring = false, cit = false, mit = false, subscription = false, purchaseOrderNumber = undefined, supplierReferenceNumber = undefined, lineItems = null, altPrices = undefined, customer = undefined, roundingMode = undefined, healthcareMetadata = undefined, cryptocurrency = undefined, cryptoNetwork = undefined, cryptoReceiveAddress = undefined, paymentRequestLabel = undefined, paymentRequestMessage = undefined, simulateChipRejection = false, simulateOutOfOrderReversal = false, asyncReversals = false, passthroughSurcharge = undefined, healthcare = false, healthcareTotal = undefined, ebtTotal = undefined, cardMetadataLookup = false, totalDiscountAmount = undefined, shippingAmount = undefined, dutyAmount = undefined, processorId = undefined, externalCustomerId = undefined, destinationCountryCode = undefined, shipFromPostalCode = undefined, shipToPostalCode = undefined, orderDate = undefined) {
|
|
31531
|
+
constructor(timeout = null, test = null, transactionRef = undefined, autogeneratedRef = null, async = null, queue = null, waitForRemovedCard = false, force = false, orderRef = undefined, destinationAccount = undefined, testCase = undefined, token = undefined, track1 = undefined, track2 = undefined, pan = undefined, routingNumber = undefined, cardholderName = undefined, expMonth = undefined, expYear = undefined, cvv = undefined, address = undefined, postalCode = undefined, country = undefined, manualEntry = false, ksn = undefined, pinBlock = undefined, cardType = undefined, paymentType = undefined, currencyCode = null, amount = null, taxExempt = null, surcharge = null, cashDiscount = null, sigFile = undefined, sigFormat = undefined, sigWidth = 0, disableSignature = false, tipAmount = undefined, taxAmount = undefined, terminalName = undefined, resetConnection = null, transactionId = undefined, onlineAuthCode = undefined, enroll = false, bypassDupeFilter = false, description = undefined, promptForTip = false, cashBackEnabled = false, cardOnFile = false, recurring = false, cit = false, mit = false, subscription = false, purchaseOrderNumber = undefined, supplierReferenceNumber = undefined, lineItems = null, altPrices = undefined, customer = undefined, roundingMode = undefined, healthcareMetadata = undefined, cryptocurrency = undefined, cryptoNetwork = undefined, cryptoReceiveAddress = undefined, paymentRequestLabel = undefined, paymentRequestMessage = undefined, simulateChipRejection = false, simulateOutOfOrderReversal = false, asyncReversals = false, passthroughSurcharge = undefined, healthcare = false, healthcareTotal = undefined, ebtTotal = undefined, cardMetadataLookup = false, totalDiscountAmount = undefined, shippingAmount = undefined, dutyAmount = undefined, processorId = undefined, externalCustomerId = undefined, destinationCountryCode = undefined, shipFromPostalCode = undefined, shipToPostalCode = undefined, orderDate = undefined, shipmentCount = null, shipmentNumber = null, externalPartnerMetadata = undefined) {
|
|
31526
31532
|
/**
|
|
31527
31533
|
* The request timeout in seconds.
|
|
31528
31534
|
*/
|
|
@@ -31576,6 +31582,14 @@ class AuthorizationRequest {
|
|
|
31576
31582
|
* An item to display. Can be overwritten or appended, based on the request type.
|
|
31577
31583
|
*/
|
|
31578
31584
|
this.lineItems = null;
|
|
31585
|
+
/**
|
|
31586
|
+
* The number of shipments the original authorization will be broken into.
|
|
31587
|
+
*/
|
|
31588
|
+
this.shipmentCount = null;
|
|
31589
|
+
/**
|
|
31590
|
+
* Which shipment this particular capture is for.
|
|
31591
|
+
*/
|
|
31592
|
+
this.shipmentNumber = null;
|
|
31579
31593
|
this.timeout = timeout;
|
|
31580
31594
|
this.test = test;
|
|
31581
31595
|
this.transactionRef = transactionRef;
|
|
@@ -31658,6 +31672,9 @@ class AuthorizationRequest {
|
|
|
31658
31672
|
this.shipFromPostalCode = shipFromPostalCode;
|
|
31659
31673
|
this.shipToPostalCode = shipToPostalCode;
|
|
31660
31674
|
this.orderDate = orderDate;
|
|
31675
|
+
this.shipmentCount = shipmentCount;
|
|
31676
|
+
this.shipmentNumber = shipmentNumber;
|
|
31677
|
+
this.externalPartnerMetadata = externalPartnerMetadata;
|
|
31661
31678
|
}
|
|
31662
31679
|
}
|
|
31663
31680
|
exports.AuthorizationRequest = AuthorizationRequest;
|
|
@@ -32209,7 +32226,7 @@ exports.CaptureRequest = CaptureRequest;
|
|
|
32209
32226
|
*/
|
|
32210
32227
|
class CaptureResponse {
|
|
32211
32228
|
// Constructor with default values for optional fields
|
|
32212
|
-
constructor(success = null, error = null, responseDescription = null, approved = null, authCode = undefined, authResponseCode = undefined, transactionId = null, batchId = undefined, transactionRef = undefined, transactionType = null, timestamp = null, tickBlock = null, test = null, destinationAccount = undefined, sig = undefined, partialAuth = null, altCurrency = null, fsaAuth = null, currencyCode = null, requestedAmount = null, authorizedAmount = null, remainingBalance = null, tipAmount = null, taxAmount = null, requestedCashBackAmount = null, authorizedCashBackAmount = null, token = undefined, entryMethod = undefined, paymentType = undefined, network = undefined, logo = undefined, maskedPan = undefined, publicKey = undefined, ScopeAlert = false, cardHolder = undefined, expMonth = undefined, expYear = undefined, postalCode = undefined, address = undefined, country = undefined, avsResponse = null, cvvResponse = undefined, receiptSuggestions = null, customer = undefined, customers = null) {
|
|
32229
|
+
constructor(success = null, error = null, responseDescription = null, approved = null, authCode = undefined, authResponseCode = undefined, transactionId = null, batchId = undefined, transactionRef = undefined, transactionType = null, timestamp = null, tickBlock = null, test = null, destinationAccount = undefined, sig = undefined, partialAuth = null, altCurrency = null, fsaAuth = null, currencyCode = null, requestedAmount = null, authorizedAmount = null, remainingBalance = null, tipAmount = null, taxAmount = null, requestedCashBackAmount = null, authorizedCashBackAmount = null, token = undefined, entryMethod = undefined, paymentType = undefined, network = undefined, logo = undefined, maskedPan = undefined, publicKey = undefined, ScopeAlert = false, cardHolder = undefined, expMonth = undefined, expYear = undefined, postalCode = undefined, address = undefined, country = undefined, avsResponse = null, cvvResponse = undefined, receiptSuggestions = null, customer = undefined, customers = null, enhancedDataPassed = false) {
|
|
32213
32230
|
/**
|
|
32214
32231
|
* Whether or not the request succeeded.
|
|
32215
32232
|
*/
|
|
@@ -32349,6 +32366,7 @@ class CaptureResponse {
|
|
|
32349
32366
|
this.receiptSuggestions = receiptSuggestions;
|
|
32350
32367
|
this.customer = customer;
|
|
32351
32368
|
this.customers = customers;
|
|
32369
|
+
this.enhancedDataPassed = enhancedDataPassed;
|
|
32352
32370
|
}
|
|
32353
32371
|
}
|
|
32354
32372
|
exports.CaptureResponse = CaptureResponse;
|
|
@@ -33119,7 +33137,7 @@ exports.TermsAndConditionsResponse = TermsAndConditionsResponse;
|
|
|
33119
33137
|
*/
|
|
33120
33138
|
class AuthorizationResponse {
|
|
33121
33139
|
// Constructor with default values for optional fields
|
|
33122
|
-
constructor(success = null, error = null, responseDescription = null, approved = null, authCode = undefined, authResponseCode = undefined, transactionId = null, batchId = undefined, transactionRef = undefined, transactionType = null, timestamp = null, tickBlock = null, test = null, destinationAccount = undefined, sig = undefined, partialAuth = null, altCurrency = null, fsaAuth = null, currencyCode = null, requestedAmount = null, authorizedAmount = null, remainingBalance = null, tipAmount = null, taxAmount = null, requestedCashBackAmount = null, authorizedCashBackAmount = null, confirmed = null, cryptoAuthorizedAmount = null, cryptoNetworkFee = null, cryptocurrency = null, cryptoNetwork = null, cryptoReceiveAddress = null, cryptoBlock = null, cryptoTransactionId = null, cryptoPaymentRequest = null, cryptoStatus = null, token = undefined, entryMethod = undefined, paymentType = undefined, network = undefined, logo = undefined, maskedPan = undefined, publicKey = undefined, ScopeAlert = false, cardHolder = undefined, expMonth = undefined, expYear = undefined, postalCode = undefined, address = undefined, country = undefined, avsResponse = null, cvvResponse = undefined, receiptSuggestions = null, customer = undefined, customers = null, sigFile = undefined, whiteListedCard = undefined, storeAndForward = null, status = null, cardMetadata = undefined) {
|
|
33140
|
+
constructor(success = null, error = null, responseDescription = null, approved = null, authCode = undefined, authResponseCode = undefined, transactionId = null, batchId = undefined, transactionRef = undefined, transactionType = null, timestamp = null, tickBlock = null, test = null, destinationAccount = undefined, sig = undefined, partialAuth = null, altCurrency = null, fsaAuth = null, currencyCode = null, requestedAmount = null, authorizedAmount = null, remainingBalance = null, tipAmount = null, taxAmount = null, requestedCashBackAmount = null, authorizedCashBackAmount = null, confirmed = null, cryptoAuthorizedAmount = null, cryptoNetworkFee = null, cryptocurrency = null, cryptoNetwork = null, cryptoReceiveAddress = null, cryptoBlock = null, cryptoTransactionId = null, cryptoPaymentRequest = null, cryptoStatus = null, token = undefined, entryMethod = undefined, paymentType = undefined, network = undefined, logo = undefined, maskedPan = undefined, publicKey = undefined, ScopeAlert = false, cardHolder = undefined, expMonth = undefined, expYear = undefined, postalCode = undefined, address = undefined, country = undefined, avsResponse = null, cvvResponse = undefined, receiptSuggestions = null, customer = undefined, customers = null, sigFile = undefined, whiteListedCard = undefined, storeAndForward = null, status = null, cardMetadata = undefined, enhancedDataPassed = false) {
|
|
33123
33141
|
/**
|
|
33124
33142
|
* Whether or not the request succeeded.
|
|
33125
33143
|
*/
|
|
@@ -33326,6 +33344,7 @@ class AuthorizationResponse {
|
|
|
33326
33344
|
this.storeAndForward = storeAndForward;
|
|
33327
33345
|
this.status = status;
|
|
33328
33346
|
this.cardMetadata = cardMetadata;
|
|
33347
|
+
this.enhancedDataPassed = enhancedDataPassed;
|
|
33329
33348
|
}
|
|
33330
33349
|
}
|
|
33331
33350
|
exports.AuthorizationResponse = AuthorizationResponse;
|
|
@@ -40384,133 +40403,102 @@ class SubmitApplicationRequest {
|
|
|
40384
40403
|
}
|
|
40385
40404
|
exports.SubmitApplicationRequest = SubmitApplicationRequest;
|
|
40386
40405
|
/**
|
|
40387
|
-
* Models
|
|
40406
|
+
* Models a surcharge review request.
|
|
40388
40407
|
*/
|
|
40389
|
-
class
|
|
40408
|
+
class SurchargeReviewRequest {
|
|
40390
40409
|
// Constructor with default values for optional fields
|
|
40391
|
-
constructor(
|
|
40410
|
+
constructor(timeout = null, test = null, cardNumber = undefined, token = undefined, amount = undefined, surchargeRate = undefined, debitTransFee = undefined, debitDiscountRate = undefined, surchargePolicy = null, excludedMerchantStates = null, zip = null, state = null, exemptForeignCards = null, surchargingMode = null, pricingPlan = null) {
|
|
40392
40411
|
/**
|
|
40393
|
-
*
|
|
40412
|
+
* The request timeout in seconds.
|
|
40394
40413
|
*/
|
|
40395
|
-
this.
|
|
40414
|
+
this.timeout = null;
|
|
40396
40415
|
/**
|
|
40397
|
-
*
|
|
40416
|
+
* Whether or not to route transaction to the test gateway.
|
|
40398
40417
|
*/
|
|
40399
|
-
this.
|
|
40400
|
-
this.enabled = enabled;
|
|
40401
|
-
this.surchargeExemptStates = surchargeExemptStates;
|
|
40402
|
-
}
|
|
40403
|
-
}
|
|
40404
|
-
exports.StateCheckSettings = StateCheckSettings;
|
|
40405
|
-
/**
|
|
40406
|
-
* Models merchant settings and configuration.
|
|
40407
|
-
*/
|
|
40408
|
-
class PricingMerchantSettings {
|
|
40409
|
-
// Constructor with default values for optional fields
|
|
40410
|
-
constructor(account = null, gateway = null, surchargingEnabled = null, customSurchargePercent = 0, reducedRate = false, inversePricingEnabled = false, creditDiscountRate = 0, acquiringSolution = null, acceptDebit = false, stateCheckSettings = undefined) {
|
|
40418
|
+
this.test = null;
|
|
40411
40419
|
/**
|
|
40412
|
-
* The
|
|
40420
|
+
* The surcharge policy.
|
|
40413
40421
|
*/
|
|
40414
|
-
this.
|
|
40422
|
+
this.surchargePolicy = null;
|
|
40415
40423
|
/**
|
|
40416
|
-
* The
|
|
40424
|
+
* The list of excluded merchant states.
|
|
40417
40425
|
*/
|
|
40418
|
-
this.
|
|
40426
|
+
this.excludedMerchantStates = null;
|
|
40419
40427
|
/**
|
|
40420
|
-
*
|
|
40428
|
+
* The zip code.
|
|
40421
40429
|
*/
|
|
40422
|
-
this.
|
|
40430
|
+
this.zip = null;
|
|
40423
40431
|
/**
|
|
40424
|
-
* The
|
|
40432
|
+
* The state or province.
|
|
40425
40433
|
*/
|
|
40426
|
-
this.
|
|
40427
|
-
this.account = account;
|
|
40428
|
-
this.gateway = gateway;
|
|
40429
|
-
this.surchargingEnabled = surchargingEnabled;
|
|
40430
|
-
this.customSurchargePercent = customSurchargePercent;
|
|
40431
|
-
this.reducedRate = reducedRate;
|
|
40432
|
-
this.inversePricingEnabled = inversePricingEnabled;
|
|
40433
|
-
this.creditDiscountRate = creditDiscountRate;
|
|
40434
|
-
this.acquiringSolution = acquiringSolution;
|
|
40435
|
-
this.acceptDebit = acceptDebit;
|
|
40436
|
-
this.stateCheckSettings = stateCheckSettings;
|
|
40437
|
-
}
|
|
40438
|
-
}
|
|
40439
|
-
exports.PricingMerchantSettings = PricingMerchantSettings;
|
|
40440
|
-
/**
|
|
40441
|
-
* Models the attributes for a pricing request.
|
|
40442
|
-
*/
|
|
40443
|
-
class PricingRequestAttributes {
|
|
40444
|
-
// Constructor with default values for optional fields
|
|
40445
|
-
constructor(cardNumber = undefined, token = null, merchantIdentifier = undefined, amount = null, country = undefined, postalCode = undefined, state = undefined, merchantSettings = undefined) {
|
|
40434
|
+
this.state = null;
|
|
40446
40435
|
/**
|
|
40447
|
-
*
|
|
40436
|
+
* If foreign cards are exempt.
|
|
40448
40437
|
*/
|
|
40449
|
-
this.
|
|
40438
|
+
this.exemptForeignCards = null;
|
|
40450
40439
|
/**
|
|
40451
|
-
* The
|
|
40440
|
+
* The surcharging mode.
|
|
40452
40441
|
*/
|
|
40453
|
-
this.
|
|
40442
|
+
this.surchargingMode = null;
|
|
40443
|
+
/**
|
|
40444
|
+
* The pricing plan.
|
|
40445
|
+
*/
|
|
40446
|
+
this.pricingPlan = null;
|
|
40447
|
+
this.timeout = timeout;
|
|
40448
|
+
this.test = test;
|
|
40454
40449
|
this.cardNumber = cardNumber;
|
|
40455
40450
|
this.token = token;
|
|
40456
|
-
this.merchantIdentifier = merchantIdentifier;
|
|
40457
40451
|
this.amount = amount;
|
|
40458
|
-
this.
|
|
40459
|
-
this.
|
|
40452
|
+
this.surchargeRate = surchargeRate;
|
|
40453
|
+
this.debitTransFee = debitTransFee;
|
|
40454
|
+
this.debitDiscountRate = debitDiscountRate;
|
|
40455
|
+
this.surchargePolicy = surchargePolicy;
|
|
40456
|
+
this.excludedMerchantStates = excludedMerchantStates;
|
|
40457
|
+
this.zip = zip;
|
|
40460
40458
|
this.state = state;
|
|
40461
|
-
this.
|
|
40459
|
+
this.exemptForeignCards = exemptForeignCards;
|
|
40460
|
+
this.surchargingMode = surchargingMode;
|
|
40461
|
+
this.pricingPlan = pricingPlan;
|
|
40462
40462
|
}
|
|
40463
40463
|
}
|
|
40464
|
-
exports.
|
|
40464
|
+
exports.SurchargeReviewRequest = SurchargeReviewRequest;
|
|
40465
40465
|
/**
|
|
40466
|
-
* Models the data
|
|
40466
|
+
* Models the data included in a surcharge review response.
|
|
40467
40467
|
*/
|
|
40468
|
-
class
|
|
40468
|
+
class SurchargeReviewResponseData {
|
|
40469
40469
|
// Constructor with default values for optional fields
|
|
40470
40470
|
constructor(type = null, attributes = null) {
|
|
40471
40471
|
/**
|
|
40472
|
-
* The type of the
|
|
40472
|
+
* The type of the response.
|
|
40473
40473
|
*/
|
|
40474
40474
|
this.type = null;
|
|
40475
40475
|
/**
|
|
40476
|
-
* The
|
|
40476
|
+
* The attributes of the response.
|
|
40477
40477
|
*/
|
|
40478
40478
|
this.attributes = null;
|
|
40479
40479
|
this.type = type;
|
|
40480
40480
|
this.attributes = attributes;
|
|
40481
40481
|
}
|
|
40482
40482
|
}
|
|
40483
|
-
exports.
|
|
40483
|
+
exports.SurchargeReviewResponseData = SurchargeReviewResponseData;
|
|
40484
40484
|
/**
|
|
40485
|
-
* Models a
|
|
40485
|
+
* Models the surcharge attributes included in a surcharge review response.
|
|
40486
40486
|
*/
|
|
40487
|
-
class
|
|
40487
|
+
class SurchargeAttributeResponseData {
|
|
40488
40488
|
// Constructor with default values for optional fields
|
|
40489
|
-
constructor(
|
|
40489
|
+
constructor(totalWithSurchargeAmount = null, success = null, type = null, surchargePercent = null, surchargeAmount = null, surchargeExempt = null, cardType = null, cardToken = undefined, brand = null, bin = null, commercialIndicator = undefined, isCommercial = null, isRegulated = null, exemptionReason = undefined, debitFeeAmount = undefined, disclosure = undefined, debitCategory = undefined, countryCode = null, state = undefined, uuid = null, expirationDate = undefined, disclosureAdditional = undefined, cardholderInfo = undefined) {
|
|
40490
40490
|
/**
|
|
40491
|
-
* The
|
|
40491
|
+
* The total amount including surcharge.
|
|
40492
40492
|
*/
|
|
40493
|
-
this.
|
|
40493
|
+
this.totalWithSurchargeAmount = null;
|
|
40494
40494
|
/**
|
|
40495
|
-
*
|
|
40495
|
+
* If the surcharge review was successful.
|
|
40496
40496
|
*/
|
|
40497
|
-
this.
|
|
40497
|
+
this.success = null;
|
|
40498
40498
|
/**
|
|
40499
|
-
* The
|
|
40499
|
+
* The type of the response.
|
|
40500
40500
|
*/
|
|
40501
|
-
this.
|
|
40502
|
-
this.timeout = timeout;
|
|
40503
|
-
this.test = test;
|
|
40504
|
-
this.data = data;
|
|
40505
|
-
}
|
|
40506
|
-
}
|
|
40507
|
-
exports.PricingRequest = PricingRequest;
|
|
40508
|
-
/**
|
|
40509
|
-
* Models pricing response data for new handler for pricing api responses.
|
|
40510
|
-
*/
|
|
40511
|
-
class PricingResponseAttributes {
|
|
40512
|
-
// Constructor with default values for optional fields
|
|
40513
|
-
constructor(surchargePercent = null, surchargeAmount = null, surchargeExempt = null, cardType = null, cardToken = undefined, brand = null, bin = null, commercialIndicator = null, disclosure = undefined, debitCategory = null, countryIssued = null, uuid = null) {
|
|
40501
|
+
this.type = null;
|
|
40514
40502
|
/**
|
|
40515
40503
|
* The surcharge percentage.
|
|
40516
40504
|
*/
|
|
@@ -40536,21 +40524,24 @@ class PricingResponseAttributes {
|
|
|
40536
40524
|
*/
|
|
40537
40525
|
this.bin = null;
|
|
40538
40526
|
/**
|
|
40539
|
-
*
|
|
40527
|
+
* If the card is commercial.
|
|
40540
40528
|
*/
|
|
40541
|
-
this.
|
|
40529
|
+
this.isCommercial = null;
|
|
40542
40530
|
/**
|
|
40543
|
-
*
|
|
40531
|
+
* If the card is Durbin-regulated (US debit).
|
|
40544
40532
|
*/
|
|
40545
|
-
this.
|
|
40533
|
+
this.isRegulated = null;
|
|
40546
40534
|
/**
|
|
40547
40535
|
* The country where the card was issued.
|
|
40548
40536
|
*/
|
|
40549
|
-
this.
|
|
40537
|
+
this.countryCode = null;
|
|
40550
40538
|
/**
|
|
40551
40539
|
* The unique identifier for the pricing response.
|
|
40552
40540
|
*/
|
|
40553
40541
|
this.uuid = null;
|
|
40542
|
+
this.totalWithSurchargeAmount = totalWithSurchargeAmount;
|
|
40543
|
+
this.success = success;
|
|
40544
|
+
this.type = type;
|
|
40554
40545
|
this.surchargePercent = surchargePercent;
|
|
40555
40546
|
this.surchargeAmount = surchargeAmount;
|
|
40556
40547
|
this.surchargeExempt = surchargeExempt;
|
|
@@ -40559,62 +40550,76 @@ class PricingResponseAttributes {
|
|
|
40559
40550
|
this.brand = brand;
|
|
40560
40551
|
this.bin = bin;
|
|
40561
40552
|
this.commercialIndicator = commercialIndicator;
|
|
40553
|
+
this.isCommercial = isCommercial;
|
|
40554
|
+
this.isRegulated = isRegulated;
|
|
40555
|
+
this.exemptionReason = exemptionReason;
|
|
40556
|
+
this.debitFeeAmount = debitFeeAmount;
|
|
40562
40557
|
this.disclosure = disclosure;
|
|
40563
40558
|
this.debitCategory = debitCategory;
|
|
40564
|
-
this.
|
|
40559
|
+
this.countryCode = countryCode;
|
|
40560
|
+
this.state = state;
|
|
40565
40561
|
this.uuid = uuid;
|
|
40562
|
+
this.expirationDate = expirationDate;
|
|
40563
|
+
this.disclosureAdditional = disclosureAdditional;
|
|
40564
|
+
this.cardholderInfo = cardholderInfo;
|
|
40566
40565
|
}
|
|
40567
40566
|
}
|
|
40568
|
-
exports.
|
|
40567
|
+
exports.SurchargeAttributeResponseData = SurchargeAttributeResponseData;
|
|
40569
40568
|
/**
|
|
40570
|
-
* Models
|
|
40569
|
+
* Models a surcharge review response.
|
|
40571
40570
|
*/
|
|
40572
|
-
class
|
|
40571
|
+
class SurchargeReviewResponse {
|
|
40573
40572
|
// Constructor with default values for optional fields
|
|
40574
|
-
constructor(
|
|
40573
|
+
constructor(success = null, error = null, responseDescription = null, data = null) {
|
|
40575
40574
|
/**
|
|
40576
|
-
*
|
|
40575
|
+
* Whether or not the request succeeded.
|
|
40577
40576
|
*/
|
|
40578
|
-
this.
|
|
40577
|
+
this.success = null;
|
|
40579
40578
|
/**
|
|
40580
|
-
* The
|
|
40579
|
+
* The error, if an error occurred.
|
|
40581
40580
|
*/
|
|
40582
|
-
this.
|
|
40583
|
-
|
|
40584
|
-
|
|
40581
|
+
this.error = null;
|
|
40582
|
+
/**
|
|
40583
|
+
* A narrative description of the transaction result.
|
|
40584
|
+
*/
|
|
40585
|
+
this.responseDescription = null;
|
|
40586
|
+
/**
|
|
40587
|
+
* The data included in the surcharge review response.
|
|
40588
|
+
*/
|
|
40589
|
+
this.data = null;
|
|
40590
|
+
this.success = success;
|
|
40591
|
+
this.error = error;
|
|
40592
|
+
this.responseDescription = responseDescription;
|
|
40593
|
+
this.data = data;
|
|
40585
40594
|
}
|
|
40586
40595
|
}
|
|
40587
|
-
exports.
|
|
40596
|
+
exports.SurchargeReviewResponse = SurchargeReviewResponse;
|
|
40588
40597
|
/**
|
|
40589
|
-
* Models
|
|
40598
|
+
* Models a request for short-lived API credentials.
|
|
40590
40599
|
*/
|
|
40591
|
-
class
|
|
40600
|
+
class TransientKeyRequest {
|
|
40592
40601
|
// Constructor with default values for optional fields
|
|
40593
|
-
constructor(
|
|
40594
|
-
/**
|
|
40595
|
-
* The HTTP status code.
|
|
40596
|
-
*/
|
|
40597
|
-
this.status = null;
|
|
40602
|
+
constructor(timeout = null, test = null, oneTime = false) {
|
|
40598
40603
|
/**
|
|
40599
|
-
* The
|
|
40604
|
+
* The request timeout in seconds.
|
|
40600
40605
|
*/
|
|
40601
|
-
this.
|
|
40606
|
+
this.timeout = null;
|
|
40602
40607
|
/**
|
|
40603
|
-
*
|
|
40608
|
+
* Whether or not to route transaction to the test gateway.
|
|
40604
40609
|
*/
|
|
40605
|
-
this.
|
|
40606
|
-
this.
|
|
40607
|
-
this.
|
|
40608
|
-
this.
|
|
40610
|
+
this.test = null;
|
|
40611
|
+
this.timeout = timeout;
|
|
40612
|
+
this.test = test;
|
|
40613
|
+
this.oneTime = oneTime;
|
|
40609
40614
|
}
|
|
40610
40615
|
}
|
|
40611
|
-
exports.
|
|
40616
|
+
exports.TransientKeyRequest = TransientKeyRequest;
|
|
40612
40617
|
/**
|
|
40613
|
-
* Models a
|
|
40618
|
+
* Models a response containing short-lived API credentials.
|
|
40614
40619
|
*/
|
|
40615
|
-
class
|
|
40620
|
+
class TransientKeyResponse {
|
|
40616
40621
|
// Constructor with default values for optional fields
|
|
40617
|
-
constructor(success = null, error = null, responseDescription = null,
|
|
40622
|
+
constructor(success = null, error = null, responseDescription = null, apiKey = null, bearerToken = null, signingKey = null) {
|
|
40618
40623
|
/**
|
|
40619
40624
|
* Whether or not the request succeeded.
|
|
40620
40625
|
*/
|
|
@@ -40628,16 +40633,26 @@ class PricingResponse {
|
|
|
40628
40633
|
*/
|
|
40629
40634
|
this.responseDescription = null;
|
|
40630
40635
|
/**
|
|
40631
|
-
* The
|
|
40636
|
+
* The transient API key.
|
|
40632
40637
|
*/
|
|
40633
|
-
this.
|
|
40638
|
+
this.apiKey = null;
|
|
40639
|
+
/**
|
|
40640
|
+
* The transient bearer token.
|
|
40641
|
+
*/
|
|
40642
|
+
this.bearerToken = null;
|
|
40643
|
+
/**
|
|
40644
|
+
* The transient signing key.
|
|
40645
|
+
*/
|
|
40646
|
+
this.signingKey = null;
|
|
40634
40647
|
this.success = success;
|
|
40635
40648
|
this.error = error;
|
|
40636
40649
|
this.responseDescription = responseDescription;
|
|
40637
|
-
this.
|
|
40650
|
+
this.apiKey = apiKey;
|
|
40651
|
+
this.bearerToken = bearerToken;
|
|
40652
|
+
this.signingKey = signingKey;
|
|
40638
40653
|
}
|
|
40639
40654
|
}
|
|
40640
|
-
exports.
|
|
40655
|
+
exports.TransientKeyResponse = TransientKeyResponse;
|
|
40641
40656
|
/**
|
|
40642
40657
|
* A request for customer signature data.
|
|
40643
40658
|
*/
|
|
@@ -41281,7 +41296,7 @@ exports.CoreResponse = CoreResponse;
|
|
|
41281
41296
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
41282
41297
|
|
|
41283
41298
|
"use strict";
|
|
41284
|
-
/*! Axios v1.
|
|
41299
|
+
/*! Axios v1.15.2 Copyright (c) 2026 Matt Zabriskie and contributors */
|
|
41285
41300
|
|
|
41286
41301
|
|
|
41287
41302
|
/**
|
|
@@ -41299,30 +41314,30 @@ function bind(fn, thisArg) {
|
|
|
41299
41314
|
|
|
41300
41315
|
// utils is a library of generic helper functions non-specific to axios
|
|
41301
41316
|
|
|
41302
|
-
const {toString} = Object.prototype;
|
|
41303
|
-
const {getPrototypeOf} = Object;
|
|
41304
|
-
const {iterator, toStringTag} = Symbol;
|
|
41317
|
+
const { toString } = Object.prototype;
|
|
41318
|
+
const { getPrototypeOf } = Object;
|
|
41319
|
+
const { iterator, toStringTag } = Symbol;
|
|
41305
41320
|
|
|
41306
|
-
const kindOf = (cache => thing => {
|
|
41307
|
-
|
|
41308
|
-
|
|
41321
|
+
const kindOf = ((cache) => (thing) => {
|
|
41322
|
+
const str = toString.call(thing);
|
|
41323
|
+
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
41309
41324
|
})(Object.create(null));
|
|
41310
41325
|
|
|
41311
41326
|
const kindOfTest = (type) => {
|
|
41312
41327
|
type = type.toLowerCase();
|
|
41313
|
-
return (thing) => kindOf(thing) === type
|
|
41328
|
+
return (thing) => kindOf(thing) === type;
|
|
41314
41329
|
};
|
|
41315
41330
|
|
|
41316
|
-
const typeOfTest = type => thing => typeof thing === type;
|
|
41331
|
+
const typeOfTest = (type) => (thing) => typeof thing === type;
|
|
41317
41332
|
|
|
41318
41333
|
/**
|
|
41319
|
-
* Determine if a value is
|
|
41334
|
+
* Determine if a value is a non-null object
|
|
41320
41335
|
*
|
|
41321
41336
|
* @param {Object} val The value to test
|
|
41322
41337
|
*
|
|
41323
41338
|
* @returns {boolean} True if value is an Array, otherwise false
|
|
41324
41339
|
*/
|
|
41325
|
-
const {isArray} = Array;
|
|
41340
|
+
const { isArray } = Array;
|
|
41326
41341
|
|
|
41327
41342
|
/**
|
|
41328
41343
|
* Determine if a value is undefined
|
|
@@ -41341,8 +41356,14 @@ const isUndefined = typeOfTest('undefined');
|
|
|
41341
41356
|
* @returns {boolean} True if value is a Buffer, otherwise false
|
|
41342
41357
|
*/
|
|
41343
41358
|
function isBuffer(val) {
|
|
41344
|
-
return
|
|
41345
|
-
|
|
41359
|
+
return (
|
|
41360
|
+
val !== null &&
|
|
41361
|
+
!isUndefined(val) &&
|
|
41362
|
+
val.constructor !== null &&
|
|
41363
|
+
!isUndefined(val.constructor) &&
|
|
41364
|
+
isFunction$1(val.constructor.isBuffer) &&
|
|
41365
|
+
val.constructor.isBuffer(val)
|
|
41366
|
+
);
|
|
41346
41367
|
}
|
|
41347
41368
|
|
|
41348
41369
|
/**
|
|
@@ -41354,7 +41375,6 @@ function isBuffer(val) {
|
|
|
41354
41375
|
*/
|
|
41355
41376
|
const isArrayBuffer = kindOfTest('ArrayBuffer');
|
|
41356
41377
|
|
|
41357
|
-
|
|
41358
41378
|
/**
|
|
41359
41379
|
* Determine if a value is a view on an ArrayBuffer
|
|
41360
41380
|
*
|
|
@@ -41364,10 +41384,10 @@ const isArrayBuffer = kindOfTest('ArrayBuffer');
|
|
|
41364
41384
|
*/
|
|
41365
41385
|
function isArrayBufferView(val) {
|
|
41366
41386
|
let result;
|
|
41367
|
-
if (
|
|
41387
|
+
if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {
|
|
41368
41388
|
result = ArrayBuffer.isView(val);
|
|
41369
41389
|
} else {
|
|
41370
|
-
result =
|
|
41390
|
+
result = val && val.buffer && isArrayBuffer(val.buffer);
|
|
41371
41391
|
}
|
|
41372
41392
|
return result;
|
|
41373
41393
|
}
|
|
@@ -41413,7 +41433,7 @@ const isObject = (thing) => thing !== null && typeof thing === 'object';
|
|
|
41413
41433
|
* @param {*} thing The value to test
|
|
41414
41434
|
* @returns {boolean} True if value is a Boolean, otherwise false
|
|
41415
41435
|
*/
|
|
41416
|
-
const isBoolean = thing => thing === true || thing === false;
|
|
41436
|
+
const isBoolean = (thing) => thing === true || thing === false;
|
|
41417
41437
|
|
|
41418
41438
|
/**
|
|
41419
41439
|
* Determine if a value is a plain Object
|
|
@@ -41428,7 +41448,13 @@ const isPlainObject = (val) => {
|
|
|
41428
41448
|
}
|
|
41429
41449
|
|
|
41430
41450
|
const prototype = getPrototypeOf(val);
|
|
41431
|
-
return (
|
|
41451
|
+
return (
|
|
41452
|
+
(prototype === null ||
|
|
41453
|
+
prototype === Object.prototype ||
|
|
41454
|
+
Object.getPrototypeOf(prototype) === null) &&
|
|
41455
|
+
!(toStringTag in val) &&
|
|
41456
|
+
!(iterator in val)
|
|
41457
|
+
);
|
|
41432
41458
|
};
|
|
41433
41459
|
|
|
41434
41460
|
/**
|
|
@@ -41470,6 +41496,31 @@ const isDate = kindOfTest('Date');
|
|
|
41470
41496
|
*/
|
|
41471
41497
|
const isFile = kindOfTest('File');
|
|
41472
41498
|
|
|
41499
|
+
/**
|
|
41500
|
+
* Determine if a value is a React Native Blob
|
|
41501
|
+
* React Native "blob": an object with a `uri` attribute. Optionally, it can
|
|
41502
|
+
* also have a `name` and `type` attribute to specify filename and content type
|
|
41503
|
+
*
|
|
41504
|
+
* @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71
|
|
41505
|
+
*
|
|
41506
|
+
* @param {*} value The value to test
|
|
41507
|
+
*
|
|
41508
|
+
* @returns {boolean} True if value is a React Native Blob, otherwise false
|
|
41509
|
+
*/
|
|
41510
|
+
const isReactNativeBlob = (value) => {
|
|
41511
|
+
return !!(value && typeof value.uri !== 'undefined');
|
|
41512
|
+
};
|
|
41513
|
+
|
|
41514
|
+
/**
|
|
41515
|
+
* Determine if environment is React Native
|
|
41516
|
+
* ReactNative `FormData` has a non-standard `getParts()` method
|
|
41517
|
+
*
|
|
41518
|
+
* @param {*} formData The formData to test
|
|
41519
|
+
*
|
|
41520
|
+
* @returns {boolean} True if environment is React Native, otherwise false
|
|
41521
|
+
*/
|
|
41522
|
+
const isReactNative = (formData) => formData && typeof formData.getParts !== 'undefined';
|
|
41523
|
+
|
|
41473
41524
|
/**
|
|
41474
41525
|
* Determine if a value is a Blob
|
|
41475
41526
|
*
|
|
@@ -41504,17 +41555,28 @@ const isStream = (val) => isObject(val) && isFunction$1(val.pipe);
|
|
|
41504
41555
|
*
|
|
41505
41556
|
* @returns {boolean} True if value is an FormData, otherwise false
|
|
41506
41557
|
*/
|
|
41558
|
+
function getGlobal() {
|
|
41559
|
+
if (typeof globalThis !== 'undefined') return globalThis;
|
|
41560
|
+
if (typeof self !== 'undefined') return self;
|
|
41561
|
+
if (typeof window !== 'undefined') return window;
|
|
41562
|
+
if (typeof __webpack_require__.g !== 'undefined') return __webpack_require__.g;
|
|
41563
|
+
return {};
|
|
41564
|
+
}
|
|
41565
|
+
|
|
41566
|
+
const G = getGlobal();
|
|
41567
|
+
const FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined;
|
|
41568
|
+
|
|
41507
41569
|
const isFormData = (thing) => {
|
|
41508
|
-
|
|
41509
|
-
|
|
41510
|
-
|
|
41511
|
-
|
|
41512
|
-
|
|
41513
|
-
|
|
41514
|
-
|
|
41515
|
-
|
|
41516
|
-
|
|
41517
|
-
|
|
41570
|
+
if (!thing) return false;
|
|
41571
|
+
if (FormDataCtor && thing instanceof FormDataCtor) return true;
|
|
41572
|
+
// Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData (GHSA-6chq-wfr3-2hj9).
|
|
41573
|
+
const proto = getPrototypeOf(thing);
|
|
41574
|
+
if (!proto || proto === Object.prototype) return false;
|
|
41575
|
+
if (!isFunction$1(thing.append)) return false;
|
|
41576
|
+
const kind = kindOf(thing);
|
|
41577
|
+
return kind === 'formdata' ||
|
|
41578
|
+
// detect form-data instance
|
|
41579
|
+
(kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]');
|
|
41518
41580
|
};
|
|
41519
41581
|
|
|
41520
41582
|
/**
|
|
@@ -41526,7 +41588,12 @@ const isFormData = (thing) => {
|
|
|
41526
41588
|
*/
|
|
41527
41589
|
const isURLSearchParams = kindOfTest('URLSearchParams');
|
|
41528
41590
|
|
|
41529
|
-
const [isReadableStream, isRequest, isResponse, isHeaders] = [
|
|
41591
|
+
const [isReadableStream, isRequest, isResponse, isHeaders] = [
|
|
41592
|
+
'ReadableStream',
|
|
41593
|
+
'Request',
|
|
41594
|
+
'Response',
|
|
41595
|
+
'Headers',
|
|
41596
|
+
].map(kindOfTest);
|
|
41530
41597
|
|
|
41531
41598
|
/**
|
|
41532
41599
|
* Trim excess whitespace off the beginning and end of a string
|
|
@@ -41535,9 +41602,9 @@ const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream',
|
|
|
41535
41602
|
*
|
|
41536
41603
|
* @returns {String} The String freed of excess whitespace
|
|
41537
41604
|
*/
|
|
41538
|
-
const trim = (str) =>
|
|
41539
|
-
str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
|
|
41540
|
-
|
|
41605
|
+
const trim = (str) => {
|
|
41606
|
+
return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
|
|
41607
|
+
};
|
|
41541
41608
|
/**
|
|
41542
41609
|
* Iterate over an Array or an Object invoking a function for each item.
|
|
41543
41610
|
*
|
|
@@ -41554,7 +41621,7 @@ const trim = (str) => str.trim ?
|
|
|
41554
41621
|
* @param {Boolean} [options.allOwnKeys = false]
|
|
41555
41622
|
* @returns {any}
|
|
41556
41623
|
*/
|
|
41557
|
-
function forEach(obj, fn, {allOwnKeys = false} = {}) {
|
|
41624
|
+
function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
41558
41625
|
// Don't bother if no value provided
|
|
41559
41626
|
if (obj === null || typeof obj === 'undefined') {
|
|
41560
41627
|
return;
|
|
@@ -41592,8 +41659,16 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
|
|
|
41592
41659
|
}
|
|
41593
41660
|
}
|
|
41594
41661
|
|
|
41662
|
+
/**
|
|
41663
|
+
* Finds a key in an object, case-insensitive, returning the actual key name.
|
|
41664
|
+
* Returns null if the object is a Buffer or if no match is found.
|
|
41665
|
+
*
|
|
41666
|
+
* @param {Object} obj - The object to search.
|
|
41667
|
+
* @param {string} key - The key to find (case-insensitive).
|
|
41668
|
+
* @returns {?string} The actual key name if found, otherwise null.
|
|
41669
|
+
*/
|
|
41595
41670
|
function findKey(obj, key) {
|
|
41596
|
-
if (isBuffer(obj)){
|
|
41671
|
+
if (isBuffer(obj)) {
|
|
41597
41672
|
return null;
|
|
41598
41673
|
}
|
|
41599
41674
|
|
|
@@ -41612,8 +41687,8 @@ function findKey(obj, key) {
|
|
|
41612
41687
|
|
|
41613
41688
|
const _global = (() => {
|
|
41614
41689
|
/*eslint no-undef:0*/
|
|
41615
|
-
if (typeof globalThis !==
|
|
41616
|
-
return typeof self !==
|
|
41690
|
+
if (typeof globalThis !== 'undefined') return globalThis;
|
|
41691
|
+
return typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : __webpack_require__.g;
|
|
41617
41692
|
})();
|
|
41618
41693
|
|
|
41619
41694
|
const isContextDefined = (context) => !isUndefined(context) && context !== _global;
|
|
@@ -41637,10 +41712,15 @@ const isContextDefined = (context) => !isUndefined(context) && context !== _glob
|
|
|
41637
41712
|
* @returns {Object} Result of all merge properties
|
|
41638
41713
|
*/
|
|
41639
41714
|
function merge(/* obj1, obj2, obj3, ... */) {
|
|
41640
|
-
const {caseless, skipUndefined} = isContextDefined(this) && this || {};
|
|
41715
|
+
const { caseless, skipUndefined } = (isContextDefined(this) && this) || {};
|
|
41641
41716
|
const result = {};
|
|
41642
41717
|
const assignValue = (val, key) => {
|
|
41643
|
-
|
|
41718
|
+
// Skip dangerous property names to prevent prototype pollution
|
|
41719
|
+
if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
|
|
41720
|
+
return;
|
|
41721
|
+
}
|
|
41722
|
+
|
|
41723
|
+
const targetKey = (caseless && findKey(result, key)) || key;
|
|
41644
41724
|
if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
|
|
41645
41725
|
result[targetKey] = merge(result[targetKey], val);
|
|
41646
41726
|
} else if (isPlainObject(val)) {
|
|
@@ -41669,24 +41749,28 @@ function merge(/* obj1, obj2, obj3, ... */) {
|
|
|
41669
41749
|
* @param {Boolean} [options.allOwnKeys]
|
|
41670
41750
|
* @returns {Object} The resulting value of object a
|
|
41671
41751
|
*/
|
|
41672
|
-
const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
|
|
41673
|
-
forEach(
|
|
41674
|
-
|
|
41675
|
-
|
|
41676
|
-
|
|
41677
|
-
|
|
41678
|
-
|
|
41679
|
-
|
|
41680
|
-
|
|
41681
|
-
|
|
41682
|
-
|
|
41683
|
-
|
|
41684
|
-
|
|
41685
|
-
|
|
41686
|
-
|
|
41687
|
-
|
|
41688
|
-
|
|
41689
|
-
|
|
41752
|
+
const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
|
|
41753
|
+
forEach(
|
|
41754
|
+
b,
|
|
41755
|
+
(val, key) => {
|
|
41756
|
+
if (thisArg && isFunction$1(val)) {
|
|
41757
|
+
Object.defineProperty(a, key, {
|
|
41758
|
+
value: bind(val, thisArg),
|
|
41759
|
+
writable: true,
|
|
41760
|
+
enumerable: true,
|
|
41761
|
+
configurable: true,
|
|
41762
|
+
});
|
|
41763
|
+
} else {
|
|
41764
|
+
Object.defineProperty(a, key, {
|
|
41765
|
+
value: val,
|
|
41766
|
+
writable: true,
|
|
41767
|
+
enumerable: true,
|
|
41768
|
+
configurable: true,
|
|
41769
|
+
});
|
|
41770
|
+
}
|
|
41771
|
+
},
|
|
41772
|
+
{ allOwnKeys }
|
|
41773
|
+
);
|
|
41690
41774
|
return a;
|
|
41691
41775
|
};
|
|
41692
41776
|
|
|
@@ -41698,7 +41782,7 @@ const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
|
|
|
41698
41782
|
* @returns {string} content value without BOM
|
|
41699
41783
|
*/
|
|
41700
41784
|
const stripBOM = (content) => {
|
|
41701
|
-
if (content.charCodeAt(0) ===
|
|
41785
|
+
if (content.charCodeAt(0) === 0xfeff) {
|
|
41702
41786
|
content = content.slice(1);
|
|
41703
41787
|
}
|
|
41704
41788
|
return content;
|
|
@@ -41719,10 +41803,10 @@ const inherits = (constructor, superConstructor, props, descriptors) => {
|
|
|
41719
41803
|
value: constructor,
|
|
41720
41804
|
writable: true,
|
|
41721
41805
|
enumerable: false,
|
|
41722
|
-
configurable: true
|
|
41806
|
+
configurable: true,
|
|
41723
41807
|
});
|
|
41724
41808
|
Object.defineProperty(constructor, 'super', {
|
|
41725
|
-
value: superConstructor.prototype
|
|
41809
|
+
value: superConstructor.prototype,
|
|
41726
41810
|
});
|
|
41727
41811
|
props && Object.assign(constructor.prototype, props);
|
|
41728
41812
|
};
|
|
@@ -41781,7 +41865,6 @@ const endsWith = (str, searchString, position) => {
|
|
|
41781
41865
|
return lastIndex !== -1 && lastIndex === position;
|
|
41782
41866
|
};
|
|
41783
41867
|
|
|
41784
|
-
|
|
41785
41868
|
/**
|
|
41786
41869
|
* Returns new array from array like object or null if failed
|
|
41787
41870
|
*
|
|
@@ -41810,9 +41893,9 @@ const toArray = (thing) => {
|
|
|
41810
41893
|
* @returns {Array}
|
|
41811
41894
|
*/
|
|
41812
41895
|
// eslint-disable-next-line func-names
|
|
41813
|
-
const isTypedArray = (TypedArray => {
|
|
41896
|
+
const isTypedArray = ((TypedArray) => {
|
|
41814
41897
|
// eslint-disable-next-line func-names
|
|
41815
|
-
return thing => {
|
|
41898
|
+
return (thing) => {
|
|
41816
41899
|
return TypedArray && thing instanceof TypedArray;
|
|
41817
41900
|
};
|
|
41818
41901
|
})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
|
|
@@ -41860,16 +41943,18 @@ const matchAll = (regExp, str) => {
|
|
|
41860
41943
|
/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
|
|
41861
41944
|
const isHTMLForm = kindOfTest('HTMLFormElement');
|
|
41862
41945
|
|
|
41863
|
-
const toCamelCase = str => {
|
|
41864
|
-
return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,
|
|
41865
|
-
|
|
41866
|
-
|
|
41867
|
-
}
|
|
41868
|
-
);
|
|
41946
|
+
const toCamelCase = (str) => {
|
|
41947
|
+
return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
|
|
41948
|
+
return p1.toUpperCase() + p2;
|
|
41949
|
+
});
|
|
41869
41950
|
};
|
|
41870
41951
|
|
|
41871
41952
|
/* Creating a function that will check if an object has a property. */
|
|
41872
|
-
const hasOwnProperty = (
|
|
41953
|
+
const hasOwnProperty = (
|
|
41954
|
+
({ hasOwnProperty }) =>
|
|
41955
|
+
(obj, prop) =>
|
|
41956
|
+
hasOwnProperty.call(obj, prop)
|
|
41957
|
+
)(Object.prototype);
|
|
41873
41958
|
|
|
41874
41959
|
/**
|
|
41875
41960
|
* Determine if a value is a RegExp object
|
|
@@ -41919,17 +42004,25 @@ const freezeMethods = (obj) => {
|
|
|
41919
42004
|
|
|
41920
42005
|
if (!descriptor.set) {
|
|
41921
42006
|
descriptor.set = () => {
|
|
41922
|
-
throw Error(
|
|
42007
|
+
throw Error("Can not rewrite read-only method '" + name + "'");
|
|
41923
42008
|
};
|
|
41924
42009
|
}
|
|
41925
42010
|
});
|
|
41926
42011
|
};
|
|
41927
42012
|
|
|
42013
|
+
/**
|
|
42014
|
+
* Converts an array or a delimited string into an object set with values as keys and true as values.
|
|
42015
|
+
* Useful for fast membership checks.
|
|
42016
|
+
*
|
|
42017
|
+
* @param {Array|string} arrayOrString - The array or string to convert.
|
|
42018
|
+
* @param {string} delimiter - The delimiter to use if input is a string.
|
|
42019
|
+
* @returns {Object} An object with keys from the array or string, values set to true.
|
|
42020
|
+
*/
|
|
41928
42021
|
const toObjectSet = (arrayOrString, delimiter) => {
|
|
41929
42022
|
const obj = {};
|
|
41930
42023
|
|
|
41931
42024
|
const define = (arr) => {
|
|
41932
|
-
arr.forEach(value => {
|
|
42025
|
+
arr.forEach((value) => {
|
|
41933
42026
|
obj[value] = true;
|
|
41934
42027
|
});
|
|
41935
42028
|
};
|
|
@@ -41942,11 +42035,9 @@ const toObjectSet = (arrayOrString, delimiter) => {
|
|
|
41942
42035
|
const noop = () => {};
|
|
41943
42036
|
|
|
41944
42037
|
const toFiniteNumber = (value, defaultValue) => {
|
|
41945
|
-
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
|
42038
|
+
return value != null && Number.isFinite((value = +value)) ? value : defaultValue;
|
|
41946
42039
|
};
|
|
41947
42040
|
|
|
41948
|
-
|
|
41949
|
-
|
|
41950
42041
|
/**
|
|
41951
42042
|
* If the thing is a FormData object, return true, otherwise return false.
|
|
41952
42043
|
*
|
|
@@ -41955,14 +42046,24 @@ const toFiniteNumber = (value, defaultValue) => {
|
|
|
41955
42046
|
* @returns {boolean}
|
|
41956
42047
|
*/
|
|
41957
42048
|
function isSpecCompliantForm(thing) {
|
|
41958
|
-
return !!(
|
|
42049
|
+
return !!(
|
|
42050
|
+
thing &&
|
|
42051
|
+
isFunction$1(thing.append) &&
|
|
42052
|
+
thing[toStringTag] === 'FormData' &&
|
|
42053
|
+
thing[iterator]
|
|
42054
|
+
);
|
|
41959
42055
|
}
|
|
41960
42056
|
|
|
42057
|
+
/**
|
|
42058
|
+
* Recursively converts an object to a JSON-compatible object, handling circular references and Buffers.
|
|
42059
|
+
*
|
|
42060
|
+
* @param {Object} obj - The object to convert.
|
|
42061
|
+
* @returns {Object} The JSON-compatible object.
|
|
42062
|
+
*/
|
|
41961
42063
|
const toJSONObject = (obj) => {
|
|
41962
42064
|
const stack = new Array(10);
|
|
41963
42065
|
|
|
41964
42066
|
const visit = (source, i) => {
|
|
41965
|
-
|
|
41966
42067
|
if (isObject(source)) {
|
|
41967
42068
|
if (stack.indexOf(source) >= 0) {
|
|
41968
42069
|
return;
|
|
@@ -41973,7 +42074,7 @@ const toJSONObject = (obj) => {
|
|
|
41973
42074
|
return source;
|
|
41974
42075
|
}
|
|
41975
42076
|
|
|
41976
|
-
if(!('toJSON' in source)) {
|
|
42077
|
+
if (!('toJSON' in source)) {
|
|
41977
42078
|
stack[i] = source;
|
|
41978
42079
|
const target = isArray(source) ? [] : {};
|
|
41979
42080
|
|
|
@@ -41994,45 +42095,77 @@ const toJSONObject = (obj) => {
|
|
|
41994
42095
|
return visit(obj, 0);
|
|
41995
42096
|
};
|
|
41996
42097
|
|
|
42098
|
+
/**
|
|
42099
|
+
* Determines if a value is an async function.
|
|
42100
|
+
*
|
|
42101
|
+
* @param {*} thing - The value to test.
|
|
42102
|
+
* @returns {boolean} True if value is an async function, otherwise false.
|
|
42103
|
+
*/
|
|
41997
42104
|
const isAsyncFn = kindOfTest('AsyncFunction');
|
|
41998
42105
|
|
|
42106
|
+
/**
|
|
42107
|
+
* Determines if a value is thenable (has then and catch methods).
|
|
42108
|
+
*
|
|
42109
|
+
* @param {*} thing - The value to test.
|
|
42110
|
+
* @returns {boolean} True if value is thenable, otherwise false.
|
|
42111
|
+
*/
|
|
41999
42112
|
const isThenable = (thing) =>
|
|
42000
|
-
thing &&
|
|
42113
|
+
thing &&
|
|
42114
|
+
(isObject(thing) || isFunction$1(thing)) &&
|
|
42115
|
+
isFunction$1(thing.then) &&
|
|
42116
|
+
isFunction$1(thing.catch);
|
|
42001
42117
|
|
|
42002
42118
|
// original code
|
|
42003
42119
|
// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
|
|
42004
42120
|
|
|
42121
|
+
/**
|
|
42122
|
+
* Provides a cross-platform setImmediate implementation.
|
|
42123
|
+
* Uses native setImmediate if available, otherwise falls back to postMessage or setTimeout.
|
|
42124
|
+
*
|
|
42125
|
+
* @param {boolean} setImmediateSupported - Whether setImmediate is supported.
|
|
42126
|
+
* @param {boolean} postMessageSupported - Whether postMessage is supported.
|
|
42127
|
+
* @returns {Function} A function to schedule a callback asynchronously.
|
|
42128
|
+
*/
|
|
42005
42129
|
const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
42006
42130
|
if (setImmediateSupported) {
|
|
42007
42131
|
return setImmediate;
|
|
42008
42132
|
}
|
|
42009
42133
|
|
|
42010
|
-
return postMessageSupported
|
|
42011
|
-
|
|
42012
|
-
|
|
42013
|
-
|
|
42014
|
-
|
|
42015
|
-
|
|
42134
|
+
return postMessageSupported
|
|
42135
|
+
? ((token, callbacks) => {
|
|
42136
|
+
_global.addEventListener(
|
|
42137
|
+
'message',
|
|
42138
|
+
({ source, data }) => {
|
|
42139
|
+
if (source === _global && data === token) {
|
|
42140
|
+
callbacks.length && callbacks.shift()();
|
|
42141
|
+
}
|
|
42142
|
+
},
|
|
42143
|
+
false
|
|
42144
|
+
);
|
|
42016
42145
|
|
|
42017
|
-
|
|
42018
|
-
|
|
42019
|
-
|
|
42020
|
-
|
|
42021
|
-
|
|
42022
|
-
|
|
42023
|
-
|
|
42024
|
-
isFunction$1(_global.postMessage)
|
|
42025
|
-
);
|
|
42146
|
+
return (cb) => {
|
|
42147
|
+
callbacks.push(cb);
|
|
42148
|
+
_global.postMessage(token, '*');
|
|
42149
|
+
};
|
|
42150
|
+
})(`axios@${Math.random()}`, [])
|
|
42151
|
+
: (cb) => setTimeout(cb);
|
|
42152
|
+
})(typeof setImmediate === 'function', isFunction$1(_global.postMessage));
|
|
42026
42153
|
|
|
42027
|
-
|
|
42028
|
-
|
|
42154
|
+
/**
|
|
42155
|
+
* Schedules a microtask or asynchronous callback as soon as possible.
|
|
42156
|
+
* Uses queueMicrotask if available, otherwise falls back to process.nextTick or _setImmediate.
|
|
42157
|
+
*
|
|
42158
|
+
* @type {Function}
|
|
42159
|
+
*/
|
|
42160
|
+
const asap =
|
|
42161
|
+
typeof queueMicrotask !== 'undefined'
|
|
42162
|
+
? queueMicrotask.bind(_global)
|
|
42163
|
+
: (typeof process !== 'undefined' && process.nextTick) || _setImmediate;
|
|
42029
42164
|
|
|
42030
42165
|
// *********************
|
|
42031
42166
|
|
|
42032
|
-
|
|
42033
42167
|
const isIterable = (thing) => thing != null && isFunction$1(thing[iterator]);
|
|
42034
42168
|
|
|
42035
|
-
|
|
42036
42169
|
var utils$1 = {
|
|
42037
42170
|
isArray,
|
|
42038
42171
|
isArrayBuffer,
|
|
@@ -42052,6 +42185,8 @@ var utils$1 = {
|
|
|
42052
42185
|
isUndefined,
|
|
42053
42186
|
isDate,
|
|
42054
42187
|
isFile,
|
|
42188
|
+
isReactNativeBlob,
|
|
42189
|
+
isReactNative,
|
|
42055
42190
|
isBlob,
|
|
42056
42191
|
isRegExp,
|
|
42057
42192
|
isFunction: isFunction$1,
|
|
@@ -42090,61 +42225,78 @@ var utils$1 = {
|
|
|
42090
42225
|
isThenable,
|
|
42091
42226
|
setImmediate: _setImmediate,
|
|
42092
42227
|
asap,
|
|
42093
|
-
isIterable
|
|
42228
|
+
isIterable,
|
|
42094
42229
|
};
|
|
42095
42230
|
|
|
42096
42231
|
class AxiosError extends Error {
|
|
42097
|
-
|
|
42098
|
-
|
|
42099
|
-
|
|
42100
|
-
|
|
42101
|
-
customProps && Object.assign(axiosError, customProps);
|
|
42102
|
-
return axiosError;
|
|
42103
|
-
}
|
|
42232
|
+
static from(error, code, config, request, response, customProps) {
|
|
42233
|
+
const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
|
|
42234
|
+
axiosError.cause = error;
|
|
42235
|
+
axiosError.name = error.name;
|
|
42104
42236
|
|
|
42105
|
-
|
|
42106
|
-
|
|
42107
|
-
|
|
42108
|
-
* @param {string} message The error message.
|
|
42109
|
-
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
42110
|
-
* @param {Object} [config] The config.
|
|
42111
|
-
* @param {Object} [request] The request.
|
|
42112
|
-
* @param {Object} [response] The response.
|
|
42113
|
-
*
|
|
42114
|
-
* @returns {Error} The created error.
|
|
42115
|
-
*/
|
|
42116
|
-
constructor(message, code, config, request, response) {
|
|
42117
|
-
super(message);
|
|
42118
|
-
this.name = 'AxiosError';
|
|
42119
|
-
this.isAxiosError = true;
|
|
42120
|
-
code && (this.code = code);
|
|
42121
|
-
config && (this.config = config);
|
|
42122
|
-
request && (this.request = request);
|
|
42123
|
-
if (response) {
|
|
42124
|
-
this.response = response;
|
|
42125
|
-
this.status = response.status;
|
|
42126
|
-
}
|
|
42237
|
+
// Preserve status from the original error if not already set from response
|
|
42238
|
+
if (error.status != null && axiosError.status == null) {
|
|
42239
|
+
axiosError.status = error.status;
|
|
42127
42240
|
}
|
|
42128
42241
|
|
|
42129
|
-
|
|
42130
|
-
|
|
42131
|
-
|
|
42132
|
-
|
|
42133
|
-
|
|
42134
|
-
|
|
42135
|
-
|
|
42136
|
-
|
|
42137
|
-
|
|
42138
|
-
|
|
42139
|
-
|
|
42140
|
-
|
|
42141
|
-
|
|
42142
|
-
|
|
42143
|
-
|
|
42144
|
-
|
|
42145
|
-
|
|
42146
|
-
|
|
42242
|
+
customProps && Object.assign(axiosError, customProps);
|
|
42243
|
+
return axiosError;
|
|
42244
|
+
}
|
|
42245
|
+
|
|
42246
|
+
/**
|
|
42247
|
+
* Create an Error with the specified message, config, error code, request and response.
|
|
42248
|
+
*
|
|
42249
|
+
* @param {string} message The error message.
|
|
42250
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
42251
|
+
* @param {Object} [config] The config.
|
|
42252
|
+
* @param {Object} [request] The request.
|
|
42253
|
+
* @param {Object} [response] The response.
|
|
42254
|
+
*
|
|
42255
|
+
* @returns {Error} The created error.
|
|
42256
|
+
*/
|
|
42257
|
+
constructor(message, code, config, request, response) {
|
|
42258
|
+
super(message);
|
|
42259
|
+
|
|
42260
|
+
// Make message enumerable to maintain backward compatibility
|
|
42261
|
+
// The native Error constructor sets message as non-enumerable,
|
|
42262
|
+
// but axios < v1.13.3 had it as enumerable
|
|
42263
|
+
Object.defineProperty(this, 'message', {
|
|
42264
|
+
value: message,
|
|
42265
|
+
enumerable: true,
|
|
42266
|
+
writable: true,
|
|
42267
|
+
configurable: true,
|
|
42268
|
+
});
|
|
42269
|
+
|
|
42270
|
+
this.name = 'AxiosError';
|
|
42271
|
+
this.isAxiosError = true;
|
|
42272
|
+
code && (this.code = code);
|
|
42273
|
+
config && (this.config = config);
|
|
42274
|
+
request && (this.request = request);
|
|
42275
|
+
if (response) {
|
|
42276
|
+
this.response = response;
|
|
42277
|
+
this.status = response.status;
|
|
42147
42278
|
}
|
|
42279
|
+
}
|
|
42280
|
+
|
|
42281
|
+
toJSON() {
|
|
42282
|
+
return {
|
|
42283
|
+
// Standard
|
|
42284
|
+
message: this.message,
|
|
42285
|
+
name: this.name,
|
|
42286
|
+
// Microsoft
|
|
42287
|
+
description: this.description,
|
|
42288
|
+
number: this.number,
|
|
42289
|
+
// Mozilla
|
|
42290
|
+
fileName: this.fileName,
|
|
42291
|
+
lineNumber: this.lineNumber,
|
|
42292
|
+
columnNumber: this.columnNumber,
|
|
42293
|
+
stack: this.stack,
|
|
42294
|
+
// Axios
|
|
42295
|
+
config: utils$1.toJSONObject(this.config),
|
|
42296
|
+
code: this.code,
|
|
42297
|
+
status: this.status,
|
|
42298
|
+
};
|
|
42299
|
+
}
|
|
42148
42300
|
}
|
|
42149
42301
|
|
|
42150
42302
|
// This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
|
|
@@ -42160,8 +42312,7 @@ AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
|
|
|
42160
42312
|
AxiosError.ERR_CANCELED = 'ERR_CANCELED';
|
|
42161
42313
|
AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
|
|
42162
42314
|
AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';
|
|
42163
|
-
|
|
42164
|
-
var AxiosError$1 = AxiosError;
|
|
42315
|
+
AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
|
|
42165
42316
|
|
|
42166
42317
|
// eslint-disable-next-line strict
|
|
42167
42318
|
var httpAdapter = null;
|
|
@@ -42199,11 +42350,14 @@ function removeBrackets(key) {
|
|
|
42199
42350
|
*/
|
|
42200
42351
|
function renderKey(path, key, dots) {
|
|
42201
42352
|
if (!path) return key;
|
|
42202
|
-
return path
|
|
42203
|
-
|
|
42204
|
-
|
|
42205
|
-
|
|
42206
|
-
|
|
42353
|
+
return path
|
|
42354
|
+
.concat(key)
|
|
42355
|
+
.map(function each(token, i) {
|
|
42356
|
+
// eslint-disable-next-line no-param-reassign
|
|
42357
|
+
token = removeBrackets(token);
|
|
42358
|
+
return !dots && i ? '[' + token + ']' : token;
|
|
42359
|
+
})
|
|
42360
|
+
.join(dots ? '.' : '');
|
|
42207
42361
|
}
|
|
42208
42362
|
|
|
42209
42363
|
/**
|
|
@@ -42253,21 +42407,27 @@ function toFormData(obj, formData, options) {
|
|
|
42253
42407
|
formData = formData || new (FormData)();
|
|
42254
42408
|
|
|
42255
42409
|
// eslint-disable-next-line no-param-reassign
|
|
42256
|
-
options = utils$1.toFlatObject(
|
|
42257
|
-
|
|
42258
|
-
|
|
42259
|
-
|
|
42260
|
-
|
|
42261
|
-
|
|
42262
|
-
|
|
42263
|
-
|
|
42410
|
+
options = utils$1.toFlatObject(
|
|
42411
|
+
options,
|
|
42412
|
+
{
|
|
42413
|
+
metaTokens: true,
|
|
42414
|
+
dots: false,
|
|
42415
|
+
indexes: false,
|
|
42416
|
+
},
|
|
42417
|
+
false,
|
|
42418
|
+
function defined(option, source) {
|
|
42419
|
+
// eslint-disable-next-line no-eq-null,eqeqeq
|
|
42420
|
+
return !utils$1.isUndefined(source[option]);
|
|
42421
|
+
}
|
|
42422
|
+
);
|
|
42264
42423
|
|
|
42265
42424
|
const metaTokens = options.metaTokens;
|
|
42266
42425
|
// eslint-disable-next-line no-use-before-define
|
|
42267
42426
|
const visitor = options.visitor || defaultVisitor;
|
|
42268
42427
|
const dots = options.dots;
|
|
42269
42428
|
const indexes = options.indexes;
|
|
42270
|
-
const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
|
|
42429
|
+
const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);
|
|
42430
|
+
const maxDepth = options.maxDepth === undefined ? 100 : options.maxDepth;
|
|
42271
42431
|
const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
|
|
42272
42432
|
|
|
42273
42433
|
if (!utils$1.isFunction(visitor)) {
|
|
@@ -42286,7 +42446,7 @@ function toFormData(obj, formData, options) {
|
|
|
42286
42446
|
}
|
|
42287
42447
|
|
|
42288
42448
|
if (!useBlob && utils$1.isBlob(value)) {
|
|
42289
|
-
throw new AxiosError
|
|
42449
|
+
throw new AxiosError('Blob is not supported. Use a Buffer instead.');
|
|
42290
42450
|
}
|
|
42291
42451
|
|
|
42292
42452
|
if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
|
|
@@ -42309,6 +42469,11 @@ function toFormData(obj, formData, options) {
|
|
|
42309
42469
|
function defaultVisitor(value, key, path) {
|
|
42310
42470
|
let arr = value;
|
|
42311
42471
|
|
|
42472
|
+
if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
|
|
42473
|
+
formData.append(renderKey(path, key, dots), convertValue(value));
|
|
42474
|
+
return false;
|
|
42475
|
+
}
|
|
42476
|
+
|
|
42312
42477
|
if (value && !path && typeof value === 'object') {
|
|
42313
42478
|
if (utils$1.endsWith(key, '{}')) {
|
|
42314
42479
|
// eslint-disable-next-line no-param-reassign
|
|
@@ -42317,17 +42482,22 @@ function toFormData(obj, formData, options) {
|
|
|
42317
42482
|
value = JSON.stringify(value);
|
|
42318
42483
|
} else if (
|
|
42319
42484
|
(utils$1.isArray(value) && isFlatArray(value)) ||
|
|
42320
|
-
((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))
|
|
42321
|
-
|
|
42485
|
+
((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value)))
|
|
42486
|
+
) {
|
|
42322
42487
|
// eslint-disable-next-line no-param-reassign
|
|
42323
42488
|
key = removeBrackets(key);
|
|
42324
42489
|
|
|
42325
42490
|
arr.forEach(function each(el, index) {
|
|
42326
|
-
!(utils$1.isUndefined(el) || el === null) &&
|
|
42327
|
-
|
|
42328
|
-
|
|
42329
|
-
|
|
42330
|
-
|
|
42491
|
+
!(utils$1.isUndefined(el) || el === null) &&
|
|
42492
|
+
formData.append(
|
|
42493
|
+
// eslint-disable-next-line no-nested-ternary
|
|
42494
|
+
indexes === true
|
|
42495
|
+
? renderKey([key], index, dots)
|
|
42496
|
+
: indexes === null
|
|
42497
|
+
? key
|
|
42498
|
+
: key + '[]',
|
|
42499
|
+
convertValue(el)
|
|
42500
|
+
);
|
|
42331
42501
|
});
|
|
42332
42502
|
return false;
|
|
42333
42503
|
}
|
|
@@ -42347,12 +42517,19 @@ function toFormData(obj, formData, options) {
|
|
|
42347
42517
|
const exposedHelpers = Object.assign(predicates, {
|
|
42348
42518
|
defaultVisitor,
|
|
42349
42519
|
convertValue,
|
|
42350
|
-
isVisitable
|
|
42520
|
+
isVisitable,
|
|
42351
42521
|
});
|
|
42352
42522
|
|
|
42353
|
-
function build(value, path) {
|
|
42523
|
+
function build(value, path, depth = 0) {
|
|
42354
42524
|
if (utils$1.isUndefined(value)) return;
|
|
42355
42525
|
|
|
42526
|
+
if (depth > maxDepth) {
|
|
42527
|
+
throw new AxiosError(
|
|
42528
|
+
'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,
|
|
42529
|
+
AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED
|
|
42530
|
+
);
|
|
42531
|
+
}
|
|
42532
|
+
|
|
42356
42533
|
if (stack.indexOf(value) !== -1) {
|
|
42357
42534
|
throw Error('Circular reference detected in ' + path.join('.'));
|
|
42358
42535
|
}
|
|
@@ -42360,12 +42537,12 @@ function toFormData(obj, formData, options) {
|
|
|
42360
42537
|
stack.push(value);
|
|
42361
42538
|
|
|
42362
42539
|
utils$1.forEach(value, function each(el, key) {
|
|
42363
|
-
const result =
|
|
42364
|
-
|
|
42365
|
-
|
|
42540
|
+
const result =
|
|
42541
|
+
!(utils$1.isUndefined(el) || el === null) &&
|
|
42542
|
+
visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
|
|
42366
42543
|
|
|
42367
42544
|
if (result === true) {
|
|
42368
|
-
build(el, path ? path.concat(key) : [key]);
|
|
42545
|
+
build(el, path ? path.concat(key) : [key], depth + 1);
|
|
42369
42546
|
}
|
|
42370
42547
|
});
|
|
42371
42548
|
|
|
@@ -42397,9 +42574,8 @@ function encode$1(str) {
|
|
|
42397
42574
|
')': '%29',
|
|
42398
42575
|
'~': '%7E',
|
|
42399
42576
|
'%20': '+',
|
|
42400
|
-
'%00': '\x00'
|
|
42401
42577
|
};
|
|
42402
|
-
return encodeURIComponent(str).replace(/[!'()~]|%20
|
|
42578
|
+
return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
|
|
42403
42579
|
return charMap[match];
|
|
42404
42580
|
});
|
|
42405
42581
|
}
|
|
@@ -42425,29 +42601,33 @@ prototype.append = function append(name, value) {
|
|
|
42425
42601
|
};
|
|
42426
42602
|
|
|
42427
42603
|
prototype.toString = function toString(encoder) {
|
|
42428
|
-
const _encode = encoder
|
|
42429
|
-
|
|
42430
|
-
|
|
42604
|
+
const _encode = encoder
|
|
42605
|
+
? function (value) {
|
|
42606
|
+
return encoder.call(this, value, encode$1);
|
|
42607
|
+
}
|
|
42608
|
+
: encode$1;
|
|
42431
42609
|
|
|
42432
|
-
return this._pairs
|
|
42433
|
-
|
|
42434
|
-
|
|
42610
|
+
return this._pairs
|
|
42611
|
+
.map(function each(pair) {
|
|
42612
|
+
return _encode(pair[0]) + '=' + _encode(pair[1]);
|
|
42613
|
+
}, '')
|
|
42614
|
+
.join('&');
|
|
42435
42615
|
};
|
|
42436
42616
|
|
|
42437
42617
|
/**
|
|
42438
|
-
* It replaces
|
|
42439
|
-
*
|
|
42618
|
+
* It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with
|
|
42619
|
+
* their plain counterparts (`:`, `$`, `,`, `+`).
|
|
42440
42620
|
*
|
|
42441
42621
|
* @param {string} val The value to be encoded.
|
|
42442
42622
|
*
|
|
42443
42623
|
* @returns {string} The encoded value.
|
|
42444
42624
|
*/
|
|
42445
42625
|
function encode(val) {
|
|
42446
|
-
return encodeURIComponent(val)
|
|
42447
|
-
replace(/%3A/gi, ':')
|
|
42448
|
-
replace(/%24/g, '$')
|
|
42449
|
-
replace(/%2C/gi, ',')
|
|
42450
|
-
replace(/%20/g, '+');
|
|
42626
|
+
return encodeURIComponent(val)
|
|
42627
|
+
.replace(/%3A/gi, ':')
|
|
42628
|
+
.replace(/%24/g, '$')
|
|
42629
|
+
.replace(/%2C/gi, ',')
|
|
42630
|
+
.replace(/%20/g, '+');
|
|
42451
42631
|
}
|
|
42452
42632
|
|
|
42453
42633
|
/**
|
|
@@ -42464,11 +42644,13 @@ function buildURL(url, params, options) {
|
|
|
42464
42644
|
return url;
|
|
42465
42645
|
}
|
|
42466
42646
|
|
|
42467
|
-
const _encode = options && options.encode || encode;
|
|
42647
|
+
const _encode = (options && options.encode) || encode;
|
|
42468
42648
|
|
|
42469
|
-
const _options = utils$1.isFunction(options)
|
|
42470
|
-
|
|
42471
|
-
|
|
42649
|
+
const _options = utils$1.isFunction(options)
|
|
42650
|
+
? {
|
|
42651
|
+
serialize: options,
|
|
42652
|
+
}
|
|
42653
|
+
: options;
|
|
42472
42654
|
|
|
42473
42655
|
const serializeFn = _options && _options.serialize;
|
|
42474
42656
|
|
|
@@ -42477,13 +42659,13 @@ function buildURL(url, params, options) {
|
|
|
42477
42659
|
if (serializeFn) {
|
|
42478
42660
|
serializedParams = serializeFn(params, _options);
|
|
42479
42661
|
} else {
|
|
42480
|
-
serializedParams = utils$1.isURLSearchParams(params)
|
|
42481
|
-
params.toString()
|
|
42482
|
-
new AxiosURLSearchParams(params, _options).toString(_encode);
|
|
42662
|
+
serializedParams = utils$1.isURLSearchParams(params)
|
|
42663
|
+
? params.toString()
|
|
42664
|
+
: new AxiosURLSearchParams(params, _options).toString(_encode);
|
|
42483
42665
|
}
|
|
42484
42666
|
|
|
42485
42667
|
if (serializedParams) {
|
|
42486
|
-
const hashmarkIndex = url.indexOf(
|
|
42668
|
+
const hashmarkIndex = url.indexOf('#');
|
|
42487
42669
|
|
|
42488
42670
|
if (hashmarkIndex !== -1) {
|
|
42489
42671
|
url = url.slice(0, hashmarkIndex);
|
|
@@ -42513,7 +42695,7 @@ class InterceptorManager {
|
|
|
42513
42695
|
fulfilled,
|
|
42514
42696
|
rejected,
|
|
42515
42697
|
synchronous: options ? options.synchronous : false,
|
|
42516
|
-
runWhen: options ? options.runWhen : null
|
|
42698
|
+
runWhen: options ? options.runWhen : null,
|
|
42517
42699
|
});
|
|
42518
42700
|
return this.handlers.length - 1;
|
|
42519
42701
|
}
|
|
@@ -42561,12 +42743,11 @@ class InterceptorManager {
|
|
|
42561
42743
|
}
|
|
42562
42744
|
}
|
|
42563
42745
|
|
|
42564
|
-
var InterceptorManager$1 = InterceptorManager;
|
|
42565
|
-
|
|
42566
42746
|
var transitionalDefaults = {
|
|
42567
42747
|
silentJSONParsing: true,
|
|
42568
42748
|
forcedJSONParsing: true,
|
|
42569
|
-
clarifyTimeoutError: false
|
|
42749
|
+
clarifyTimeoutError: false,
|
|
42750
|
+
legacyInterceptorReqResOrdering: true,
|
|
42570
42751
|
};
|
|
42571
42752
|
|
|
42572
42753
|
var URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
|
|
@@ -42580,14 +42761,14 @@ var platform$1 = {
|
|
|
42580
42761
|
classes: {
|
|
42581
42762
|
URLSearchParams: URLSearchParams$1,
|
|
42582
42763
|
FormData: FormData$1,
|
|
42583
|
-
Blob: Blob$1
|
|
42764
|
+
Blob: Blob$1,
|
|
42584
42765
|
},
|
|
42585
|
-
protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
|
|
42766
|
+
protocols: ['http', 'https', 'file', 'blob', 'url', 'data'],
|
|
42586
42767
|
};
|
|
42587
42768
|
|
|
42588
42769
|
const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
42589
42770
|
|
|
42590
|
-
const _navigator = typeof navigator === 'object' && navigator || undefined;
|
|
42771
|
+
const _navigator = (typeof navigator === 'object' && navigator) || undefined;
|
|
42591
42772
|
|
|
42592
42773
|
/**
|
|
42593
42774
|
* Determine if we're running in a standard browser environment
|
|
@@ -42606,7 +42787,8 @@ const _navigator = typeof navigator === 'object' && navigator || undefined;
|
|
|
42606
42787
|
*
|
|
42607
42788
|
* @returns {boolean}
|
|
42608
42789
|
*/
|
|
42609
|
-
const hasStandardBrowserEnv =
|
|
42790
|
+
const hasStandardBrowserEnv =
|
|
42791
|
+
hasBrowserEnv &&
|
|
42610
42792
|
(!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
|
|
42611
42793
|
|
|
42612
42794
|
/**
|
|
@@ -42627,25 +42809,25 @@ const hasStandardBrowserWebWorkerEnv = (() => {
|
|
|
42627
42809
|
);
|
|
42628
42810
|
})();
|
|
42629
42811
|
|
|
42630
|
-
const origin = hasBrowserEnv && window.location.href || 'http://localhost';
|
|
42812
|
+
const origin = (hasBrowserEnv && window.location.href) || 'http://localhost';
|
|
42631
42813
|
|
|
42632
42814
|
var utils = /*#__PURE__*/Object.freeze({
|
|
42633
42815
|
__proto__: null,
|
|
42634
42816
|
hasBrowserEnv: hasBrowserEnv,
|
|
42635
|
-
hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
|
|
42636
42817
|
hasStandardBrowserEnv: hasStandardBrowserEnv,
|
|
42818
|
+
hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
|
|
42637
42819
|
navigator: _navigator,
|
|
42638
42820
|
origin: origin
|
|
42639
42821
|
});
|
|
42640
42822
|
|
|
42641
42823
|
var platform = {
|
|
42642
42824
|
...utils,
|
|
42643
|
-
...platform$1
|
|
42825
|
+
...platform$1,
|
|
42644
42826
|
};
|
|
42645
42827
|
|
|
42646
42828
|
function toURLEncodedForm(data, options) {
|
|
42647
42829
|
return toFormData(data, new platform.classes.URLSearchParams(), {
|
|
42648
|
-
visitor: function(value, key, path, helpers) {
|
|
42830
|
+
visitor: function (value, key, path, helpers) {
|
|
42649
42831
|
if (platform.isNode && utils$1.isBuffer(value)) {
|
|
42650
42832
|
this.append(key, value.toString('base64'));
|
|
42651
42833
|
return false;
|
|
@@ -42653,7 +42835,7 @@ function toURLEncodedForm(data, options) {
|
|
|
42653
42835
|
|
|
42654
42836
|
return helpers.defaultVisitor.apply(this, arguments);
|
|
42655
42837
|
},
|
|
42656
|
-
...options
|
|
42838
|
+
...options,
|
|
42657
42839
|
});
|
|
42658
42840
|
}
|
|
42659
42841
|
|
|
@@ -42669,7 +42851,7 @@ function parsePropPath(name) {
|
|
|
42669
42851
|
// foo.x.y.z
|
|
42670
42852
|
// foo-x-y-z
|
|
42671
42853
|
// foo x y z
|
|
42672
|
-
return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
|
|
42854
|
+
return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
|
|
42673
42855
|
return match[0] === '[]' ? '' : match[1] || match[0];
|
|
42674
42856
|
});
|
|
42675
42857
|
}
|
|
@@ -42713,7 +42895,9 @@ function formDataToJSON(formData) {
|
|
|
42713
42895
|
|
|
42714
42896
|
if (isLast) {
|
|
42715
42897
|
if (utils$1.hasOwnProp(target, name)) {
|
|
42716
|
-
target[name] =
|
|
42898
|
+
target[name] = utils$1.isArray(target[name])
|
|
42899
|
+
? target[name].concat(value)
|
|
42900
|
+
: [target[name], value];
|
|
42717
42901
|
} else {
|
|
42718
42902
|
target[name] = value;
|
|
42719
42903
|
}
|
|
@@ -42747,6 +42931,8 @@ function formDataToJSON(formData) {
|
|
|
42747
42931
|
return null;
|
|
42748
42932
|
}
|
|
42749
42933
|
|
|
42934
|
+
const own = (obj, key) => (obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : undefined);
|
|
42935
|
+
|
|
42750
42936
|
/**
|
|
42751
42937
|
* It takes a string, tries to parse it, and if it fails, it returns the stringified version
|
|
42752
42938
|
* of the input
|
|
@@ -42773,96 +42959,110 @@ function stringifySafely(rawValue, parser, encoder) {
|
|
|
42773
42959
|
}
|
|
42774
42960
|
|
|
42775
42961
|
const defaults = {
|
|
42776
|
-
|
|
42777
42962
|
transitional: transitionalDefaults,
|
|
42778
42963
|
|
|
42779
42964
|
adapter: ['xhr', 'http', 'fetch'],
|
|
42780
42965
|
|
|
42781
|
-
transformRequest: [
|
|
42782
|
-
|
|
42783
|
-
|
|
42784
|
-
|
|
42966
|
+
transformRequest: [
|
|
42967
|
+
function transformRequest(data, headers) {
|
|
42968
|
+
const contentType = headers.getContentType() || '';
|
|
42969
|
+
const hasJSONContentType = contentType.indexOf('application/json') > -1;
|
|
42970
|
+
const isObjectPayload = utils$1.isObject(data);
|
|
42785
42971
|
|
|
42786
|
-
|
|
42787
|
-
|
|
42788
|
-
|
|
42972
|
+
if (isObjectPayload && utils$1.isHTMLForm(data)) {
|
|
42973
|
+
data = new FormData(data);
|
|
42974
|
+
}
|
|
42789
42975
|
|
|
42790
|
-
|
|
42976
|
+
const isFormData = utils$1.isFormData(data);
|
|
42791
42977
|
|
|
42792
|
-
|
|
42793
|
-
|
|
42794
|
-
|
|
42978
|
+
if (isFormData) {
|
|
42979
|
+
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
|
42980
|
+
}
|
|
42795
42981
|
|
|
42796
|
-
|
|
42797
|
-
|
|
42798
|
-
|
|
42799
|
-
|
|
42800
|
-
|
|
42801
|
-
|
|
42802
|
-
|
|
42803
|
-
|
|
42804
|
-
|
|
42805
|
-
|
|
42806
|
-
|
|
42807
|
-
|
|
42808
|
-
|
|
42809
|
-
|
|
42810
|
-
|
|
42811
|
-
|
|
42982
|
+
if (
|
|
42983
|
+
utils$1.isArrayBuffer(data) ||
|
|
42984
|
+
utils$1.isBuffer(data) ||
|
|
42985
|
+
utils$1.isStream(data) ||
|
|
42986
|
+
utils$1.isFile(data) ||
|
|
42987
|
+
utils$1.isBlob(data) ||
|
|
42988
|
+
utils$1.isReadableStream(data)
|
|
42989
|
+
) {
|
|
42990
|
+
return data;
|
|
42991
|
+
}
|
|
42992
|
+
if (utils$1.isArrayBufferView(data)) {
|
|
42993
|
+
return data.buffer;
|
|
42994
|
+
}
|
|
42995
|
+
if (utils$1.isURLSearchParams(data)) {
|
|
42996
|
+
headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
|
|
42997
|
+
return data.toString();
|
|
42998
|
+
}
|
|
42812
42999
|
|
|
42813
|
-
|
|
43000
|
+
let isFileList;
|
|
42814
43001
|
|
|
42815
|
-
|
|
42816
|
-
|
|
42817
|
-
|
|
42818
|
-
|
|
43002
|
+
if (isObjectPayload) {
|
|
43003
|
+
const formSerializer = own(this, 'formSerializer');
|
|
43004
|
+
if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
|
|
43005
|
+
return toURLEncodedForm(data, formSerializer).toString();
|
|
43006
|
+
}
|
|
42819
43007
|
|
|
42820
|
-
|
|
42821
|
-
|
|
43008
|
+
if (
|
|
43009
|
+
(isFileList = utils$1.isFileList(data)) ||
|
|
43010
|
+
contentType.indexOf('multipart/form-data') > -1
|
|
43011
|
+
) {
|
|
43012
|
+
const env = own(this, 'env');
|
|
43013
|
+
const _FormData = env && env.FormData;
|
|
42822
43014
|
|
|
42823
|
-
|
|
42824
|
-
|
|
42825
|
-
|
|
42826
|
-
|
|
42827
|
-
|
|
43015
|
+
return toFormData(
|
|
43016
|
+
isFileList ? { 'files[]': data } : data,
|
|
43017
|
+
_FormData && new _FormData(),
|
|
43018
|
+
formSerializer
|
|
43019
|
+
);
|
|
43020
|
+
}
|
|
42828
43021
|
}
|
|
42829
|
-
}
|
|
42830
43022
|
|
|
42831
|
-
|
|
42832
|
-
|
|
42833
|
-
|
|
42834
|
-
|
|
43023
|
+
if (isObjectPayload || hasJSONContentType) {
|
|
43024
|
+
headers.setContentType('application/json', false);
|
|
43025
|
+
return stringifySafely(data);
|
|
43026
|
+
}
|
|
42835
43027
|
|
|
42836
|
-
|
|
42837
|
-
|
|
43028
|
+
return data;
|
|
43029
|
+
},
|
|
43030
|
+
],
|
|
42838
43031
|
|
|
42839
|
-
transformResponse: [
|
|
42840
|
-
|
|
42841
|
-
|
|
42842
|
-
|
|
43032
|
+
transformResponse: [
|
|
43033
|
+
function transformResponse(data) {
|
|
43034
|
+
const transitional = own(this, 'transitional') || defaults.transitional;
|
|
43035
|
+
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
43036
|
+
const responseType = own(this, 'responseType');
|
|
43037
|
+
const JSONRequested = responseType === 'json';
|
|
42843
43038
|
|
|
42844
|
-
|
|
42845
|
-
|
|
42846
|
-
|
|
43039
|
+
if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
|
|
43040
|
+
return data;
|
|
43041
|
+
}
|
|
42847
43042
|
|
|
42848
|
-
|
|
42849
|
-
|
|
42850
|
-
|
|
43043
|
+
if (
|
|
43044
|
+
data &&
|
|
43045
|
+
utils$1.isString(data) &&
|
|
43046
|
+
((forcedJSONParsing && !responseType) || JSONRequested)
|
|
43047
|
+
) {
|
|
43048
|
+
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
43049
|
+
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
42851
43050
|
|
|
42852
|
-
|
|
42853
|
-
|
|
42854
|
-
|
|
42855
|
-
|
|
42856
|
-
|
|
42857
|
-
|
|
43051
|
+
try {
|
|
43052
|
+
return JSON.parse(data, own(this, 'parseReviver'));
|
|
43053
|
+
} catch (e) {
|
|
43054
|
+
if (strictJSONParsing) {
|
|
43055
|
+
if (e.name === 'SyntaxError') {
|
|
43056
|
+
throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, own(this, 'response'));
|
|
43057
|
+
}
|
|
43058
|
+
throw e;
|
|
42858
43059
|
}
|
|
42859
|
-
throw e;
|
|
42860
43060
|
}
|
|
42861
43061
|
}
|
|
42862
|
-
}
|
|
42863
43062
|
|
|
42864
|
-
|
|
42865
|
-
|
|
43063
|
+
return data;
|
|
43064
|
+
},
|
|
43065
|
+
],
|
|
42866
43066
|
|
|
42867
43067
|
/**
|
|
42868
43068
|
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
@@ -42878,7 +43078,7 @@ const defaults = {
|
|
|
42878
43078
|
|
|
42879
43079
|
env: {
|
|
42880
43080
|
FormData: platform.classes.FormData,
|
|
42881
|
-
Blob: platform.classes.Blob
|
|
43081
|
+
Blob: platform.classes.Blob,
|
|
42882
43082
|
},
|
|
42883
43083
|
|
|
42884
43084
|
validateStatus: function validateStatus(status) {
|
|
@@ -42887,25 +43087,36 @@ const defaults = {
|
|
|
42887
43087
|
|
|
42888
43088
|
headers: {
|
|
42889
43089
|
common: {
|
|
42890
|
-
|
|
42891
|
-
'Content-Type': undefined
|
|
42892
|
-
}
|
|
42893
|
-
}
|
|
43090
|
+
Accept: 'application/json, text/plain, */*',
|
|
43091
|
+
'Content-Type': undefined,
|
|
43092
|
+
},
|
|
43093
|
+
},
|
|
42894
43094
|
};
|
|
42895
43095
|
|
|
42896
43096
|
utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
|
|
42897
43097
|
defaults.headers[method] = {};
|
|
42898
43098
|
});
|
|
42899
43099
|
|
|
42900
|
-
var defaults$1 = defaults;
|
|
42901
|
-
|
|
42902
43100
|
// RawAxiosHeaders whose duplicates are ignored by node
|
|
42903
43101
|
// c.f. https://nodejs.org/api/http.html#http_message_headers
|
|
42904
43102
|
const ignoreDuplicateOf = utils$1.toObjectSet([
|
|
42905
|
-
'age',
|
|
42906
|
-
'
|
|
42907
|
-
'
|
|
42908
|
-
'
|
|
43103
|
+
'age',
|
|
43104
|
+
'authorization',
|
|
43105
|
+
'content-length',
|
|
43106
|
+
'content-type',
|
|
43107
|
+
'etag',
|
|
43108
|
+
'expires',
|
|
43109
|
+
'from',
|
|
43110
|
+
'host',
|
|
43111
|
+
'if-modified-since',
|
|
43112
|
+
'if-unmodified-since',
|
|
43113
|
+
'last-modified',
|
|
43114
|
+
'location',
|
|
43115
|
+
'max-forwards',
|
|
43116
|
+
'proxy-authorization',
|
|
43117
|
+
'referer',
|
|
43118
|
+
'retry-after',
|
|
43119
|
+
'user-agent',
|
|
42909
43120
|
]);
|
|
42910
43121
|
|
|
42911
43122
|
/**
|
|
@@ -42922,47 +43133,81 @@ const ignoreDuplicateOf = utils$1.toObjectSet([
|
|
|
42922
43133
|
*
|
|
42923
43134
|
* @returns {Object} Headers parsed into an object
|
|
42924
43135
|
*/
|
|
42925
|
-
var parseHeaders = rawHeaders => {
|
|
43136
|
+
var parseHeaders = (rawHeaders) => {
|
|
42926
43137
|
const parsed = {};
|
|
42927
43138
|
let key;
|
|
42928
43139
|
let val;
|
|
42929
43140
|
let i;
|
|
42930
43141
|
|
|
42931
|
-
rawHeaders &&
|
|
42932
|
-
|
|
42933
|
-
|
|
42934
|
-
|
|
43142
|
+
rawHeaders &&
|
|
43143
|
+
rawHeaders.split('\n').forEach(function parser(line) {
|
|
43144
|
+
i = line.indexOf(':');
|
|
43145
|
+
key = line.substring(0, i).trim().toLowerCase();
|
|
43146
|
+
val = line.substring(i + 1).trim();
|
|
42935
43147
|
|
|
42936
|
-
|
|
42937
|
-
|
|
42938
|
-
|
|
43148
|
+
if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
|
|
43149
|
+
return;
|
|
43150
|
+
}
|
|
42939
43151
|
|
|
42940
|
-
|
|
42941
|
-
|
|
42942
|
-
|
|
43152
|
+
if (key === 'set-cookie') {
|
|
43153
|
+
if (parsed[key]) {
|
|
43154
|
+
parsed[key].push(val);
|
|
43155
|
+
} else {
|
|
43156
|
+
parsed[key] = [val];
|
|
43157
|
+
}
|
|
42943
43158
|
} else {
|
|
42944
|
-
parsed[key] = [val
|
|
43159
|
+
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
|
|
42945
43160
|
}
|
|
42946
|
-
}
|
|
42947
|
-
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
|
|
42948
|
-
}
|
|
42949
|
-
});
|
|
43161
|
+
});
|
|
42950
43162
|
|
|
42951
43163
|
return parsed;
|
|
42952
43164
|
};
|
|
42953
43165
|
|
|
42954
43166
|
const $internals = Symbol('internals');
|
|
42955
43167
|
|
|
43168
|
+
const INVALID_HEADER_VALUE_CHARS_RE = /[^\x09\x20-\x7E\x80-\xFF]/g;
|
|
43169
|
+
|
|
43170
|
+
function trimSPorHTAB(str) {
|
|
43171
|
+
let start = 0;
|
|
43172
|
+
let end = str.length;
|
|
43173
|
+
|
|
43174
|
+
while (start < end) {
|
|
43175
|
+
const code = str.charCodeAt(start);
|
|
43176
|
+
|
|
43177
|
+
if (code !== 0x09 && code !== 0x20) {
|
|
43178
|
+
break;
|
|
43179
|
+
}
|
|
43180
|
+
|
|
43181
|
+
start += 1;
|
|
43182
|
+
}
|
|
43183
|
+
|
|
43184
|
+
while (end > start) {
|
|
43185
|
+
const code = str.charCodeAt(end - 1);
|
|
43186
|
+
|
|
43187
|
+
if (code !== 0x09 && code !== 0x20) {
|
|
43188
|
+
break;
|
|
43189
|
+
}
|
|
43190
|
+
|
|
43191
|
+
end -= 1;
|
|
43192
|
+
}
|
|
43193
|
+
|
|
43194
|
+
return start === 0 && end === str.length ? str : str.slice(start, end);
|
|
43195
|
+
}
|
|
43196
|
+
|
|
42956
43197
|
function normalizeHeader(header) {
|
|
42957
43198
|
return header && String(header).trim().toLowerCase();
|
|
42958
43199
|
}
|
|
42959
43200
|
|
|
43201
|
+
function sanitizeHeaderValue(str) {
|
|
43202
|
+
return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ''));
|
|
43203
|
+
}
|
|
43204
|
+
|
|
42960
43205
|
function normalizeValue(value) {
|
|
42961
43206
|
if (value === false || value == null) {
|
|
42962
43207
|
return value;
|
|
42963
43208
|
}
|
|
42964
43209
|
|
|
42965
|
-
return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
|
|
43210
|
+
return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
|
|
42966
43211
|
}
|
|
42967
43212
|
|
|
42968
43213
|
function parseTokens(str) {
|
|
@@ -43000,8 +43245,10 @@ function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
|
|
43000
43245
|
}
|
|
43001
43246
|
|
|
43002
43247
|
function formatHeader(header) {
|
|
43003
|
-
return header
|
|
43004
|
-
.
|
|
43248
|
+
return header
|
|
43249
|
+
.trim()
|
|
43250
|
+
.toLowerCase()
|
|
43251
|
+
.replace(/([a-z\d])(\w*)/g, (w, char, str) => {
|
|
43005
43252
|
return char.toUpperCase() + str;
|
|
43006
43253
|
});
|
|
43007
43254
|
}
|
|
@@ -43009,12 +43256,12 @@ function formatHeader(header) {
|
|
|
43009
43256
|
function buildAccessors(obj, header) {
|
|
43010
43257
|
const accessorName = utils$1.toCamelCase(' ' + header);
|
|
43011
43258
|
|
|
43012
|
-
['get', 'set', 'has'].forEach(methodName => {
|
|
43259
|
+
['get', 'set', 'has'].forEach((methodName) => {
|
|
43013
43260
|
Object.defineProperty(obj, methodName + accessorName, {
|
|
43014
|
-
value: function(arg1, arg2, arg3) {
|
|
43261
|
+
value: function (arg1, arg2, arg3) {
|
|
43015
43262
|
return this[methodName].call(this, header, arg1, arg2, arg3);
|
|
43016
43263
|
},
|
|
43017
|
-
configurable: true
|
|
43264
|
+
configurable: true,
|
|
43018
43265
|
});
|
|
43019
43266
|
});
|
|
43020
43267
|
}
|
|
@@ -43036,7 +43283,12 @@ class AxiosHeaders {
|
|
|
43036
43283
|
|
|
43037
43284
|
const key = utils$1.findKey(self, lHeader);
|
|
43038
43285
|
|
|
43039
|
-
if
|
|
43286
|
+
if (
|
|
43287
|
+
!key ||
|
|
43288
|
+
self[key] === undefined ||
|
|
43289
|
+
_rewrite === true ||
|
|
43290
|
+
(_rewrite === undefined && self[key] !== false)
|
|
43291
|
+
) {
|
|
43040
43292
|
self[key || _header] = normalizeValue(_value);
|
|
43041
43293
|
}
|
|
43042
43294
|
}
|
|
@@ -43046,17 +43298,22 @@ class AxiosHeaders {
|
|
|
43046
43298
|
|
|
43047
43299
|
if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
|
|
43048
43300
|
setHeaders(header, valueOrRewrite);
|
|
43049
|
-
} else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
43301
|
+
} else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
43050
43302
|
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
43051
43303
|
} else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
|
|
43052
|
-
let obj = {},
|
|
43304
|
+
let obj = {},
|
|
43305
|
+
dest,
|
|
43306
|
+
key;
|
|
43053
43307
|
for (const entry of header) {
|
|
43054
43308
|
if (!utils$1.isArray(entry)) {
|
|
43055
43309
|
throw TypeError('Object iterator must return a key-value pair');
|
|
43056
43310
|
}
|
|
43057
43311
|
|
|
43058
|
-
obj[key = entry[0]] = (dest = obj[key])
|
|
43059
|
-
|
|
43312
|
+
obj[(key = entry[0])] = (dest = obj[key])
|
|
43313
|
+
? utils$1.isArray(dest)
|
|
43314
|
+
? [...dest, entry[1]]
|
|
43315
|
+
: [dest, entry[1]]
|
|
43316
|
+
: entry[1];
|
|
43060
43317
|
}
|
|
43061
43318
|
|
|
43062
43319
|
setHeaders(obj, valueOrRewrite);
|
|
@@ -43103,7 +43360,11 @@ class AxiosHeaders {
|
|
|
43103
43360
|
if (header) {
|
|
43104
43361
|
const key = utils$1.findKey(this, header);
|
|
43105
43362
|
|
|
43106
|
-
return !!(
|
|
43363
|
+
return !!(
|
|
43364
|
+
key &&
|
|
43365
|
+
this[key] !== undefined &&
|
|
43366
|
+
(!matcher || matchHeaderValue(this, this[key], key, matcher))
|
|
43367
|
+
);
|
|
43107
43368
|
}
|
|
43108
43369
|
|
|
43109
43370
|
return false;
|
|
@@ -43143,7 +43404,7 @@ class AxiosHeaders {
|
|
|
43143
43404
|
|
|
43144
43405
|
while (i--) {
|
|
43145
43406
|
const key = keys[i];
|
|
43146
|
-
if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
|
43407
|
+
if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
|
43147
43408
|
delete this[key];
|
|
43148
43409
|
deleted = true;
|
|
43149
43410
|
}
|
|
@@ -43187,7 +43448,9 @@ class AxiosHeaders {
|
|
|
43187
43448
|
const obj = Object.create(null);
|
|
43188
43449
|
|
|
43189
43450
|
utils$1.forEach(this, (value, header) => {
|
|
43190
|
-
value != null &&
|
|
43451
|
+
value != null &&
|
|
43452
|
+
value !== false &&
|
|
43453
|
+
(obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
|
|
43191
43454
|
});
|
|
43192
43455
|
|
|
43193
43456
|
return obj;
|
|
@@ -43198,11 +43461,13 @@ class AxiosHeaders {
|
|
|
43198
43461
|
}
|
|
43199
43462
|
|
|
43200
43463
|
toString() {
|
|
43201
|
-
return Object.entries(this.toJSON())
|
|
43464
|
+
return Object.entries(this.toJSON())
|
|
43465
|
+
.map(([header, value]) => header + ': ' + value)
|
|
43466
|
+
.join('\n');
|
|
43202
43467
|
}
|
|
43203
43468
|
|
|
43204
43469
|
getSetCookie() {
|
|
43205
|
-
return this.get(
|
|
43470
|
+
return this.get('set-cookie') || [];
|
|
43206
43471
|
}
|
|
43207
43472
|
|
|
43208
43473
|
get [Symbol.toStringTag]() {
|
|
@@ -43222,9 +43487,12 @@ class AxiosHeaders {
|
|
|
43222
43487
|
}
|
|
43223
43488
|
|
|
43224
43489
|
static accessor(header) {
|
|
43225
|
-
const internals =
|
|
43226
|
-
|
|
43227
|
-
|
|
43490
|
+
const internals =
|
|
43491
|
+
(this[$internals] =
|
|
43492
|
+
this[$internals] =
|
|
43493
|
+
{
|
|
43494
|
+
accessors: {},
|
|
43495
|
+
});
|
|
43228
43496
|
|
|
43229
43497
|
const accessors = internals.accessors;
|
|
43230
43498
|
const prototype = this.prototype;
|
|
@@ -43244,23 +43512,28 @@ class AxiosHeaders {
|
|
|
43244
43512
|
}
|
|
43245
43513
|
}
|
|
43246
43514
|
|
|
43247
|
-
AxiosHeaders.accessor([
|
|
43515
|
+
AxiosHeaders.accessor([
|
|
43516
|
+
'Content-Type',
|
|
43517
|
+
'Content-Length',
|
|
43518
|
+
'Accept',
|
|
43519
|
+
'Accept-Encoding',
|
|
43520
|
+
'User-Agent',
|
|
43521
|
+
'Authorization',
|
|
43522
|
+
]);
|
|
43248
43523
|
|
|
43249
43524
|
// reserved names hotfix
|
|
43250
|
-
utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
|
|
43525
|
+
utils$1.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
|
|
43251
43526
|
let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
|
|
43252
43527
|
return {
|
|
43253
43528
|
get: () => value,
|
|
43254
43529
|
set(headerValue) {
|
|
43255
43530
|
this[mapped] = headerValue;
|
|
43256
|
-
}
|
|
43257
|
-
}
|
|
43531
|
+
},
|
|
43532
|
+
};
|
|
43258
43533
|
});
|
|
43259
43534
|
|
|
43260
43535
|
utils$1.freezeMethods(AxiosHeaders);
|
|
43261
43536
|
|
|
43262
|
-
var AxiosHeaders$1 = AxiosHeaders;
|
|
43263
|
-
|
|
43264
43537
|
/**
|
|
43265
43538
|
* Transform the data for a request or a response
|
|
43266
43539
|
*
|
|
@@ -43270,9 +43543,9 @@ var AxiosHeaders$1 = AxiosHeaders;
|
|
|
43270
43543
|
* @returns {*} The resulting transformed data
|
|
43271
43544
|
*/
|
|
43272
43545
|
function transformData(fns, response) {
|
|
43273
|
-
const config = this || defaults
|
|
43546
|
+
const config = this || defaults;
|
|
43274
43547
|
const context = response || config;
|
|
43275
|
-
const headers = AxiosHeaders
|
|
43548
|
+
const headers = AxiosHeaders.from(context.headers);
|
|
43276
43549
|
let data = context.data;
|
|
43277
43550
|
|
|
43278
43551
|
utils$1.forEach(fns, function transform(fn) {
|
|
@@ -43288,7 +43561,7 @@ function isCancel(value) {
|
|
|
43288
43561
|
return !!(value && value.__CANCEL__);
|
|
43289
43562
|
}
|
|
43290
43563
|
|
|
43291
|
-
class CanceledError extends AxiosError
|
|
43564
|
+
class CanceledError extends AxiosError {
|
|
43292
43565
|
/**
|
|
43293
43566
|
* A `CanceledError` is an object that is thrown when an operation is canceled.
|
|
43294
43567
|
*
|
|
@@ -43299,14 +43572,12 @@ class CanceledError extends AxiosError$1 {
|
|
|
43299
43572
|
* @returns {CanceledError} The created error.
|
|
43300
43573
|
*/
|
|
43301
43574
|
constructor(message, config, request) {
|
|
43302
|
-
super(message == null ? 'canceled' : message, AxiosError
|
|
43575
|
+
super(message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
|
|
43303
43576
|
this.name = 'CanceledError';
|
|
43304
43577
|
this.__CANCEL__ = true;
|
|
43305
43578
|
}
|
|
43306
43579
|
}
|
|
43307
43580
|
|
|
43308
|
-
var CanceledError$1 = CanceledError;
|
|
43309
|
-
|
|
43310
43581
|
/**
|
|
43311
43582
|
* Resolve or reject a Promise based on response status.
|
|
43312
43583
|
*
|
|
@@ -43321,19 +43592,23 @@ function settle(resolve, reject, response) {
|
|
|
43321
43592
|
if (!response.status || !validateStatus || validateStatus(response.status)) {
|
|
43322
43593
|
resolve(response);
|
|
43323
43594
|
} else {
|
|
43324
|
-
reject(
|
|
43325
|
-
|
|
43326
|
-
|
|
43327
|
-
|
|
43328
|
-
|
|
43329
|
-
|
|
43330
|
-
|
|
43595
|
+
reject(
|
|
43596
|
+
new AxiosError(
|
|
43597
|
+
'Request failed with status code ' + response.status,
|
|
43598
|
+
[AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][
|
|
43599
|
+
Math.floor(response.status / 100) - 4
|
|
43600
|
+
],
|
|
43601
|
+
response.config,
|
|
43602
|
+
response.request,
|
|
43603
|
+
response
|
|
43604
|
+
)
|
|
43605
|
+
);
|
|
43331
43606
|
}
|
|
43332
43607
|
}
|
|
43333
43608
|
|
|
43334
43609
|
function parseProtocol(url) {
|
|
43335
43610
|
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
43336
|
-
return match && match[1] || '';
|
|
43611
|
+
return (match && match[1]) || '';
|
|
43337
43612
|
}
|
|
43338
43613
|
|
|
43339
43614
|
/**
|
|
@@ -43384,7 +43659,7 @@ function speedometer(samplesCount, min) {
|
|
|
43384
43659
|
|
|
43385
43660
|
const passed = startedAt && now - startedAt;
|
|
43386
43661
|
|
|
43387
|
-
return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
|
|
43662
|
+
return passed ? Math.round((bytesCount * 1000) / passed) : undefined;
|
|
43388
43663
|
};
|
|
43389
43664
|
}
|
|
43390
43665
|
|
|
@@ -43413,7 +43688,7 @@ function throttle(fn, freq) {
|
|
|
43413
43688
|
const throttled = (...args) => {
|
|
43414
43689
|
const now = Date.now();
|
|
43415
43690
|
const passed = now - timestamp;
|
|
43416
|
-
if (
|
|
43691
|
+
if (passed >= threshold) {
|
|
43417
43692
|
invoke(args, now);
|
|
43418
43693
|
} else {
|
|
43419
43694
|
lastArgs = args;
|
|
@@ -43435,25 +43710,25 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
|
43435
43710
|
let bytesNotified = 0;
|
|
43436
43711
|
const _speedometer = speedometer(50, 250);
|
|
43437
43712
|
|
|
43438
|
-
return throttle(e => {
|
|
43439
|
-
const
|
|
43713
|
+
return throttle((e) => {
|
|
43714
|
+
const rawLoaded = e.loaded;
|
|
43440
43715
|
const total = e.lengthComputable ? e.total : undefined;
|
|
43441
|
-
const
|
|
43716
|
+
const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
|
|
43717
|
+
const progressBytes = Math.max(0, loaded - bytesNotified);
|
|
43442
43718
|
const rate = _speedometer(progressBytes);
|
|
43443
|
-
const inRange = loaded <= total;
|
|
43444
43719
|
|
|
43445
|
-
bytesNotified = loaded;
|
|
43720
|
+
bytesNotified = Math.max(bytesNotified, loaded);
|
|
43446
43721
|
|
|
43447
43722
|
const data = {
|
|
43448
43723
|
loaded,
|
|
43449
43724
|
total,
|
|
43450
|
-
progress: total ?
|
|
43725
|
+
progress: total ? loaded / total : undefined,
|
|
43451
43726
|
bytes: progressBytes,
|
|
43452
43727
|
rate: rate ? rate : undefined,
|
|
43453
|
-
estimated: rate && total
|
|
43728
|
+
estimated: rate && total ? (total - loaded) / rate : undefined,
|
|
43454
43729
|
event: e,
|
|
43455
43730
|
lengthComputable: total != null,
|
|
43456
|
-
[isDownloadStream ? 'download' : 'upload']: true
|
|
43731
|
+
[isDownloadStream ? 'download' : 'upload']: true,
|
|
43457
43732
|
};
|
|
43458
43733
|
|
|
43459
43734
|
listener(data);
|
|
@@ -43463,77 +43738,82 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
|
43463
43738
|
const progressEventDecorator = (total, throttled) => {
|
|
43464
43739
|
const lengthComputable = total != null;
|
|
43465
43740
|
|
|
43466
|
-
return [
|
|
43467
|
-
|
|
43468
|
-
|
|
43469
|
-
|
|
43470
|
-
|
|
43741
|
+
return [
|
|
43742
|
+
(loaded) =>
|
|
43743
|
+
throttled[0]({
|
|
43744
|
+
lengthComputable,
|
|
43745
|
+
total,
|
|
43746
|
+
loaded,
|
|
43747
|
+
}),
|
|
43748
|
+
throttled[1],
|
|
43749
|
+
];
|
|
43471
43750
|
};
|
|
43472
43751
|
|
|
43473
|
-
const asyncDecorator =
|
|
43752
|
+
const asyncDecorator =
|
|
43753
|
+
(fn) =>
|
|
43754
|
+
(...args) =>
|
|
43755
|
+
utils$1.asap(() => fn(...args));
|
|
43474
43756
|
|
|
43475
|
-
var isURLSameOrigin = platform.hasStandardBrowserEnv
|
|
43476
|
-
|
|
43757
|
+
var isURLSameOrigin = platform.hasStandardBrowserEnv
|
|
43758
|
+
? ((origin, isMSIE) => (url) => {
|
|
43759
|
+
url = new URL(url, platform.origin);
|
|
43477
43760
|
|
|
43478
|
-
|
|
43479
|
-
|
|
43480
|
-
|
|
43481
|
-
|
|
43482
|
-
|
|
43483
|
-
})(
|
|
43484
|
-
|
|
43485
|
-
|
|
43486
|
-
)
|
|
43487
|
-
|
|
43488
|
-
var cookies = platform.hasStandardBrowserEnv ?
|
|
43761
|
+
return (
|
|
43762
|
+
origin.protocol === url.protocol &&
|
|
43763
|
+
origin.host === url.host &&
|
|
43764
|
+
(isMSIE || origin.port === url.port)
|
|
43765
|
+
);
|
|
43766
|
+
})(
|
|
43767
|
+
new URL(platform.origin),
|
|
43768
|
+
platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
|
|
43769
|
+
)
|
|
43770
|
+
: () => true;
|
|
43489
43771
|
|
|
43490
|
-
|
|
43491
|
-
|
|
43492
|
-
|
|
43493
|
-
|
|
43772
|
+
var cookies = platform.hasStandardBrowserEnv
|
|
43773
|
+
? // Standard browser envs support document.cookie
|
|
43774
|
+
{
|
|
43775
|
+
write(name, value, expires, path, domain, secure, sameSite) {
|
|
43776
|
+
if (typeof document === 'undefined') return;
|
|
43494
43777
|
|
|
43495
|
-
|
|
43778
|
+
const cookie = [`${name}=${encodeURIComponent(value)}`];
|
|
43496
43779
|
|
|
43497
|
-
|
|
43498
|
-
|
|
43499
|
-
|
|
43500
|
-
|
|
43501
|
-
|
|
43502
|
-
|
|
43503
|
-
|
|
43504
|
-
|
|
43505
|
-
|
|
43506
|
-
|
|
43507
|
-
|
|
43508
|
-
|
|
43509
|
-
|
|
43510
|
-
|
|
43511
|
-
|
|
43780
|
+
if (utils$1.isNumber(expires)) {
|
|
43781
|
+
cookie.push(`expires=${new Date(expires).toUTCString()}`);
|
|
43782
|
+
}
|
|
43783
|
+
if (utils$1.isString(path)) {
|
|
43784
|
+
cookie.push(`path=${path}`);
|
|
43785
|
+
}
|
|
43786
|
+
if (utils$1.isString(domain)) {
|
|
43787
|
+
cookie.push(`domain=${domain}`);
|
|
43788
|
+
}
|
|
43789
|
+
if (secure === true) {
|
|
43790
|
+
cookie.push('secure');
|
|
43791
|
+
}
|
|
43792
|
+
if (utils$1.isString(sameSite)) {
|
|
43793
|
+
cookie.push(`SameSite=${sameSite}`);
|
|
43794
|
+
}
|
|
43512
43795
|
|
|
43513
|
-
|
|
43514
|
-
|
|
43796
|
+
document.cookie = cookie.join('; ');
|
|
43797
|
+
},
|
|
43515
43798
|
|
|
43516
|
-
|
|
43517
|
-
|
|
43518
|
-
|
|
43519
|
-
|
|
43520
|
-
|
|
43799
|
+
read(name) {
|
|
43800
|
+
if (typeof document === 'undefined') return null;
|
|
43801
|
+
const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
|
|
43802
|
+
return match ? decodeURIComponent(match[1]) : null;
|
|
43803
|
+
},
|
|
43521
43804
|
|
|
43522
|
-
|
|
43523
|
-
|
|
43805
|
+
remove(name) {
|
|
43806
|
+
this.write(name, '', Date.now() - 86400000, '/');
|
|
43807
|
+
},
|
|
43524
43808
|
}
|
|
43525
|
-
|
|
43526
|
-
|
|
43527
|
-
|
|
43528
|
-
|
|
43529
|
-
|
|
43530
|
-
|
|
43531
|
-
|
|
43532
|
-
|
|
43533
|
-
return null;
|
|
43534
|
-
},
|
|
43535
|
-
remove() {}
|
|
43536
|
-
};
|
|
43809
|
+
: // Non-standard browser env (web workers, react-native) lack needed support.
|
|
43810
|
+
{
|
|
43811
|
+
write() {},
|
|
43812
|
+
read() {
|
|
43813
|
+
return null;
|
|
43814
|
+
},
|
|
43815
|
+
remove() {},
|
|
43816
|
+
};
|
|
43537
43817
|
|
|
43538
43818
|
/**
|
|
43539
43819
|
* Determines whether the specified URL is absolute
|
|
@@ -43546,6 +43826,10 @@ function isAbsoluteURL(url) {
|
|
|
43546
43826
|
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
|
|
43547
43827
|
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
|
|
43548
43828
|
// by any combination of letters, digits, plus, period, or hyphen.
|
|
43829
|
+
if (typeof url !== 'string') {
|
|
43830
|
+
return false;
|
|
43831
|
+
}
|
|
43832
|
+
|
|
43549
43833
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
43550
43834
|
}
|
|
43551
43835
|
|
|
@@ -43575,13 +43859,13 @@ function combineURLs(baseURL, relativeURL) {
|
|
|
43575
43859
|
*/
|
|
43576
43860
|
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
|
43577
43861
|
let isRelativeUrl = !isAbsoluteURL(requestedURL);
|
|
43578
|
-
if (baseURL && (isRelativeUrl || allowAbsoluteUrls
|
|
43862
|
+
if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) {
|
|
43579
43863
|
return combineURLs(baseURL, requestedURL);
|
|
43580
43864
|
}
|
|
43581
43865
|
return requestedURL;
|
|
43582
43866
|
}
|
|
43583
43867
|
|
|
43584
|
-
const headersToObject = (thing) => thing instanceof AxiosHeaders
|
|
43868
|
+
const headersToObject = (thing) => (thing instanceof AxiosHeaders ? { ...thing } : thing);
|
|
43585
43869
|
|
|
43586
43870
|
/**
|
|
43587
43871
|
* Config-specific merge-function which creates a new config-object
|
|
@@ -43595,7 +43879,18 @@ const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing
|
|
|
43595
43879
|
function mergeConfig(config1, config2) {
|
|
43596
43880
|
// eslint-disable-next-line no-param-reassign
|
|
43597
43881
|
config2 = config2 || {};
|
|
43598
|
-
|
|
43882
|
+
|
|
43883
|
+
// Use a null-prototype object so that downstream reads such as `config.auth`
|
|
43884
|
+
// or `config.baseURL` cannot inherit polluted values from Object.prototype
|
|
43885
|
+
// (see GHSA-q8qp-cvcw-x6jj). `hasOwnProperty` is restored as a non-enumerable
|
|
43886
|
+
// own slot to preserve ergonomics for user code that relies on it.
|
|
43887
|
+
const config = Object.create(null);
|
|
43888
|
+
Object.defineProperty(config, 'hasOwnProperty', {
|
|
43889
|
+
value: Object.prototype.hasOwnProperty,
|
|
43890
|
+
enumerable: false,
|
|
43891
|
+
writable: true,
|
|
43892
|
+
configurable: true,
|
|
43893
|
+
});
|
|
43599
43894
|
|
|
43600
43895
|
function getMergedValue(target, source, prop, caseless) {
|
|
43601
43896
|
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
|
@@ -43634,9 +43929,9 @@ function mergeConfig(config1, config2) {
|
|
|
43634
43929
|
|
|
43635
43930
|
// eslint-disable-next-line consistent-return
|
|
43636
43931
|
function mergeDirectKeys(a, b, prop) {
|
|
43637
|
-
if (prop
|
|
43932
|
+
if (utils$1.hasOwnProp(config2, prop)) {
|
|
43638
43933
|
return getMergedValue(a, b);
|
|
43639
|
-
} else if (prop
|
|
43934
|
+
} else if (utils$1.hasOwnProp(config1, prop)) {
|
|
43640
43935
|
return getMergedValue(undefined, a);
|
|
43641
43936
|
}
|
|
43642
43937
|
}
|
|
@@ -43668,14 +43963,19 @@ function mergeConfig(config1, config2) {
|
|
|
43668
43963
|
httpsAgent: defaultToConfig2,
|
|
43669
43964
|
cancelToken: defaultToConfig2,
|
|
43670
43965
|
socketPath: defaultToConfig2,
|
|
43966
|
+
allowedSocketPaths: defaultToConfig2,
|
|
43671
43967
|
responseEncoding: defaultToConfig2,
|
|
43672
43968
|
validateStatus: mergeDirectKeys,
|
|
43673
|
-
headers: (a, b, prop) =>
|
|
43969
|
+
headers: (a, b, prop) =>
|
|
43970
|
+
mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true),
|
|
43674
43971
|
};
|
|
43675
43972
|
|
|
43676
43973
|
utils$1.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
|
|
43677
|
-
|
|
43678
|
-
const
|
|
43974
|
+
if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return;
|
|
43975
|
+
const merge = utils$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
|
|
43976
|
+
const a = utils$1.hasOwnProp(config1, prop) ? config1[prop] : undefined;
|
|
43977
|
+
const b = utils$1.hasOwnProp(config2, prop) ? config2[prop] : undefined;
|
|
43978
|
+
const configValue = merge(a, b, prop);
|
|
43679
43979
|
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
43680
43980
|
});
|
|
43681
43981
|
|
|
@@ -43685,16 +43985,38 @@ function mergeConfig(config1, config2) {
|
|
|
43685
43985
|
var resolveConfig = (config) => {
|
|
43686
43986
|
const newConfig = mergeConfig({}, config);
|
|
43687
43987
|
|
|
43688
|
-
|
|
43689
|
-
|
|
43690
|
-
|
|
43691
|
-
|
|
43692
|
-
|
|
43988
|
+
// Read only own properties to prevent prototype pollution gadgets
|
|
43989
|
+
// (e.g. Object.prototype.baseURL = 'https://evil.com'). See GHSA-q8qp-cvcw-x6jj.
|
|
43990
|
+
const own = (key) => (utils$1.hasOwnProp(newConfig, key) ? newConfig[key] : undefined);
|
|
43991
|
+
|
|
43992
|
+
const data = own('data');
|
|
43993
|
+
let withXSRFToken = own('withXSRFToken');
|
|
43994
|
+
const xsrfHeaderName = own('xsrfHeaderName');
|
|
43995
|
+
const xsrfCookieName = own('xsrfCookieName');
|
|
43996
|
+
let headers = own('headers');
|
|
43997
|
+
const auth = own('auth');
|
|
43998
|
+
const baseURL = own('baseURL');
|
|
43999
|
+
const allowAbsoluteUrls = own('allowAbsoluteUrls');
|
|
44000
|
+
const url = own('url');
|
|
44001
|
+
|
|
44002
|
+
newConfig.headers = headers = AxiosHeaders.from(headers);
|
|
44003
|
+
|
|
44004
|
+
newConfig.url = buildURL(
|
|
44005
|
+
buildFullPath(baseURL, url, allowAbsoluteUrls),
|
|
44006
|
+
config.params,
|
|
44007
|
+
config.paramsSerializer
|
|
44008
|
+
);
|
|
43693
44009
|
|
|
43694
44010
|
// HTTP basic authentication
|
|
43695
44011
|
if (auth) {
|
|
43696
|
-
headers.set(
|
|
43697
|
-
|
|
44012
|
+
headers.set(
|
|
44013
|
+
'Authorization',
|
|
44014
|
+
'Basic ' +
|
|
44015
|
+
btoa(
|
|
44016
|
+
(auth.username || '') +
|
|
44017
|
+
':' +
|
|
44018
|
+
(auth.password ? unescape(encodeURIComponent(auth.password)) : '')
|
|
44019
|
+
)
|
|
43698
44020
|
);
|
|
43699
44021
|
}
|
|
43700
44022
|
|
|
@@ -43712,17 +44034,25 @@ var resolveConfig = (config) => {
|
|
|
43712
44034
|
}
|
|
43713
44035
|
});
|
|
43714
44036
|
}
|
|
43715
|
-
}
|
|
44037
|
+
}
|
|
43716
44038
|
|
|
43717
44039
|
// Add xsrf header
|
|
43718
44040
|
// This is only done if running in a standard browser environment.
|
|
43719
44041
|
// Specifically not if we're in a web worker, or react-native.
|
|
43720
44042
|
|
|
43721
44043
|
if (platform.hasStandardBrowserEnv) {
|
|
43722
|
-
|
|
44044
|
+
if (utils$1.isFunction(withXSRFToken)) {
|
|
44045
|
+
withXSRFToken = withXSRFToken(newConfig);
|
|
44046
|
+
}
|
|
43723
44047
|
|
|
43724
|
-
|
|
43725
|
-
|
|
44048
|
+
// Strict boolean check — prevents proto-pollution gadgets (e.g. Object.prototype.withXSRFToken = 1)
|
|
44049
|
+
// and misconfigurations (e.g. "false") from short-circuiting the same-origin check and leaking
|
|
44050
|
+
// the XSRF token cross-origin. See GHSA-xx6v-rp6x-q39c.
|
|
44051
|
+
const shouldSendXSRF =
|
|
44052
|
+
withXSRFToken === true ||
|
|
44053
|
+
(withXSRFToken == null && isURLSameOrigin(newConfig.url));
|
|
44054
|
+
|
|
44055
|
+
if (shouldSendXSRF) {
|
|
43726
44056
|
const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
|
|
43727
44057
|
|
|
43728
44058
|
if (xsrfValue) {
|
|
@@ -43736,196 +44066,218 @@ var resolveConfig = (config) => {
|
|
|
43736
44066
|
|
|
43737
44067
|
const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
|
|
43738
44068
|
|
|
43739
|
-
var xhrAdapter = isXHRAdapterSupported &&
|
|
43740
|
-
|
|
43741
|
-
|
|
43742
|
-
|
|
43743
|
-
|
|
43744
|
-
|
|
43745
|
-
|
|
43746
|
-
|
|
43747
|
-
|
|
44069
|
+
var xhrAdapter = isXHRAdapterSupported &&
|
|
44070
|
+
function (config) {
|
|
44071
|
+
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
44072
|
+
const _config = resolveConfig(config);
|
|
44073
|
+
let requestData = _config.data;
|
|
44074
|
+
const requestHeaders = AxiosHeaders.from(_config.headers).normalize();
|
|
44075
|
+
let { responseType, onUploadProgress, onDownloadProgress } = _config;
|
|
44076
|
+
let onCanceled;
|
|
44077
|
+
let uploadThrottled, downloadThrottled;
|
|
44078
|
+
let flushUpload, flushDownload;
|
|
43748
44079
|
|
|
43749
|
-
|
|
43750
|
-
|
|
43751
|
-
|
|
44080
|
+
function done() {
|
|
44081
|
+
flushUpload && flushUpload(); // flush events
|
|
44082
|
+
flushDownload && flushDownload(); // flush events
|
|
43752
44083
|
|
|
43753
|
-
|
|
44084
|
+
_config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
|
|
43754
44085
|
|
|
43755
|
-
|
|
43756
|
-
|
|
44086
|
+
_config.signal && _config.signal.removeEventListener('abort', onCanceled);
|
|
44087
|
+
}
|
|
43757
44088
|
|
|
43758
|
-
|
|
44089
|
+
let request = new XMLHttpRequest();
|
|
43759
44090
|
|
|
43760
|
-
|
|
44091
|
+
request.open(_config.method.toUpperCase(), _config.url, true);
|
|
43761
44092
|
|
|
43762
|
-
|
|
43763
|
-
|
|
44093
|
+
// Set the request timeout in MS
|
|
44094
|
+
request.timeout = _config.timeout;
|
|
43764
44095
|
|
|
43765
|
-
|
|
43766
|
-
|
|
43767
|
-
|
|
44096
|
+
function onloadend() {
|
|
44097
|
+
if (!request) {
|
|
44098
|
+
return;
|
|
44099
|
+
}
|
|
44100
|
+
// Prepare the response
|
|
44101
|
+
const responseHeaders = AxiosHeaders.from(
|
|
44102
|
+
'getAllResponseHeaders' in request && request.getAllResponseHeaders()
|
|
44103
|
+
);
|
|
44104
|
+
const responseData =
|
|
44105
|
+
!responseType || responseType === 'text' || responseType === 'json'
|
|
44106
|
+
? request.responseText
|
|
44107
|
+
: request.response;
|
|
44108
|
+
const response = {
|
|
44109
|
+
data: responseData,
|
|
44110
|
+
status: request.status,
|
|
44111
|
+
statusText: request.statusText,
|
|
44112
|
+
headers: responseHeaders,
|
|
44113
|
+
config,
|
|
44114
|
+
request,
|
|
44115
|
+
};
|
|
44116
|
+
|
|
44117
|
+
settle(
|
|
44118
|
+
function _resolve(value) {
|
|
44119
|
+
resolve(value);
|
|
44120
|
+
done();
|
|
44121
|
+
},
|
|
44122
|
+
function _reject(err) {
|
|
44123
|
+
reject(err);
|
|
44124
|
+
done();
|
|
44125
|
+
},
|
|
44126
|
+
response
|
|
44127
|
+
);
|
|
44128
|
+
|
|
44129
|
+
// Clean up request
|
|
44130
|
+
request = null;
|
|
43768
44131
|
}
|
|
43769
|
-
// Prepare the response
|
|
43770
|
-
const responseHeaders = AxiosHeaders$1.from(
|
|
43771
|
-
'getAllResponseHeaders' in request && request.getAllResponseHeaders()
|
|
43772
|
-
);
|
|
43773
|
-
const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
|
|
43774
|
-
request.responseText : request.response;
|
|
43775
|
-
const response = {
|
|
43776
|
-
data: responseData,
|
|
43777
|
-
status: request.status,
|
|
43778
|
-
statusText: request.statusText,
|
|
43779
|
-
headers: responseHeaders,
|
|
43780
|
-
config,
|
|
43781
|
-
request
|
|
43782
|
-
};
|
|
43783
44132
|
|
|
43784
|
-
|
|
43785
|
-
|
|
43786
|
-
|
|
43787
|
-
}
|
|
43788
|
-
|
|
43789
|
-
|
|
43790
|
-
|
|
44133
|
+
if ('onloadend' in request) {
|
|
44134
|
+
// Use onloadend if available
|
|
44135
|
+
request.onloadend = onloadend;
|
|
44136
|
+
} else {
|
|
44137
|
+
// Listen for ready state to emulate onloadend
|
|
44138
|
+
request.onreadystatechange = function handleLoad() {
|
|
44139
|
+
if (!request || request.readyState !== 4) {
|
|
44140
|
+
return;
|
|
44141
|
+
}
|
|
43791
44142
|
|
|
43792
|
-
|
|
43793
|
-
|
|
43794
|
-
|
|
44143
|
+
// The request errored out and we didn't get a response, this will be
|
|
44144
|
+
// handled by onerror instead
|
|
44145
|
+
// With one exception: request that using file: protocol, most browsers
|
|
44146
|
+
// will return status as 0 even though it's a successful request
|
|
44147
|
+
if (
|
|
44148
|
+
request.status === 0 &&
|
|
44149
|
+
!(request.responseURL && request.responseURL.indexOf('file:') === 0)
|
|
44150
|
+
) {
|
|
44151
|
+
return;
|
|
44152
|
+
}
|
|
44153
|
+
// readystate handler is calling before onerror or ontimeout handlers,
|
|
44154
|
+
// so we should call onloadend on the next 'tick'
|
|
44155
|
+
setTimeout(onloadend);
|
|
44156
|
+
};
|
|
44157
|
+
}
|
|
43795
44158
|
|
|
43796
|
-
|
|
43797
|
-
|
|
43798
|
-
|
|
43799
|
-
} else {
|
|
43800
|
-
// Listen for ready state to emulate onloadend
|
|
43801
|
-
request.onreadystatechange = function handleLoad() {
|
|
43802
|
-
if (!request || request.readyState !== 4) {
|
|
44159
|
+
// Handle browser request cancellation (as opposed to a manual cancellation)
|
|
44160
|
+
request.onabort = function handleAbort() {
|
|
44161
|
+
if (!request) {
|
|
43803
44162
|
return;
|
|
43804
44163
|
}
|
|
43805
44164
|
|
|
43806
|
-
|
|
43807
|
-
|
|
43808
|
-
//
|
|
43809
|
-
|
|
43810
|
-
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
|
|
43811
|
-
return;
|
|
43812
|
-
}
|
|
43813
|
-
// readystate handler is calling before onerror or ontimeout handlers,
|
|
43814
|
-
// so we should call onloadend on the next 'tick'
|
|
43815
|
-
setTimeout(onloadend);
|
|
44165
|
+
reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
|
|
44166
|
+
|
|
44167
|
+
// Clean up request
|
|
44168
|
+
request = null;
|
|
43816
44169
|
};
|
|
43817
|
-
}
|
|
43818
44170
|
|
|
43819
|
-
|
|
43820
|
-
|
|
43821
|
-
|
|
43822
|
-
|
|
43823
|
-
|
|
44171
|
+
// Handle low level network errors
|
|
44172
|
+
request.onerror = function handleError(event) {
|
|
44173
|
+
// Browsers deliver a ProgressEvent in XHR onerror
|
|
44174
|
+
// (message may be empty; when present, surface it)
|
|
44175
|
+
// See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
|
|
44176
|
+
const msg = event && event.message ? event.message : 'Network Error';
|
|
44177
|
+
const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request);
|
|
44178
|
+
// attach the underlying event for consumers who want details
|
|
44179
|
+
err.event = event || null;
|
|
44180
|
+
reject(err);
|
|
44181
|
+
request = null;
|
|
44182
|
+
};
|
|
43824
44183
|
|
|
43825
|
-
|
|
44184
|
+
// Handle timeout
|
|
44185
|
+
request.ontimeout = function handleTimeout() {
|
|
44186
|
+
let timeoutErrorMessage = _config.timeout
|
|
44187
|
+
? 'timeout of ' + _config.timeout + 'ms exceeded'
|
|
44188
|
+
: 'timeout exceeded';
|
|
44189
|
+
const transitional = _config.transitional || transitionalDefaults;
|
|
44190
|
+
if (_config.timeoutErrorMessage) {
|
|
44191
|
+
timeoutErrorMessage = _config.timeoutErrorMessage;
|
|
44192
|
+
}
|
|
44193
|
+
reject(
|
|
44194
|
+
new AxiosError(
|
|
44195
|
+
timeoutErrorMessage,
|
|
44196
|
+
transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
|
|
44197
|
+
config,
|
|
44198
|
+
request
|
|
44199
|
+
)
|
|
44200
|
+
);
|
|
43826
44201
|
|
|
43827
|
-
|
|
43828
|
-
|
|
43829
|
-
|
|
44202
|
+
// Clean up request
|
|
44203
|
+
request = null;
|
|
44204
|
+
};
|
|
43830
44205
|
|
|
43831
|
-
|
|
43832
|
-
|
|
43833
|
-
// Browsers deliver a ProgressEvent in XHR onerror
|
|
43834
|
-
// (message may be empty; when present, surface it)
|
|
43835
|
-
// See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
|
|
43836
|
-
const msg = event && event.message ? event.message : 'Network Error';
|
|
43837
|
-
const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
|
|
43838
|
-
// attach the underlying event for consumers who want details
|
|
43839
|
-
err.event = event || null;
|
|
43840
|
-
reject(err);
|
|
43841
|
-
request = null;
|
|
43842
|
-
};
|
|
43843
|
-
|
|
43844
|
-
// Handle timeout
|
|
43845
|
-
request.ontimeout = function handleTimeout() {
|
|
43846
|
-
let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
|
|
43847
|
-
const transitional = _config.transitional || transitionalDefaults;
|
|
43848
|
-
if (_config.timeoutErrorMessage) {
|
|
43849
|
-
timeoutErrorMessage = _config.timeoutErrorMessage;
|
|
43850
|
-
}
|
|
43851
|
-
reject(new AxiosError$1(
|
|
43852
|
-
timeoutErrorMessage,
|
|
43853
|
-
transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
|
|
43854
|
-
config,
|
|
43855
|
-
request));
|
|
43856
|
-
|
|
43857
|
-
// Clean up request
|
|
43858
|
-
request = null;
|
|
43859
|
-
};
|
|
44206
|
+
// Remove Content-Type if data is undefined
|
|
44207
|
+
requestData === undefined && requestHeaders.setContentType(null);
|
|
43860
44208
|
|
|
43861
|
-
|
|
43862
|
-
|
|
44209
|
+
// Add headers to the request
|
|
44210
|
+
if ('setRequestHeader' in request) {
|
|
44211
|
+
utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
|
44212
|
+
request.setRequestHeader(key, val);
|
|
44213
|
+
});
|
|
44214
|
+
}
|
|
43863
44215
|
|
|
43864
|
-
|
|
43865
|
-
|
|
43866
|
-
|
|
43867
|
-
|
|
43868
|
-
});
|
|
43869
|
-
}
|
|
44216
|
+
// Add withCredentials to request if needed
|
|
44217
|
+
if (!utils$1.isUndefined(_config.withCredentials)) {
|
|
44218
|
+
request.withCredentials = !!_config.withCredentials;
|
|
44219
|
+
}
|
|
43870
44220
|
|
|
43871
|
-
|
|
43872
|
-
|
|
43873
|
-
|
|
43874
|
-
|
|
44221
|
+
// Add responseType to request if needed
|
|
44222
|
+
if (responseType && responseType !== 'json') {
|
|
44223
|
+
request.responseType = _config.responseType;
|
|
44224
|
+
}
|
|
43875
44225
|
|
|
43876
|
-
|
|
43877
|
-
|
|
43878
|
-
|
|
43879
|
-
|
|
44226
|
+
// Handle progress if needed
|
|
44227
|
+
if (onDownloadProgress) {
|
|
44228
|
+
[downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
|
|
44229
|
+
request.addEventListener('progress', downloadThrottled);
|
|
44230
|
+
}
|
|
43880
44231
|
|
|
43881
|
-
|
|
43882
|
-
|
|
43883
|
-
|
|
43884
|
-
request.addEventListener('progress', downloadThrottled);
|
|
43885
|
-
}
|
|
44232
|
+
// Not all browsers support upload events
|
|
44233
|
+
if (onUploadProgress && request.upload) {
|
|
44234
|
+
[uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
|
|
43886
44235
|
|
|
43887
|
-
|
|
43888
|
-
if (onUploadProgress && request.upload) {
|
|
43889
|
-
([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));
|
|
44236
|
+
request.upload.addEventListener('progress', uploadThrottled);
|
|
43890
44237
|
|
|
43891
|
-
|
|
44238
|
+
request.upload.addEventListener('loadend', flushUpload);
|
|
44239
|
+
}
|
|
43892
44240
|
|
|
43893
|
-
|
|
43894
|
-
|
|
44241
|
+
if (_config.cancelToken || _config.signal) {
|
|
44242
|
+
// Handle cancellation
|
|
44243
|
+
// eslint-disable-next-line func-names
|
|
44244
|
+
onCanceled = (cancel) => {
|
|
44245
|
+
if (!request) {
|
|
44246
|
+
return;
|
|
44247
|
+
}
|
|
44248
|
+
reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
|
|
44249
|
+
request.abort();
|
|
44250
|
+
request = null;
|
|
44251
|
+
};
|
|
43895
44252
|
|
|
43896
|
-
|
|
43897
|
-
|
|
43898
|
-
|
|
43899
|
-
|
|
43900
|
-
|
|
43901
|
-
return;
|
|
44253
|
+
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
|
44254
|
+
if (_config.signal) {
|
|
44255
|
+
_config.signal.aborted
|
|
44256
|
+
? onCanceled()
|
|
44257
|
+
: _config.signal.addEventListener('abort', onCanceled);
|
|
43902
44258
|
}
|
|
43903
|
-
reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
|
|
43904
|
-
request.abort();
|
|
43905
|
-
request = null;
|
|
43906
|
-
};
|
|
43907
|
-
|
|
43908
|
-
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
|
43909
|
-
if (_config.signal) {
|
|
43910
|
-
_config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);
|
|
43911
44259
|
}
|
|
43912
|
-
}
|
|
43913
44260
|
|
|
43914
|
-
|
|
43915
|
-
|
|
43916
|
-
if (protocol && platform.protocols.indexOf(protocol) === -1) {
|
|
43917
|
-
reject(new AxiosError$1('Unsupported protocol ' + protocol + ':', AxiosError$1.ERR_BAD_REQUEST, config));
|
|
43918
|
-
return;
|
|
43919
|
-
}
|
|
44261
|
+
const protocol = parseProtocol(_config.url);
|
|
43920
44262
|
|
|
44263
|
+
if (protocol && platform.protocols.indexOf(protocol) === -1) {
|
|
44264
|
+
reject(
|
|
44265
|
+
new AxiosError(
|
|
44266
|
+
'Unsupported protocol ' + protocol + ':',
|
|
44267
|
+
AxiosError.ERR_BAD_REQUEST,
|
|
44268
|
+
config
|
|
44269
|
+
)
|
|
44270
|
+
);
|
|
44271
|
+
return;
|
|
44272
|
+
}
|
|
43921
44273
|
|
|
43922
|
-
|
|
43923
|
-
|
|
43924
|
-
|
|
43925
|
-
};
|
|
44274
|
+
// Send the request
|
|
44275
|
+
request.send(requestData || null);
|
|
44276
|
+
});
|
|
44277
|
+
};
|
|
43926
44278
|
|
|
43927
44279
|
const composeSignals = (signals, timeout) => {
|
|
43928
|
-
const {length} = (signals = signals ? signals.filter(Boolean) : []);
|
|
44280
|
+
const { length } = (signals = signals ? signals.filter(Boolean) : []);
|
|
43929
44281
|
|
|
43930
44282
|
if (timeout || length) {
|
|
43931
44283
|
let controller = new AbortController();
|
|
@@ -43937,21 +44289,29 @@ const composeSignals = (signals, timeout) => {
|
|
|
43937
44289
|
aborted = true;
|
|
43938
44290
|
unsubscribe();
|
|
43939
44291
|
const err = reason instanceof Error ? reason : this.reason;
|
|
43940
|
-
controller.abort(
|
|
44292
|
+
controller.abort(
|
|
44293
|
+
err instanceof AxiosError
|
|
44294
|
+
? err
|
|
44295
|
+
: new CanceledError(err instanceof Error ? err.message : err)
|
|
44296
|
+
);
|
|
43941
44297
|
}
|
|
43942
44298
|
};
|
|
43943
44299
|
|
|
43944
|
-
let timer =
|
|
43945
|
-
|
|
43946
|
-
|
|
43947
|
-
|
|
44300
|
+
let timer =
|
|
44301
|
+
timeout &&
|
|
44302
|
+
setTimeout(() => {
|
|
44303
|
+
timer = null;
|
|
44304
|
+
onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT));
|
|
44305
|
+
}, timeout);
|
|
43948
44306
|
|
|
43949
44307
|
const unsubscribe = () => {
|
|
43950
44308
|
if (signals) {
|
|
43951
44309
|
timer && clearTimeout(timer);
|
|
43952
44310
|
timer = null;
|
|
43953
|
-
signals.forEach(signal => {
|
|
43954
|
-
signal.unsubscribe
|
|
44311
|
+
signals.forEach((signal) => {
|
|
44312
|
+
signal.unsubscribe
|
|
44313
|
+
? signal.unsubscribe(onabort)
|
|
44314
|
+
: signal.removeEventListener('abort', onabort);
|
|
43955
44315
|
});
|
|
43956
44316
|
signals = null;
|
|
43957
44317
|
}
|
|
@@ -43959,7 +44319,7 @@ const composeSignals = (signals, timeout) => {
|
|
|
43959
44319
|
|
|
43960
44320
|
signals.forEach((signal) => signal.addEventListener('abort', onabort));
|
|
43961
44321
|
|
|
43962
|
-
const {signal} = controller;
|
|
44322
|
+
const { signal } = controller;
|
|
43963
44323
|
|
|
43964
44324
|
signal.unsubscribe = () => utils$1.asap(unsubscribe);
|
|
43965
44325
|
|
|
@@ -43967,12 +44327,10 @@ const composeSignals = (signals, timeout) => {
|
|
|
43967
44327
|
}
|
|
43968
44328
|
};
|
|
43969
44329
|
|
|
43970
|
-
var composeSignals$1 = composeSignals;
|
|
43971
|
-
|
|
43972
44330
|
const streamChunk = function* (chunk, chunkSize) {
|
|
43973
44331
|
let len = chunk.byteLength;
|
|
43974
44332
|
|
|
43975
|
-
if (
|
|
44333
|
+
if (len < chunkSize) {
|
|
43976
44334
|
yield chunk;
|
|
43977
44335
|
return;
|
|
43978
44336
|
}
|
|
@@ -44002,7 +44360,7 @@ const readStream = async function* (stream) {
|
|
|
44002
44360
|
const reader = stream.getReader();
|
|
44003
44361
|
try {
|
|
44004
44362
|
for (;;) {
|
|
44005
|
-
const {done, value} = await reader.read();
|
|
44363
|
+
const { done, value } = await reader.read();
|
|
44006
44364
|
if (done) {
|
|
44007
44365
|
break;
|
|
44008
44366
|
}
|
|
@@ -44025,64 +44383,69 @@ const trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
|
|
44025
44383
|
}
|
|
44026
44384
|
};
|
|
44027
44385
|
|
|
44028
|
-
return new ReadableStream(
|
|
44029
|
-
|
|
44030
|
-
|
|
44031
|
-
|
|
44386
|
+
return new ReadableStream(
|
|
44387
|
+
{
|
|
44388
|
+
async pull(controller) {
|
|
44389
|
+
try {
|
|
44390
|
+
const { done, value } = await iterator.next();
|
|
44032
44391
|
|
|
44033
|
-
|
|
44034
|
-
|
|
44035
|
-
|
|
44036
|
-
|
|
44037
|
-
|
|
44392
|
+
if (done) {
|
|
44393
|
+
_onFinish();
|
|
44394
|
+
controller.close();
|
|
44395
|
+
return;
|
|
44396
|
+
}
|
|
44038
44397
|
|
|
44039
|
-
|
|
44040
|
-
|
|
44041
|
-
|
|
44042
|
-
|
|
44398
|
+
let len = value.byteLength;
|
|
44399
|
+
if (onProgress) {
|
|
44400
|
+
let loadedBytes = (bytes += len);
|
|
44401
|
+
onProgress(loadedBytes);
|
|
44402
|
+
}
|
|
44403
|
+
controller.enqueue(new Uint8Array(value));
|
|
44404
|
+
} catch (err) {
|
|
44405
|
+
_onFinish(err);
|
|
44406
|
+
throw err;
|
|
44043
44407
|
}
|
|
44044
|
-
|
|
44045
|
-
|
|
44046
|
-
_onFinish(
|
|
44047
|
-
|
|
44048
|
-
}
|
|
44408
|
+
},
|
|
44409
|
+
cancel(reason) {
|
|
44410
|
+
_onFinish(reason);
|
|
44411
|
+
return iterator.return();
|
|
44412
|
+
},
|
|
44049
44413
|
},
|
|
44050
|
-
|
|
44051
|
-
|
|
44052
|
-
return iterator.return();
|
|
44414
|
+
{
|
|
44415
|
+
highWaterMark: 2,
|
|
44053
44416
|
}
|
|
44054
|
-
|
|
44055
|
-
highWaterMark: 2
|
|
44056
|
-
})
|
|
44417
|
+
);
|
|
44057
44418
|
};
|
|
44058
44419
|
|
|
44059
44420
|
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
44060
44421
|
|
|
44061
|
-
const {isFunction} = utils$1;
|
|
44422
|
+
const { isFunction } = utils$1;
|
|
44062
44423
|
|
|
44063
|
-
const globalFetchAPI = (({Request, Response}) => ({
|
|
44064
|
-
Request,
|
|
44424
|
+
const globalFetchAPI = (({ Request, Response }) => ({
|
|
44425
|
+
Request,
|
|
44426
|
+
Response,
|
|
44065
44427
|
}))(utils$1.global);
|
|
44066
44428
|
|
|
44067
|
-
const {
|
|
44068
|
-
ReadableStream: ReadableStream$1, TextEncoder
|
|
44069
|
-
} = utils$1.global;
|
|
44070
|
-
|
|
44429
|
+
const { ReadableStream: ReadableStream$1, TextEncoder } = utils$1.global;
|
|
44071
44430
|
|
|
44072
44431
|
const test = (fn, ...args) => {
|
|
44073
44432
|
try {
|
|
44074
44433
|
return !!fn(...args);
|
|
44075
44434
|
} catch (e) {
|
|
44076
|
-
return false
|
|
44435
|
+
return false;
|
|
44077
44436
|
}
|
|
44078
44437
|
};
|
|
44079
44438
|
|
|
44080
44439
|
const factory = (env) => {
|
|
44081
|
-
env = utils$1.merge.call(
|
|
44082
|
-
|
|
44083
|
-
|
|
44440
|
+
env = utils$1.merge.call(
|
|
44441
|
+
{
|
|
44442
|
+
skipUndefined: true,
|
|
44443
|
+
},
|
|
44444
|
+
globalFetchAPI,
|
|
44445
|
+
env
|
|
44446
|
+
);
|
|
44084
44447
|
|
|
44085
|
-
const {fetch: envFetch, Request, Response} = env;
|
|
44448
|
+
const { fetch: envFetch, Request, Response } = env;
|
|
44086
44449
|
const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';
|
|
44087
44450
|
const isRequestSupported = isFunction(Request);
|
|
44088
44451
|
const isResponseSupported = isFunction(Response);
|
|
@@ -44093,46 +44456,67 @@ const factory = (env) => {
|
|
|
44093
44456
|
|
|
44094
44457
|
const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
|
|
44095
44458
|
|
|
44096
|
-
const encodeText =
|
|
44097
|
-
|
|
44098
|
-
|
|
44099
|
-
|
|
44459
|
+
const encodeText =
|
|
44460
|
+
isFetchSupported &&
|
|
44461
|
+
(typeof TextEncoder === 'function'
|
|
44462
|
+
? (
|
|
44463
|
+
(encoder) => (str) =>
|
|
44464
|
+
encoder.encode(str)
|
|
44465
|
+
)(new TextEncoder())
|
|
44466
|
+
: async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
|
|
44467
|
+
|
|
44468
|
+
const supportsRequestStream =
|
|
44469
|
+
isRequestSupported &&
|
|
44470
|
+
isReadableStreamSupported &&
|
|
44471
|
+
test(() => {
|
|
44472
|
+
let duplexAccessed = false;
|
|
44473
|
+
|
|
44474
|
+
const request = new Request(platform.origin, {
|
|
44475
|
+
body: new ReadableStream$1(),
|
|
44476
|
+
method: 'POST',
|
|
44477
|
+
get duplex() {
|
|
44478
|
+
duplexAccessed = true;
|
|
44479
|
+
return 'half';
|
|
44480
|
+
},
|
|
44481
|
+
});
|
|
44100
44482
|
|
|
44101
|
-
|
|
44102
|
-
let duplexAccessed = false;
|
|
44483
|
+
const hasContentType = request.headers.has('Content-Type');
|
|
44103
44484
|
|
|
44104
|
-
|
|
44105
|
-
|
|
44106
|
-
|
|
44107
|
-
get duplex() {
|
|
44108
|
-
duplexAccessed = true;
|
|
44109
|
-
return 'half';
|
|
44110
|
-
},
|
|
44111
|
-
}).headers.has('Content-Type');
|
|
44485
|
+
if (request.body != null) {
|
|
44486
|
+
request.body.cancel();
|
|
44487
|
+
}
|
|
44112
44488
|
|
|
44113
|
-
|
|
44114
|
-
|
|
44489
|
+
return duplexAccessed && !hasContentType;
|
|
44490
|
+
});
|
|
44115
44491
|
|
|
44116
|
-
const supportsResponseStream =
|
|
44492
|
+
const supportsResponseStream =
|
|
44493
|
+
isResponseSupported &&
|
|
44494
|
+
isReadableStreamSupported &&
|
|
44117
44495
|
test(() => utils$1.isReadableStream(new Response('').body));
|
|
44118
44496
|
|
|
44119
44497
|
const resolvers = {
|
|
44120
|
-
stream: supportsResponseStream && ((res) => res.body)
|
|
44498
|
+
stream: supportsResponseStream && ((res) => res.body),
|
|
44121
44499
|
};
|
|
44122
44500
|
|
|
44123
|
-
isFetchSupported &&
|
|
44124
|
-
|
|
44125
|
-
|
|
44126
|
-
|
|
44501
|
+
isFetchSupported &&
|
|
44502
|
+
(() => {
|
|
44503
|
+
['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach((type) => {
|
|
44504
|
+
!resolvers[type] &&
|
|
44505
|
+
(resolvers[type] = (res, config) => {
|
|
44506
|
+
let method = res && res[type];
|
|
44127
44507
|
|
|
44128
|
-
|
|
44129
|
-
|
|
44130
|
-
|
|
44508
|
+
if (method) {
|
|
44509
|
+
return method.call(res);
|
|
44510
|
+
}
|
|
44131
44511
|
|
|
44132
|
-
|
|
44512
|
+
throw new AxiosError(
|
|
44513
|
+
`Response type '${type}' is not supported`,
|
|
44514
|
+
AxiosError.ERR_NOT_SUPPORT,
|
|
44515
|
+
config
|
|
44516
|
+
);
|
|
44517
|
+
});
|
|
44133
44518
|
});
|
|
44134
|
-
});
|
|
44135
|
-
})());
|
|
44519
|
+
})();
|
|
44136
44520
|
|
|
44137
44521
|
const getBodyLength = async (body) => {
|
|
44138
44522
|
if (body == null) {
|
|
@@ -44183,32 +44567,41 @@ const factory = (env) => {
|
|
|
44183
44567
|
responseType,
|
|
44184
44568
|
headers,
|
|
44185
44569
|
withCredentials = 'same-origin',
|
|
44186
|
-
fetchOptions
|
|
44570
|
+
fetchOptions,
|
|
44187
44571
|
} = resolveConfig(config);
|
|
44188
44572
|
|
|
44189
44573
|
let _fetch = envFetch || fetch;
|
|
44190
44574
|
|
|
44191
44575
|
responseType = responseType ? (responseType + '').toLowerCase() : 'text';
|
|
44192
44576
|
|
|
44193
|
-
let composedSignal = composeSignals
|
|
44577
|
+
let composedSignal = composeSignals(
|
|
44578
|
+
[signal, cancelToken && cancelToken.toAbortSignal()],
|
|
44579
|
+
timeout
|
|
44580
|
+
);
|
|
44194
44581
|
|
|
44195
44582
|
let request = null;
|
|
44196
44583
|
|
|
44197
|
-
const unsubscribe =
|
|
44198
|
-
composedSignal
|
|
44199
|
-
|
|
44584
|
+
const unsubscribe =
|
|
44585
|
+
composedSignal &&
|
|
44586
|
+
composedSignal.unsubscribe &&
|
|
44587
|
+
(() => {
|
|
44588
|
+
composedSignal.unsubscribe();
|
|
44589
|
+
});
|
|
44200
44590
|
|
|
44201
44591
|
let requestContentLength;
|
|
44202
44592
|
|
|
44203
44593
|
try {
|
|
44204
44594
|
if (
|
|
44205
|
-
onUploadProgress &&
|
|
44595
|
+
onUploadProgress &&
|
|
44596
|
+
supportsRequestStream &&
|
|
44597
|
+
method !== 'get' &&
|
|
44598
|
+
method !== 'head' &&
|
|
44206
44599
|
(requestContentLength = await resolveBodyLength(headers, data)) !== 0
|
|
44207
44600
|
) {
|
|
44208
44601
|
let _request = new Request(url, {
|
|
44209
44602
|
method: 'POST',
|
|
44210
44603
|
body: data,
|
|
44211
|
-
duplex:
|
|
44604
|
+
duplex: 'half',
|
|
44212
44605
|
});
|
|
44213
44606
|
|
|
44214
44607
|
let contentTypeHeader;
|
|
@@ -44233,7 +44626,20 @@ const factory = (env) => {
|
|
|
44233
44626
|
|
|
44234
44627
|
// Cloudflare Workers throws when credentials are defined
|
|
44235
44628
|
// see https://github.com/cloudflare/workerd/issues/902
|
|
44236
|
-
const isCredentialsSupported = isRequestSupported &&
|
|
44629
|
+
const isCredentialsSupported = isRequestSupported && 'credentials' in Request.prototype;
|
|
44630
|
+
|
|
44631
|
+
// If data is FormData and Content-Type is multipart/form-data without boundary,
|
|
44632
|
+
// delete it so fetch can set it correctly with the boundary
|
|
44633
|
+
if (utils$1.isFormData(data)) {
|
|
44634
|
+
const contentType = headers.getContentType();
|
|
44635
|
+
if (
|
|
44636
|
+
contentType &&
|
|
44637
|
+
/^multipart\/form-data/i.test(contentType) &&
|
|
44638
|
+
!/boundary=/i.test(contentType)
|
|
44639
|
+
) {
|
|
44640
|
+
headers.delete('content-type');
|
|
44641
|
+
}
|
|
44642
|
+
}
|
|
44237
44643
|
|
|
44238
44644
|
const resolvedOptions = {
|
|
44239
44645
|
...fetchOptions,
|
|
@@ -44241,29 +44647,35 @@ const factory = (env) => {
|
|
|
44241
44647
|
method: method.toUpperCase(),
|
|
44242
44648
|
headers: headers.normalize().toJSON(),
|
|
44243
44649
|
body: data,
|
|
44244
|
-
duplex:
|
|
44245
|
-
credentials: isCredentialsSupported ? withCredentials : undefined
|
|
44650
|
+
duplex: 'half',
|
|
44651
|
+
credentials: isCredentialsSupported ? withCredentials : undefined,
|
|
44246
44652
|
};
|
|
44247
44653
|
|
|
44248
44654
|
request = isRequestSupported && new Request(url, resolvedOptions);
|
|
44249
44655
|
|
|
44250
|
-
let response = await (isRequestSupported
|
|
44656
|
+
let response = await (isRequestSupported
|
|
44657
|
+
? _fetch(request, fetchOptions)
|
|
44658
|
+
: _fetch(url, resolvedOptions));
|
|
44251
44659
|
|
|
44252
|
-
const isStreamResponse =
|
|
44660
|
+
const isStreamResponse =
|
|
44661
|
+
supportsResponseStream && (responseType === 'stream' || responseType === 'response');
|
|
44253
44662
|
|
|
44254
44663
|
if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
|
|
44255
44664
|
const options = {};
|
|
44256
44665
|
|
|
44257
|
-
['status', 'statusText', 'headers'].forEach(prop => {
|
|
44666
|
+
['status', 'statusText', 'headers'].forEach((prop) => {
|
|
44258
44667
|
options[prop] = response[prop];
|
|
44259
44668
|
});
|
|
44260
44669
|
|
|
44261
44670
|
const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
|
|
44262
44671
|
|
|
44263
|
-
const [onProgress, flush] =
|
|
44264
|
-
|
|
44265
|
-
|
|
44266
|
-
|
|
44672
|
+
const [onProgress, flush] =
|
|
44673
|
+
(onDownloadProgress &&
|
|
44674
|
+
progressEventDecorator(
|
|
44675
|
+
responseContentLength,
|
|
44676
|
+
progressEventReducer(asyncDecorator(onDownloadProgress), true)
|
|
44677
|
+
)) ||
|
|
44678
|
+
[];
|
|
44267
44679
|
|
|
44268
44680
|
response = new Response(
|
|
44269
44681
|
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
@@ -44276,54 +44688,64 @@ const factory = (env) => {
|
|
|
44276
44688
|
|
|
44277
44689
|
responseType = responseType || 'text';
|
|
44278
44690
|
|
|
44279
|
-
let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](
|
|
44691
|
+
let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](
|
|
44692
|
+
response,
|
|
44693
|
+
config
|
|
44694
|
+
);
|
|
44280
44695
|
|
|
44281
44696
|
!isStreamResponse && unsubscribe && unsubscribe();
|
|
44282
44697
|
|
|
44283
44698
|
return await new Promise((resolve, reject) => {
|
|
44284
44699
|
settle(resolve, reject, {
|
|
44285
44700
|
data: responseData,
|
|
44286
|
-
headers: AxiosHeaders
|
|
44701
|
+
headers: AxiosHeaders.from(response.headers),
|
|
44287
44702
|
status: response.status,
|
|
44288
44703
|
statusText: response.statusText,
|
|
44289
44704
|
config,
|
|
44290
|
-
request
|
|
44705
|
+
request,
|
|
44291
44706
|
});
|
|
44292
|
-
})
|
|
44707
|
+
});
|
|
44293
44708
|
} catch (err) {
|
|
44294
44709
|
unsubscribe && unsubscribe();
|
|
44295
44710
|
|
|
44296
44711
|
if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
|
|
44297
44712
|
throw Object.assign(
|
|
44298
|
-
new AxiosError
|
|
44713
|
+
new AxiosError(
|
|
44714
|
+
'Network Error',
|
|
44715
|
+
AxiosError.ERR_NETWORK,
|
|
44716
|
+
config,
|
|
44717
|
+
request,
|
|
44718
|
+
err && err.response
|
|
44719
|
+
),
|
|
44299
44720
|
{
|
|
44300
|
-
cause: err.cause || err
|
|
44721
|
+
cause: err.cause || err,
|
|
44301
44722
|
}
|
|
44302
|
-
)
|
|
44723
|
+
);
|
|
44303
44724
|
}
|
|
44304
44725
|
|
|
44305
|
-
throw AxiosError
|
|
44726
|
+
throw AxiosError.from(err, err && err.code, config, request, err && err.response);
|
|
44306
44727
|
}
|
|
44307
|
-
}
|
|
44728
|
+
};
|
|
44308
44729
|
};
|
|
44309
44730
|
|
|
44310
44731
|
const seedCache = new Map();
|
|
44311
44732
|
|
|
44312
44733
|
const getFetch = (config) => {
|
|
44313
44734
|
let env = (config && config.env) || {};
|
|
44314
|
-
const {fetch, Request, Response} = env;
|
|
44315
|
-
const seeds = [
|
|
44316
|
-
Request, Response, fetch
|
|
44317
|
-
];
|
|
44735
|
+
const { fetch, Request, Response } = env;
|
|
44736
|
+
const seeds = [Request, Response, fetch];
|
|
44318
44737
|
|
|
44319
|
-
let len = seeds.length,
|
|
44320
|
-
|
|
44738
|
+
let len = seeds.length,
|
|
44739
|
+
i = len,
|
|
44740
|
+
seed,
|
|
44741
|
+
target,
|
|
44742
|
+
map = seedCache;
|
|
44321
44743
|
|
|
44322
44744
|
while (i--) {
|
|
44323
44745
|
seed = seeds[i];
|
|
44324
44746
|
target = map.get(seed);
|
|
44325
44747
|
|
|
44326
|
-
target === undefined && map.set(seed, target =
|
|
44748
|
+
target === undefined && map.set(seed, (target = i ? new Map() : factory(env)));
|
|
44327
44749
|
|
|
44328
44750
|
map = target;
|
|
44329
44751
|
}
|
|
@@ -44339,7 +44761,7 @@ getFetch();
|
|
|
44339
44761
|
* - `http` for Node.js
|
|
44340
44762
|
* - `xhr` for browsers
|
|
44341
44763
|
* - `fetch` for fetch API-based requests
|
|
44342
|
-
*
|
|
44764
|
+
*
|
|
44343
44765
|
* @type {Object<string, Function|Object>}
|
|
44344
44766
|
*/
|
|
44345
44767
|
const knownAdapters = {
|
|
@@ -44347,7 +44769,7 @@ const knownAdapters = {
|
|
|
44347
44769
|
xhr: xhrAdapter,
|
|
44348
44770
|
fetch: {
|
|
44349
44771
|
get: getFetch,
|
|
44350
|
-
}
|
|
44772
|
+
},
|
|
44351
44773
|
};
|
|
44352
44774
|
|
|
44353
44775
|
// Assign adapter names for easier debugging and identification
|
|
@@ -44364,7 +44786,7 @@ utils$1.forEach(knownAdapters, (fn, value) => {
|
|
|
44364
44786
|
|
|
44365
44787
|
/**
|
|
44366
44788
|
* Render a rejection reason string for unknown or unsupported adapters
|
|
44367
|
-
*
|
|
44789
|
+
*
|
|
44368
44790
|
* @param {string} reason
|
|
44369
44791
|
* @returns {string}
|
|
44370
44792
|
*/
|
|
@@ -44372,17 +44794,18 @@ const renderReason = (reason) => `- ${reason}`;
|
|
|
44372
44794
|
|
|
44373
44795
|
/**
|
|
44374
44796
|
* Check if the adapter is resolved (function, null, or false)
|
|
44375
|
-
*
|
|
44797
|
+
*
|
|
44376
44798
|
* @param {Function|null|false} adapter
|
|
44377
44799
|
* @returns {boolean}
|
|
44378
44800
|
*/
|
|
44379
|
-
const isResolvedHandle = (adapter) =>
|
|
44801
|
+
const isResolvedHandle = (adapter) =>
|
|
44802
|
+
utils$1.isFunction(adapter) || adapter === null || adapter === false;
|
|
44380
44803
|
|
|
44381
44804
|
/**
|
|
44382
44805
|
* Get the first suitable adapter from the provided list.
|
|
44383
44806
|
* Tries each adapter in order until a supported one is found.
|
|
44384
44807
|
* Throws an AxiosError if no adapter is suitable.
|
|
44385
|
-
*
|
|
44808
|
+
*
|
|
44386
44809
|
* @param {Array<string|Function>|string|Function} adapters - Adapter(s) by name or function.
|
|
44387
44810
|
* @param {Object} config - Axios request configuration
|
|
44388
44811
|
* @throws {AxiosError} If no suitable adapter is available
|
|
@@ -44407,7 +44830,7 @@ function getAdapter(adapters, config) {
|
|
|
44407
44830
|
adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
|
|
44408
44831
|
|
|
44409
44832
|
if (adapter === undefined) {
|
|
44410
|
-
throw new AxiosError
|
|
44833
|
+
throw new AxiosError(`Unknown adapter '${id}'`);
|
|
44411
44834
|
}
|
|
44412
44835
|
}
|
|
44413
44836
|
|
|
@@ -44419,16 +44842,19 @@ function getAdapter(adapters, config) {
|
|
|
44419
44842
|
}
|
|
44420
44843
|
|
|
44421
44844
|
if (!adapter) {
|
|
44422
|
-
const reasons = Object.entries(rejectedReasons)
|
|
44423
|
-
|
|
44845
|
+
const reasons = Object.entries(rejectedReasons).map(
|
|
44846
|
+
([id, state]) =>
|
|
44847
|
+
`adapter ${id} ` +
|
|
44424
44848
|
(state === false ? 'is not supported by the environment' : 'is not available in the build')
|
|
44425
|
-
|
|
44849
|
+
);
|
|
44426
44850
|
|
|
44427
|
-
let s = length
|
|
44428
|
-
|
|
44429
|
-
|
|
44851
|
+
let s = length
|
|
44852
|
+
? reasons.length > 1
|
|
44853
|
+
? 'since :\n' + reasons.map(renderReason).join('\n')
|
|
44854
|
+
: ' ' + renderReason(reasons[0])
|
|
44855
|
+
: 'as no adapter specified';
|
|
44430
44856
|
|
|
44431
|
-
throw new AxiosError
|
|
44857
|
+
throw new AxiosError(
|
|
44432
44858
|
`There is no suitable adapter to dispatch the request ` + s,
|
|
44433
44859
|
'ERR_NOT_SUPPORT'
|
|
44434
44860
|
);
|
|
@@ -44451,7 +44877,7 @@ var adapters = {
|
|
|
44451
44877
|
* Exposes all known adapters
|
|
44452
44878
|
* @type {Object<string, Function|Object>}
|
|
44453
44879
|
*/
|
|
44454
|
-
adapters: knownAdapters
|
|
44880
|
+
adapters: knownAdapters,
|
|
44455
44881
|
};
|
|
44456
44882
|
|
|
44457
44883
|
/**
|
|
@@ -44467,7 +44893,7 @@ function throwIfCancellationRequested(config) {
|
|
|
44467
44893
|
}
|
|
44468
44894
|
|
|
44469
44895
|
if (config.signal && config.signal.aborted) {
|
|
44470
|
-
throw new CanceledError
|
|
44896
|
+
throw new CanceledError(null, config);
|
|
44471
44897
|
}
|
|
44472
44898
|
}
|
|
44473
44899
|
|
|
@@ -44481,53 +44907,49 @@ function throwIfCancellationRequested(config) {
|
|
|
44481
44907
|
function dispatchRequest(config) {
|
|
44482
44908
|
throwIfCancellationRequested(config);
|
|
44483
44909
|
|
|
44484
|
-
config.headers = AxiosHeaders
|
|
44910
|
+
config.headers = AxiosHeaders.from(config.headers);
|
|
44485
44911
|
|
|
44486
44912
|
// Transform request data
|
|
44487
|
-
config.data = transformData.call(
|
|
44488
|
-
config,
|
|
44489
|
-
config.transformRequest
|
|
44490
|
-
);
|
|
44913
|
+
config.data = transformData.call(config, config.transformRequest);
|
|
44491
44914
|
|
|
44492
44915
|
if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
|
|
44493
44916
|
config.headers.setContentType('application/x-www-form-urlencoded', false);
|
|
44494
44917
|
}
|
|
44495
44918
|
|
|
44496
|
-
const adapter = adapters.getAdapter(config.adapter || defaults
|
|
44497
|
-
|
|
44498
|
-
return adapter(config).then(function onAdapterResolution(response) {
|
|
44499
|
-
throwIfCancellationRequested(config);
|
|
44919
|
+
const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);
|
|
44500
44920
|
|
|
44501
|
-
|
|
44502
|
-
response
|
|
44503
|
-
config,
|
|
44504
|
-
config.transformResponse,
|
|
44505
|
-
response
|
|
44506
|
-
);
|
|
44507
|
-
|
|
44508
|
-
response.headers = AxiosHeaders$1.from(response.headers);
|
|
44509
|
-
|
|
44510
|
-
return response;
|
|
44511
|
-
}, function onAdapterRejection(reason) {
|
|
44512
|
-
if (!isCancel(reason)) {
|
|
44921
|
+
return adapter(config).then(
|
|
44922
|
+
function onAdapterResolution(response) {
|
|
44513
44923
|
throwIfCancellationRequested(config);
|
|
44514
44924
|
|
|
44515
44925
|
// Transform response data
|
|
44516
|
-
|
|
44517
|
-
|
|
44518
|
-
|
|
44519
|
-
|
|
44520
|
-
|
|
44521
|
-
|
|
44522
|
-
|
|
44926
|
+
response.data = transformData.call(config, config.transformResponse, response);
|
|
44927
|
+
|
|
44928
|
+
response.headers = AxiosHeaders.from(response.headers);
|
|
44929
|
+
|
|
44930
|
+
return response;
|
|
44931
|
+
},
|
|
44932
|
+
function onAdapterRejection(reason) {
|
|
44933
|
+
if (!isCancel(reason)) {
|
|
44934
|
+
throwIfCancellationRequested(config);
|
|
44935
|
+
|
|
44936
|
+
// Transform response data
|
|
44937
|
+
if (reason && reason.response) {
|
|
44938
|
+
reason.response.data = transformData.call(
|
|
44939
|
+
config,
|
|
44940
|
+
config.transformResponse,
|
|
44941
|
+
reason.response
|
|
44942
|
+
);
|
|
44943
|
+
reason.response.headers = AxiosHeaders.from(reason.response.headers);
|
|
44944
|
+
}
|
|
44523
44945
|
}
|
|
44524
|
-
}
|
|
44525
44946
|
|
|
44526
|
-
|
|
44527
|
-
|
|
44947
|
+
return Promise.reject(reason);
|
|
44948
|
+
}
|
|
44949
|
+
);
|
|
44528
44950
|
}
|
|
44529
44951
|
|
|
44530
|
-
const VERSION = "1.
|
|
44952
|
+
const VERSION = "1.15.2";
|
|
44531
44953
|
|
|
44532
44954
|
const validators$1 = {};
|
|
44533
44955
|
|
|
@@ -44551,15 +44973,23 @@ const deprecatedWarnings = {};
|
|
|
44551
44973
|
*/
|
|
44552
44974
|
validators$1.transitional = function transitional(validator, version, message) {
|
|
44553
44975
|
function formatMessage(opt, desc) {
|
|
44554
|
-
return
|
|
44976
|
+
return (
|
|
44977
|
+
'[Axios v' +
|
|
44978
|
+
VERSION +
|
|
44979
|
+
"] Transitional option '" +
|
|
44980
|
+
opt +
|
|
44981
|
+
"'" +
|
|
44982
|
+
desc +
|
|
44983
|
+
(message ? '. ' + message : '')
|
|
44984
|
+
);
|
|
44555
44985
|
}
|
|
44556
44986
|
|
|
44557
44987
|
// eslint-disable-next-line func-names
|
|
44558
44988
|
return (value, opt, opts) => {
|
|
44559
44989
|
if (validator === false) {
|
|
44560
|
-
throw new AxiosError
|
|
44990
|
+
throw new AxiosError(
|
|
44561
44991
|
formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
|
|
44562
|
-
AxiosError
|
|
44992
|
+
AxiosError.ERR_DEPRECATED
|
|
44563
44993
|
);
|
|
44564
44994
|
}
|
|
44565
44995
|
|
|
@@ -44583,7 +45013,7 @@ validators$1.spelling = function spelling(correctSpelling) {
|
|
|
44583
45013
|
// eslint-disable-next-line no-console
|
|
44584
45014
|
console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
|
|
44585
45015
|
return true;
|
|
44586
|
-
}
|
|
45016
|
+
};
|
|
44587
45017
|
};
|
|
44588
45018
|
|
|
44589
45019
|
/**
|
|
@@ -44598,30 +45028,35 @@ validators$1.spelling = function spelling(correctSpelling) {
|
|
|
44598
45028
|
|
|
44599
45029
|
function assertOptions(options, schema, allowUnknown) {
|
|
44600
45030
|
if (typeof options !== 'object') {
|
|
44601
|
-
throw new AxiosError
|
|
45031
|
+
throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
|
|
44602
45032
|
}
|
|
44603
45033
|
const keys = Object.keys(options);
|
|
44604
45034
|
let i = keys.length;
|
|
44605
45035
|
while (i-- > 0) {
|
|
44606
45036
|
const opt = keys[i];
|
|
44607
|
-
|
|
45037
|
+
// Use hasOwnProperty so a polluted Object.prototype.<opt> cannot supply
|
|
45038
|
+
// a non-function validator and cause a TypeError. See GHSA-q8qp-cvcw-x6jj.
|
|
45039
|
+
const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : undefined;
|
|
44608
45040
|
if (validator) {
|
|
44609
45041
|
const value = options[opt];
|
|
44610
45042
|
const result = value === undefined || validator(value, opt, options);
|
|
44611
45043
|
if (result !== true) {
|
|
44612
|
-
throw new AxiosError
|
|
45044
|
+
throw new AxiosError(
|
|
45045
|
+
'option ' + opt + ' must be ' + result,
|
|
45046
|
+
AxiosError.ERR_BAD_OPTION_VALUE
|
|
45047
|
+
);
|
|
44613
45048
|
}
|
|
44614
45049
|
continue;
|
|
44615
45050
|
}
|
|
44616
45051
|
if (allowUnknown !== true) {
|
|
44617
|
-
throw new AxiosError
|
|
45052
|
+
throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);
|
|
44618
45053
|
}
|
|
44619
45054
|
}
|
|
44620
45055
|
}
|
|
44621
45056
|
|
|
44622
45057
|
var validator = {
|
|
44623
45058
|
assertOptions,
|
|
44624
|
-
validators: validators$1
|
|
45059
|
+
validators: validators$1,
|
|
44625
45060
|
};
|
|
44626
45061
|
|
|
44627
45062
|
const validators = validator.validators;
|
|
@@ -44637,8 +45072,8 @@ class Axios {
|
|
|
44637
45072
|
constructor(instanceConfig) {
|
|
44638
45073
|
this.defaults = instanceConfig || {};
|
|
44639
45074
|
this.interceptors = {
|
|
44640
|
-
request: new InterceptorManager
|
|
44641
|
-
response: new InterceptorManager
|
|
45075
|
+
request: new InterceptorManager(),
|
|
45076
|
+
response: new InterceptorManager(),
|
|
44642
45077
|
};
|
|
44643
45078
|
}
|
|
44644
45079
|
|
|
@@ -44660,13 +45095,29 @@ class Axios {
|
|
|
44660
45095
|
Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());
|
|
44661
45096
|
|
|
44662
45097
|
// slice off the Error: ... line
|
|
44663
|
-
const stack =
|
|
45098
|
+
const stack = (() => {
|
|
45099
|
+
if (!dummy.stack) {
|
|
45100
|
+
return '';
|
|
45101
|
+
}
|
|
45102
|
+
|
|
45103
|
+
const firstNewlineIndex = dummy.stack.indexOf('\n');
|
|
45104
|
+
|
|
45105
|
+
return firstNewlineIndex === -1 ? '' : dummy.stack.slice(firstNewlineIndex + 1);
|
|
45106
|
+
})();
|
|
44664
45107
|
try {
|
|
44665
45108
|
if (!err.stack) {
|
|
44666
45109
|
err.stack = stack;
|
|
44667
45110
|
// match without the 2 top stack lines
|
|
44668
|
-
} else if (stack
|
|
44669
|
-
|
|
45111
|
+
} else if (stack) {
|
|
45112
|
+
const firstNewlineIndex = stack.indexOf('\n');
|
|
45113
|
+
const secondNewlineIndex =
|
|
45114
|
+
firstNewlineIndex === -1 ? -1 : stack.indexOf('\n', firstNewlineIndex + 1);
|
|
45115
|
+
const stackWithoutTwoTopLines =
|
|
45116
|
+
secondNewlineIndex === -1 ? '' : stack.slice(secondNewlineIndex + 1);
|
|
45117
|
+
|
|
45118
|
+
if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) {
|
|
45119
|
+
err.stack += '\n' + stack;
|
|
45120
|
+
}
|
|
44670
45121
|
}
|
|
44671
45122
|
} catch (e) {
|
|
44672
45123
|
// ignore the case where "stack" is an un-writable property
|
|
@@ -44689,26 +45140,35 @@ class Axios {
|
|
|
44689
45140
|
|
|
44690
45141
|
config = mergeConfig(this.defaults, config);
|
|
44691
45142
|
|
|
44692
|
-
const {transitional, paramsSerializer, headers} = config;
|
|
45143
|
+
const { transitional, paramsSerializer, headers } = config;
|
|
44693
45144
|
|
|
44694
45145
|
if (transitional !== undefined) {
|
|
44695
|
-
validator.assertOptions(
|
|
44696
|
-
|
|
44697
|
-
|
|
44698
|
-
|
|
44699
|
-
|
|
45146
|
+
validator.assertOptions(
|
|
45147
|
+
transitional,
|
|
45148
|
+
{
|
|
45149
|
+
silentJSONParsing: validators.transitional(validators.boolean),
|
|
45150
|
+
forcedJSONParsing: validators.transitional(validators.boolean),
|
|
45151
|
+
clarifyTimeoutError: validators.transitional(validators.boolean),
|
|
45152
|
+
legacyInterceptorReqResOrdering: validators.transitional(validators.boolean),
|
|
45153
|
+
},
|
|
45154
|
+
false
|
|
45155
|
+
);
|
|
44700
45156
|
}
|
|
44701
45157
|
|
|
44702
45158
|
if (paramsSerializer != null) {
|
|
44703
45159
|
if (utils$1.isFunction(paramsSerializer)) {
|
|
44704
45160
|
config.paramsSerializer = {
|
|
44705
|
-
serialize: paramsSerializer
|
|
45161
|
+
serialize: paramsSerializer,
|
|
44706
45162
|
};
|
|
44707
45163
|
} else {
|
|
44708
|
-
validator.assertOptions(
|
|
44709
|
-
|
|
44710
|
-
|
|
44711
|
-
|
|
45164
|
+
validator.assertOptions(
|
|
45165
|
+
paramsSerializer,
|
|
45166
|
+
{
|
|
45167
|
+
encode: validators.function,
|
|
45168
|
+
serialize: validators.function,
|
|
45169
|
+
},
|
|
45170
|
+
true
|
|
45171
|
+
);
|
|
44712
45172
|
}
|
|
44713
45173
|
}
|
|
44714
45174
|
|
|
@@ -44719,28 +45179,27 @@ class Axios {
|
|
|
44719
45179
|
config.allowAbsoluteUrls = true;
|
|
44720
45180
|
}
|
|
44721
45181
|
|
|
44722
|
-
validator.assertOptions(
|
|
44723
|
-
|
|
44724
|
-
|
|
44725
|
-
|
|
45182
|
+
validator.assertOptions(
|
|
45183
|
+
config,
|
|
45184
|
+
{
|
|
45185
|
+
baseUrl: validators.spelling('baseURL'),
|
|
45186
|
+
withXsrfToken: validators.spelling('withXSRFToken'),
|
|
45187
|
+
},
|
|
45188
|
+
true
|
|
45189
|
+
);
|
|
44726
45190
|
|
|
44727
45191
|
// Set config.method
|
|
44728
45192
|
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
|
44729
45193
|
|
|
44730
45194
|
// Flatten headers
|
|
44731
|
-
let contextHeaders = headers && utils$1.merge(
|
|
44732
|
-
headers.common,
|
|
44733
|
-
headers[config.method]
|
|
44734
|
-
);
|
|
45195
|
+
let contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]);
|
|
44735
45196
|
|
|
44736
|
-
headers &&
|
|
44737
|
-
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
|
|
44738
|
-
(method) => {
|
|
45197
|
+
headers &&
|
|
45198
|
+
utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], (method) => {
|
|
44739
45199
|
delete headers[method];
|
|
44740
|
-
}
|
|
44741
|
-
);
|
|
45200
|
+
});
|
|
44742
45201
|
|
|
44743
|
-
config.headers = AxiosHeaders
|
|
45202
|
+
config.headers = AxiosHeaders.concat(contextHeaders, headers);
|
|
44744
45203
|
|
|
44745
45204
|
// filter out skipped interceptors
|
|
44746
45205
|
const requestInterceptorChain = [];
|
|
@@ -44752,7 +45211,15 @@ class Axios {
|
|
|
44752
45211
|
|
|
44753
45212
|
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
44754
45213
|
|
|
44755
|
-
|
|
45214
|
+
const transitional = config.transitional || transitionalDefaults;
|
|
45215
|
+
const legacyInterceptorReqResOrdering =
|
|
45216
|
+
transitional && transitional.legacyInterceptorReqResOrdering;
|
|
45217
|
+
|
|
45218
|
+
if (legacyInterceptorReqResOrdering) {
|
|
45219
|
+
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
45220
|
+
} else {
|
|
45221
|
+
requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
45222
|
+
}
|
|
44756
45223
|
});
|
|
44757
45224
|
|
|
44758
45225
|
const responseInterceptorChain = [];
|
|
@@ -44820,28 +45287,32 @@ class Axios {
|
|
|
44820
45287
|
// Provide aliases for supported request methods
|
|
44821
45288
|
utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
|
44822
45289
|
/*eslint func-names:0*/
|
|
44823
|
-
Axios.prototype[method] = function(url, config) {
|
|
44824
|
-
return this.request(
|
|
44825
|
-
|
|
44826
|
-
|
|
44827
|
-
|
|
44828
|
-
|
|
45290
|
+
Axios.prototype[method] = function (url, config) {
|
|
45291
|
+
return this.request(
|
|
45292
|
+
mergeConfig(config || {}, {
|
|
45293
|
+
method,
|
|
45294
|
+
url,
|
|
45295
|
+
data: (config || {}).data,
|
|
45296
|
+
})
|
|
45297
|
+
);
|
|
44829
45298
|
};
|
|
44830
45299
|
});
|
|
44831
45300
|
|
|
44832
45301
|
utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
44833
|
-
/*eslint func-names:0*/
|
|
44834
|
-
|
|
44835
45302
|
function generateHTTPMethod(isForm) {
|
|
44836
45303
|
return function httpMethod(url, data, config) {
|
|
44837
|
-
return this.request(
|
|
44838
|
-
|
|
44839
|
-
|
|
44840
|
-
|
|
44841
|
-
|
|
44842
|
-
|
|
44843
|
-
|
|
44844
|
-
|
|
45304
|
+
return this.request(
|
|
45305
|
+
mergeConfig(config || {}, {
|
|
45306
|
+
method,
|
|
45307
|
+
headers: isForm
|
|
45308
|
+
? {
|
|
45309
|
+
'Content-Type': 'multipart/form-data',
|
|
45310
|
+
}
|
|
45311
|
+
: {},
|
|
45312
|
+
url,
|
|
45313
|
+
data,
|
|
45314
|
+
})
|
|
45315
|
+
);
|
|
44845
45316
|
};
|
|
44846
45317
|
}
|
|
44847
45318
|
|
|
@@ -44850,8 +45321,6 @@ utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method)
|
|
|
44850
45321
|
Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
|
|
44851
45322
|
});
|
|
44852
45323
|
|
|
44853
|
-
var Axios$1 = Axios;
|
|
44854
|
-
|
|
44855
45324
|
/**
|
|
44856
45325
|
* A `CancelToken` is an object that can be used to request cancellation of an operation.
|
|
44857
45326
|
*
|
|
@@ -44874,7 +45343,7 @@ class CancelToken {
|
|
|
44874
45343
|
const token = this;
|
|
44875
45344
|
|
|
44876
45345
|
// eslint-disable-next-line func-names
|
|
44877
|
-
this.promise.then(cancel => {
|
|
45346
|
+
this.promise.then((cancel) => {
|
|
44878
45347
|
if (!token._listeners) return;
|
|
44879
45348
|
|
|
44880
45349
|
let i = token._listeners.length;
|
|
@@ -44886,10 +45355,10 @@ class CancelToken {
|
|
|
44886
45355
|
});
|
|
44887
45356
|
|
|
44888
45357
|
// eslint-disable-next-line func-names
|
|
44889
|
-
this.promise.then = onfulfilled => {
|
|
45358
|
+
this.promise.then = (onfulfilled) => {
|
|
44890
45359
|
let _resolve;
|
|
44891
45360
|
// eslint-disable-next-line func-names
|
|
44892
|
-
const promise = new Promise(resolve => {
|
|
45361
|
+
const promise = new Promise((resolve) => {
|
|
44893
45362
|
token.subscribe(resolve);
|
|
44894
45363
|
_resolve = resolve;
|
|
44895
45364
|
}).then(onfulfilled);
|
|
@@ -44907,7 +45376,7 @@ class CancelToken {
|
|
|
44907
45376
|
return;
|
|
44908
45377
|
}
|
|
44909
45378
|
|
|
44910
|
-
token.reason = new CanceledError
|
|
45379
|
+
token.reason = new CanceledError(message, config, request);
|
|
44911
45380
|
resolvePromise(token.reason);
|
|
44912
45381
|
});
|
|
44913
45382
|
}
|
|
@@ -44977,13 +45446,11 @@ class CancelToken {
|
|
|
44977
45446
|
});
|
|
44978
45447
|
return {
|
|
44979
45448
|
token,
|
|
44980
|
-
cancel
|
|
45449
|
+
cancel,
|
|
44981
45450
|
};
|
|
44982
45451
|
}
|
|
44983
45452
|
}
|
|
44984
45453
|
|
|
44985
|
-
var CancelToken$1 = CancelToken;
|
|
44986
|
-
|
|
44987
45454
|
/**
|
|
44988
45455
|
* Syntactic sugar for invoking a function and expanding an array for arguments.
|
|
44989
45456
|
*
|
|
@@ -45019,7 +45486,7 @@ function spread(callback) {
|
|
|
45019
45486
|
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
|
|
45020
45487
|
*/
|
|
45021
45488
|
function isAxiosError(payload) {
|
|
45022
|
-
return utils$1.isObject(payload) &&
|
|
45489
|
+
return utils$1.isObject(payload) && payload.isAxiosError === true;
|
|
45023
45490
|
}
|
|
45024
45491
|
|
|
45025
45492
|
const HttpStatusCode = {
|
|
@@ -45098,8 +45565,6 @@ Object.entries(HttpStatusCode).forEach(([key, value]) => {
|
|
|
45098
45565
|
HttpStatusCode[value] = key;
|
|
45099
45566
|
});
|
|
45100
45567
|
|
|
45101
|
-
var HttpStatusCode$1 = HttpStatusCode;
|
|
45102
|
-
|
|
45103
45568
|
/**
|
|
45104
45569
|
* Create an instance of Axios
|
|
45105
45570
|
*
|
|
@@ -45108,14 +45573,14 @@ var HttpStatusCode$1 = HttpStatusCode;
|
|
|
45108
45573
|
* @returns {Axios} A new instance of Axios
|
|
45109
45574
|
*/
|
|
45110
45575
|
function createInstance(defaultConfig) {
|
|
45111
|
-
const context = new Axios
|
|
45112
|
-
const instance = bind(Axios
|
|
45576
|
+
const context = new Axios(defaultConfig);
|
|
45577
|
+
const instance = bind(Axios.prototype.request, context);
|
|
45113
45578
|
|
|
45114
45579
|
// Copy axios.prototype to instance
|
|
45115
|
-
utils$1.extend(instance, Axios
|
|
45580
|
+
utils$1.extend(instance, Axios.prototype, context, { allOwnKeys: true });
|
|
45116
45581
|
|
|
45117
45582
|
// Copy context to instance
|
|
45118
|
-
utils$1.extend(instance, context, null, {allOwnKeys: true});
|
|
45583
|
+
utils$1.extend(instance, context, null, { allOwnKeys: true });
|
|
45119
45584
|
|
|
45120
45585
|
// Factory for creating new instances
|
|
45121
45586
|
instance.create = function create(instanceConfig) {
|
|
@@ -45126,20 +45591,20 @@ function createInstance(defaultConfig) {
|
|
|
45126
45591
|
}
|
|
45127
45592
|
|
|
45128
45593
|
// Create the default instance to be exported
|
|
45129
|
-
const axios = createInstance(defaults
|
|
45594
|
+
const axios = createInstance(defaults);
|
|
45130
45595
|
|
|
45131
45596
|
// Expose Axios class to allow class inheritance
|
|
45132
|
-
axios.Axios = Axios
|
|
45597
|
+
axios.Axios = Axios;
|
|
45133
45598
|
|
|
45134
45599
|
// Expose Cancel & CancelToken
|
|
45135
|
-
axios.CanceledError = CanceledError
|
|
45136
|
-
axios.CancelToken = CancelToken
|
|
45600
|
+
axios.CanceledError = CanceledError;
|
|
45601
|
+
axios.CancelToken = CancelToken;
|
|
45137
45602
|
axios.isCancel = isCancel;
|
|
45138
45603
|
axios.VERSION = VERSION;
|
|
45139
45604
|
axios.toFormData = toFormData;
|
|
45140
45605
|
|
|
45141
45606
|
// Expose AxiosError class
|
|
45142
|
-
axios.AxiosError = AxiosError
|
|
45607
|
+
axios.AxiosError = AxiosError;
|
|
45143
45608
|
|
|
45144
45609
|
// alias for CanceledError for backward compatibility
|
|
45145
45610
|
axios.Cancel = axios.CanceledError;
|
|
@@ -45157,13 +45622,13 @@ axios.isAxiosError = isAxiosError;
|
|
|
45157
45622
|
// Expose mergeConfig
|
|
45158
45623
|
axios.mergeConfig = mergeConfig;
|
|
45159
45624
|
|
|
45160
|
-
axios.AxiosHeaders = AxiosHeaders
|
|
45625
|
+
axios.AxiosHeaders = AxiosHeaders;
|
|
45161
45626
|
|
|
45162
|
-
axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
|
|
45627
|
+
axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
|
|
45163
45628
|
|
|
45164
45629
|
axios.getAdapter = adapters.getAdapter;
|
|
45165
45630
|
|
|
45166
|
-
axios.HttpStatusCode = HttpStatusCode
|
|
45631
|
+
axios.HttpStatusCode = HttpStatusCode;
|
|
45167
45632
|
|
|
45168
45633
|
axios.default = axios;
|
|
45169
45634
|
|