@sp-api-sdk/shipping-api-v1 3.1.4 → 3.1.6
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/dist/cjs/api-model/api/shipping-api.js +0 -15
- package/dist/cjs/api-model/base.js +0 -19
- package/dist/cjs/api-model/common.js +0 -37
- package/dist/cjs/api-model/configuration.js +0 -17
- package/dist/cjs/api-model/models/service-type.js +0 -2
- package/dist/es/api-model/api/shipping-api.js +0 -15
- package/dist/es/api-model/base.js +0 -19
- package/dist/es/api-model/common.js +0 -37
- package/dist/es/api-model/configuration.js +0 -17
- package/dist/es/api-model/models/service-type.js +0 -2
- package/dist/types/api-model/api/shipping-api.d.ts +0 -53
- package/dist/types/api-model/base.d.ts +0 -24
- package/dist/types/api-model/common.d.ts +0 -37
- package/dist/types/api-model/configuration.d.ts +0 -17
- package/dist/types/api-model/models/accepted-rate.d.ts +0 -22
- package/dist/types/api-model/models/account.d.ts +0 -4
- package/dist/types/api-model/models/address.d.ts +0 -24
- package/dist/types/api-model/models/cancel-shipment-response.d.ts +0 -4
- package/dist/types/api-model/models/container-item.d.ts +0 -16
- package/dist/types/api-model/models/container-specification.d.ts +0 -12
- package/dist/types/api-model/models/container.d.ts +0 -23
- package/dist/types/api-model/models/create-shipment-request.d.ts +0 -16
- package/dist/types/api-model/models/create-shipment-response.d.ts +0 -9
- package/dist/types/api-model/models/create-shipment-result.d.ts +0 -6
- package/dist/types/api-model/models/currency.d.ts +0 -6
- package/dist/types/api-model/models/dimensions.d.ts +0 -10
- package/dist/types/api-model/models/event.d.ts +0 -11
- package/dist/types/api-model/models/get-account-response.d.ts +0 -9
- package/dist/types/api-model/models/get-rates-request.d.ts +0 -18
- package/dist/types/api-model/models/get-rates-response.d.ts +0 -9
- package/dist/types/api-model/models/get-rates-result.d.ts +0 -4
- package/dist/types/api-model/models/get-shipment-response.d.ts +0 -9
- package/dist/types/api-model/models/get-tracking-information-response.d.ts +0 -9
- package/dist/types/api-model/models/label-result.d.ts +0 -11
- package/dist/types/api-model/models/label-specification.d.ts +0 -6
- package/dist/types/api-model/models/label.d.ts +0 -9
- package/dist/types/api-model/models/location.d.ts +0 -10
- package/dist/types/api-model/models/model-error.d.ts +0 -8
- package/dist/types/api-model/models/party.d.ts +0 -4
- package/dist/types/api-model/models/purchase-labels-request.d.ts +0 -9
- package/dist/types/api-model/models/purchase-labels-response.d.ts +0 -9
- package/dist/types/api-model/models/purchase-labels-result.d.ts +0 -13
- package/dist/types/api-model/models/purchase-shipment-request.d.ts +0 -28
- package/dist/types/api-model/models/purchase-shipment-response.d.ts +0 -9
- package/dist/types/api-model/models/purchase-shipment-result.d.ts +0 -11
- package/dist/types/api-model/models/rate.d.ts +0 -26
- package/dist/types/api-model/models/retrieve-shipping-label-request.d.ts +0 -7
- package/dist/types/api-model/models/retrieve-shipping-label-response.d.ts +0 -9
- package/dist/types/api-model/models/retrieve-shipping-label-result.d.ts +0 -9
- package/dist/types/api-model/models/service-rate.d.ts +0 -22
- package/dist/types/api-model/models/service-type.d.ts +0 -2
- package/dist/types/api-model/models/shipment.d.ts +0 -28
- package/dist/types/api-model/models/shipping-promise-set.d.ts +0 -12
- package/dist/types/api-model/models/time-range.d.ts +0 -6
- package/dist/types/api-model/models/tracking-information.d.ts +0 -13
- package/dist/types/api-model/models/tracking-summary.d.ts +0 -4
- package/dist/types/api-model/models/weight.d.ts +0 -6
- package/package.json +25 -4
|
@@ -25,7 +25,6 @@ const common_1 = require("../common");
|
|
|
25
25
|
const base_1 = require("../base");
|
|
26
26
|
/**
|
|
27
27
|
* ShippingApi - axios parameter creator
|
|
28
|
-
* @export
|
|
29
28
|
*/
|
|
30
29
|
const ShippingApiAxiosParamCreator = function (configuration) {
|
|
31
30
|
return {
|
|
@@ -299,7 +298,6 @@ const ShippingApiAxiosParamCreator = function (configuration) {
|
|
|
299
298
|
exports.ShippingApiAxiosParamCreator = ShippingApiAxiosParamCreator;
|
|
300
299
|
/**
|
|
301
300
|
* ShippingApi - functional programming interface
|
|
302
|
-
* @export
|
|
303
301
|
*/
|
|
304
302
|
const ShippingApiFp = function (configuration) {
|
|
305
303
|
const localVarAxiosParamCreator = (0, exports.ShippingApiAxiosParamCreator)(configuration);
|
|
@@ -419,7 +417,6 @@ const ShippingApiFp = function (configuration) {
|
|
|
419
417
|
exports.ShippingApiFp = ShippingApiFp;
|
|
420
418
|
/**
|
|
421
419
|
* ShippingApi - factory interface
|
|
422
|
-
* @export
|
|
423
420
|
*/
|
|
424
421
|
const ShippingApiFactory = function (configuration, basePath, axios) {
|
|
425
422
|
const localVarFp = (0, exports.ShippingApiFp)(configuration);
|
|
@@ -509,9 +506,6 @@ const ShippingApiFactory = function (configuration, basePath, axios) {
|
|
|
509
506
|
exports.ShippingApiFactory = ShippingApiFactory;
|
|
510
507
|
/**
|
|
511
508
|
* ShippingApi - object-oriented interface
|
|
512
|
-
* @export
|
|
513
|
-
* @class ShippingApi
|
|
514
|
-
* @extends {BaseAPI}
|
|
515
509
|
*/
|
|
516
510
|
class ShippingApi extends base_1.BaseAPI {
|
|
517
511
|
/**
|
|
@@ -519,7 +513,6 @@ class ShippingApi extends base_1.BaseAPI {
|
|
|
519
513
|
* @param {ShippingApiCancelShipmentRequest} requestParameters Request parameters.
|
|
520
514
|
* @param {*} [options] Override http request option.
|
|
521
515
|
* @throws {RequiredError}
|
|
522
|
-
* @memberof ShippingApi
|
|
523
516
|
*/
|
|
524
517
|
cancelShipment(requestParameters, options) {
|
|
525
518
|
return (0, exports.ShippingApiFp)(this.configuration).cancelShipment(requestParameters.shipmentId, options).then((request) => request(this.axios, this.basePath));
|
|
@@ -529,7 +522,6 @@ class ShippingApi extends base_1.BaseAPI {
|
|
|
529
522
|
* @param {ShippingApiCreateShipmentRequest} requestParameters Request parameters.
|
|
530
523
|
* @param {*} [options] Override http request option.
|
|
531
524
|
* @throws {RequiredError}
|
|
532
|
-
* @memberof ShippingApi
|
|
533
525
|
*/
|
|
534
526
|
createShipment(requestParameters, options) {
|
|
535
527
|
return (0, exports.ShippingApiFp)(this.configuration).createShipment(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
|
|
@@ -538,7 +530,6 @@ class ShippingApi extends base_1.BaseAPI {
|
|
|
538
530
|
* Verify if the current account is valid. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
|
|
539
531
|
* @param {*} [options] Override http request option.
|
|
540
532
|
* @throws {RequiredError}
|
|
541
|
-
* @memberof ShippingApi
|
|
542
533
|
*/
|
|
543
534
|
getAccount(options) {
|
|
544
535
|
return (0, exports.ShippingApiFp)(this.configuration).getAccount(options).then((request) => request(this.axios, this.basePath));
|
|
@@ -548,7 +539,6 @@ class ShippingApi extends base_1.BaseAPI {
|
|
|
548
539
|
* @param {ShippingApiGetRatesRequest} requestParameters Request parameters.
|
|
549
540
|
* @param {*} [options] Override http request option.
|
|
550
541
|
* @throws {RequiredError}
|
|
551
|
-
* @memberof ShippingApi
|
|
552
542
|
*/
|
|
553
543
|
getRates(requestParameters, options) {
|
|
554
544
|
return (0, exports.ShippingApiFp)(this.configuration).getRates(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
|
|
@@ -558,7 +548,6 @@ class ShippingApi extends base_1.BaseAPI {
|
|
|
558
548
|
* @param {ShippingApiGetShipmentRequest} requestParameters Request parameters.
|
|
559
549
|
* @param {*} [options] Override http request option.
|
|
560
550
|
* @throws {RequiredError}
|
|
561
|
-
* @memberof ShippingApi
|
|
562
551
|
*/
|
|
563
552
|
getShipment(requestParameters, options) {
|
|
564
553
|
return (0, exports.ShippingApiFp)(this.configuration).getShipment(requestParameters.shipmentId, options).then((request) => request(this.axios, this.basePath));
|
|
@@ -568,7 +557,6 @@ class ShippingApi extends base_1.BaseAPI {
|
|
|
568
557
|
* @param {ShippingApiGetTrackingInformationRequest} requestParameters Request parameters.
|
|
569
558
|
* @param {*} [options] Override http request option.
|
|
570
559
|
* @throws {RequiredError}
|
|
571
|
-
* @memberof ShippingApi
|
|
572
560
|
*/
|
|
573
561
|
getTrackingInformation(requestParameters, options) {
|
|
574
562
|
return (0, exports.ShippingApiFp)(this.configuration).getTrackingInformation(requestParameters.trackingId, options).then((request) => request(this.axios, this.basePath));
|
|
@@ -578,7 +566,6 @@ class ShippingApi extends base_1.BaseAPI {
|
|
|
578
566
|
* @param {ShippingApiPurchaseLabelsRequest} requestParameters Request parameters.
|
|
579
567
|
* @param {*} [options] Override http request option.
|
|
580
568
|
* @throws {RequiredError}
|
|
581
|
-
* @memberof ShippingApi
|
|
582
569
|
*/
|
|
583
570
|
purchaseLabels(requestParameters, options) {
|
|
584
571
|
return (0, exports.ShippingApiFp)(this.configuration).purchaseLabels(requestParameters.shipmentId, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
|
|
@@ -588,7 +575,6 @@ class ShippingApi extends base_1.BaseAPI {
|
|
|
588
575
|
* @param {ShippingApiPurchaseShipmentRequest} requestParameters Request parameters.
|
|
589
576
|
* @param {*} [options] Override http request option.
|
|
590
577
|
* @throws {RequiredError}
|
|
591
|
-
* @memberof ShippingApi
|
|
592
578
|
*/
|
|
593
579
|
purchaseShipment(requestParameters, options) {
|
|
594
580
|
return (0, exports.ShippingApiFp)(this.configuration).purchaseShipment(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
|
|
@@ -598,7 +584,6 @@ class ShippingApi extends base_1.BaseAPI {
|
|
|
598
584
|
* @param {ShippingApiRetrieveShippingLabelRequest} requestParameters Request parameters.
|
|
599
585
|
* @param {*} [options] Override http request option.
|
|
600
586
|
* @throws {RequiredError}
|
|
601
|
-
* @memberof ShippingApi
|
|
602
587
|
*/
|
|
603
588
|
retrieveShippingLabel(requestParameters, options) {
|
|
604
589
|
return (0, exports.ShippingApiFp)(this.configuration).retrieveShippingLabel(requestParameters.shipmentId, requestParameters.trackingId, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
|
|
@@ -19,21 +19,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
19
19
|
exports.operationServerMap = exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
|
|
20
20
|
const axios_1 = __importDefault(require("axios"));
|
|
21
21
|
exports.BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
24
|
-
* @export
|
|
25
|
-
*/
|
|
26
22
|
exports.COLLECTION_FORMATS = {
|
|
27
23
|
csv: ",",
|
|
28
24
|
ssv: " ",
|
|
29
25
|
tsv: "\t",
|
|
30
26
|
pipes: "|",
|
|
31
27
|
};
|
|
32
|
-
/**
|
|
33
|
-
*
|
|
34
|
-
* @export
|
|
35
|
-
* @class BaseAPI
|
|
36
|
-
*/
|
|
37
28
|
class BaseAPI {
|
|
38
29
|
basePath;
|
|
39
30
|
axios;
|
|
@@ -49,12 +40,6 @@ class BaseAPI {
|
|
|
49
40
|
}
|
|
50
41
|
exports.BaseAPI = BaseAPI;
|
|
51
42
|
;
|
|
52
|
-
/**
|
|
53
|
-
*
|
|
54
|
-
* @export
|
|
55
|
-
* @class RequiredError
|
|
56
|
-
* @extends {Error}
|
|
57
|
-
*/
|
|
58
43
|
class RequiredError extends Error {
|
|
59
44
|
field;
|
|
60
45
|
constructor(field, msg) {
|
|
@@ -64,8 +49,4 @@ class RequiredError extends Error {
|
|
|
64
49
|
}
|
|
65
50
|
}
|
|
66
51
|
exports.RequiredError = RequiredError;
|
|
67
|
-
/**
|
|
68
|
-
*
|
|
69
|
-
* @export
|
|
70
|
-
*/
|
|
71
52
|
exports.operationServerMap = {};
|
|
@@ -15,15 +15,10 @@
|
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
|
|
17
17
|
const base_1 = require("./base");
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
* @export
|
|
21
|
-
*/
|
|
22
18
|
exports.DUMMY_BASE_URL = 'https://example.com';
|
|
23
19
|
/**
|
|
24
20
|
*
|
|
25
21
|
* @throws {RequiredError}
|
|
26
|
-
* @export
|
|
27
22
|
*/
|
|
28
23
|
const assertParamExists = function (functionName, paramName, paramValue) {
|
|
29
24
|
if (paramValue === null || paramValue === undefined) {
|
|
@@ -31,10 +26,6 @@ const assertParamExists = function (functionName, paramName, paramValue) {
|
|
|
31
26
|
}
|
|
32
27
|
};
|
|
33
28
|
exports.assertParamExists = assertParamExists;
|
|
34
|
-
/**
|
|
35
|
-
*
|
|
36
|
-
* @export
|
|
37
|
-
*/
|
|
38
29
|
const setApiKeyToObject = async function (object, keyParamName, configuration) {
|
|
39
30
|
if (configuration && configuration.apiKey) {
|
|
40
31
|
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
|
|
@@ -44,20 +35,12 @@ const setApiKeyToObject = async function (object, keyParamName, configuration) {
|
|
|
44
35
|
}
|
|
45
36
|
};
|
|
46
37
|
exports.setApiKeyToObject = setApiKeyToObject;
|
|
47
|
-
/**
|
|
48
|
-
*
|
|
49
|
-
* @export
|
|
50
|
-
*/
|
|
51
38
|
const setBasicAuthToObject = function (object, configuration) {
|
|
52
39
|
if (configuration && (configuration.username || configuration.password)) {
|
|
53
40
|
object["auth"] = { username: configuration.username, password: configuration.password };
|
|
54
41
|
}
|
|
55
42
|
};
|
|
56
43
|
exports.setBasicAuthToObject = setBasicAuthToObject;
|
|
57
|
-
/**
|
|
58
|
-
*
|
|
59
|
-
* @export
|
|
60
|
-
*/
|
|
61
44
|
const setBearerAuthToObject = async function (object, configuration) {
|
|
62
45
|
if (configuration && configuration.accessToken) {
|
|
63
46
|
const accessToken = typeof configuration.accessToken === 'function'
|
|
@@ -67,10 +50,6 @@ const setBearerAuthToObject = async function (object, configuration) {
|
|
|
67
50
|
}
|
|
68
51
|
};
|
|
69
52
|
exports.setBearerAuthToObject = setBearerAuthToObject;
|
|
70
|
-
/**
|
|
71
|
-
*
|
|
72
|
-
* @export
|
|
73
|
-
*/
|
|
74
53
|
const setOAuthToObject = async function (object, name, scopes, configuration) {
|
|
75
54
|
if (configuration && configuration.accessToken) {
|
|
76
55
|
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
|
|
@@ -100,20 +79,12 @@ function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
|
|
|
100
79
|
}
|
|
101
80
|
}
|
|
102
81
|
}
|
|
103
|
-
/**
|
|
104
|
-
*
|
|
105
|
-
* @export
|
|
106
|
-
*/
|
|
107
82
|
const setSearchParams = function (url, ...objects) {
|
|
108
83
|
const searchParams = new URLSearchParams(url.search);
|
|
109
84
|
setFlattenedQueryParams(searchParams, objects);
|
|
110
85
|
url.search = searchParams.toString();
|
|
111
86
|
};
|
|
112
87
|
exports.setSearchParams = setSearchParams;
|
|
113
|
-
/**
|
|
114
|
-
*
|
|
115
|
-
* @export
|
|
116
|
-
*/
|
|
117
88
|
const serializeDataIfNeeded = function (value, requestOptions, configuration) {
|
|
118
89
|
const nonString = typeof value !== 'string';
|
|
119
90
|
const needsSerialization = nonString && configuration && configuration.isJsonMime
|
|
@@ -124,18 +95,10 @@ const serializeDataIfNeeded = function (value, requestOptions, configuration) {
|
|
|
124
95
|
: (value || "");
|
|
125
96
|
};
|
|
126
97
|
exports.serializeDataIfNeeded = serializeDataIfNeeded;
|
|
127
|
-
/**
|
|
128
|
-
*
|
|
129
|
-
* @export
|
|
130
|
-
*/
|
|
131
98
|
const toPathString = function (url) {
|
|
132
99
|
return url.pathname + url.search + url.hash;
|
|
133
100
|
};
|
|
134
101
|
exports.toPathString = toPathString;
|
|
135
|
-
/**
|
|
136
|
-
*
|
|
137
|
-
* @export
|
|
138
|
-
*/
|
|
139
102
|
const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
|
|
140
103
|
return (axios = globalAxios, basePath = BASE_PATH) => {
|
|
141
104
|
const axiosRequestArgs = { ...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url };
|
|
@@ -18,49 +18,32 @@ class Configuration {
|
|
|
18
18
|
/**
|
|
19
19
|
* parameter for apiKey security
|
|
20
20
|
* @param name security name
|
|
21
|
-
* @memberof Configuration
|
|
22
21
|
*/
|
|
23
22
|
apiKey;
|
|
24
23
|
/**
|
|
25
24
|
* parameter for basic security
|
|
26
|
-
*
|
|
27
|
-
* @type {string}
|
|
28
|
-
* @memberof Configuration
|
|
29
25
|
*/
|
|
30
26
|
username;
|
|
31
27
|
/**
|
|
32
28
|
* parameter for basic security
|
|
33
|
-
*
|
|
34
|
-
* @type {string}
|
|
35
|
-
* @memberof Configuration
|
|
36
29
|
*/
|
|
37
30
|
password;
|
|
38
31
|
/**
|
|
39
32
|
* parameter for oauth2 security
|
|
40
33
|
* @param name security name
|
|
41
34
|
* @param scopes oauth2 scope
|
|
42
|
-
* @memberof Configuration
|
|
43
35
|
*/
|
|
44
36
|
accessToken;
|
|
45
37
|
/**
|
|
46
38
|
* override base path
|
|
47
|
-
*
|
|
48
|
-
* @type {string}
|
|
49
|
-
* @memberof Configuration
|
|
50
39
|
*/
|
|
51
40
|
basePath;
|
|
52
41
|
/**
|
|
53
42
|
* override server index
|
|
54
|
-
*
|
|
55
|
-
* @type {number}
|
|
56
|
-
* @memberof Configuration
|
|
57
43
|
*/
|
|
58
44
|
serverIndex;
|
|
59
45
|
/**
|
|
60
46
|
* base options for axios calls
|
|
61
|
-
*
|
|
62
|
-
* @type {any}
|
|
63
|
-
* @memberof Configuration
|
|
64
47
|
*/
|
|
65
48
|
baseOptions;
|
|
66
49
|
/**
|
|
@@ -16,8 +16,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
16
16
|
exports.ServiceType = void 0;
|
|
17
17
|
/**
|
|
18
18
|
* The type of shipping service that will be used for the service offering.
|
|
19
|
-
* @export
|
|
20
|
-
* @enum {string}
|
|
21
19
|
*/
|
|
22
20
|
exports.ServiceType = {
|
|
23
21
|
AmazonShippingGround: 'Amazon Shipping Ground',
|
|
@@ -19,7 +19,6 @@ import { DUMMY_BASE_URL, assertParamExists, setSearchParams, serializeDataIfNeed
|
|
|
19
19
|
import { BASE_PATH, BaseAPI, operationServerMap } from '../base';
|
|
20
20
|
/**
|
|
21
21
|
* ShippingApi - axios parameter creator
|
|
22
|
-
* @export
|
|
23
22
|
*/
|
|
24
23
|
export const ShippingApiAxiosParamCreator = function (configuration) {
|
|
25
24
|
return {
|
|
@@ -292,7 +291,6 @@ export const ShippingApiAxiosParamCreator = function (configuration) {
|
|
|
292
291
|
};
|
|
293
292
|
/**
|
|
294
293
|
* ShippingApi - functional programming interface
|
|
295
|
-
* @export
|
|
296
294
|
*/
|
|
297
295
|
export const ShippingApiFp = function (configuration) {
|
|
298
296
|
const localVarAxiosParamCreator = ShippingApiAxiosParamCreator(configuration);
|
|
@@ -411,7 +409,6 @@ export const ShippingApiFp = function (configuration) {
|
|
|
411
409
|
};
|
|
412
410
|
/**
|
|
413
411
|
* ShippingApi - factory interface
|
|
414
|
-
* @export
|
|
415
412
|
*/
|
|
416
413
|
export const ShippingApiFactory = function (configuration, basePath, axios) {
|
|
417
414
|
const localVarFp = ShippingApiFp(configuration);
|
|
@@ -500,9 +497,6 @@ export const ShippingApiFactory = function (configuration, basePath, axios) {
|
|
|
500
497
|
};
|
|
501
498
|
/**
|
|
502
499
|
* ShippingApi - object-oriented interface
|
|
503
|
-
* @export
|
|
504
|
-
* @class ShippingApi
|
|
505
|
-
* @extends {BaseAPI}
|
|
506
500
|
*/
|
|
507
501
|
export class ShippingApi extends BaseAPI {
|
|
508
502
|
/**
|
|
@@ -510,7 +504,6 @@ export class ShippingApi extends BaseAPI {
|
|
|
510
504
|
* @param {ShippingApiCancelShipmentRequest} requestParameters Request parameters.
|
|
511
505
|
* @param {*} [options] Override http request option.
|
|
512
506
|
* @throws {RequiredError}
|
|
513
|
-
* @memberof ShippingApi
|
|
514
507
|
*/
|
|
515
508
|
cancelShipment(requestParameters, options) {
|
|
516
509
|
return ShippingApiFp(this.configuration).cancelShipment(requestParameters.shipmentId, options).then((request) => request(this.axios, this.basePath));
|
|
@@ -520,7 +513,6 @@ export class ShippingApi extends BaseAPI {
|
|
|
520
513
|
* @param {ShippingApiCreateShipmentRequest} requestParameters Request parameters.
|
|
521
514
|
* @param {*} [options] Override http request option.
|
|
522
515
|
* @throws {RequiredError}
|
|
523
|
-
* @memberof ShippingApi
|
|
524
516
|
*/
|
|
525
517
|
createShipment(requestParameters, options) {
|
|
526
518
|
return ShippingApiFp(this.configuration).createShipment(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
|
|
@@ -529,7 +521,6 @@ export class ShippingApi extends BaseAPI {
|
|
|
529
521
|
* Verify if the current account is valid. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
|
|
530
522
|
* @param {*} [options] Override http request option.
|
|
531
523
|
* @throws {RequiredError}
|
|
532
|
-
* @memberof ShippingApi
|
|
533
524
|
*/
|
|
534
525
|
getAccount(options) {
|
|
535
526
|
return ShippingApiFp(this.configuration).getAccount(options).then((request) => request(this.axios, this.basePath));
|
|
@@ -539,7 +530,6 @@ export class ShippingApi extends BaseAPI {
|
|
|
539
530
|
* @param {ShippingApiGetRatesRequest} requestParameters Request parameters.
|
|
540
531
|
* @param {*} [options] Override http request option.
|
|
541
532
|
* @throws {RequiredError}
|
|
542
|
-
* @memberof ShippingApi
|
|
543
533
|
*/
|
|
544
534
|
getRates(requestParameters, options) {
|
|
545
535
|
return ShippingApiFp(this.configuration).getRates(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
|
|
@@ -549,7 +539,6 @@ export class ShippingApi extends BaseAPI {
|
|
|
549
539
|
* @param {ShippingApiGetShipmentRequest} requestParameters Request parameters.
|
|
550
540
|
* @param {*} [options] Override http request option.
|
|
551
541
|
* @throws {RequiredError}
|
|
552
|
-
* @memberof ShippingApi
|
|
553
542
|
*/
|
|
554
543
|
getShipment(requestParameters, options) {
|
|
555
544
|
return ShippingApiFp(this.configuration).getShipment(requestParameters.shipmentId, options).then((request) => request(this.axios, this.basePath));
|
|
@@ -559,7 +548,6 @@ export class ShippingApi extends BaseAPI {
|
|
|
559
548
|
* @param {ShippingApiGetTrackingInformationRequest} requestParameters Request parameters.
|
|
560
549
|
* @param {*} [options] Override http request option.
|
|
561
550
|
* @throws {RequiredError}
|
|
562
|
-
* @memberof ShippingApi
|
|
563
551
|
*/
|
|
564
552
|
getTrackingInformation(requestParameters, options) {
|
|
565
553
|
return ShippingApiFp(this.configuration).getTrackingInformation(requestParameters.trackingId, options).then((request) => request(this.axios, this.basePath));
|
|
@@ -569,7 +557,6 @@ export class ShippingApi extends BaseAPI {
|
|
|
569
557
|
* @param {ShippingApiPurchaseLabelsRequest} requestParameters Request parameters.
|
|
570
558
|
* @param {*} [options] Override http request option.
|
|
571
559
|
* @throws {RequiredError}
|
|
572
|
-
* @memberof ShippingApi
|
|
573
560
|
*/
|
|
574
561
|
purchaseLabels(requestParameters, options) {
|
|
575
562
|
return ShippingApiFp(this.configuration).purchaseLabels(requestParameters.shipmentId, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
|
|
@@ -579,7 +566,6 @@ export class ShippingApi extends BaseAPI {
|
|
|
579
566
|
* @param {ShippingApiPurchaseShipmentRequest} requestParameters Request parameters.
|
|
580
567
|
* @param {*} [options] Override http request option.
|
|
581
568
|
* @throws {RequiredError}
|
|
582
|
-
* @memberof ShippingApi
|
|
583
569
|
*/
|
|
584
570
|
purchaseShipment(requestParameters, options) {
|
|
585
571
|
return ShippingApiFp(this.configuration).purchaseShipment(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
|
|
@@ -589,7 +575,6 @@ export class ShippingApi extends BaseAPI {
|
|
|
589
575
|
* @param {ShippingApiRetrieveShippingLabelRequest} requestParameters Request parameters.
|
|
590
576
|
* @param {*} [options] Override http request option.
|
|
591
577
|
* @throws {RequiredError}
|
|
592
|
-
* @memberof ShippingApi
|
|
593
578
|
*/
|
|
594
579
|
retrieveShippingLabel(requestParameters, options) {
|
|
595
580
|
return ShippingApiFp(this.configuration).retrieveShippingLabel(requestParameters.shipmentId, requestParameters.trackingId, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
|
|
@@ -13,21 +13,12 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import globalAxios from 'axios';
|
|
15
15
|
export const BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
|
|
16
|
-
/**
|
|
17
|
-
*
|
|
18
|
-
* @export
|
|
19
|
-
*/
|
|
20
16
|
export const COLLECTION_FORMATS = {
|
|
21
17
|
csv: ",",
|
|
22
18
|
ssv: " ",
|
|
23
19
|
tsv: "\t",
|
|
24
20
|
pipes: "|",
|
|
25
21
|
};
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
* @export
|
|
29
|
-
* @class BaseAPI
|
|
30
|
-
*/
|
|
31
22
|
export class BaseAPI {
|
|
32
23
|
basePath;
|
|
33
24
|
axios;
|
|
@@ -42,12 +33,6 @@ export class BaseAPI {
|
|
|
42
33
|
}
|
|
43
34
|
}
|
|
44
35
|
;
|
|
45
|
-
/**
|
|
46
|
-
*
|
|
47
|
-
* @export
|
|
48
|
-
* @class RequiredError
|
|
49
|
-
* @extends {Error}
|
|
50
|
-
*/
|
|
51
36
|
export class RequiredError extends Error {
|
|
52
37
|
field;
|
|
53
38
|
constructor(field, msg) {
|
|
@@ -56,8 +41,4 @@ export class RequiredError extends Error {
|
|
|
56
41
|
this.name = "RequiredError";
|
|
57
42
|
}
|
|
58
43
|
}
|
|
59
|
-
/**
|
|
60
|
-
*
|
|
61
|
-
* @export
|
|
62
|
-
*/
|
|
63
44
|
export const operationServerMap = {};
|
|
@@ -12,25 +12,16 @@
|
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
14
|
import { RequiredError } from "./base";
|
|
15
|
-
/**
|
|
16
|
-
*
|
|
17
|
-
* @export
|
|
18
|
-
*/
|
|
19
15
|
export const DUMMY_BASE_URL = 'https://example.com';
|
|
20
16
|
/**
|
|
21
17
|
*
|
|
22
18
|
* @throws {RequiredError}
|
|
23
|
-
* @export
|
|
24
19
|
*/
|
|
25
20
|
export const assertParamExists = function (functionName, paramName, paramValue) {
|
|
26
21
|
if (paramValue === null || paramValue === undefined) {
|
|
27
22
|
throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
|
|
28
23
|
}
|
|
29
24
|
};
|
|
30
|
-
/**
|
|
31
|
-
*
|
|
32
|
-
* @export
|
|
33
|
-
*/
|
|
34
25
|
export const setApiKeyToObject = async function (object, keyParamName, configuration) {
|
|
35
26
|
if (configuration && configuration.apiKey) {
|
|
36
27
|
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
|
|
@@ -39,19 +30,11 @@ export const setApiKeyToObject = async function (object, keyParamName, configura
|
|
|
39
30
|
object[keyParamName] = localVarApiKeyValue;
|
|
40
31
|
}
|
|
41
32
|
};
|
|
42
|
-
/**
|
|
43
|
-
*
|
|
44
|
-
* @export
|
|
45
|
-
*/
|
|
46
33
|
export const setBasicAuthToObject = function (object, configuration) {
|
|
47
34
|
if (configuration && (configuration.username || configuration.password)) {
|
|
48
35
|
object["auth"] = { username: configuration.username, password: configuration.password };
|
|
49
36
|
}
|
|
50
37
|
};
|
|
51
|
-
/**
|
|
52
|
-
*
|
|
53
|
-
* @export
|
|
54
|
-
*/
|
|
55
38
|
export const setBearerAuthToObject = async function (object, configuration) {
|
|
56
39
|
if (configuration && configuration.accessToken) {
|
|
57
40
|
const accessToken = typeof configuration.accessToken === 'function'
|
|
@@ -60,10 +43,6 @@ export const setBearerAuthToObject = async function (object, configuration) {
|
|
|
60
43
|
object["Authorization"] = "Bearer " + accessToken;
|
|
61
44
|
}
|
|
62
45
|
};
|
|
63
|
-
/**
|
|
64
|
-
*
|
|
65
|
-
* @export
|
|
66
|
-
*/
|
|
67
46
|
export const setOAuthToObject = async function (object, name, scopes, configuration) {
|
|
68
47
|
if (configuration && configuration.accessToken) {
|
|
69
48
|
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
|
|
@@ -92,19 +71,11 @@ function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
|
|
|
92
71
|
}
|
|
93
72
|
}
|
|
94
73
|
}
|
|
95
|
-
/**
|
|
96
|
-
*
|
|
97
|
-
* @export
|
|
98
|
-
*/
|
|
99
74
|
export const setSearchParams = function (url, ...objects) {
|
|
100
75
|
const searchParams = new URLSearchParams(url.search);
|
|
101
76
|
setFlattenedQueryParams(searchParams, objects);
|
|
102
77
|
url.search = searchParams.toString();
|
|
103
78
|
};
|
|
104
|
-
/**
|
|
105
|
-
*
|
|
106
|
-
* @export
|
|
107
|
-
*/
|
|
108
79
|
export const serializeDataIfNeeded = function (value, requestOptions, configuration) {
|
|
109
80
|
const nonString = typeof value !== 'string';
|
|
110
81
|
const needsSerialization = nonString && configuration && configuration.isJsonMime
|
|
@@ -114,17 +85,9 @@ export const serializeDataIfNeeded = function (value, requestOptions, configurat
|
|
|
114
85
|
? JSON.stringify(value !== undefined ? value : {})
|
|
115
86
|
: (value || "");
|
|
116
87
|
};
|
|
117
|
-
/**
|
|
118
|
-
*
|
|
119
|
-
* @export
|
|
120
|
-
*/
|
|
121
88
|
export const toPathString = function (url) {
|
|
122
89
|
return url.pathname + url.search + url.hash;
|
|
123
90
|
};
|
|
124
|
-
/**
|
|
125
|
-
*
|
|
126
|
-
* @export
|
|
127
|
-
*/
|
|
128
91
|
export const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
|
|
129
92
|
return (axios = globalAxios, basePath = BASE_PATH) => {
|
|
130
93
|
const axiosRequestArgs = { ...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url };
|
|
@@ -15,49 +15,32 @@ export class Configuration {
|
|
|
15
15
|
/**
|
|
16
16
|
* parameter for apiKey security
|
|
17
17
|
* @param name security name
|
|
18
|
-
* @memberof Configuration
|
|
19
18
|
*/
|
|
20
19
|
apiKey;
|
|
21
20
|
/**
|
|
22
21
|
* parameter for basic security
|
|
23
|
-
*
|
|
24
|
-
* @type {string}
|
|
25
|
-
* @memberof Configuration
|
|
26
22
|
*/
|
|
27
23
|
username;
|
|
28
24
|
/**
|
|
29
25
|
* parameter for basic security
|
|
30
|
-
*
|
|
31
|
-
* @type {string}
|
|
32
|
-
* @memberof Configuration
|
|
33
26
|
*/
|
|
34
27
|
password;
|
|
35
28
|
/**
|
|
36
29
|
* parameter for oauth2 security
|
|
37
30
|
* @param name security name
|
|
38
31
|
* @param scopes oauth2 scope
|
|
39
|
-
* @memberof Configuration
|
|
40
32
|
*/
|
|
41
33
|
accessToken;
|
|
42
34
|
/**
|
|
43
35
|
* override base path
|
|
44
|
-
*
|
|
45
|
-
* @type {string}
|
|
46
|
-
* @memberof Configuration
|
|
47
36
|
*/
|
|
48
37
|
basePath;
|
|
49
38
|
/**
|
|
50
39
|
* override server index
|
|
51
|
-
*
|
|
52
|
-
* @type {number}
|
|
53
|
-
* @memberof Configuration
|
|
54
40
|
*/
|
|
55
41
|
serverIndex;
|
|
56
42
|
/**
|
|
57
43
|
* base options for axios calls
|
|
58
|
-
*
|
|
59
|
-
* @type {any}
|
|
60
|
-
* @memberof Configuration
|
|
61
44
|
*/
|
|
62
45
|
baseOptions;
|
|
63
46
|
/**
|