@shipengine/alchemy 2.2.3 → 2.3.0
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/components/alchemy-provider/alchemy-provider.d.ts +0 -15
- package/index.js +493 -287
- package/index.mjs +495 -288
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { createContext, forwardRef, useContext, createElement as createElement$1
|
|
|
3
3
|
import { jsx as jsx$1, jsxs as jsxs$1 } from 'react/jsx-runtime';
|
|
4
4
|
import { css, Global, ThemeProvider, CacheProvider } from '@emotion/react';
|
|
5
5
|
import { BrandName } from '@packlink/brands';
|
|
6
|
-
import {
|
|
6
|
+
import { createIconCache, getEmotionResetStyles, GigerConfigProvider, GigerTestProvider } from '@packlink/giger';
|
|
7
7
|
import { QueryClient, QueryClientProvider, useQuery, useMutation, useQueryClient } from 'react-query';
|
|
8
8
|
import { Theme } from '@packlink/giger-theme';
|
|
9
9
|
import { I18nextProvider } from 'react-i18next';
|
|
@@ -2455,17 +2455,17 @@ Object.defineProperty(dist, "__esModule", { value: true });
|
|
|
2455
2455
|
var _default = dist.default = (function () {
|
|
2456
2456
|
});
|
|
2457
2457
|
|
|
2458
|
-
var __getOwnPropSymbols$
|
|
2459
|
-
var __hasOwnProp$
|
|
2460
|
-
var __propIsEnum$
|
|
2458
|
+
var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
|
|
2459
|
+
var __hasOwnProp$c = Object.prototype.hasOwnProperty;
|
|
2460
|
+
var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
|
|
2461
2461
|
var __objRest$8 = (source, exclude) => {
|
|
2462
2462
|
var target = {};
|
|
2463
2463
|
for (var prop in source)
|
|
2464
|
-
if (__hasOwnProp$
|
|
2464
|
+
if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
2465
2465
|
target[prop] = source[prop];
|
|
2466
|
-
if (source != null && __getOwnPropSymbols$
|
|
2467
|
-
for (var prop of __getOwnPropSymbols$
|
|
2468
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
2466
|
+
if (source != null && __getOwnPropSymbols$c)
|
|
2467
|
+
for (var prop of __getOwnPropSymbols$c(source)) {
|
|
2468
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$c.call(source, prop))
|
|
2469
2469
|
target[prop] = source[prop];
|
|
2470
2470
|
}
|
|
2471
2471
|
return target;
|
|
@@ -2553,9 +2553,17 @@ const types = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
|
2553
2553
|
class AccountSettingsAPI {
|
|
2554
2554
|
constructor(client) {
|
|
2555
2555
|
this.client = client;
|
|
2556
|
+
/**
|
|
2557
|
+
* The `get` method retrieves the account settings for a given user.
|
|
2558
|
+
*/
|
|
2556
2559
|
this.get = () => {
|
|
2557
2560
|
return this.client.get("/v1/account/settings");
|
|
2558
2561
|
};
|
|
2562
|
+
/**
|
|
2563
|
+
* The `update` method updates specific account settings for a given user.
|
|
2564
|
+
*
|
|
2565
|
+
* @params Partial<AccountSettings> The account settings to update.
|
|
2566
|
+
*/
|
|
2559
2567
|
this.update = (settings) => {
|
|
2560
2568
|
return this.client.put("/v1/account/settings", settings);
|
|
2561
2569
|
};
|
|
@@ -2566,9 +2574,17 @@ class AccountSettingsAPI {
|
|
|
2566
2574
|
class AddressesAPI {
|
|
2567
2575
|
constructor(client) {
|
|
2568
2576
|
this.client = client;
|
|
2577
|
+
/**
|
|
2578
|
+
* The `validate` method validates a list of addresses.
|
|
2579
|
+
*
|
|
2580
|
+
* @params Address[] The addresses to be validated.
|
|
2581
|
+
*/
|
|
2569
2582
|
this.validate = (addresses) => {
|
|
2570
2583
|
return this.client.post("/v1/addresses/validate", addresses);
|
|
2571
2584
|
};
|
|
2585
|
+
/**
|
|
2586
|
+
* The `parse` method parses a string of text to extract addresses.
|
|
2587
|
+
*/
|
|
2572
2588
|
this.parse = (text, address) => {
|
|
2573
2589
|
return this.client.put("/v1/addresses/recognize", {
|
|
2574
2590
|
address,
|
|
@@ -5216,7 +5232,7 @@ var ipaddr = {
|
|
|
5216
5232
|
}).call(commonjsGlobal);
|
|
5217
5233
|
} (ipaddr));
|
|
5218
5234
|
|
|
5219
|
-
var __async$
|
|
5235
|
+
var __async$w = (__this, __arguments, generator) => {
|
|
5220
5236
|
return new Promise((resolve, reject) => {
|
|
5221
5237
|
var fulfilled = (value) => {
|
|
5222
5238
|
try {
|
|
@@ -5236,7 +5252,7 @@ var __async$x = (__this, __arguments, generator) => {
|
|
|
5236
5252
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
5237
5253
|
});
|
|
5238
5254
|
};
|
|
5239
|
-
const getEndUserIpAddress = () => __async$
|
|
5255
|
+
const getEndUserIpAddress = () => __async$w(void 0, null, function* () {
|
|
5240
5256
|
try {
|
|
5241
5257
|
const response = yield axios.get("https://api.ipify.org/?format=json");
|
|
5242
5258
|
if (response.data.ip && ipaddrExports.isValid(response.data.ip)) {
|
|
@@ -5248,38 +5264,38 @@ const getEndUserIpAddress = () => __async$x(void 0, null, function* () {
|
|
|
5248
5264
|
}
|
|
5249
5265
|
});
|
|
5250
5266
|
|
|
5251
|
-
var __defProp$
|
|
5252
|
-
var __defProps$
|
|
5253
|
-
var __getOwnPropDescs$
|
|
5254
|
-
var __getOwnPropSymbols$
|
|
5255
|
-
var __hasOwnProp$
|
|
5256
|
-
var __propIsEnum$
|
|
5257
|
-
var __defNormalProp$
|
|
5258
|
-
var __spreadValues$
|
|
5267
|
+
var __defProp$5 = Object.defineProperty;
|
|
5268
|
+
var __defProps$3 = Object.defineProperties;
|
|
5269
|
+
var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
|
|
5270
|
+
var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
|
|
5271
|
+
var __hasOwnProp$b = Object.prototype.hasOwnProperty;
|
|
5272
|
+
var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
|
|
5273
|
+
var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5274
|
+
var __spreadValues$5 = (a, b) => {
|
|
5259
5275
|
for (var prop in b || (b = {}))
|
|
5260
|
-
if (__hasOwnProp$
|
|
5261
|
-
__defNormalProp$
|
|
5262
|
-
if (__getOwnPropSymbols$
|
|
5263
|
-
for (var prop of __getOwnPropSymbols$
|
|
5264
|
-
if (__propIsEnum$
|
|
5265
|
-
__defNormalProp$
|
|
5276
|
+
if (__hasOwnProp$b.call(b, prop))
|
|
5277
|
+
__defNormalProp$5(a, prop, b[prop]);
|
|
5278
|
+
if (__getOwnPropSymbols$b)
|
|
5279
|
+
for (var prop of __getOwnPropSymbols$b(b)) {
|
|
5280
|
+
if (__propIsEnum$b.call(b, prop))
|
|
5281
|
+
__defNormalProp$5(a, prop, b[prop]);
|
|
5266
5282
|
}
|
|
5267
5283
|
return a;
|
|
5268
5284
|
};
|
|
5269
|
-
var __spreadProps$
|
|
5285
|
+
var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
|
|
5270
5286
|
var __objRest$7 = (source, exclude) => {
|
|
5271
5287
|
var target = {};
|
|
5272
5288
|
for (var prop in source)
|
|
5273
|
-
if (__hasOwnProp$
|
|
5289
|
+
if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
5274
5290
|
target[prop] = source[prop];
|
|
5275
|
-
if (source != null && __getOwnPropSymbols$
|
|
5276
|
-
for (var prop of __getOwnPropSymbols$
|
|
5277
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
5291
|
+
if (source != null && __getOwnPropSymbols$b)
|
|
5292
|
+
for (var prop of __getOwnPropSymbols$b(source)) {
|
|
5293
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
|
|
5278
5294
|
target[prop] = source[prop];
|
|
5279
5295
|
}
|
|
5280
5296
|
return target;
|
|
5281
5297
|
};
|
|
5282
|
-
var __async$
|
|
5298
|
+
var __async$v = (__this, __arguments, generator) => {
|
|
5283
5299
|
return new Promise((resolve, reject) => {
|
|
5284
5300
|
var fulfilled = (value) => {
|
|
5285
5301
|
try {
|
|
@@ -5302,35 +5318,68 @@ var __async$w = (__this, __arguments, generator) => {
|
|
|
5302
5318
|
class CarriersAPI {
|
|
5303
5319
|
constructor(client) {
|
|
5304
5320
|
this.client = client;
|
|
5321
|
+
/**
|
|
5322
|
+
* The `list` method retrieves a list of connected carriers for a given user.
|
|
5323
|
+
*/
|
|
5305
5324
|
this.list = () => {
|
|
5306
5325
|
return this.client.get("/v1/carriers");
|
|
5307
5326
|
};
|
|
5327
|
+
/**
|
|
5328
|
+
* The `get` method retrieves a specific carrier by `carrierId`.
|
|
5329
|
+
*/
|
|
5308
5330
|
this.get = (carrierId) => {
|
|
5309
5331
|
return this.client.get(`/v1/carriers/${carrierId}`);
|
|
5310
5332
|
};
|
|
5311
|
-
|
|
5333
|
+
/**
|
|
5334
|
+
* The `connect` method connects a carrier account to a user's ShipEngine account.
|
|
5335
|
+
*/
|
|
5336
|
+
this.connect = (_a) => __async$v(this, null, function* () {
|
|
5312
5337
|
var _b = _a, { carrierCode } = _b, connection = __objRest$7(_b, ["carrierCode"]);
|
|
5313
5338
|
const endUserIpAddress = yield getEndUserIpAddress();
|
|
5314
5339
|
if (!endUserIpAddress)
|
|
5315
5340
|
return Promise.reject([new CodedError("Unable to get IP address")]);
|
|
5316
|
-
return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$
|
|
5341
|
+
return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$3(__spreadValues$5({}, connection), {
|
|
5317
5342
|
endUserIpAddress
|
|
5318
5343
|
}));
|
|
5319
5344
|
});
|
|
5345
|
+
/**
|
|
5346
|
+
* The `addFunds` method allows a user to add funds to their carrier account balance.
|
|
5347
|
+
* Not all carrier providers allow you to maintain a balance.
|
|
5348
|
+
*
|
|
5349
|
+
* - For example, FedEx does
|
|
5350
|
+
* not require you to maintain a balance that will be used when purchasing labels.
|
|
5351
|
+
*/
|
|
5320
5352
|
this.addFunds = (carrierId, funds) => {
|
|
5321
5353
|
return this.client.put(`/v1/carriers/${carrierId}/add_funds`, funds);
|
|
5322
5354
|
};
|
|
5355
|
+
/**
|
|
5356
|
+
* The `updateAutoFunding` method allows a user to update the auto-funding settings
|
|
5357
|
+
* on their ShipEngine account.
|
|
5358
|
+
*
|
|
5359
|
+
* e.g. Enable auto-funding, set a balance threshold, and a maximum number of time
|
|
5360
|
+
* per day you wish to auto-fund your account.
|
|
5361
|
+
*/
|
|
5323
5362
|
this.updateAutoFunding = (carrierId, options) => {
|
|
5324
5363
|
return this.client.post(
|
|
5325
5364
|
`/v1/carriers/${carrierId}/auto_funding`,
|
|
5326
5365
|
options
|
|
5327
5366
|
);
|
|
5328
5367
|
};
|
|
5368
|
+
/**
|
|
5369
|
+
* The `getAutoFunding` method retrieves the current auto-funding settings.
|
|
5370
|
+
*
|
|
5371
|
+
* If no auto-funding rules have been set, the response will contain the default
|
|
5372
|
+
* values for auto-funding. Auto-funding is disabled by default.
|
|
5373
|
+
*/
|
|
5329
5374
|
this.getAutoFunding = (carrierId) => {
|
|
5330
5375
|
return this.client.get(
|
|
5331
5376
|
`/v1/carriers/${carrierId}/auto_funding`
|
|
5332
5377
|
);
|
|
5333
5378
|
};
|
|
5379
|
+
/**
|
|
5380
|
+
* The `getWalletHistory` method retrieves the wallet transaction history for
|
|
5381
|
+
* a ShipEngine wallet account.
|
|
5382
|
+
*/
|
|
5334
5383
|
this.getWalletHistory = (startDate, endDate, page) => {
|
|
5335
5384
|
return this.client.get(`/v1/carriers/wallet_history`, {
|
|
5336
5385
|
params: {
|
|
@@ -5340,17 +5389,33 @@ class CarriersAPI {
|
|
|
5340
5389
|
}
|
|
5341
5390
|
});
|
|
5342
5391
|
};
|
|
5392
|
+
/**
|
|
5393
|
+
* The `getServices` method retrieves a list of shipping services that a given carrier offers.
|
|
5394
|
+
*/
|
|
5343
5395
|
this.getServices = (carrierId) => {
|
|
5344
5396
|
return this.client.get(`/v1/carriers/${carrierId}/services`);
|
|
5345
5397
|
};
|
|
5398
|
+
/**
|
|
5399
|
+
* The `getPackageRatingGroup` method retrieves a list of package rating groups.
|
|
5400
|
+
* This is primarily used for carriers that support negotiated rates, and a user
|
|
5401
|
+
* has a rate card with multiple package rating groups.
|
|
5402
|
+
*/
|
|
5346
5403
|
this.getPackageRatingGroup = (carrierId) => {
|
|
5347
5404
|
return this.client.get(
|
|
5348
5405
|
`/v1/carriers/${carrierId}/package_rating_group`
|
|
5349
5406
|
);
|
|
5350
5407
|
};
|
|
5408
|
+
/**
|
|
5409
|
+
* The `getCountries` method retrieves a list of countries that a given carrier
|
|
5410
|
+
* supports shipping to.
|
|
5411
|
+
*/
|
|
5351
5412
|
this.getCountries = (carrierId) => {
|
|
5352
5413
|
return this.client.get(`/v1/carriers/${carrierId}/countries`);
|
|
5353
5414
|
};
|
|
5415
|
+
/**
|
|
5416
|
+
* The `getCurrencies` method retrieves a list of currencies that a given carrier
|
|
5417
|
+
* supports the usage of.
|
|
5418
|
+
*/
|
|
5354
5419
|
this.getCurrencies = (carrierId) => {
|
|
5355
5420
|
return this.client.get(`/v1/carriers/${carrierId}/currencies`);
|
|
5356
5421
|
};
|
|
@@ -7538,6 +7603,9 @@ var lib = {
|
|
|
7538
7603
|
class CustomPackagesAPI {
|
|
7539
7604
|
constructor(client) {
|
|
7540
7605
|
this.client = client;
|
|
7606
|
+
/**
|
|
7607
|
+
* The `list` method retrieves a list of custom packages a given user has created.
|
|
7608
|
+
*/
|
|
7541
7609
|
this.list = () => {
|
|
7542
7610
|
return this.client.get("/v1/packages");
|
|
7543
7611
|
};
|
|
@@ -7545,23 +7613,23 @@ class CustomPackagesAPI {
|
|
|
7545
7613
|
}
|
|
7546
7614
|
}
|
|
7547
7615
|
|
|
7548
|
-
var __defProp$
|
|
7549
|
-
var __getOwnPropSymbols$
|
|
7550
|
-
var __hasOwnProp$
|
|
7551
|
-
var __propIsEnum$
|
|
7552
|
-
var __defNormalProp$
|
|
7553
|
-
var __spreadValues$
|
|
7616
|
+
var __defProp$4 = Object.defineProperty;
|
|
7617
|
+
var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
|
|
7618
|
+
var __hasOwnProp$a = Object.prototype.hasOwnProperty;
|
|
7619
|
+
var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
|
|
7620
|
+
var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7621
|
+
var __spreadValues$4 = (a, b) => {
|
|
7554
7622
|
for (var prop in b || (b = {}))
|
|
7555
|
-
if (__hasOwnProp$
|
|
7556
|
-
__defNormalProp$
|
|
7557
|
-
if (__getOwnPropSymbols$
|
|
7558
|
-
for (var prop of __getOwnPropSymbols$
|
|
7559
|
-
if (__propIsEnum$
|
|
7560
|
-
__defNormalProp$
|
|
7623
|
+
if (__hasOwnProp$a.call(b, prop))
|
|
7624
|
+
__defNormalProp$4(a, prop, b[prop]);
|
|
7625
|
+
if (__getOwnPropSymbols$a)
|
|
7626
|
+
for (var prop of __getOwnPropSymbols$a(b)) {
|
|
7627
|
+
if (__propIsEnum$a.call(b, prop))
|
|
7628
|
+
__defNormalProp$4(a, prop, b[prop]);
|
|
7561
7629
|
}
|
|
7562
7630
|
return a;
|
|
7563
7631
|
};
|
|
7564
|
-
var __async$
|
|
7632
|
+
var __async$u = (__this, __arguments, generator) => {
|
|
7565
7633
|
return new Promise((resolve, reject) => {
|
|
7566
7634
|
var fulfilled = (value) => {
|
|
7567
7635
|
try {
|
|
@@ -7584,21 +7652,36 @@ var __async$v = (__this, __arguments, generator) => {
|
|
|
7584
7652
|
class FundingSourcesAPI {
|
|
7585
7653
|
constructor(client) {
|
|
7586
7654
|
this.client = client;
|
|
7655
|
+
/**
|
|
7656
|
+
* The `list` method retrieves a list of funding sources for a given user.
|
|
7657
|
+
*/
|
|
7587
7658
|
this.list = () => {
|
|
7588
7659
|
return this.client.get("/v1/funding_sources");
|
|
7589
7660
|
};
|
|
7661
|
+
/**
|
|
7662
|
+
* The `get` method retrieves a specific funding source by `fundingSourceId`.
|
|
7663
|
+
*/
|
|
7590
7664
|
this.get = (fundingSourceId) => {
|
|
7591
7665
|
return this.client.get(`/v1/funding_sources/${fundingSourceId}`);
|
|
7592
7666
|
};
|
|
7593
|
-
|
|
7667
|
+
/**
|
|
7668
|
+
* The `create` method creates a new funding source for a given user. This requires
|
|
7669
|
+
* payment information to be collected from the user.
|
|
7670
|
+
*/
|
|
7671
|
+
this.create = (createFundingSource) => __async$u(this, null, function* () {
|
|
7594
7672
|
const endUserIpAddress = yield getEndUserIpAddress();
|
|
7595
7673
|
if (!endUserIpAddress)
|
|
7596
7674
|
return Promise.reject([new CodedError("Unable to get IP address")]);
|
|
7597
|
-
return yield this.client.post("/v1/funding_sources", __spreadValues$
|
|
7675
|
+
return yield this.client.post("/v1/funding_sources", __spreadValues$4({
|
|
7598
7676
|
endUserIpAddress
|
|
7599
7677
|
}, createFundingSource));
|
|
7600
7678
|
});
|
|
7601
|
-
|
|
7679
|
+
/**
|
|
7680
|
+
* The `update` method updates a funding source for a given user. This allows the
|
|
7681
|
+
* user to update the billing address or payment information associated with the
|
|
7682
|
+
* funding source.
|
|
7683
|
+
*/
|
|
7684
|
+
this.update = (billingInfo, creditCardInfo, fundingSourceId) => __async$u(this, null, function* () {
|
|
7602
7685
|
const endUserIpAddress = yield getEndUserIpAddress();
|
|
7603
7686
|
if (!endUserIpAddress)
|
|
7604
7687
|
return Promise.reject([new CodedError("Unable to get IP address")]);
|
|
@@ -7611,15 +7694,22 @@ class FundingSourcesAPI {
|
|
|
7611
7694
|
}
|
|
7612
7695
|
);
|
|
7613
7696
|
});
|
|
7614
|
-
|
|
7697
|
+
/**
|
|
7698
|
+
* The `registerCarrier` method registers a carrier account and associates
|
|
7699
|
+
* it with a given funding source.
|
|
7700
|
+
*/
|
|
7701
|
+
this.registerCarrier = (carrier) => __async$u(this, null, function* () {
|
|
7615
7702
|
const endUserIpAddress = yield getEndUserIpAddress();
|
|
7616
7703
|
if (!endUserIpAddress)
|
|
7617
7704
|
return Promise.reject([new CodedError("Unable to get IP address")]);
|
|
7618
|
-
return yield this.client.post("/v1/registration/funding_source", __spreadValues$
|
|
7705
|
+
return yield this.client.post("/v1/registration/funding_source", __spreadValues$4({
|
|
7619
7706
|
endUserIpAddress
|
|
7620
7707
|
}, carrier));
|
|
7621
7708
|
});
|
|
7622
|
-
|
|
7709
|
+
/**
|
|
7710
|
+
* The `addFunds` method allows you to add funds to a funding source.
|
|
7711
|
+
*/
|
|
7712
|
+
this.addFunds = (amount, fundingSourceId) => __async$u(this, null, function* () {
|
|
7623
7713
|
return yield this.client.put(
|
|
7624
7714
|
`/v1/funding_sources/${fundingSourceId}/add_funds`,
|
|
7625
7715
|
amount
|
|
@@ -7632,6 +7722,10 @@ class FundingSourcesAPI {
|
|
|
7632
7722
|
class InsuranceAPI {
|
|
7633
7723
|
constructor(client) {
|
|
7634
7724
|
this.client = client;
|
|
7725
|
+
/**
|
|
7726
|
+
* The `get` method retrieves the insurance balance for a given `insuranceProvider`
|
|
7727
|
+
* by ID.
|
|
7728
|
+
*/
|
|
7635
7729
|
this.get = (insuranceProvider) => {
|
|
7636
7730
|
return this.client.get(`/v1/insurance/${insuranceProvider}/balance`);
|
|
7637
7731
|
};
|
|
@@ -7642,15 +7736,31 @@ class InsuranceAPI {
|
|
|
7642
7736
|
class LabelsAPI {
|
|
7643
7737
|
constructor(client) {
|
|
7644
7738
|
this.client = client;
|
|
7739
|
+
/**
|
|
7740
|
+
* The `get` method retrieves a specific label by `labelId`.
|
|
7741
|
+
*/
|
|
7645
7742
|
this.get = (labelId) => {
|
|
7646
7743
|
return this.client.get(`/v1/labels/${labelId}`);
|
|
7647
7744
|
};
|
|
7745
|
+
/**
|
|
7746
|
+
* The `list` method retrieves a list of labels created by a given user.
|
|
7747
|
+
*/
|
|
7648
7748
|
this.list = (params = {}) => {
|
|
7649
7749
|
return this.client.get("/v1/labels", { params });
|
|
7650
7750
|
};
|
|
7751
|
+
/**
|
|
7752
|
+
* The `createByRateId` allows you to create a shipping label by using a `rateId`
|
|
7753
|
+
* which is a unique identifier tied to a specific rate.
|
|
7754
|
+
*
|
|
7755
|
+
* This helps ensure that when a user is rate shopping, they can purchase a
|
|
7756
|
+
* label for the price they were initially rated.
|
|
7757
|
+
*/
|
|
7651
7758
|
this.createByRateId = (rateId, options) => {
|
|
7652
7759
|
return this.client.post(`/v1/labels/rates/${rateId}`, options);
|
|
7653
7760
|
};
|
|
7761
|
+
/**
|
|
7762
|
+
* The `void` method allows a user to void a label by `labelId`.
|
|
7763
|
+
*/
|
|
7654
7764
|
this.void = (labelId) => {
|
|
7655
7765
|
return this.client.put(`/v1/labels/${labelId}/void`);
|
|
7656
7766
|
};
|
|
@@ -7661,12 +7771,22 @@ class LabelsAPI {
|
|
|
7661
7771
|
class OrderSourcesAPI {
|
|
7662
7772
|
constructor(client) {
|
|
7663
7773
|
this.client = client;
|
|
7774
|
+
/**
|
|
7775
|
+
* The `list` method retrieves a list of connected order sources for a given user.
|
|
7776
|
+
*/
|
|
7664
7777
|
this.list = () => {
|
|
7665
7778
|
return this.client.get("/v-beta/order_sources");
|
|
7666
7779
|
};
|
|
7780
|
+
/**
|
|
7781
|
+
* The `get` method retrieves a specific order source by `orderSourceId`.
|
|
7782
|
+
*/
|
|
7667
7783
|
this.get = (orderSourceId) => {
|
|
7668
7784
|
return this.client.get(`/v-beta/order_sources/${orderSourceId}`);
|
|
7669
7785
|
};
|
|
7786
|
+
/**
|
|
7787
|
+
* The `refresh` method refreshes a specific order source by `orderSourceId`.
|
|
7788
|
+
* This will pull in any `new orders` since the last order import.
|
|
7789
|
+
*/
|
|
7670
7790
|
this.refresh = (orderSourceId) => {
|
|
7671
7791
|
return this.client.put(`/v-beta/order_sources/${orderSourceId}/refresh`);
|
|
7672
7792
|
};
|
|
@@ -7677,20 +7797,36 @@ class OrderSourcesAPI {
|
|
|
7677
7797
|
class RateCardsAPI {
|
|
7678
7798
|
constructor(client) {
|
|
7679
7799
|
this.client = client;
|
|
7800
|
+
/**
|
|
7801
|
+
* The `list` method retrieves a list of rate cards for a given list of carrier ID's.
|
|
7802
|
+
*/
|
|
7680
7803
|
this.list = (carrierIds) => {
|
|
7681
7804
|
return this.client.get(
|
|
7682
7805
|
`/v1/rate_cards?carrier_ids=${carrierIds.toString()}`
|
|
7683
7806
|
);
|
|
7684
7807
|
};
|
|
7808
|
+
/**
|
|
7809
|
+
* The `get` method retrieves a specific rate card by `rateCardId`.
|
|
7810
|
+
*/
|
|
7685
7811
|
this.get = (rateCardId) => {
|
|
7686
7812
|
return this.client.get(`/v1/rate_cards/${rateCardId}`);
|
|
7687
7813
|
};
|
|
7814
|
+
/**
|
|
7815
|
+
* The `create` method creates a new rate card for a given user.
|
|
7816
|
+
*/
|
|
7688
7817
|
this.create = (rateCardInput) => {
|
|
7689
7818
|
return this.client.post("/v1/rate_cards", rateCardInput);
|
|
7690
7819
|
};
|
|
7820
|
+
/**
|
|
7821
|
+
* The `update` method updates a specific rate card by `rateCardId` with a new
|
|
7822
|
+
* `RateCard`.
|
|
7823
|
+
*/
|
|
7691
7824
|
this.update = (rateCard) => {
|
|
7692
7825
|
return this.client.put(`/v1/rate_cards/${rateCard.id}`, rateCard);
|
|
7693
7826
|
};
|
|
7827
|
+
/**
|
|
7828
|
+
* The `download` method allows for downloading a given rate card by `rateCardId`.
|
|
7829
|
+
*/
|
|
7694
7830
|
this.download = (rateCardId) => {
|
|
7695
7831
|
return this.client.get(`/v1/rate_cards/${rateCardId}/rates/download`, {
|
|
7696
7832
|
headers: {
|
|
@@ -7699,6 +7835,9 @@ class RateCardsAPI {
|
|
|
7699
7835
|
responseType: "blob"
|
|
7700
7836
|
});
|
|
7701
7837
|
};
|
|
7838
|
+
/**
|
|
7839
|
+
* The `upload` method allows for uploading a given rate card as a spreadsheet file.
|
|
7840
|
+
*/
|
|
7702
7841
|
this.upload = (rateCardId, file) => {
|
|
7703
7842
|
const formData = new FormData();
|
|
7704
7843
|
formData.append("file", file);
|
|
@@ -7708,6 +7847,9 @@ class RateCardsAPI {
|
|
|
7708
7847
|
}
|
|
7709
7848
|
});
|
|
7710
7849
|
};
|
|
7850
|
+
/**
|
|
7851
|
+
* The `publish` method allows for publishing a given rate card by `rateCardId`.
|
|
7852
|
+
*/
|
|
7711
7853
|
this.publish = (rateCardId) => {
|
|
7712
7854
|
return this.client.post(`/v1/rate_cards/${rateCardId}/publish`);
|
|
7713
7855
|
};
|
|
@@ -7724,6 +7866,10 @@ class RateCardsAPI {
|
|
|
7724
7866
|
class RatesAPI {
|
|
7725
7867
|
constructor(client) {
|
|
7726
7868
|
this.client = client;
|
|
7869
|
+
/**
|
|
7870
|
+
* The `calculate` method calculates rates for a shipment by shipment ID based
|
|
7871
|
+
* on the shipment's options.
|
|
7872
|
+
*/
|
|
7727
7873
|
this.calculateByShipmentId = (shipmentId, options) => {
|
|
7728
7874
|
return this.client.post("/v1/rates", {
|
|
7729
7875
|
rateOptions: options,
|
|
@@ -7737,20 +7883,32 @@ class RatesAPI {
|
|
|
7737
7883
|
class SalesOrderShipmentsAPI {
|
|
7738
7884
|
constructor(client) {
|
|
7739
7885
|
this.client = client;
|
|
7886
|
+
/**
|
|
7887
|
+
* The `list` method retrieves a list of sales order shipments for a given user.
|
|
7888
|
+
*/
|
|
7740
7889
|
this.list = (body = {}, params) => {
|
|
7741
7890
|
return this.client.post("/v-beta/shipments/list", body, {
|
|
7742
7891
|
params
|
|
7743
7892
|
});
|
|
7744
7893
|
};
|
|
7894
|
+
/**
|
|
7895
|
+
* The `get` method retrieves a specific sales order shipment by `shipmentId`.
|
|
7896
|
+
*/
|
|
7745
7897
|
this.get = (shipmentId) => {
|
|
7746
7898
|
return this.client.get(`/v-beta/shipments/${shipmentId}`);
|
|
7747
7899
|
};
|
|
7900
|
+
/**
|
|
7901
|
+
* The `create` method creates a new shipment for a sales order.
|
|
7902
|
+
*/
|
|
7748
7903
|
this.create = (salesOrderId, shipment) => {
|
|
7749
7904
|
return this.client.post(
|
|
7750
7905
|
`/v-beta/shipments/sales_order/${salesOrderId}`,
|
|
7751
7906
|
shipment
|
|
7752
7907
|
);
|
|
7753
7908
|
};
|
|
7909
|
+
/**
|
|
7910
|
+
* The `update` method updates a specific sales order shipment by `shipmentId`.
|
|
7911
|
+
*/
|
|
7754
7912
|
this.update = (shipmentId, shipment) => {
|
|
7755
7913
|
return this.client.put(`/v-beta/shipments/${shipmentId}`, shipment);
|
|
7756
7914
|
};
|
|
@@ -7761,12 +7919,23 @@ class SalesOrderShipmentsAPI {
|
|
|
7761
7919
|
class SalesOrdersAPI {
|
|
7762
7920
|
constructor(client) {
|
|
7763
7921
|
this.client = client;
|
|
7922
|
+
/**
|
|
7923
|
+
* The `list` method retrieves a list of sales orders.
|
|
7924
|
+
*/
|
|
7764
7925
|
this.list = (params = {}) => {
|
|
7765
7926
|
return this.client.get("/v-beta/sales_orders", { params });
|
|
7766
7927
|
};
|
|
7928
|
+
/**
|
|
7929
|
+
* The `get` method retrieves a specific sales order by `salesOrderId`.
|
|
7930
|
+
*/
|
|
7767
7931
|
this.get = (salesOrderId) => {
|
|
7768
7932
|
return this.client.get(`/v-beta/sales_orders/${salesOrderId}`);
|
|
7769
7933
|
};
|
|
7934
|
+
/**
|
|
7935
|
+
* The `notifyShipped` method notifies order source that the order has been
|
|
7936
|
+
* shipped. Typically, the order source will then notify the user based on
|
|
7937
|
+
* this update from ShipEngine API.
|
|
7938
|
+
*/
|
|
7770
7939
|
this.notifyShipped = (salesOrderId, tracking) => {
|
|
7771
7940
|
return this.client.post(`/v-beta/sales_orders/${salesOrderId}/notify`, tracking);
|
|
7772
7941
|
};
|
|
@@ -7774,7 +7943,7 @@ class SalesOrdersAPI {
|
|
|
7774
7943
|
}
|
|
7775
7944
|
}
|
|
7776
7945
|
|
|
7777
|
-
var __async$
|
|
7946
|
+
var __async$t = (__this, __arguments, generator) => {
|
|
7778
7947
|
return new Promise((resolve, reject) => {
|
|
7779
7948
|
var fulfilled = (value) => {
|
|
7780
7949
|
try {
|
|
@@ -7797,16 +7966,27 @@ var __async$u = (__this, __arguments, generator) => {
|
|
|
7797
7966
|
class ShipmentsAPI {
|
|
7798
7967
|
constructor(client) {
|
|
7799
7968
|
this.client = client;
|
|
7969
|
+
/**
|
|
7970
|
+
* The `getShipmentRates` method retrieves rates for a given shipment by
|
|
7971
|
+
* shipment ID.
|
|
7972
|
+
*/
|
|
7800
7973
|
this.getShipmentRates = ({ shipmentId, createdAtStart }) => {
|
|
7801
7974
|
return this.client.get(
|
|
7802
7975
|
`/v1/shipments/${shipmentId}/rates`,
|
|
7803
7976
|
createdAtStart !== void 0 ? { params: { createdAtStart } } : void 0
|
|
7804
7977
|
);
|
|
7805
7978
|
};
|
|
7979
|
+
/**
|
|
7980
|
+
* The `list` method retrieves a list of shipments for a given user.
|
|
7981
|
+
*/
|
|
7806
7982
|
this.list = (options) => {
|
|
7807
7983
|
return this.client.get("/v1/shipments", { params: options });
|
|
7808
7984
|
};
|
|
7809
|
-
|
|
7985
|
+
/**
|
|
7986
|
+
* The `create` method allows for creating shipments based on a list of shipment
|
|
7987
|
+
* items passed into this method.
|
|
7988
|
+
*/
|
|
7989
|
+
this.create = (...shipments) => __async$t(this, null, function* () {
|
|
7810
7990
|
return this.client.post("/v1/shipments", {
|
|
7811
7991
|
shipments
|
|
7812
7992
|
});
|
|
@@ -7818,15 +7998,31 @@ class ShipmentsAPI {
|
|
|
7818
7998
|
class WarehousesAPI {
|
|
7819
7999
|
constructor(client) {
|
|
7820
8000
|
this.client = client;
|
|
8001
|
+
/**
|
|
8002
|
+
* The `list` method retrieves a list of `warehouses` (Ship From Locations)
|
|
8003
|
+
* for a given user.
|
|
8004
|
+
*/
|
|
7821
8005
|
this.list = () => {
|
|
7822
8006
|
return this.client.get("/v1/warehouses");
|
|
7823
8007
|
};
|
|
8008
|
+
/**
|
|
8009
|
+
* The `create` method allows for creation of warehouses (Ship From Locations)
|
|
8010
|
+
* on a users ShipEngine account.
|
|
8011
|
+
*/
|
|
7824
8012
|
this.create = (warehouse) => {
|
|
7825
8013
|
return this.client.post("/v1/warehouses", warehouse);
|
|
7826
8014
|
};
|
|
8015
|
+
/**
|
|
8016
|
+
* The `update` method updates a specific warehouse (Ship From Location) for a
|
|
8017
|
+
* given user by `warehouseId`.
|
|
8018
|
+
*/
|
|
7827
8019
|
this.update = (warehouseId, warehouse) => {
|
|
7828
8020
|
return this.client.put(`/v1/warehouses/${warehouseId}`, warehouse);
|
|
7829
8021
|
};
|
|
8022
|
+
/**
|
|
8023
|
+
* The `delete` method deletes a specific warehouse (Ship From Location) by
|
|
8024
|
+
* `warehouseId` from a users ShipEngine account.
|
|
8025
|
+
*/
|
|
7830
8026
|
this.delete = (warehouseId) => {
|
|
7831
8027
|
return this.client.delete(`/v1/warehouses/${warehouseId}`);
|
|
7832
8028
|
};
|
|
@@ -7834,26 +8030,26 @@ class WarehousesAPI {
|
|
|
7834
8030
|
}
|
|
7835
8031
|
}
|
|
7836
8032
|
|
|
7837
|
-
var __defProp$
|
|
7838
|
-
var __defProps$
|
|
7839
|
-
var __getOwnPropDescs$
|
|
7840
|
-
var __getOwnPropSymbols$
|
|
7841
|
-
var __hasOwnProp$
|
|
7842
|
-
var __propIsEnum$
|
|
7843
|
-
var __defNormalProp$
|
|
7844
|
-
var __spreadValues$
|
|
8033
|
+
var __defProp$3 = Object.defineProperty;
|
|
8034
|
+
var __defProps$2 = Object.defineProperties;
|
|
8035
|
+
var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
|
|
8036
|
+
var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
|
|
8037
|
+
var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
|
|
8038
|
+
var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
|
|
8039
|
+
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8040
|
+
var __spreadValues$3 = (a, b) => {
|
|
7845
8041
|
for (var prop in b || (b = {}))
|
|
7846
|
-
if (__hasOwnProp$
|
|
7847
|
-
__defNormalProp$
|
|
7848
|
-
if (__getOwnPropSymbols$
|
|
7849
|
-
for (var prop of __getOwnPropSymbols$
|
|
7850
|
-
if (__propIsEnum$
|
|
7851
|
-
__defNormalProp$
|
|
8042
|
+
if (__hasOwnProp$9.call(b, prop))
|
|
8043
|
+
__defNormalProp$3(a, prop, b[prop]);
|
|
8044
|
+
if (__getOwnPropSymbols$9)
|
|
8045
|
+
for (var prop of __getOwnPropSymbols$9(b)) {
|
|
8046
|
+
if (__propIsEnum$9.call(b, prop))
|
|
8047
|
+
__defNormalProp$3(a, prop, b[prop]);
|
|
7852
8048
|
}
|
|
7853
8049
|
return a;
|
|
7854
8050
|
};
|
|
7855
|
-
var __spreadProps$
|
|
7856
|
-
var __async$
|
|
8051
|
+
var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
|
|
8052
|
+
var __async$s = (__this, __arguments, generator) => {
|
|
7857
8053
|
return new Promise((resolve, reject) => {
|
|
7858
8054
|
var fulfilled = (value) => {
|
|
7859
8055
|
try {
|
|
@@ -7875,7 +8071,7 @@ var __async$t = (__this, __arguments, generator) => {
|
|
|
7875
8071
|
};
|
|
7876
8072
|
const logger$1 = E({
|
|
7877
8073
|
name: "shipengine-api",
|
|
7878
|
-
serializers: __spreadProps$
|
|
8074
|
+
serializers: __spreadProps$2(__spreadValues$3({}, k), {
|
|
7879
8075
|
req: (req) => ({
|
|
7880
8076
|
headers: req.headers,
|
|
7881
8077
|
method: req.method,
|
|
@@ -7900,7 +8096,7 @@ class ShipEngineAPI {
|
|
|
7900
8096
|
constructor(token, { baseURL, headers, getToken }) {
|
|
7901
8097
|
const client = axios.create({
|
|
7902
8098
|
baseURL,
|
|
7903
|
-
headers: __spreadProps$
|
|
8099
|
+
headers: __spreadProps$2(__spreadValues$3({}, headers), {
|
|
7904
8100
|
Authorization: `Bearer ${token}`,
|
|
7905
8101
|
"Content-Type": "application/json"
|
|
7906
8102
|
}),
|
|
@@ -7947,7 +8143,7 @@ class ShipEngineAPI {
|
|
|
7947
8143
|
);
|
|
7948
8144
|
return res;
|
|
7949
8145
|
},
|
|
7950
|
-
(err) => __async$
|
|
8146
|
+
(err) => __async$s(this, null, function* () {
|
|
7951
8147
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
7952
8148
|
logger$1.error(
|
|
7953
8149
|
{ err, req: err.config, res: err.response },
|
|
@@ -7987,48 +8183,135 @@ class ShipEngineAPI {
|
|
|
7987
8183
|
);
|
|
7988
8184
|
this.client = client;
|
|
7989
8185
|
}
|
|
8186
|
+
/**
|
|
8187
|
+
* The `token` method takes in a string and sets it as the Authorization header for all requests.
|
|
8188
|
+
*/
|
|
7990
8189
|
set token(token) {
|
|
7991
8190
|
this.client.defaults.headers.common["Authorization"] = `Bearer ${token}`;
|
|
7992
8191
|
}
|
|
8192
|
+
/**
|
|
8193
|
+
* The `accountSettings` method provides access to the Account Settings endpoints
|
|
8194
|
+
* in ShipEngine API.
|
|
8195
|
+
*
|
|
8196
|
+
* @see {@link AccountSettingsAPI | The Account Settings API module}
|
|
8197
|
+
*/
|
|
7993
8198
|
get accountSettings() {
|
|
7994
8199
|
return new AccountSettingsAPI(this.client);
|
|
7995
8200
|
}
|
|
8201
|
+
/**
|
|
8202
|
+
* The `addresses` method provides access to the Address Validation endpoints
|
|
8203
|
+
* in ShipEngine API. e.g. Validate Addresses, Parse Addresses, etc.
|
|
8204
|
+
*
|
|
8205
|
+
* @see {@link AddressesAPI | The Addresses API module}
|
|
8206
|
+
*/
|
|
7996
8207
|
get addresses() {
|
|
7997
8208
|
return new AddressesAPI(this.client);
|
|
7998
8209
|
}
|
|
8210
|
+
/**
|
|
8211
|
+
* The `carriers` method provides access to the Carrier endpoints in ShipEngine
|
|
8212
|
+
* API. e.g. List Carriers, Get Carrier, Connect Carrier, etc.
|
|
8213
|
+
*
|
|
8214
|
+
* @see {@link CarriersAPI | The Carriers API module}
|
|
8215
|
+
*/
|
|
7999
8216
|
get carriers() {
|
|
8000
8217
|
return new CarriersAPI(this.client);
|
|
8001
8218
|
}
|
|
8219
|
+
/**
|
|
8220
|
+
* The `customPackages` method provides access to the Packages endpoint in ShipEngine
|
|
8221
|
+
* API. e.g. List Packages
|
|
8222
|
+
*
|
|
8223
|
+
* @see {@link CustomPackagesAPI | The Custom Packages API module}
|
|
8224
|
+
*/
|
|
8002
8225
|
get customPackages() {
|
|
8003
8226
|
return new CustomPackagesAPI(this.client);
|
|
8004
8227
|
}
|
|
8228
|
+
/**
|
|
8229
|
+
* The `fundingSources` method provides access to the Funding Sources endpoints
|
|
8230
|
+
* in ShipEngine API.
|
|
8231
|
+
*
|
|
8232
|
+
* @see {@link FundingSourcesAPI | The Funding Sources API module}
|
|
8233
|
+
*/
|
|
8005
8234
|
get fundingSources() {
|
|
8006
8235
|
return new FundingSourcesAPI(this.client);
|
|
8007
8236
|
}
|
|
8237
|
+
/**
|
|
8238
|
+
* The `insurance` method provides access to the Insurance endpoint in ShipEngine
|
|
8239
|
+
* API. e.g. Get Insurance Balance
|
|
8240
|
+
*
|
|
8241
|
+
* @see {@link InsuranceAPI | The Insurance API module}
|
|
8242
|
+
*/
|
|
8008
8243
|
get insurance() {
|
|
8009
8244
|
return new InsuranceAPI(this.client);
|
|
8010
8245
|
}
|
|
8246
|
+
/**
|
|
8247
|
+
* The `labels` method provides access to the Label endpoints in ShipEngine API.
|
|
8248
|
+
* e.g. Create Label, Get Label, Void Label, etc.
|
|
8249
|
+
*
|
|
8250
|
+
* @see {@link LabelsAPI | The Labels API module}
|
|
8251
|
+
*/
|
|
8011
8252
|
get labels() {
|
|
8012
8253
|
return new LabelsAPI(this.client);
|
|
8013
8254
|
}
|
|
8255
|
+
/**
|
|
8256
|
+
* The `orderSources` method provides access to the Order Sources endpoints in
|
|
8257
|
+
* ShipEngine API. e.g. List Order Sources, Get Order Source, Refresh Order Source, etc.
|
|
8258
|
+
*
|
|
8259
|
+
* @see {@link OrderSourcesAPI | The Order Sources API module}
|
|
8260
|
+
*/
|
|
8014
8261
|
get orderSources() {
|
|
8015
8262
|
return new OrderSourcesAPI(this.client);
|
|
8016
8263
|
}
|
|
8264
|
+
/**
|
|
8265
|
+
* The `rateCards` method provides access to the Rate Cards endpoints in ShipEngine
|
|
8266
|
+
* API.
|
|
8267
|
+
*
|
|
8268
|
+
* @see {@link RateCardsAPI | The Rate Cards API module}
|
|
8269
|
+
*/
|
|
8017
8270
|
get rateCards() {
|
|
8018
8271
|
return new RateCardsAPI(this.client);
|
|
8019
8272
|
}
|
|
8273
|
+
/**
|
|
8274
|
+
* The `rates` method provides access to the Rate endpoints in ShipEngine API.
|
|
8275
|
+
* e.g. Get Rates
|
|
8276
|
+
*
|
|
8277
|
+
* @see {@link RatesAPI | The Rates API module}
|
|
8278
|
+
*/
|
|
8020
8279
|
get rates() {
|
|
8021
8280
|
return new RatesAPI(this.client);
|
|
8022
8281
|
}
|
|
8282
|
+
/**
|
|
8283
|
+
* The `salesOrderShipments` method provides access to the `v-beta` Sales
|
|
8284
|
+
* Order Shipments endpoints in ShipEngine API.
|
|
8285
|
+
*
|
|
8286
|
+
* @see {@link SalesOrderShipmentsAPI | The Sales Order Shipments API module}
|
|
8287
|
+
*/
|
|
8023
8288
|
get salesOrderShipments() {
|
|
8024
8289
|
return new SalesOrderShipmentsAPI(this.client);
|
|
8025
8290
|
}
|
|
8291
|
+
/**
|
|
8292
|
+
* The `salesOrders` method provides access to the `v-beta` Sales Order endpoints
|
|
8293
|
+
* in ShipEngine API.
|
|
8294
|
+
*
|
|
8295
|
+
* @see {@link SalesOrdersAPI | The Sales Orders API module}
|
|
8296
|
+
*/
|
|
8026
8297
|
get salesOrders() {
|
|
8027
8298
|
return new SalesOrdersAPI(this.client);
|
|
8028
8299
|
}
|
|
8300
|
+
/**
|
|
8301
|
+
* The `shipments` method provides access to the Shipment endpoints in ShipEngine
|
|
8302
|
+
* API. e.g. Create Shipment, Get Shipment, etc.
|
|
8303
|
+
*
|
|
8304
|
+
* @see {@link ShipmentsAPI | The Shipments API module}
|
|
8305
|
+
*/
|
|
8029
8306
|
get shipments() {
|
|
8030
8307
|
return new ShipmentsAPI(this.client);
|
|
8031
8308
|
}
|
|
8309
|
+
/**
|
|
8310
|
+
* The `warehouses` method provides access to the Warehouses endpoints in ShipEngine
|
|
8311
|
+
* API. e.g. List Warehouses, Get Warehouse, etc.
|
|
8312
|
+
*
|
|
8313
|
+
* @see {@link WarehousesAPI | The Warehouses API module}
|
|
8314
|
+
*/
|
|
8032
8315
|
get warehouses() {
|
|
8033
8316
|
return new WarehousesAPI(this.client);
|
|
8034
8317
|
}
|
|
@@ -8087,25 +8370,25 @@ const delay = (ms) => new Promise((resolve) => {
|
|
|
8087
8370
|
|
|
8088
8371
|
const onError = (errors) => errors.forEach(console.log);
|
|
8089
8372
|
|
|
8090
|
-
var __defProp$
|
|
8091
|
-
var __defProps$
|
|
8092
|
-
var __getOwnPropDescs$
|
|
8093
|
-
var __getOwnPropSymbols$
|
|
8094
|
-
var __hasOwnProp$
|
|
8095
|
-
var __propIsEnum$
|
|
8096
|
-
var __defNormalProp$
|
|
8097
|
-
var __spreadValues$
|
|
8373
|
+
var __defProp$2 = Object.defineProperty;
|
|
8374
|
+
var __defProps$1 = Object.defineProperties;
|
|
8375
|
+
var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
|
|
8376
|
+
var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
|
|
8377
|
+
var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
|
|
8378
|
+
var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
|
|
8379
|
+
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8380
|
+
var __spreadValues$2 = (a, b) => {
|
|
8098
8381
|
for (var prop in b || (b = {}))
|
|
8099
|
-
if (__hasOwnProp$
|
|
8100
|
-
__defNormalProp$
|
|
8101
|
-
if (__getOwnPropSymbols$
|
|
8102
|
-
for (var prop of __getOwnPropSymbols$
|
|
8103
|
-
if (__propIsEnum$
|
|
8104
|
-
__defNormalProp$
|
|
8382
|
+
if (__hasOwnProp$8.call(b, prop))
|
|
8383
|
+
__defNormalProp$2(a, prop, b[prop]);
|
|
8384
|
+
if (__getOwnPropSymbols$8)
|
|
8385
|
+
for (var prop of __getOwnPropSymbols$8(b)) {
|
|
8386
|
+
if (__propIsEnum$8.call(b, prop))
|
|
8387
|
+
__defNormalProp$2(a, prop, b[prop]);
|
|
8105
8388
|
}
|
|
8106
8389
|
return a;
|
|
8107
8390
|
};
|
|
8108
|
-
var __spreadProps$
|
|
8391
|
+
var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
|
|
8109
8392
|
const streams = [];
|
|
8110
8393
|
if (process.env.NODE_ENV === "production") {
|
|
8111
8394
|
streams.push({
|
|
@@ -8114,7 +8397,7 @@ if (process.env.NODE_ENV === "production") {
|
|
|
8114
8397
|
}
|
|
8115
8398
|
const logger = E({
|
|
8116
8399
|
name: "shipengine",
|
|
8117
|
-
serializers: __spreadProps$
|
|
8400
|
+
serializers: __spreadProps$1(__spreadValues$2({}, k), {
|
|
8118
8401
|
req: (req) => ({
|
|
8119
8402
|
headers: req.headers,
|
|
8120
8403
|
method: req.method,
|
|
@@ -8149,7 +8432,7 @@ const useGetAccountSettings = () => {
|
|
|
8149
8432
|
});
|
|
8150
8433
|
};
|
|
8151
8434
|
|
|
8152
|
-
var __async$
|
|
8435
|
+
var __async$r = (__this, __arguments, generator) => {
|
|
8153
8436
|
return new Promise((resolve, reject) => {
|
|
8154
8437
|
var fulfilled = (value) => {
|
|
8155
8438
|
try {
|
|
@@ -8172,7 +8455,7 @@ var __async$s = (__this, __arguments, generator) => {
|
|
|
8172
8455
|
const useUpdateAccountSettings = () => {
|
|
8173
8456
|
const { client } = useShipEngine();
|
|
8174
8457
|
return useMutation({
|
|
8175
|
-
mutationFn: (settings) => __async$
|
|
8458
|
+
mutationFn: (settings) => __async$r(void 0, null, function* () {
|
|
8176
8459
|
const result = yield client.accountSettings.update(settings);
|
|
8177
8460
|
return result.data;
|
|
8178
8461
|
}),
|
|
@@ -8181,7 +8464,7 @@ const useUpdateAccountSettings = () => {
|
|
|
8181
8464
|
});
|
|
8182
8465
|
};
|
|
8183
8466
|
|
|
8184
|
-
var __async$
|
|
8467
|
+
var __async$q = (__this, __arguments, generator) => {
|
|
8185
8468
|
return new Promise((resolve, reject) => {
|
|
8186
8469
|
var fulfilled = (value) => {
|
|
8187
8470
|
try {
|
|
@@ -8204,7 +8487,7 @@ var __async$r = (__this, __arguments, generator) => {
|
|
|
8204
8487
|
const useParseAddress = () => {
|
|
8205
8488
|
const { client } = useShipEngine();
|
|
8206
8489
|
return useMutation({
|
|
8207
|
-
mutationFn: (_0) => __async$
|
|
8490
|
+
mutationFn: (_0) => __async$q(void 0, [_0], function* ({ address, text }) {
|
|
8208
8491
|
const result = yield client.addresses.parse(text, address);
|
|
8209
8492
|
return result.data;
|
|
8210
8493
|
}),
|
|
@@ -8213,7 +8496,7 @@ const useParseAddress = () => {
|
|
|
8213
8496
|
});
|
|
8214
8497
|
};
|
|
8215
8498
|
|
|
8216
|
-
var __async$
|
|
8499
|
+
var __async$p = (__this, __arguments, generator) => {
|
|
8217
8500
|
return new Promise((resolve, reject) => {
|
|
8218
8501
|
var fulfilled = (value) => {
|
|
8219
8502
|
try {
|
|
@@ -8236,7 +8519,7 @@ var __async$q = (__this, __arguments, generator) => {
|
|
|
8236
8519
|
const useValidateAddresses = () => {
|
|
8237
8520
|
const { client } = useShipEngine();
|
|
8238
8521
|
return useMutation({
|
|
8239
|
-
mutationFn: (addresses) => __async$
|
|
8522
|
+
mutationFn: (addresses) => __async$p(void 0, null, function* () {
|
|
8240
8523
|
const result = yield client.addresses.validate(addresses);
|
|
8241
8524
|
return result.data;
|
|
8242
8525
|
}),
|
|
@@ -8245,7 +8528,7 @@ const useValidateAddresses = () => {
|
|
|
8245
8528
|
});
|
|
8246
8529
|
};
|
|
8247
8530
|
|
|
8248
|
-
var __async$
|
|
8531
|
+
var __async$o = (__this, __arguments, generator) => {
|
|
8249
8532
|
return new Promise((resolve, reject) => {
|
|
8250
8533
|
var fulfilled = (value) => {
|
|
8251
8534
|
try {
|
|
@@ -8268,7 +8551,7 @@ var __async$p = (__this, __arguments, generator) => {
|
|
|
8268
8551
|
const useAddFunds = (carrierId) => {
|
|
8269
8552
|
const { client } = useShipEngine();
|
|
8270
8553
|
return useMutation({
|
|
8271
|
-
mutationFn: (funds) => __async$
|
|
8554
|
+
mutationFn: (funds) => __async$o(void 0, null, function* () {
|
|
8272
8555
|
const result = yield client.carriers.addFunds(carrierId, funds);
|
|
8273
8556
|
return result.data;
|
|
8274
8557
|
}),
|
|
@@ -8277,7 +8560,7 @@ const useAddFunds = (carrierId) => {
|
|
|
8277
8560
|
});
|
|
8278
8561
|
};
|
|
8279
8562
|
|
|
8280
|
-
var __async$
|
|
8563
|
+
var __async$n = (__this, __arguments, generator) => {
|
|
8281
8564
|
return new Promise((resolve, reject) => {
|
|
8282
8565
|
var fulfilled = (value) => {
|
|
8283
8566
|
try {
|
|
@@ -8300,7 +8583,7 @@ var __async$o = (__this, __arguments, generator) => {
|
|
|
8300
8583
|
const useConnectCarrier = () => {
|
|
8301
8584
|
const { client } = useShipEngine();
|
|
8302
8585
|
return useMutation({
|
|
8303
|
-
mutationFn: (params) => __async$
|
|
8586
|
+
mutationFn: (params) => __async$n(void 0, null, function* () {
|
|
8304
8587
|
const result = yield client.carriers.connect(params);
|
|
8305
8588
|
return result.data;
|
|
8306
8589
|
}),
|
|
@@ -8437,7 +8720,7 @@ const useListCarriers = () => {
|
|
|
8437
8720
|
});
|
|
8438
8721
|
};
|
|
8439
8722
|
|
|
8440
|
-
var __async$
|
|
8723
|
+
var __async$m = (__this, __arguments, generator) => {
|
|
8441
8724
|
return new Promise((resolve, reject) => {
|
|
8442
8725
|
var fulfilled = (value) => {
|
|
8443
8726
|
try {
|
|
@@ -8461,7 +8744,7 @@ const useUpdateAutoFunding = (carrierId) => {
|
|
|
8461
8744
|
const { client } = useShipEngine();
|
|
8462
8745
|
const queryClient = useQueryClient();
|
|
8463
8746
|
return useMutation({
|
|
8464
|
-
mutationFn: (options) => __async$
|
|
8747
|
+
mutationFn: (options) => __async$m(void 0, null, function* () {
|
|
8465
8748
|
const result = yield client.carriers.updateAutoFunding(carrierId, options);
|
|
8466
8749
|
return result.data;
|
|
8467
8750
|
}),
|
|
@@ -8483,7 +8766,7 @@ const useListCustomPackageTypes = () => {
|
|
|
8483
8766
|
});
|
|
8484
8767
|
};
|
|
8485
8768
|
|
|
8486
|
-
var __async$
|
|
8769
|
+
var __async$l = (__this, __arguments, generator) => {
|
|
8487
8770
|
return new Promise((resolve, reject) => {
|
|
8488
8771
|
var fulfilled = (value) => {
|
|
8489
8772
|
try {
|
|
@@ -8506,7 +8789,7 @@ var __async$m = (__this, __arguments, generator) => {
|
|
|
8506
8789
|
const useCreateFundingSource = () => {
|
|
8507
8790
|
const { client } = useShipEngine();
|
|
8508
8791
|
return useMutation({
|
|
8509
|
-
mutationFn: (fundingSource) => __async$
|
|
8792
|
+
mutationFn: (fundingSource) => __async$l(void 0, null, function* () {
|
|
8510
8793
|
const result = yield client.fundingSources.create(fundingSource);
|
|
8511
8794
|
return result.data;
|
|
8512
8795
|
}),
|
|
@@ -8515,7 +8798,7 @@ const useCreateFundingSource = () => {
|
|
|
8515
8798
|
});
|
|
8516
8799
|
};
|
|
8517
8800
|
|
|
8518
|
-
var __async$
|
|
8801
|
+
var __async$k = (__this, __arguments, generator) => {
|
|
8519
8802
|
return new Promise((resolve, reject) => {
|
|
8520
8803
|
var fulfilled = (value) => {
|
|
8521
8804
|
try {
|
|
@@ -8538,7 +8821,7 @@ var __async$l = (__this, __arguments, generator) => {
|
|
|
8538
8821
|
const useFundingSourcesAddFunds = (fundingSourceId) => {
|
|
8539
8822
|
const { client } = useShipEngine();
|
|
8540
8823
|
return useMutation({
|
|
8541
|
-
mutationFn: (funds) => __async$
|
|
8824
|
+
mutationFn: (funds) => __async$k(void 0, null, function* () {
|
|
8542
8825
|
const result = yield client.fundingSources.addFunds(funds, fundingSourceId);
|
|
8543
8826
|
return result.data;
|
|
8544
8827
|
}),
|
|
@@ -8567,7 +8850,7 @@ const useListFundingSources = () => {
|
|
|
8567
8850
|
});
|
|
8568
8851
|
};
|
|
8569
8852
|
|
|
8570
|
-
var __async$
|
|
8853
|
+
var __async$j = (__this, __arguments, generator) => {
|
|
8571
8854
|
return new Promise((resolve, reject) => {
|
|
8572
8855
|
var fulfilled = (value) => {
|
|
8573
8856
|
try {
|
|
@@ -8590,7 +8873,7 @@ var __async$k = (__this, __arguments, generator) => {
|
|
|
8590
8873
|
const useRegisterCarrier = () => {
|
|
8591
8874
|
const { client } = useShipEngine();
|
|
8592
8875
|
return useMutation({
|
|
8593
|
-
mutationFn: (carrier) => __async$
|
|
8876
|
+
mutationFn: (carrier) => __async$j(void 0, null, function* () {
|
|
8594
8877
|
const result = yield client.fundingSources.registerCarrier(carrier);
|
|
8595
8878
|
return result.data;
|
|
8596
8879
|
}),
|
|
@@ -8599,7 +8882,7 @@ const useRegisterCarrier = () => {
|
|
|
8599
8882
|
});
|
|
8600
8883
|
};
|
|
8601
8884
|
|
|
8602
|
-
var __async$
|
|
8885
|
+
var __async$i = (__this, __arguments, generator) => {
|
|
8603
8886
|
return new Promise((resolve, reject) => {
|
|
8604
8887
|
var fulfilled = (value) => {
|
|
8605
8888
|
try {
|
|
@@ -8622,7 +8905,7 @@ var __async$j = (__this, __arguments, generator) => {
|
|
|
8622
8905
|
const useUpdateFundingSource = () => {
|
|
8623
8906
|
const { client } = useShipEngine();
|
|
8624
8907
|
return useMutation({
|
|
8625
|
-
mutationFn: (_0) => __async$
|
|
8908
|
+
mutationFn: (_0) => __async$i(void 0, [_0], function* ({
|
|
8626
8909
|
billingInfo,
|
|
8627
8910
|
creditCardInfo,
|
|
8628
8911
|
fundingSourceId
|
|
@@ -8654,22 +8937,22 @@ const useGetInsuranceAccount = (insuranceProvider) => {
|
|
|
8654
8937
|
});
|
|
8655
8938
|
};
|
|
8656
8939
|
|
|
8657
|
-
var __getOwnPropSymbols$
|
|
8658
|
-
var __hasOwnProp$
|
|
8659
|
-
var __propIsEnum$
|
|
8940
|
+
var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
|
|
8941
|
+
var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
|
|
8942
|
+
var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
|
|
8660
8943
|
var __objRest$6 = (source, exclude) => {
|
|
8661
8944
|
var target = {};
|
|
8662
8945
|
for (var prop in source)
|
|
8663
|
-
if (__hasOwnProp$
|
|
8946
|
+
if (__hasOwnProp$7.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
8664
8947
|
target[prop] = source[prop];
|
|
8665
|
-
if (source != null && __getOwnPropSymbols$
|
|
8666
|
-
for (var prop of __getOwnPropSymbols$
|
|
8667
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
8948
|
+
if (source != null && __getOwnPropSymbols$7)
|
|
8949
|
+
for (var prop of __getOwnPropSymbols$7(source)) {
|
|
8950
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$7.call(source, prop))
|
|
8668
8951
|
target[prop] = source[prop];
|
|
8669
8952
|
}
|
|
8670
8953
|
return target;
|
|
8671
8954
|
};
|
|
8672
|
-
var __async$
|
|
8955
|
+
var __async$h = (__this, __arguments, generator) => {
|
|
8673
8956
|
return new Promise((resolve, reject) => {
|
|
8674
8957
|
var fulfilled = (value) => {
|
|
8675
8958
|
try {
|
|
@@ -8692,7 +8975,7 @@ var __async$i = (__this, __arguments, generator) => {
|
|
|
8692
8975
|
const useCreateLabel = () => {
|
|
8693
8976
|
const { client } = useShipEngine();
|
|
8694
8977
|
return useMutation({
|
|
8695
|
-
mutationFn: (_a) => __async$
|
|
8978
|
+
mutationFn: (_a) => __async$h(void 0, null, function* () {
|
|
8696
8979
|
var _b = _a, { rateId } = _b, options = __objRest$6(_b, ["rateId"]);
|
|
8697
8980
|
const result = yield client.labels.createByRateId(rateId, options);
|
|
8698
8981
|
return result.data;
|
|
@@ -8728,7 +9011,7 @@ const useListLabels = (params) => {
|
|
|
8728
9011
|
});
|
|
8729
9012
|
};
|
|
8730
9013
|
|
|
8731
|
-
var __async$
|
|
9014
|
+
var __async$g = (__this, __arguments, generator) => {
|
|
8732
9015
|
return new Promise((resolve, reject) => {
|
|
8733
9016
|
var fulfilled = (value) => {
|
|
8734
9017
|
try {
|
|
@@ -8751,7 +9034,7 @@ var __async$h = (__this, __arguments, generator) => {
|
|
|
8751
9034
|
const useVoidLabel = () => {
|
|
8752
9035
|
const { client } = useShipEngine();
|
|
8753
9036
|
return useMutation({
|
|
8754
|
-
mutationFn: (labelId) => __async$
|
|
9037
|
+
mutationFn: (labelId) => __async$g(void 0, null, function* () {
|
|
8755
9038
|
const result = yield client.labels.void(labelId);
|
|
8756
9039
|
return result.data;
|
|
8757
9040
|
}),
|
|
@@ -8770,7 +9053,7 @@ const useListOrderSources = () => {
|
|
|
8770
9053
|
});
|
|
8771
9054
|
};
|
|
8772
9055
|
|
|
8773
|
-
var __async$
|
|
9056
|
+
var __async$f = (__this, __arguments, generator) => {
|
|
8774
9057
|
return new Promise((resolve, reject) => {
|
|
8775
9058
|
var fulfilled = (value) => {
|
|
8776
9059
|
try {
|
|
@@ -8793,7 +9076,7 @@ var __async$g = (__this, __arguments, generator) => {
|
|
|
8793
9076
|
const useRefreshOrderSourceAsync = () => {
|
|
8794
9077
|
const { client } = useShipEngine();
|
|
8795
9078
|
return useMutation({
|
|
8796
|
-
mutationFn: (orderSourceId) => __async$
|
|
9079
|
+
mutationFn: (orderSourceId) => __async$f(void 0, null, function* () {
|
|
8797
9080
|
const result = yield client.orderSources.refresh(orderSourceId);
|
|
8798
9081
|
return result.data;
|
|
8799
9082
|
}),
|
|
@@ -8804,9 +9087,9 @@ const useRefreshOrderSource = () => {
|
|
|
8804
9087
|
const { client } = useShipEngine();
|
|
8805
9088
|
const { mutateAsync: refreshOrderSourceAsync } = useRefreshOrderSourceAsync();
|
|
8806
9089
|
return useMutation({
|
|
8807
|
-
mutationFn: (orderSourceId) => __async$
|
|
9090
|
+
mutationFn: (orderSourceId) => __async$f(void 0, null, function* () {
|
|
8808
9091
|
yield refreshOrderSourceAsync(orderSourceId);
|
|
8809
|
-
const waitResult = yield retryUntil(() => __async$
|
|
9092
|
+
const waitResult = yield retryUntil(() => __async$f(void 0, null, function* () {
|
|
8810
9093
|
const { data: checkResult } = yield client.orderSources.get(orderSourceId);
|
|
8811
9094
|
if (["preparing_update", "updating"].includes(checkResult.refreshInfo.status)) {
|
|
8812
9095
|
throw new CodedError("Order source is still refreshing");
|
|
@@ -8820,7 +9103,7 @@ const useRefreshOrderSource = () => {
|
|
|
8820
9103
|
});
|
|
8821
9104
|
};
|
|
8822
9105
|
|
|
8823
|
-
var __async$
|
|
9106
|
+
var __async$e = (__this, __arguments, generator) => {
|
|
8824
9107
|
return new Promise((resolve, reject) => {
|
|
8825
9108
|
var fulfilled = (value) => {
|
|
8826
9109
|
try {
|
|
@@ -8843,7 +9126,7 @@ var __async$f = (__this, __arguments, generator) => {
|
|
|
8843
9126
|
const useCreateRateCard = () => {
|
|
8844
9127
|
const { client } = useShipEngine();
|
|
8845
9128
|
return useMutation({
|
|
8846
|
-
mutationFn: (rateCard) => __async$
|
|
9129
|
+
mutationFn: (rateCard) => __async$e(void 0, null, function* () {
|
|
8847
9130
|
const result = yield client.rateCards.create(rateCard);
|
|
8848
9131
|
return result.data;
|
|
8849
9132
|
}),
|
|
@@ -8890,7 +9173,7 @@ const useListRateCards = (carrierIds) => {
|
|
|
8890
9173
|
});
|
|
8891
9174
|
};
|
|
8892
9175
|
|
|
8893
|
-
var __async$
|
|
9176
|
+
var __async$d = (__this, __arguments, generator) => {
|
|
8894
9177
|
return new Promise((resolve, reject) => {
|
|
8895
9178
|
var fulfilled = (value) => {
|
|
8896
9179
|
try {
|
|
@@ -8913,7 +9196,7 @@ var __async$e = (__this, __arguments, generator) => {
|
|
|
8913
9196
|
const usePublishRateCard = () => {
|
|
8914
9197
|
const { client } = useShipEngine();
|
|
8915
9198
|
return useMutation({
|
|
8916
|
-
mutationFn: (rateCardId) => __async$
|
|
9199
|
+
mutationFn: (rateCardId) => __async$d(void 0, null, function* () {
|
|
8917
9200
|
return yield client.rateCards.publish(rateCardId);
|
|
8918
9201
|
}),
|
|
8919
9202
|
mutationKey: ["usePublishRateCard"],
|
|
@@ -8921,7 +9204,7 @@ const usePublishRateCard = () => {
|
|
|
8921
9204
|
});
|
|
8922
9205
|
};
|
|
8923
9206
|
|
|
8924
|
-
var __async$
|
|
9207
|
+
var __async$c = (__this, __arguments, generator) => {
|
|
8925
9208
|
return new Promise((resolve, reject) => {
|
|
8926
9209
|
var fulfilled = (value) => {
|
|
8927
9210
|
try {
|
|
@@ -8944,7 +9227,7 @@ var __async$d = (__this, __arguments, generator) => {
|
|
|
8944
9227
|
const useUpdateRateCard = () => {
|
|
8945
9228
|
const { client } = useShipEngine();
|
|
8946
9229
|
return useMutation({
|
|
8947
|
-
mutationFn: (rateCard) => __async$
|
|
9230
|
+
mutationFn: (rateCard) => __async$c(void 0, null, function* () {
|
|
8948
9231
|
const result = yield client.rateCards.update(rateCard);
|
|
8949
9232
|
return result.data;
|
|
8950
9233
|
}),
|
|
@@ -8953,7 +9236,7 @@ const useUpdateRateCard = () => {
|
|
|
8953
9236
|
});
|
|
8954
9237
|
};
|
|
8955
9238
|
|
|
8956
|
-
var __async$
|
|
9239
|
+
var __async$b = (__this, __arguments, generator) => {
|
|
8957
9240
|
return new Promise((resolve, reject) => {
|
|
8958
9241
|
var fulfilled = (value) => {
|
|
8959
9242
|
try {
|
|
@@ -8976,7 +9259,7 @@ var __async$c = (__this, __arguments, generator) => {
|
|
|
8976
9259
|
const useUploadRateCard = () => {
|
|
8977
9260
|
const { client } = useShipEngine();
|
|
8978
9261
|
return useMutation({
|
|
8979
|
-
mutationFn: (_0) => __async$
|
|
9262
|
+
mutationFn: (_0) => __async$b(void 0, [_0], function* ({ rateCardId, file }) {
|
|
8980
9263
|
const result = yield client.rateCards.upload(rateCardId, file);
|
|
8981
9264
|
return result.data;
|
|
8982
9265
|
}),
|
|
@@ -8985,7 +9268,7 @@ const useUploadRateCard = () => {
|
|
|
8985
9268
|
});
|
|
8986
9269
|
};
|
|
8987
9270
|
|
|
8988
|
-
var __async$
|
|
9271
|
+
var __async$a = (__this, __arguments, generator) => {
|
|
8989
9272
|
return new Promise((resolve, reject) => {
|
|
8990
9273
|
var fulfilled = (value) => {
|
|
8991
9274
|
try {
|
|
@@ -9008,7 +9291,7 @@ var __async$b = (__this, __arguments, generator) => {
|
|
|
9008
9291
|
const useDeleteRateCard = () => {
|
|
9009
9292
|
const { client } = useShipEngine();
|
|
9010
9293
|
return useMutation({
|
|
9011
|
-
mutationFn: (rateCardId) => __async$
|
|
9294
|
+
mutationFn: (rateCardId) => __async$a(void 0, null, function* () {
|
|
9012
9295
|
const result = yield client.rateCards.delete(rateCardId);
|
|
9013
9296
|
return result.data;
|
|
9014
9297
|
}),
|
|
@@ -9017,7 +9300,7 @@ const useDeleteRateCard = () => {
|
|
|
9017
9300
|
});
|
|
9018
9301
|
};
|
|
9019
9302
|
|
|
9020
|
-
var __async$
|
|
9303
|
+
var __async$9 = (__this, __arguments, generator) => {
|
|
9021
9304
|
return new Promise((resolve, reject) => {
|
|
9022
9305
|
var fulfilled = (value) => {
|
|
9023
9306
|
try {
|
|
@@ -9040,7 +9323,7 @@ var __async$a = (__this, __arguments, generator) => {
|
|
|
9040
9323
|
const useCalculateRates = () => {
|
|
9041
9324
|
const { client } = useShipEngine();
|
|
9042
9325
|
return useMutation({
|
|
9043
|
-
mutationFn: (_0) => __async$
|
|
9326
|
+
mutationFn: (_0) => __async$9(void 0, [_0], function* ({ rateOptions, shipmentId }) {
|
|
9044
9327
|
const result = yield client.rates.calculateByShipmentId(shipmentId, rateOptions);
|
|
9045
9328
|
return result.data;
|
|
9046
9329
|
}),
|
|
@@ -9075,22 +9358,22 @@ const useListSalesOrders = (params = {}) => {
|
|
|
9075
9358
|
});
|
|
9076
9359
|
};
|
|
9077
9360
|
|
|
9078
|
-
var __getOwnPropSymbols$
|
|
9079
|
-
var __hasOwnProp$
|
|
9080
|
-
var __propIsEnum$
|
|
9361
|
+
var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
|
|
9362
|
+
var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
|
|
9363
|
+
var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
|
|
9081
9364
|
var __objRest$5 = (source, exclude) => {
|
|
9082
9365
|
var target = {};
|
|
9083
9366
|
for (var prop in source)
|
|
9084
|
-
if (__hasOwnProp$
|
|
9367
|
+
if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
9085
9368
|
target[prop] = source[prop];
|
|
9086
|
-
if (source != null && __getOwnPropSymbols$
|
|
9087
|
-
for (var prop of __getOwnPropSymbols$
|
|
9088
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
9369
|
+
if (source != null && __getOwnPropSymbols$6)
|
|
9370
|
+
for (var prop of __getOwnPropSymbols$6(source)) {
|
|
9371
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
|
|
9089
9372
|
target[prop] = source[prop];
|
|
9090
9373
|
}
|
|
9091
9374
|
return target;
|
|
9092
9375
|
};
|
|
9093
|
-
var __async$
|
|
9376
|
+
var __async$8 = (__this, __arguments, generator) => {
|
|
9094
9377
|
return new Promise((resolve, reject) => {
|
|
9095
9378
|
var fulfilled = (value) => {
|
|
9096
9379
|
try {
|
|
@@ -9113,7 +9396,7 @@ var __async$9 = (__this, __arguments, generator) => {
|
|
|
9113
9396
|
const useNotifySalesOrderShipped = () => {
|
|
9114
9397
|
const { client } = useShipEngine();
|
|
9115
9398
|
return useMutation({
|
|
9116
|
-
mutationFn: (_a) => __async$
|
|
9399
|
+
mutationFn: (_a) => __async$8(void 0, null, function* () {
|
|
9117
9400
|
var _b = _a, { salesOrderId } = _b, tracking = __objRest$5(_b, ["salesOrderId"]);
|
|
9118
9401
|
const result = yield client.salesOrders.notifyShipped(salesOrderId, tracking);
|
|
9119
9402
|
return result.data;
|
|
@@ -9123,22 +9406,22 @@ const useNotifySalesOrderShipped = () => {
|
|
|
9123
9406
|
});
|
|
9124
9407
|
};
|
|
9125
9408
|
|
|
9126
|
-
var __getOwnPropSymbols$
|
|
9127
|
-
var __hasOwnProp$
|
|
9128
|
-
var __propIsEnum$
|
|
9409
|
+
var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
|
|
9410
|
+
var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
|
|
9411
|
+
var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
|
|
9129
9412
|
var __objRest$4 = (source, exclude) => {
|
|
9130
9413
|
var target = {};
|
|
9131
9414
|
for (var prop in source)
|
|
9132
|
-
if (__hasOwnProp$
|
|
9415
|
+
if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
9133
9416
|
target[prop] = source[prop];
|
|
9134
|
-
if (source != null && __getOwnPropSymbols$
|
|
9135
|
-
for (var prop of __getOwnPropSymbols$
|
|
9136
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
9417
|
+
if (source != null && __getOwnPropSymbols$5)
|
|
9418
|
+
for (var prop of __getOwnPropSymbols$5(source)) {
|
|
9419
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
|
|
9137
9420
|
target[prop] = source[prop];
|
|
9138
9421
|
}
|
|
9139
9422
|
return target;
|
|
9140
9423
|
};
|
|
9141
|
-
var __async$
|
|
9424
|
+
var __async$7 = (__this, __arguments, generator) => {
|
|
9142
9425
|
return new Promise((resolve, reject) => {
|
|
9143
9426
|
var fulfilled = (value) => {
|
|
9144
9427
|
try {
|
|
@@ -9161,7 +9444,7 @@ var __async$8 = (__this, __arguments, generator) => {
|
|
|
9161
9444
|
const useCreateSalesOrderShipment = () => {
|
|
9162
9445
|
const { client } = useShipEngine();
|
|
9163
9446
|
return useMutation({
|
|
9164
|
-
mutationFn: (_a) => __async$
|
|
9447
|
+
mutationFn: (_a) => __async$7(void 0, null, function* () {
|
|
9165
9448
|
var _b = _a, { salesOrderId } = _b, shipment = __objRest$4(_b, ["salesOrderId"]);
|
|
9166
9449
|
const result = yield client.salesOrderShipments.create(salesOrderId, shipment);
|
|
9167
9450
|
return result.data;
|
|
@@ -9197,22 +9480,22 @@ const useListSalesOrderShipments = (params) => {
|
|
|
9197
9480
|
});
|
|
9198
9481
|
};
|
|
9199
9482
|
|
|
9200
|
-
var __getOwnPropSymbols$
|
|
9201
|
-
var __hasOwnProp$
|
|
9202
|
-
var __propIsEnum$
|
|
9483
|
+
var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
|
|
9484
|
+
var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
|
|
9485
|
+
var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
|
|
9203
9486
|
var __objRest$3 = (source, exclude) => {
|
|
9204
9487
|
var target = {};
|
|
9205
9488
|
for (var prop in source)
|
|
9206
|
-
if (__hasOwnProp$
|
|
9489
|
+
if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
9207
9490
|
target[prop] = source[prop];
|
|
9208
|
-
if (source != null && __getOwnPropSymbols$
|
|
9209
|
-
for (var prop of __getOwnPropSymbols$
|
|
9210
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
9491
|
+
if (source != null && __getOwnPropSymbols$4)
|
|
9492
|
+
for (var prop of __getOwnPropSymbols$4(source)) {
|
|
9493
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
|
|
9211
9494
|
target[prop] = source[prop];
|
|
9212
9495
|
}
|
|
9213
9496
|
return target;
|
|
9214
9497
|
};
|
|
9215
|
-
var __async$
|
|
9498
|
+
var __async$6 = (__this, __arguments, generator) => {
|
|
9216
9499
|
return new Promise((resolve, reject) => {
|
|
9217
9500
|
var fulfilled = (value) => {
|
|
9218
9501
|
try {
|
|
@@ -9235,7 +9518,7 @@ var __async$7 = (__this, __arguments, generator) => {
|
|
|
9235
9518
|
const useUpdateSalesOrderShipment = () => {
|
|
9236
9519
|
const { client } = useShipEngine();
|
|
9237
9520
|
return useMutation({
|
|
9238
|
-
mutationFn: (_a) => __async$
|
|
9521
|
+
mutationFn: (_a) => __async$6(void 0, null, function* () {
|
|
9239
9522
|
var _b = _a, { shipmentId } = _b, shipment = __objRest$3(_b, ["shipmentId"]);
|
|
9240
9523
|
const result = yield client.salesOrderShipments.update(shipmentId, shipment);
|
|
9241
9524
|
return result.data;
|
|
@@ -9245,26 +9528,26 @@ const useUpdateSalesOrderShipment = () => {
|
|
|
9245
9528
|
});
|
|
9246
9529
|
};
|
|
9247
9530
|
|
|
9248
|
-
var __defProp$
|
|
9249
|
-
var __defProps
|
|
9250
|
-
var __getOwnPropDescs
|
|
9251
|
-
var __getOwnPropSymbols$
|
|
9252
|
-
var __hasOwnProp$
|
|
9253
|
-
var __propIsEnum$
|
|
9254
|
-
var __defNormalProp$
|
|
9255
|
-
var __spreadValues$
|
|
9531
|
+
var __defProp$1 = Object.defineProperty;
|
|
9532
|
+
var __defProps = Object.defineProperties;
|
|
9533
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
9534
|
+
var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
|
|
9535
|
+
var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
|
|
9536
|
+
var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
|
|
9537
|
+
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9538
|
+
var __spreadValues$1 = (a, b) => {
|
|
9256
9539
|
for (var prop in b || (b = {}))
|
|
9257
|
-
if (__hasOwnProp$
|
|
9258
|
-
__defNormalProp$
|
|
9259
|
-
if (__getOwnPropSymbols$
|
|
9260
|
-
for (var prop of __getOwnPropSymbols$
|
|
9261
|
-
if (__propIsEnum$
|
|
9262
|
-
__defNormalProp$
|
|
9540
|
+
if (__hasOwnProp$3.call(b, prop))
|
|
9541
|
+
__defNormalProp$1(a, prop, b[prop]);
|
|
9542
|
+
if (__getOwnPropSymbols$3)
|
|
9543
|
+
for (var prop of __getOwnPropSymbols$3(b)) {
|
|
9544
|
+
if (__propIsEnum$3.call(b, prop))
|
|
9545
|
+
__defNormalProp$1(a, prop, b[prop]);
|
|
9263
9546
|
}
|
|
9264
9547
|
return a;
|
|
9265
9548
|
};
|
|
9266
|
-
var __spreadProps
|
|
9267
|
-
var __async$
|
|
9549
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
9550
|
+
var __async$5 = (__this, __arguments, generator) => {
|
|
9268
9551
|
return new Promise((resolve, reject) => {
|
|
9269
9552
|
var fulfilled = (value) => {
|
|
9270
9553
|
try {
|
|
@@ -9287,7 +9570,7 @@ var __async$6 = (__this, __arguments, generator) => {
|
|
|
9287
9570
|
const useCreateShipment = () => {
|
|
9288
9571
|
const { client } = useShipEngine();
|
|
9289
9572
|
return useMutation({
|
|
9290
|
-
mutationFn: (shipment) => __async$
|
|
9573
|
+
mutationFn: (shipment) => __async$5(void 0, null, function* () {
|
|
9291
9574
|
var _a;
|
|
9292
9575
|
if (shipment.warehouseId === void 0) {
|
|
9293
9576
|
throw new CodedError("errorMessages.noWarehouses", {
|
|
@@ -9305,7 +9588,7 @@ const useCreateShipment = () => {
|
|
|
9305
9588
|
postalCode: "",
|
|
9306
9589
|
stateProvince: ""
|
|
9307
9590
|
};
|
|
9308
|
-
return (yield client.shipments.create(__spreadProps
|
|
9591
|
+
return (yield client.shipments.create(__spreadProps(__spreadValues$1({}, shipment), {
|
|
9309
9592
|
shipTo
|
|
9310
9593
|
}))).data;
|
|
9311
9594
|
}),
|
|
@@ -9346,17 +9629,17 @@ const useGetShipment = (shipmentId) => {
|
|
|
9346
9629
|
});
|
|
9347
9630
|
};
|
|
9348
9631
|
|
|
9349
|
-
var __getOwnPropSymbols$
|
|
9350
|
-
var __hasOwnProp$
|
|
9351
|
-
var __propIsEnum$
|
|
9632
|
+
var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
|
|
9633
|
+
var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
|
|
9634
|
+
var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
|
|
9352
9635
|
var __objRest$2 = (source, exclude) => {
|
|
9353
9636
|
var target = {};
|
|
9354
9637
|
for (var prop in source)
|
|
9355
|
-
if (__hasOwnProp$
|
|
9638
|
+
if (__hasOwnProp$2.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
9356
9639
|
target[prop] = source[prop];
|
|
9357
|
-
if (source != null && __getOwnPropSymbols$
|
|
9358
|
-
for (var prop of __getOwnPropSymbols$
|
|
9359
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
9640
|
+
if (source != null && __getOwnPropSymbols$2)
|
|
9641
|
+
for (var prop of __getOwnPropSymbols$2(source)) {
|
|
9642
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$2.call(source, prop))
|
|
9360
9643
|
target[prop] = source[prop];
|
|
9361
9644
|
}
|
|
9362
9645
|
return target;
|
|
@@ -9373,7 +9656,7 @@ const useListShipments = (_params) => {
|
|
|
9373
9656
|
});
|
|
9374
9657
|
};
|
|
9375
9658
|
|
|
9376
|
-
var __async$
|
|
9659
|
+
var __async$4 = (__this, __arguments, generator) => {
|
|
9377
9660
|
return new Promise((resolve, reject) => {
|
|
9378
9661
|
var fulfilled = (value) => {
|
|
9379
9662
|
try {
|
|
@@ -9396,7 +9679,7 @@ var __async$5 = (__this, __arguments, generator) => {
|
|
|
9396
9679
|
const useCreateWarehouse = () => {
|
|
9397
9680
|
const { client } = useShipEngine();
|
|
9398
9681
|
return useMutation({
|
|
9399
|
-
mutationFn: (data) => __async$
|
|
9682
|
+
mutationFn: (data) => __async$4(void 0, null, function* () {
|
|
9400
9683
|
const result = yield client.warehouses.create(data);
|
|
9401
9684
|
return result.data;
|
|
9402
9685
|
}),
|
|
@@ -9405,7 +9688,7 @@ const useCreateWarehouse = () => {
|
|
|
9405
9688
|
});
|
|
9406
9689
|
};
|
|
9407
9690
|
|
|
9408
|
-
var __async$
|
|
9691
|
+
var __async$3 = (__this, __arguments, generator) => {
|
|
9409
9692
|
return new Promise((resolve, reject) => {
|
|
9410
9693
|
var fulfilled = (value) => {
|
|
9411
9694
|
try {
|
|
@@ -9428,7 +9711,7 @@ var __async$4 = (__this, __arguments, generator) => {
|
|
|
9428
9711
|
const useDeleteWarehouse = () => {
|
|
9429
9712
|
const { client } = useShipEngine();
|
|
9430
9713
|
return useMutation({
|
|
9431
|
-
mutationFn: (_0) => __async$
|
|
9714
|
+
mutationFn: (_0) => __async$3(void 0, [_0], function* ({ warehouseId }) {
|
|
9432
9715
|
const result = yield client.warehouses.delete(warehouseId);
|
|
9433
9716
|
return result.data;
|
|
9434
9717
|
}),
|
|
@@ -9449,22 +9732,22 @@ const useListWarehouses = (options) => {
|
|
|
9449
9732
|
});
|
|
9450
9733
|
};
|
|
9451
9734
|
|
|
9452
|
-
var __getOwnPropSymbols$
|
|
9453
|
-
var __hasOwnProp$
|
|
9454
|
-
var __propIsEnum$
|
|
9735
|
+
var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
|
|
9736
|
+
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
|
|
9737
|
+
var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
|
|
9455
9738
|
var __objRest$1 = (source, exclude) => {
|
|
9456
9739
|
var target = {};
|
|
9457
9740
|
for (var prop in source)
|
|
9458
|
-
if (__hasOwnProp$
|
|
9741
|
+
if (__hasOwnProp$1.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
9459
9742
|
target[prop] = source[prop];
|
|
9460
|
-
if (source != null && __getOwnPropSymbols$
|
|
9461
|
-
for (var prop of __getOwnPropSymbols$
|
|
9462
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
9743
|
+
if (source != null && __getOwnPropSymbols$1)
|
|
9744
|
+
for (var prop of __getOwnPropSymbols$1(source)) {
|
|
9745
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$1.call(source, prop))
|
|
9463
9746
|
target[prop] = source[prop];
|
|
9464
9747
|
}
|
|
9465
9748
|
return target;
|
|
9466
9749
|
};
|
|
9467
|
-
var __async$
|
|
9750
|
+
var __async$2 = (__this, __arguments, generator) => {
|
|
9468
9751
|
return new Promise((resolve, reject) => {
|
|
9469
9752
|
var fulfilled = (value) => {
|
|
9470
9753
|
try {
|
|
@@ -9487,7 +9770,7 @@ var __async$3 = (__this, __arguments, generator) => {
|
|
|
9487
9770
|
const useUpdateWarehouse = () => {
|
|
9488
9771
|
const { client } = useShipEngine();
|
|
9489
9772
|
return useMutation({
|
|
9490
|
-
mutationFn: (_a) => __async$
|
|
9773
|
+
mutationFn: (_a) => __async$2(void 0, null, function* () {
|
|
9491
9774
|
var _b = _a, { warehouseId } = _b, warehouse = __objRest$1(_b, ["warehouseId"]);
|
|
9492
9775
|
const result = yield client.warehouses.update(warehouseId, warehouse);
|
|
9493
9776
|
return result.data;
|
|
@@ -9497,7 +9780,7 @@ const useUpdateWarehouse = () => {
|
|
|
9497
9780
|
});
|
|
9498
9781
|
};
|
|
9499
9782
|
|
|
9500
|
-
var __async$
|
|
9783
|
+
var __async$1 = (__this, __arguments, generator) => {
|
|
9501
9784
|
return new Promise((resolve, reject) => {
|
|
9502
9785
|
var fulfilled = (value) => {
|
|
9503
9786
|
try {
|
|
@@ -9520,12 +9803,12 @@ var __async$2 = (__this, __arguments, generator) => {
|
|
|
9520
9803
|
const useLoadFonts = ({ cdnURL = "/", scope, theme }) => {
|
|
9521
9804
|
const [fontFamily, setFontFamily] = useState();
|
|
9522
9805
|
useEffect(() => {
|
|
9523
|
-
(() => __async$
|
|
9806
|
+
(() => __async$1(void 0, null, function* () {
|
|
9524
9807
|
var _a;
|
|
9525
9808
|
try {
|
|
9526
9809
|
const fontFaces = (_a = theme == null ? void 0 : theme.fontFaces) != null ? _a : [];
|
|
9527
9810
|
yield Promise.all(
|
|
9528
|
-
fontFaces.map((_0) => __async$
|
|
9811
|
+
fontFaces.map((_0) => __async$1(void 0, [_0], function* ({ family, source, descriptors }) {
|
|
9529
9812
|
const fontSources = source.map((url) => `url(${url.replace("$cdnUrl", cdnURL)})`).join(", ");
|
|
9530
9813
|
try {
|
|
9531
9814
|
const font = new FontFace(family, fontSources, descriptors);
|
|
@@ -9547,7 +9830,7 @@ const useLoadFonts = ({ cdnURL = "/", scope, theme }) => {
|
|
|
9547
9830
|
});
|
|
9548
9831
|
};
|
|
9549
9832
|
|
|
9550
|
-
var __async
|
|
9833
|
+
var __async = (__this, __arguments, generator) => {
|
|
9551
9834
|
return new Promise((resolve, reject) => {
|
|
9552
9835
|
var fulfilled = (value) => {
|
|
9553
9836
|
try {
|
|
@@ -9570,7 +9853,7 @@ var __async$1 = (__this, __arguments, generator) => {
|
|
|
9570
9853
|
const useLoadIcons = ({ brandName, cdnURL = "/" }) => {
|
|
9571
9854
|
const [iconIndex, setIconIndex] = useState();
|
|
9572
9855
|
useEffect(() => {
|
|
9573
|
-
(() => __async
|
|
9856
|
+
(() => __async(void 0, null, function* () {
|
|
9574
9857
|
try {
|
|
9575
9858
|
const result = yield axios.get("/brand/iconIndex.json", { baseURL: cdnURL });
|
|
9576
9859
|
setIconIndex(result.data);
|
|
@@ -9580,7 +9863,7 @@ const useLoadIcons = ({ brandName, cdnURL = "/" }) => {
|
|
|
9580
9863
|
}))();
|
|
9581
9864
|
}, [brandName, cdnURL]);
|
|
9582
9865
|
return useCallback(
|
|
9583
|
-
(iconName) => __async
|
|
9866
|
+
(iconName) => __async(void 0, null, function* () {
|
|
9584
9867
|
if (iconIndex) {
|
|
9585
9868
|
const iconBrand = (iconIndex[iconName.toLowerCase()] || []).includes(brandName) ? brandName : BrandName.FALLBACK;
|
|
9586
9869
|
const result = yield axios.get(
|
|
@@ -9606,39 +9889,7 @@ const useLoadTheme = ({ cdnURL = "/", brandName }) => {
|
|
|
9606
9889
|
return theme;
|
|
9607
9890
|
};
|
|
9608
9891
|
|
|
9609
|
-
var __defProp$2 = Object.defineProperty;
|
|
9610
|
-
var __defProps$1 = Object.defineProperties;
|
|
9611
|
-
var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
|
|
9612
|
-
var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
|
|
9613
|
-
var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
|
|
9614
|
-
var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
|
|
9615
|
-
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9616
|
-
var __spreadValues$2 = (a, b) => {
|
|
9617
|
-
for (var prop in b || (b = {}))
|
|
9618
|
-
if (__hasOwnProp$2.call(b, prop))
|
|
9619
|
-
__defNormalProp$2(a, prop, b[prop]);
|
|
9620
|
-
if (__getOwnPropSymbols$2)
|
|
9621
|
-
for (var prop of __getOwnPropSymbols$2(b)) {
|
|
9622
|
-
if (__propIsEnum$2.call(b, prop))
|
|
9623
|
-
__defNormalProp$2(a, prop, b[prop]);
|
|
9624
|
-
}
|
|
9625
|
-
return a;
|
|
9626
|
-
};
|
|
9627
|
-
var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
|
|
9628
9892
|
const AlchemyContext = createContext(void 0);
|
|
9629
|
-
const renderAlchemyProviders = ({
|
|
9630
|
-
baseURL,
|
|
9631
|
-
children,
|
|
9632
|
-
getToken,
|
|
9633
|
-
theme,
|
|
9634
|
-
scope,
|
|
9635
|
-
fontStyles,
|
|
9636
|
-
iconCache,
|
|
9637
|
-
resolveIcon
|
|
9638
|
-
}) => /* @__PURE__ */ jsxs(ThemeProvider, { theme, children: [
|
|
9639
|
-
/* @__PURE__ */ jsx(Global, { styles: [getEmotionResetStyles(scope), fontStyles] }),
|
|
9640
|
-
/* @__PURE__ */ jsx(GigerConfigProvider, { iconCache, resolveIcon, children: /* @__PURE__ */ jsx(ShipEngine, { baseURL, getToken, children }) })
|
|
9641
|
-
] });
|
|
9642
9893
|
const AlchemyProvider = ({
|
|
9643
9894
|
baseURL = "https://api.shipengine.com",
|
|
9644
9895
|
brandName = BrandName.FALLBACK,
|
|
@@ -9656,7 +9907,10 @@ const AlchemyProvider = ({
|
|
|
9656
9907
|
if (!theme)
|
|
9657
9908
|
return null;
|
|
9658
9909
|
const contextValue = { baseURL, brandName, cdnURL, getToken, locale, onError, scope, theme };
|
|
9659
|
-
return /* @__PURE__ */ jsx(AlchemyContext.Provider, { value: contextValue, children:
|
|
9910
|
+
return /* @__PURE__ */ jsx(AlchemyContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs(ThemeProvider, { theme, children: [
|
|
9911
|
+
/* @__PURE__ */ jsx(Global, { styles: [getEmotionResetStyles(scope), fontStyles] }),
|
|
9912
|
+
/* @__PURE__ */ jsx(GigerConfigProvider, { iconCache, resolveIcon, children: /* @__PURE__ */ jsx(ShipEngine, { baseURL, getToken, children }) })
|
|
9913
|
+
] }) });
|
|
9660
9914
|
};
|
|
9661
9915
|
const useAlchemy = () => {
|
|
9662
9916
|
const context = useContext(AlchemyContext);
|
|
@@ -9666,57 +9920,10 @@ const useAlchemy = () => {
|
|
|
9666
9920
|
return context;
|
|
9667
9921
|
};
|
|
9668
9922
|
|
|
9669
|
-
var __defProp$1 = Object.defineProperty;
|
|
9670
|
-
var __defProps = Object.defineProperties;
|
|
9671
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
9672
|
-
var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
|
|
9673
|
-
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
|
|
9674
|
-
var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
|
|
9675
|
-
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9676
|
-
var __spreadValues$1 = (a, b) => {
|
|
9677
|
-
for (var prop in b || (b = {}))
|
|
9678
|
-
if (__hasOwnProp$1.call(b, prop))
|
|
9679
|
-
__defNormalProp$1(a, prop, b[prop]);
|
|
9680
|
-
if (__getOwnPropSymbols$1)
|
|
9681
|
-
for (var prop of __getOwnPropSymbols$1(b)) {
|
|
9682
|
-
if (__propIsEnum$1.call(b, prop))
|
|
9683
|
-
__defNormalProp$1(a, prop, b[prop]);
|
|
9684
|
-
}
|
|
9685
|
-
return a;
|
|
9686
|
-
};
|
|
9687
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
9688
|
-
var __async = (__this, __arguments, generator) => {
|
|
9689
|
-
return new Promise((resolve, reject) => {
|
|
9690
|
-
var fulfilled = (value) => {
|
|
9691
|
-
try {
|
|
9692
|
-
step(generator.next(value));
|
|
9693
|
-
} catch (e) {
|
|
9694
|
-
reject(e);
|
|
9695
|
-
}
|
|
9696
|
-
};
|
|
9697
|
-
var rejected = (value) => {
|
|
9698
|
-
try {
|
|
9699
|
-
step(generator.throw(value));
|
|
9700
|
-
} catch (e) {
|
|
9701
|
-
reject(e);
|
|
9702
|
-
}
|
|
9703
|
-
};
|
|
9704
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
9705
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
9706
|
-
});
|
|
9707
|
-
};
|
|
9708
9923
|
const AlchemyTestProvider = ({ baseURL, children }) => {
|
|
9709
9924
|
const scope = "lmnt";
|
|
9710
9925
|
const theme = useMemo(() => new Theme(), []);
|
|
9711
|
-
const fontStyles = css({ [`.${scope}`]: { fontFamily: theme.defaultFontFamily } });
|
|
9712
9926
|
const getToken = useCallback(() => "none", []);
|
|
9713
|
-
const iconCache = useMemo(createIconCache, []);
|
|
9714
|
-
const resolveIcon = useCallback(
|
|
9715
|
-
(iconName) => __async(void 0, null, function* () {
|
|
9716
|
-
return `<svg data-svg-id="${iconName}">mock icon-${iconName}</svg>`;
|
|
9717
|
-
}),
|
|
9718
|
-
[]
|
|
9719
|
-
);
|
|
9720
9927
|
const contextValue = {
|
|
9721
9928
|
baseURL,
|
|
9722
9929
|
brandName: BrandName.FALLBACK,
|
|
@@ -9726,7 +9933,7 @@ const AlchemyTestProvider = ({ baseURL, children }) => {
|
|
|
9726
9933
|
scope,
|
|
9727
9934
|
theme
|
|
9728
9935
|
};
|
|
9729
|
-
return /* @__PURE__ */ jsx(AlchemyContext.Provider, { value: contextValue, children:
|
|
9936
|
+
return /* @__PURE__ */ jsx(AlchemyContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(GigerTestProvider, { theme, children: /* @__PURE__ */ jsx(ShipEngine, { baseURL, getToken, children }) }) });
|
|
9730
9937
|
};
|
|
9731
9938
|
|
|
9732
9939
|
var classnamesExports = {};
|
|
@@ -10347,4 +10554,4 @@ const alchemy = {
|
|
|
10347
10554
|
createElement
|
|
10348
10555
|
};
|
|
10349
10556
|
|
|
10350
|
-
export { AccountSettingsAPI, AddressesAPI, AlchemyContext, AlchemyProvider, AlchemyTestProvider, CarriersAPI, CodedError, ConfirmationType, CreditCardVendor, Currency, CustomPackagesAPI, CustomsContentsType, CustomsNonDeliveryType, Element, ElementContainerProvider, ErrorBoundary, FundingSourcesAPI, InsuranceAPI, InsuranceProviderType, LabelsAPI, OrderSourcesAPI, RateCardStatus, RateCardsAPI, RatesAPI, types as SE, SalesOrderShipmentsAPI, SalesOrdersAPI, ShipEngine, ShipEngineAPI, ShipEngineContext, ShipmentsAPI, WarehousesAPI, alchemy, alchemy as default, delay, getEndUserIpAddress, isCodedError, isCodedErrors, logger, memoizedCreateCache, onError,
|
|
10557
|
+
export { AccountSettingsAPI, AddressesAPI, AlchemyContext, AlchemyProvider, AlchemyTestProvider, CarriersAPI, CodedError, ConfirmationType, CreditCardVendor, Currency, CustomPackagesAPI, CustomsContentsType, CustomsNonDeliveryType, Element, ElementContainerProvider, ErrorBoundary, FundingSourcesAPI, InsuranceAPI, InsuranceProviderType, LabelsAPI, OrderSourcesAPI, RateCardStatus, RateCardsAPI, RatesAPI, types as SE, SalesOrderShipmentsAPI, SalesOrdersAPI, ShipEngine, ShipEngineAPI, ShipEngineContext, ShipmentsAPI, WarehousesAPI, alchemy, alchemy as default, delay, getEndUserIpAddress, isCodedError, isCodedErrors, logger, memoizedCreateCache, onError, retryUntil, useAddFunds, useAlchemy, useCalculateRates, useConnectCarrier, useCreateFundingSource, useCreateLabel, useCreateRateCard, useCreateSalesOrderShipment, useCreateShipment, useCreateWarehouse, useDeleteRateCard, useDeleteWarehouse, useDownloadRateCard, useElementContainer, useFundingSourcesAddFunds, useGetAccountSettings, useGetAutoFundingConfiguration, useGetCarrierById, useGetCountriesByCarrier, useGetCurrenciesByCarrier, useGetFundingSourceById, useGetInsuranceAccount, useGetLabel, useGetPackageRatingGroupByCarrier, useGetRateCardById, useGetSalesOrder, useGetSalesOrderShipment, useGetServicesByCarrier, useGetShipment, useGetShipmentRates, useGetWalletHistory, useI18n, useListCarriers, useListCustomPackageTypes, useListFundingSources, useListLabels, useListOrderSources, useListRateCards, useListSalesOrderShipments, useListSalesOrders, useListShipments, useListWarehouses, useLoadFonts, useLoadIcons, useLoadTheme, useNotifySalesOrderShipped, useParseAddress, usePublishRateCard, useRefreshOrderSource, useRefreshOrderSourceAsync, useRegisterCarrier, useShipEngine, useUpdateAccountSettings, useUpdateAutoFunding, useUpdateFundingSource, useUpdateRateCard, useUpdateSalesOrderShipment, useUpdateWarehouse, useUploadRateCard, useValidateAddresses, useVoidLabel };
|