@sp-api-sdk/vendor-shipments-api-v1 1.6.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +58 -0
  3. package/dist/cjs/index.js +6 -0
  4. package/dist/cjs/src/api-model/api/vendor-shipping-api.js +119 -0
  5. package/dist/cjs/src/api-model/api.js +17 -0
  6. package/dist/cjs/src/api-model/base.js +62 -0
  7. package/dist/cjs/src/api-model/common.js +137 -0
  8. package/dist/cjs/src/api-model/configuration.js +42 -0
  9. package/dist/cjs/src/api-model/index.js +19 -0
  10. package/dist/cjs/src/api-model/models/address.js +15 -0
  11. package/dist/cjs/src/api-model/models/carton-reference-details.js +15 -0
  12. package/dist/cjs/src/api-model/models/carton.js +15 -0
  13. package/dist/cjs/src/api-model/models/container-identification.js +28 -0
  14. package/dist/cjs/src/api-model/models/container-item.js +15 -0
  15. package/dist/cjs/src/api-model/models/dimensions.js +27 -0
  16. package/dist/cjs/src/api-model/models/duration.js +25 -0
  17. package/dist/cjs/src/api-model/models/expiry.js +15 -0
  18. package/dist/cjs/src/api-model/models/import-details.js +29 -0
  19. package/dist/cjs/src/api-model/models/index.js +31 -0
  20. package/dist/cjs/src/api-model/models/item-details.js +27 -0
  21. package/dist/cjs/src/api-model/models/item-quantity.js +25 -0
  22. package/dist/cjs/src/api-model/models/item.js +15 -0
  23. package/dist/cjs/src/api-model/models/location.js +15 -0
  24. package/dist/cjs/src/api-model/models/model-error.js +15 -0
  25. package/dist/cjs/src/api-model/models/money.js +15 -0
  26. package/dist/cjs/src/api-model/models/pallet.js +15 -0
  27. package/dist/cjs/src/api-model/models/party-identification.js +15 -0
  28. package/dist/cjs/src/api-model/models/route.js +15 -0
  29. package/dist/cjs/src/api-model/models/shipment-confirmation.js +49 -0
  30. package/dist/cjs/src/api-model/models/shipment-measurements.js +15 -0
  31. package/dist/cjs/src/api-model/models/stop.js +26 -0
  32. package/dist/cjs/src/api-model/models/submit-shipment-confirmations-request.js +15 -0
  33. package/dist/cjs/src/api-model/models/submit-shipment-confirmations-response.js +15 -0
  34. package/dist/cjs/src/api-model/models/tax-registration-details.js +25 -0
  35. package/dist/cjs/src/api-model/models/transaction-reference.js +15 -0
  36. package/dist/cjs/src/api-model/models/transportation-details.js +26 -0
  37. package/dist/cjs/src/api-model/models/volume.js +27 -0
  38. package/dist/cjs/src/api-model/models/weight.js +27 -0
  39. package/dist/cjs/src/client.js +35 -0
  40. package/dist/cjs/src/error.js +10 -0
  41. package/dist/es/index.js +3 -0
  42. package/dist/es/src/api-model/api/vendor-shipping-api.js +111 -0
  43. package/dist/es/src/api-model/api.js +14 -0
  44. package/dist/es/src/api-model/base.js +56 -0
  45. package/dist/es/src/api-model/common.js +125 -0
  46. package/dist/es/src/api-model/configuration.js +38 -0
  47. package/dist/es/src/api-model/index.js +16 -0
  48. package/dist/es/src/api-model/models/address.js +14 -0
  49. package/dist/es/src/api-model/models/carton-reference-details.js +14 -0
  50. package/dist/es/src/api-model/models/carton.js +14 -0
  51. package/dist/es/src/api-model/models/container-identification.js +25 -0
  52. package/dist/es/src/api-model/models/container-item.js +14 -0
  53. package/dist/es/src/api-model/models/dimensions.js +24 -0
  54. package/dist/es/src/api-model/models/duration.js +22 -0
  55. package/dist/es/src/api-model/models/expiry.js +14 -0
  56. package/dist/es/src/api-model/models/import-details.js +26 -0
  57. package/dist/es/src/api-model/models/index.js +28 -0
  58. package/dist/es/src/api-model/models/item-details.js +24 -0
  59. package/dist/es/src/api-model/models/item-quantity.js +22 -0
  60. package/dist/es/src/api-model/models/item.js +14 -0
  61. package/dist/es/src/api-model/models/location.js +14 -0
  62. package/dist/es/src/api-model/models/model-error.js +14 -0
  63. package/dist/es/src/api-model/models/money.js +14 -0
  64. package/dist/es/src/api-model/models/pallet.js +14 -0
  65. package/dist/es/src/api-model/models/party-identification.js +14 -0
  66. package/dist/es/src/api-model/models/route.js +14 -0
  67. package/dist/es/src/api-model/models/shipment-confirmation.js +46 -0
  68. package/dist/es/src/api-model/models/shipment-measurements.js +14 -0
  69. package/dist/es/src/api-model/models/stop.js +23 -0
  70. package/dist/es/src/api-model/models/submit-shipment-confirmations-request.js +14 -0
  71. package/dist/es/src/api-model/models/submit-shipment-confirmations-response.js +14 -0
  72. package/dist/es/src/api-model/models/tax-registration-details.js +22 -0
  73. package/dist/es/src/api-model/models/transaction-reference.js +14 -0
  74. package/dist/es/src/api-model/models/transportation-details.js +23 -0
  75. package/dist/es/src/api-model/models/volume.js +24 -0
  76. package/dist/es/src/api-model/models/weight.js +24 -0
  77. package/dist/es/src/client.js +31 -0
  78. package/dist/es/src/error.js +6 -0
  79. package/dist/types/index.d.ts +3 -0
  80. package/dist/types/src/api-model/api/vendor-shipping-api.d.ts +84 -0
  81. package/dist/types/src/api-model/api.d.ts +12 -0
  82. package/dist/types/src/api-model/base.d.ts +55 -0
  83. package/dist/types/src/api-model/common.d.ts +65 -0
  84. package/dist/types/src/api-model/configuration.d.ts +83 -0
  85. package/dist/types/src/api-model/index.d.ts +14 -0
  86. package/dist/types/src/api-model/models/address.d.ts +84 -0
  87. package/dist/types/src/api-model/models/carton-reference-details.d.ts +30 -0
  88. package/dist/types/src/api-model/models/carton.d.ts +58 -0
  89. package/dist/types/src/api-model/models/container-identification.d.ts +41 -0
  90. package/dist/types/src/api-model/models/container-item.d.ts +38 -0
  91. package/dist/types/src/api-model/models/dimensions.d.ts +52 -0
  92. package/dist/types/src/api-model/models/duration.d.ts +38 -0
  93. package/dist/types/src/api-model/models/expiry.d.ts +37 -0
  94. package/dist/types/src/api-model/models/import-details.d.ts +68 -0
  95. package/dist/types/src/api-model/models/index.d.ts +28 -0
  96. package/dist/types/src/api-model/models/item-details.d.ts +60 -0
  97. package/dist/types/src/api-model/models/item-quantity.d.ts +44 -0
  98. package/dist/types/src/api-model/models/item.d.ts +50 -0
  99. package/dist/types/src/api-model/models/location.d.ts +36 -0
  100. package/dist/types/src/api-model/models/model-error.d.ts +36 -0
  101. package/dist/types/src/api-model/models/money.d.ts +30 -0
  102. package/dist/types/src/api-model/models/pallet.d.ts +65 -0
  103. package/dist/types/src/api-model/models/party-identification.d.ts +38 -0
  104. package/dist/types/src/api-model/models/route.d.ts +25 -0
  105. package/dist/types/src/api-model/models/shipment-confirmation.d.ts +157 -0
  106. package/dist/types/src/api-model/models/shipment-measurements.d.ts +44 -0
  107. package/dist/types/src/api-model/models/stop.d.ts +52 -0
  108. package/dist/types/src/api-model/models/submit-shipment-confirmations-request.d.ts +25 -0
  109. package/dist/types/src/api-model/models/submit-shipment-confirmations-response.d.ts +31 -0
  110. package/dist/types/src/api-model/models/tax-registration-details.d.ts +38 -0
  111. package/dist/types/src/api-model/models/transaction-reference.d.ts +24 -0
  112. package/dist/types/src/api-model/models/transportation-details.d.ts +51 -0
  113. package/dist/types/src/api-model/models/volume.d.ts +40 -0
  114. package/dist/types/src/api-model/models/weight.d.ts +40 -0
  115. package/dist/types/src/client.d.ts +13 -0
  116. package/dist/types/src/error.d.ts +3 -0
  117. package/package.json +53 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Bizon
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,58 @@
1
+ # `vendor-shipments-api-v1`
2
+
3
+ The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors.
4
+
5
+ ## Installing
6
+
7
+ ```sh
8
+ yarn add @sp-api-sdk/vendor-shipments-api-v1
9
+ ```
10
+
11
+ ```sh
12
+ npm install @sp-api-sdk/vendor-shipments-api-v1
13
+ ```
14
+
15
+ ## Getting Started
16
+
17
+ ```javascript
18
+ import {SellingPartnerApiAuth} from '@sp-api-sdk/auth'
19
+ import {VendorShipmentsApiClient} from '@sp-api-sdk/vendor-shipments-api-v1'
20
+
21
+ const auth = new SellingPartnerApiAuth({
22
+ clientId: '',
23
+ clientSecret: '',
24
+ refreshToken: '',
25
+ secretAccessKey: '',
26
+ accessKeyId: '',
27
+ region: '',
28
+ role: {
29
+ arn: '',
30
+ }
31
+ })
32
+
33
+ const client = new VendorShipmentsApiClient({
34
+ auth,
35
+ region: 'eu' // or 'eu-west-1'
36
+ })
37
+ ```
38
+
39
+ ## Handle Rate Limiting
40
+
41
+ If you want to let the SDK retry after each 429 responses, instanciate the client like this:
42
+
43
+ ```javascript
44
+ const client = new VendorShipmentsApiClient({
45
+ auth,
46
+ region: 'eu',
47
+ rateLimiting: {
48
+ retry: true,
49
+ onRetry: (retryInfo) => console.log(retryInfo) // Optional
50
+ }
51
+ })
52
+ ```
53
+
54
+ The SDK gets the rate limits for each routes from the API documentation
55
+
56
+ ## API documentation
57
+
58
+ See [here](https://github.com/amzn/selling-partner-api-docs/tree/main/references/vendor-shipments-api/vendorShipments.md)
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ (0, tslib_1.__exportStar)(require("./src/client"), exports);
5
+ (0, tslib_1.__exportStar)(require("./src/error"), exports);
6
+ (0, tslib_1.__exportStar)(require("./src/api-model/models"), exports);
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Selling Partner API for Retail Procurement Shipments
6
+ * The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors.
7
+ *
8
+ * The version of the OpenAPI document: v1
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.VendorShippingApi = exports.VendorShippingApiFactory = exports.VendorShippingApiFp = exports.VendorShippingApiAxiosParamCreator = void 0;
17
+ const tslib_1 = require("tslib");
18
+ const axios_1 = (0, tslib_1.__importDefault)(require("axios"));
19
+ // Some imports not used depending on template conditions
20
+ // @ts-ignore
21
+ const common_1 = require("../common");
22
+ // @ts-ignore
23
+ const base_1 = require("../base");
24
+ /**
25
+ * VendorShippingApi - axios parameter creator
26
+ * @export
27
+ */
28
+ const VendorShippingApiAxiosParamCreator = function (configuration) {
29
+ return {
30
+ /**
31
+ * Submits one or more shipment confirmations for vendor orders. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
32
+ * @param {SubmitShipmentConfirmationsRequest} body
33
+ * @param {*} [options] Override http request option.
34
+ * @throws {RequiredError}
35
+ */
36
+ submitShipmentConfirmations: async (body, options = {}) => {
37
+ // verify required parameter 'body' is not null or undefined
38
+ (0, common_1.assertParamExists)('submitShipmentConfirmations', 'body', body);
39
+ const localVarPath = `/vendor/shipping/v1/shipmentConfirmations`;
40
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
41
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
42
+ let baseOptions;
43
+ if (configuration) {
44
+ baseOptions = configuration.baseOptions;
45
+ }
46
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
47
+ const localVarHeaderParameter = {};
48
+ const localVarQueryParameter = {};
49
+ localVarHeaderParameter['Content-Type'] = 'application/json';
50
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query);
51
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
52
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
53
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration);
54
+ return {
55
+ url: (0, common_1.toPathString)(localVarUrlObj),
56
+ options: localVarRequestOptions,
57
+ };
58
+ },
59
+ };
60
+ };
61
+ exports.VendorShippingApiAxiosParamCreator = VendorShippingApiAxiosParamCreator;
62
+ /**
63
+ * VendorShippingApi - functional programming interface
64
+ * @export
65
+ */
66
+ const VendorShippingApiFp = function (configuration) {
67
+ const localVarAxiosParamCreator = (0, exports.VendorShippingApiAxiosParamCreator)(configuration);
68
+ return {
69
+ /**
70
+ * Submits one or more shipment confirmations for vendor orders. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
71
+ * @param {SubmitShipmentConfirmationsRequest} body
72
+ * @param {*} [options] Override http request option.
73
+ * @throws {RequiredError}
74
+ */
75
+ async submitShipmentConfirmations(body, options) {
76
+ const localVarAxiosArgs = await localVarAxiosParamCreator.submitShipmentConfirmations(body, options);
77
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
78
+ },
79
+ };
80
+ };
81
+ exports.VendorShippingApiFp = VendorShippingApiFp;
82
+ /**
83
+ * VendorShippingApi - factory interface
84
+ * @export
85
+ */
86
+ const VendorShippingApiFactory = function (configuration, basePath, axios) {
87
+ const localVarFp = (0, exports.VendorShippingApiFp)(configuration);
88
+ return {
89
+ /**
90
+ * Submits one or more shipment confirmations for vendor orders. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
91
+ * @param {SubmitShipmentConfirmationsRequest} body
92
+ * @param {*} [options] Override http request option.
93
+ * @throws {RequiredError}
94
+ */
95
+ submitShipmentConfirmations(body, options) {
96
+ return localVarFp.submitShipmentConfirmations(body, options).then((request) => request(axios, basePath));
97
+ },
98
+ };
99
+ };
100
+ exports.VendorShippingApiFactory = VendorShippingApiFactory;
101
+ /**
102
+ * VendorShippingApi - object-oriented interface
103
+ * @export
104
+ * @class VendorShippingApi
105
+ * @extends {BaseAPI}
106
+ */
107
+ class VendorShippingApi extends base_1.BaseAPI {
108
+ /**
109
+ * Submits one or more shipment confirmations for vendor orders. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
110
+ * @param {VendorShippingApiSubmitShipmentConfirmationsRequest} requestParameters Request parameters.
111
+ * @param {*} [options] Override http request option.
112
+ * @throws {RequiredError}
113
+ * @memberof VendorShippingApi
114
+ */
115
+ submitShipmentConfirmations(requestParameters, options) {
116
+ return (0, exports.VendorShippingApiFp)(this.configuration).submitShipmentConfirmations(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
117
+ }
118
+ }
119
+ exports.VendorShippingApi = VendorShippingApi;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Selling Partner API for Retail Procurement Shipments
6
+ * The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors.
7
+ *
8
+ * The version of the OpenAPI document: v1
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ const tslib_1 = require("tslib");
17
+ (0, tslib_1.__exportStar)(require("./api/vendor-shipping-api"), exports);
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Selling Partner API for Retail Procurement Shipments
6
+ * The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors.
7
+ *
8
+ * The version of the OpenAPI document: v1
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
17
+ const tslib_1 = require("tslib");
18
+ // Some imports not used depending on template conditions
19
+ // @ts-ignore
20
+ const axios_1 = (0, tslib_1.__importDefault)(require("axios"));
21
+ exports.BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
22
+ /**
23
+ *
24
+ * @export
25
+ */
26
+ exports.COLLECTION_FORMATS = {
27
+ csv: ",",
28
+ ssv: " ",
29
+ tsv: "\t",
30
+ pipes: "|",
31
+ };
32
+ /**
33
+ *
34
+ * @export
35
+ * @class BaseAPI
36
+ */
37
+ class BaseAPI {
38
+ constructor(configuration, basePath = exports.BASE_PATH, axios = axios_1.default) {
39
+ this.basePath = basePath;
40
+ this.axios = axios;
41
+ if (configuration) {
42
+ this.configuration = configuration;
43
+ this.basePath = configuration.basePath || this.basePath;
44
+ }
45
+ }
46
+ }
47
+ exports.BaseAPI = BaseAPI;
48
+ ;
49
+ /**
50
+ *
51
+ * @export
52
+ * @class RequiredError
53
+ * @extends {Error}
54
+ */
55
+ class RequiredError extends Error {
56
+ constructor(field, msg) {
57
+ super(msg);
58
+ this.field = field;
59
+ this.name = "RequiredError";
60
+ }
61
+ }
62
+ exports.RequiredError = RequiredError;
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Selling Partner API for Retail Procurement Shipments
6
+ * The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors.
7
+ *
8
+ * The version of the OpenAPI document: v1
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
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
+ const base_1 = require("./base");
18
+ /**
19
+ *
20
+ * @export
21
+ */
22
+ exports.DUMMY_BASE_URL = 'https://example.com';
23
+ /**
24
+ *
25
+ * @throws {RequiredError}
26
+ * @export
27
+ */
28
+ const assertParamExists = function (functionName, paramName, paramValue) {
29
+ if (paramValue === null || paramValue === undefined) {
30
+ throw new base_1.RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
31
+ }
32
+ };
33
+ exports.assertParamExists = assertParamExists;
34
+ /**
35
+ *
36
+ * @export
37
+ */
38
+ const setApiKeyToObject = async function (object, keyParamName, configuration) {
39
+ if (configuration && configuration.apiKey) {
40
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
41
+ ? await configuration.apiKey(keyParamName)
42
+ : await configuration.apiKey;
43
+ object[keyParamName] = localVarApiKeyValue;
44
+ }
45
+ };
46
+ exports.setApiKeyToObject = setApiKeyToObject;
47
+ /**
48
+ *
49
+ * @export
50
+ */
51
+ const setBasicAuthToObject = function (object, configuration) {
52
+ if (configuration && (configuration.username || configuration.password)) {
53
+ object["auth"] = { username: configuration.username, password: configuration.password };
54
+ }
55
+ };
56
+ exports.setBasicAuthToObject = setBasicAuthToObject;
57
+ /**
58
+ *
59
+ * @export
60
+ */
61
+ const setBearerAuthToObject = async function (object, configuration) {
62
+ if (configuration && configuration.accessToken) {
63
+ const accessToken = typeof configuration.accessToken === 'function'
64
+ ? await configuration.accessToken()
65
+ : await configuration.accessToken;
66
+ object["Authorization"] = "Bearer " + accessToken;
67
+ }
68
+ };
69
+ exports.setBearerAuthToObject = setBearerAuthToObject;
70
+ /**
71
+ *
72
+ * @export
73
+ */
74
+ const setOAuthToObject = async function (object, name, scopes, configuration) {
75
+ if (configuration && configuration.accessToken) {
76
+ const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
77
+ ? await configuration.accessToken(name, scopes)
78
+ : await configuration.accessToken;
79
+ object["Authorization"] = "Bearer " + localVarAccessTokenValue;
80
+ }
81
+ };
82
+ exports.setOAuthToObject = setOAuthToObject;
83
+ /**
84
+ *
85
+ * @export
86
+ */
87
+ const setSearchParams = function (url, ...objects) {
88
+ const searchParams = new URLSearchParams(url.search);
89
+ for (const object of objects) {
90
+ for (const key in object) {
91
+ if (Array.isArray(object[key])) {
92
+ searchParams.delete(key);
93
+ for (const item of object[key]) {
94
+ searchParams.append(key, item);
95
+ }
96
+ }
97
+ else {
98
+ searchParams.set(key, object[key]);
99
+ }
100
+ }
101
+ }
102
+ url.search = searchParams.toString();
103
+ };
104
+ exports.setSearchParams = setSearchParams;
105
+ /**
106
+ *
107
+ * @export
108
+ */
109
+ const serializeDataIfNeeded = function (value, requestOptions, configuration) {
110
+ const nonString = typeof value !== 'string';
111
+ const needsSerialization = nonString && configuration && configuration.isJsonMime
112
+ ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
113
+ : nonString;
114
+ return needsSerialization
115
+ ? JSON.stringify(value !== undefined ? value : {})
116
+ : (value || "");
117
+ };
118
+ exports.serializeDataIfNeeded = serializeDataIfNeeded;
119
+ /**
120
+ *
121
+ * @export
122
+ */
123
+ const toPathString = function (url) {
124
+ return url.pathname + url.search + url.hash;
125
+ };
126
+ exports.toPathString = toPathString;
127
+ /**
128
+ *
129
+ * @export
130
+ */
131
+ const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
132
+ return (axios = globalAxios, basePath = BASE_PATH) => {
133
+ const axiosRequestArgs = { ...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url };
134
+ return axios.request(axiosRequestArgs);
135
+ };
136
+ };
137
+ exports.createRequestFunction = createRequestFunction;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Selling Partner API for Retail Procurement Shipments
6
+ * The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors.
7
+ *
8
+ * The version of the OpenAPI document: v1
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.Configuration = void 0;
17
+ class Configuration {
18
+ constructor(param = {}) {
19
+ this.apiKey = param.apiKey;
20
+ this.username = param.username;
21
+ this.password = param.password;
22
+ this.accessToken = param.accessToken;
23
+ this.basePath = param.basePath;
24
+ this.baseOptions = param.baseOptions;
25
+ this.formDataCtor = param.formDataCtor;
26
+ }
27
+ /**
28
+ * Check if the given MIME is a JSON MIME.
29
+ * JSON MIME examples:
30
+ * application/json
31
+ * application/json; charset=UTF8
32
+ * APPLICATION/JSON
33
+ * application/vnd.company+json
34
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
35
+ * @return True if the given MIME is JSON, false otherwise.
36
+ */
37
+ isJsonMime(mime) {
38
+ const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
39
+ return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
40
+ }
41
+ }
42
+ exports.Configuration = Configuration;