@sp-api-sdk/fba-inventory-api-v1 4.0.0 → 4.1.1

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/index.js CHANGED
@@ -1,509 +1,497 @@
1
- // src/client.ts
2
1
  import { createAxiosInstance } from "@sp-api-sdk/common";
3
-
4
- // src/api-model/api/fba-inventory-api.ts
5
- import globalAxios2 from "axios";
6
-
7
- // src/api-model/base.ts
8
2
  import globalAxios from "axios";
9
- var BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
10
- var COLLECTION_FORMATS = {
11
- csv: ",",
12
- ssv: " ",
13
- tsv: " ",
14
- pipes: "|"
3
+ //#region src/api-model/base.ts
4
+ const BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
5
+ const COLLECTION_FORMATS = {
6
+ csv: ",",
7
+ ssv: " ",
8
+ tsv: " ",
9
+ pipes: "|"
15
10
  };
16
11
  var BaseAPI = class {
17
- constructor(configuration, basePath = BASE_PATH, axios = globalAxios) {
18
- this.basePath = basePath;
19
- this.axios = axios;
20
- if (configuration) {
21
- this.configuration = configuration;
22
- this.basePath = configuration.basePath ?? basePath;
23
- }
24
- }
25
- basePath;
26
- axios;
27
- configuration;
12
+ basePath;
13
+ axios;
14
+ configuration;
15
+ constructor(configuration, basePath = BASE_PATH, axios = globalAxios) {
16
+ this.basePath = basePath;
17
+ this.axios = axios;
18
+ if (configuration) {
19
+ this.configuration = configuration;
20
+ this.basePath = configuration.basePath ?? basePath;
21
+ }
22
+ }
28
23
  };
29
24
  var RequiredError = class extends Error {
30
- constructor(field, msg) {
31
- super(msg);
32
- this.field = field;
33
- this.name = "RequiredError";
34
- }
35
- field;
25
+ field;
26
+ constructor(field, msg) {
27
+ super(msg);
28
+ this.field = field;
29
+ this.name = "RequiredError";
30
+ }
36
31
  };
37
- var operationServerMap = {};
38
-
39
- // src/api-model/common.ts
40
- var DUMMY_BASE_URL = "https://example.com";
41
- var assertParamExists = function(functionName, paramName, paramValue) {
42
- if (paramValue === null || paramValue === void 0) {
43
- throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
44
- }
32
+ const operationServerMap = {};
33
+ //#endregion
34
+ //#region src/api-model/common.ts
35
+ const DUMMY_BASE_URL = "https://example.com";
36
+ /**
37
+ *
38
+ * @throws {RequiredError}
39
+ */
40
+ const assertParamExists = function(functionName, paramName, paramValue) {
41
+ if (paramValue === null || paramValue === void 0) throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
45
42
  };
46
43
  function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
47
- if (parameter == null) return;
48
- if (typeof parameter === "object") {
49
- if (Array.isArray(parameter) || parameter instanceof Set) {
50
- parameter.forEach((item) => setFlattenedQueryParams(urlSearchParams, item, key));
51
- } else {
52
- Object.keys(parameter).forEach(
53
- (currentKey) => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== "" ? "." : ""}${currentKey}`)
54
- );
55
- }
56
- } else {
57
- if (urlSearchParams.has(key)) {
58
- urlSearchParams.append(key, parameter);
59
- } else {
60
- urlSearchParams.set(key, parameter);
61
- }
62
- }
44
+ if (parameter == null) return;
45
+ if (typeof parameter === "object") if (Array.isArray(parameter) || parameter instanceof Set) parameter.forEach((item) => setFlattenedQueryParams(urlSearchParams, item, key));
46
+ else Object.keys(parameter).forEach((currentKey) => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== "" ? "." : ""}${currentKey}`));
47
+ else if (urlSearchParams.has(key)) urlSearchParams.append(key, parameter);
48
+ else urlSearchParams.set(key, parameter);
63
49
  }
64
- var setSearchParams = function(url, ...objects) {
65
- const searchParams = new URLSearchParams(url.search);
66
- setFlattenedQueryParams(searchParams, objects);
67
- url.search = searchParams.toString();
50
+ const setSearchParams = function(url, ...objects) {
51
+ const searchParams = new URLSearchParams(url.search);
52
+ setFlattenedQueryParams(searchParams, objects);
53
+ url.search = searchParams.toString();
68
54
  };
69
- var replaceWithSerializableTypeIfNeeded = function(key, value) {
70
- if (value instanceof Set) {
71
- return Array.from(value);
72
- } else {
73
- return value;
74
- }
55
+ /**
56
+ * JSON serialization helper function which replaces instances of unserializable types with serializable ones.
57
+ * This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
58
+ * Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
59
+ */
60
+ const replaceWithSerializableTypeIfNeeded = function(key, value) {
61
+ if (value instanceof Set) return Array.from(value);
62
+ else return value;
75
63
  };
76
- var serializeDataIfNeeded = function(value, requestOptions, configuration) {
77
- const nonString = typeof value !== "string";
78
- const needsSerialization = nonString && configuration && configuration.isJsonMime ? configuration.isJsonMime(requestOptions.headers["Content-Type"]) : nonString;
79
- return needsSerialization ? JSON.stringify(value !== void 0 ? value : {}, replaceWithSerializableTypeIfNeeded) : value || "";
64
+ const serializeDataIfNeeded = function(value, requestOptions, configuration) {
65
+ const nonString = typeof value !== "string";
66
+ return (nonString && configuration && configuration.isJsonMime ? configuration.isJsonMime(requestOptions.headers["Content-Type"]) : nonString) ? JSON.stringify(value !== void 0 ? value : {}, replaceWithSerializableTypeIfNeeded) : value || "";
80
67
  };
81
- var toPathString = function(url) {
82
- return url.pathname + url.search + url.hash;
68
+ const toPathString = function(url) {
69
+ return url.pathname + url.search + url.hash;
83
70
  };
84
- var createRequestFunction = function(axiosArgs, globalAxios3, BASE_PATH2, configuration) {
85
- return (axios = globalAxios3, basePath = BASE_PATH2) => {
86
- const axiosRequestArgs = { ...axiosArgs.options, url: (axios.defaults.baseURL ? "" : configuration?.basePath ?? basePath) + axiosArgs.url };
87
- return axios.request(axiosRequestArgs);
88
- };
71
+ const createRequestFunction = function(axiosArgs, globalAxios, BASE_PATH, configuration) {
72
+ return (axios = globalAxios, basePath = BASE_PATH) => {
73
+ const axiosRequestArgs = {
74
+ ...axiosArgs.options,
75
+ url: (axios.defaults.baseURL ? "" : configuration?.basePath ?? basePath) + axiosArgs.url
76
+ };
77
+ return axios.request(axiosRequestArgs);
78
+ };
89
79
  };
90
-
91
- // src/api-model/api/fba-inventory-api.ts
92
- var FbaInventoryApiAxiosParamCreator = function(configuration) {
93
- return {
94
- /**
95
- * Requests that Amazon add items to the Sandbox Inventory with desired amount of quantity in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
96
- * @param {string} xAmznIdempotencyToken A unique token/requestId provided with each call to ensure idempotency.
97
- * @param {AddInventoryRequest} addInventoryRequestBody List of items to add to Sandbox inventory.
98
- * @param {*} [options] Override http request option.
99
- * @throws {RequiredError}
100
- */
101
- addInventory: async (xAmznIdempotencyToken, addInventoryRequestBody, options = {}) => {
102
- assertParamExists("addInventory", "xAmznIdempotencyToken", xAmznIdempotencyToken);
103
- assertParamExists("addInventory", "addInventoryRequestBody", addInventoryRequestBody);
104
- const localVarPath = `/fba/inventory/v1/items/inventory`;
105
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
106
- let baseOptions;
107
- if (configuration) {
108
- baseOptions = configuration.baseOptions;
109
- }
110
- const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
111
- const localVarHeaderParameter = {};
112
- const localVarQueryParameter = {};
113
- localVarHeaderParameter["Content-Type"] = "application/json";
114
- localVarHeaderParameter["Accept"] = "application/json";
115
- if (xAmznIdempotencyToken != null) {
116
- localVarHeaderParameter["x-amzn-idempotency-token"] = String(xAmznIdempotencyToken);
117
- }
118
- setSearchParams(localVarUrlObj, localVarQueryParameter);
119
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
120
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
121
- localVarRequestOptions.data = serializeDataIfNeeded(addInventoryRequestBody, localVarRequestOptions, configuration);
122
- return {
123
- url: toPathString(localVarUrlObj),
124
- options: localVarRequestOptions
125
- };
126
- },
127
- /**
128
- * Requests that Amazon create product-details in the Sandbox Inventory in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
129
- * @param {CreateInventoryItemRequest} createInventoryItemRequestBody CreateInventoryItem Request Body Parameter.
130
- * @param {*} [options] Override http request option.
131
- * @throws {RequiredError}
132
- */
133
- createInventoryItem: async (createInventoryItemRequestBody, options = {}) => {
134
- assertParamExists("createInventoryItem", "createInventoryItemRequestBody", createInventoryItemRequestBody);
135
- const localVarPath = `/fba/inventory/v1/items`;
136
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
137
- let baseOptions;
138
- if (configuration) {
139
- baseOptions = configuration.baseOptions;
140
- }
141
- const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
142
- const localVarHeaderParameter = {};
143
- const localVarQueryParameter = {};
144
- localVarHeaderParameter["Content-Type"] = "application/json";
145
- localVarHeaderParameter["Accept"] = "application/json";
146
- setSearchParams(localVarUrlObj, localVarQueryParameter);
147
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
148
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
149
- localVarRequestOptions.data = serializeDataIfNeeded(createInventoryItemRequestBody, localVarRequestOptions, configuration);
150
- return {
151
- url: toPathString(localVarUrlObj),
152
- options: localVarRequestOptions
153
- };
154
- },
155
- /**
156
- * Requests that Amazon Deletes an item from the Sandbox Inventory in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
157
- * @param {string} sellerSku A single seller SKU used for querying the specified seller SKU inventory summaries.
158
- * @param {string} marketplaceId The marketplace ID for the marketplace for which the sellerSku is to be deleted.
159
- * @param {*} [options] Override http request option.
160
- * @throws {RequiredError}
161
- */
162
- deleteInventoryItem: async (sellerSku, marketplaceId, options = {}) => {
163
- assertParamExists("deleteInventoryItem", "sellerSku", sellerSku);
164
- assertParamExists("deleteInventoryItem", "marketplaceId", marketplaceId);
165
- const localVarPath = `/fba/inventory/v1/items/{sellerSku}`.replace("{sellerSku}", encodeURIComponent(String(sellerSku)));
166
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
167
- let baseOptions;
168
- if (configuration) {
169
- baseOptions = configuration.baseOptions;
170
- }
171
- const localVarRequestOptions = { method: "DELETE", ...baseOptions, ...options };
172
- const localVarHeaderParameter = {};
173
- const localVarQueryParameter = {};
174
- if (marketplaceId !== void 0) {
175
- localVarQueryParameter["marketplaceId"] = marketplaceId;
176
- }
177
- localVarHeaderParameter["Accept"] = "application/json";
178
- setSearchParams(localVarUrlObj, localVarQueryParameter);
179
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
180
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
181
- return {
182
- url: toPathString(localVarUrlObj),
183
- options: localVarRequestOptions
184
- };
185
- },
186
- /**
187
- * Returns a list of inventory summaries. The summaries returned depend on the presence or absence of the startDateTime, sellerSkus and sellerSku parameters: - All inventory summaries with available details are returned when the startDateTime, sellerSkus and sellerSku parameters are omitted. - When startDateTime is provided, the operation returns inventory summaries that have had changes after the date and time specified. The sellerSkus and sellerSku parameters are ignored. Important: To avoid errors, use both startDateTime and nextToken to get the next page of inventory summaries that have changed after the date and time specified. - When the sellerSkus parameter is provided, the operation returns inventory summaries for only the specified sellerSkus. The sellerSku parameter is ignored. - When the sellerSku parameter is provided, the operation returns inventory summaries for only the specified sellerSku. Note: The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). Usage Plan: | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits).
188
- * @param {GetInventorySummariesGranularityTypeEnum} granularityType The granularity type for the inventory aggregation level.
189
- * @param {string} granularityId The granularity ID for the inventory aggregation level.
190
- * @param {Array<string>} marketplaceIds The marketplace ID for the marketplace for which to return inventory summaries.
191
- * @param {boolean} [details] true to return inventory summaries with additional summarized inventory details and quantities. Otherwise, returns inventory summaries only (default value).
192
- * @param {string} [startDateTime] A start date and time in ISO8601 format. If specified, all inventory summaries that have changed since then are returned. You must specify a date and time that is no earlier than 18 months prior to the date and time when you call the API. Note: Changes in inboundWorkingQuantity, inboundShippedQuantity and inboundReceivingQuantity are not detected.
193
- * @param {Array<string>} [sellerSkus] A list of seller SKUs for which to return inventory summaries. You may specify up to 50 SKUs.
194
- * @param {string} [sellerSku] A single seller SKU used for querying the specified seller SKU inventory summaries.
195
- * @param {string} [nextToken] String token returned in the response of your previous request. The string token will expire 30 seconds after being created.
196
- * @param {*} [options] Override http request option.
197
- * @throws {RequiredError}
198
- */
199
- getInventorySummaries: async (granularityType, granularityId, marketplaceIds, details, startDateTime, sellerSkus, sellerSku, nextToken, options = {}) => {
200
- assertParamExists("getInventorySummaries", "granularityType", granularityType);
201
- assertParamExists("getInventorySummaries", "granularityId", granularityId);
202
- assertParamExists("getInventorySummaries", "marketplaceIds", marketplaceIds);
203
- const localVarPath = `/fba/inventory/v1/summaries`;
204
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
205
- let baseOptions;
206
- if (configuration) {
207
- baseOptions = configuration.baseOptions;
208
- }
209
- const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
210
- const localVarHeaderParameter = {};
211
- const localVarQueryParameter = {};
212
- if (details !== void 0) {
213
- localVarQueryParameter["details"] = details;
214
- }
215
- if (granularityType !== void 0) {
216
- localVarQueryParameter["granularityType"] = granularityType;
217
- }
218
- if (granularityId !== void 0) {
219
- localVarQueryParameter["granularityId"] = granularityId;
220
- }
221
- if (startDateTime !== void 0) {
222
- localVarQueryParameter["startDateTime"] = startDateTime instanceof Date ? startDateTime.toISOString() : startDateTime;
223
- }
224
- if (sellerSkus) {
225
- localVarQueryParameter["sellerSkus"] = sellerSkus.join(COLLECTION_FORMATS.csv);
226
- }
227
- if (sellerSku !== void 0) {
228
- localVarQueryParameter["sellerSku"] = sellerSku;
229
- }
230
- if (nextToken !== void 0) {
231
- localVarQueryParameter["nextToken"] = nextToken;
232
- }
233
- if (marketplaceIds) {
234
- localVarQueryParameter["marketplaceIds"] = marketplaceIds.join(COLLECTION_FORMATS.csv);
235
- }
236
- localVarHeaderParameter["Accept"] = "application/json";
237
- setSearchParams(localVarUrlObj, localVarQueryParameter);
238
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
239
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
240
- return {
241
- url: toPathString(localVarUrlObj),
242
- options: localVarRequestOptions
243
- };
244
- }
245
- };
80
+ //#endregion
81
+ //#region src/api-model/api/fba-inventory-api.ts
82
+ /**
83
+ * FbaInventoryApi - axios parameter creator
84
+ */
85
+ const FbaInventoryApiAxiosParamCreator = function(configuration) {
86
+ return {
87
+ /**
88
+ * Requests that Amazon add items to the Sandbox Inventory with desired amount of quantity in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
89
+ * @param {string} xAmznIdempotencyToken A unique token/requestId provided with each call to ensure idempotency.
90
+ * @param {AddInventoryRequest} addInventoryRequestBody List of items to add to Sandbox inventory.
91
+ * @param {*} [options] Override http request option.
92
+ * @throws {RequiredError}
93
+ */
94
+ addInventory: async (xAmznIdempotencyToken, addInventoryRequestBody, options = {}) => {
95
+ assertParamExists("addInventory", "xAmznIdempotencyToken", xAmznIdempotencyToken);
96
+ assertParamExists("addInventory", "addInventoryRequestBody", addInventoryRequestBody);
97
+ const localVarUrlObj = new URL(`/fba/inventory/v1/items/inventory`, DUMMY_BASE_URL);
98
+ let baseOptions;
99
+ if (configuration) baseOptions = configuration.baseOptions;
100
+ const localVarRequestOptions = {
101
+ method: "POST",
102
+ ...baseOptions,
103
+ ...options
104
+ };
105
+ const localVarHeaderParameter = {};
106
+ const localVarQueryParameter = {};
107
+ localVarHeaderParameter["Content-Type"] = "application/json";
108
+ localVarHeaderParameter["Accept"] = "application/json";
109
+ if (xAmznIdempotencyToken != null) localVarHeaderParameter["x-amzn-idempotency-token"] = String(xAmznIdempotencyToken);
110
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
111
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
112
+ localVarRequestOptions.headers = {
113
+ ...localVarHeaderParameter,
114
+ ...headersFromBaseOptions,
115
+ ...options.headers
116
+ };
117
+ localVarRequestOptions.data = serializeDataIfNeeded(addInventoryRequestBody, localVarRequestOptions, configuration);
118
+ return {
119
+ url: toPathString(localVarUrlObj),
120
+ options: localVarRequestOptions
121
+ };
122
+ },
123
+ /**
124
+ * Requests that Amazon create product-details in the Sandbox Inventory in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
125
+ * @param {CreateInventoryItemRequest} createInventoryItemRequestBody CreateInventoryItem Request Body Parameter.
126
+ * @param {*} [options] Override http request option.
127
+ * @throws {RequiredError}
128
+ */
129
+ createInventoryItem: async (createInventoryItemRequestBody, options = {}) => {
130
+ assertParamExists("createInventoryItem", "createInventoryItemRequestBody", createInventoryItemRequestBody);
131
+ const localVarUrlObj = new URL(`/fba/inventory/v1/items`, DUMMY_BASE_URL);
132
+ let baseOptions;
133
+ if (configuration) baseOptions = configuration.baseOptions;
134
+ const localVarRequestOptions = {
135
+ method: "POST",
136
+ ...baseOptions,
137
+ ...options
138
+ };
139
+ const localVarHeaderParameter = {};
140
+ const localVarQueryParameter = {};
141
+ localVarHeaderParameter["Content-Type"] = "application/json";
142
+ localVarHeaderParameter["Accept"] = "application/json";
143
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
144
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
145
+ localVarRequestOptions.headers = {
146
+ ...localVarHeaderParameter,
147
+ ...headersFromBaseOptions,
148
+ ...options.headers
149
+ };
150
+ localVarRequestOptions.data = serializeDataIfNeeded(createInventoryItemRequestBody, localVarRequestOptions, configuration);
151
+ return {
152
+ url: toPathString(localVarUrlObj),
153
+ options: localVarRequestOptions
154
+ };
155
+ },
156
+ /**
157
+ * Requests that Amazon Deletes an item from the Sandbox Inventory in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
158
+ * @param {string} sellerSku A single seller SKU used for querying the specified seller SKU inventory summaries.
159
+ * @param {string} marketplaceId The marketplace ID for the marketplace for which the sellerSku is to be deleted.
160
+ * @param {*} [options] Override http request option.
161
+ * @throws {RequiredError}
162
+ */
163
+ deleteInventoryItem: async (sellerSku, marketplaceId, options = {}) => {
164
+ assertParamExists("deleteInventoryItem", "sellerSku", sellerSku);
165
+ assertParamExists("deleteInventoryItem", "marketplaceId", marketplaceId);
166
+ const localVarPath = `/fba/inventory/v1/items/{sellerSku}`.replace("{sellerSku}", encodeURIComponent(String(sellerSku)));
167
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
168
+ let baseOptions;
169
+ if (configuration) baseOptions = configuration.baseOptions;
170
+ const localVarRequestOptions = {
171
+ method: "DELETE",
172
+ ...baseOptions,
173
+ ...options
174
+ };
175
+ const localVarHeaderParameter = {};
176
+ const localVarQueryParameter = {};
177
+ if (marketplaceId !== void 0) localVarQueryParameter["marketplaceId"] = marketplaceId;
178
+ localVarHeaderParameter["Accept"] = "application/json";
179
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
180
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
181
+ localVarRequestOptions.headers = {
182
+ ...localVarHeaderParameter,
183
+ ...headersFromBaseOptions,
184
+ ...options.headers
185
+ };
186
+ return {
187
+ url: toPathString(localVarUrlObj),
188
+ options: localVarRequestOptions
189
+ };
190
+ },
191
+ /**
192
+ * Returns a list of inventory summaries. The summaries returned depend on the presence or absence of the startDateTime, sellerSkus and sellerSku parameters: - All inventory summaries with available details are returned when the startDateTime, sellerSkus and sellerSku parameters are omitted. - When startDateTime is provided, the operation returns inventory summaries that have had changes after the date and time specified. The sellerSkus and sellerSku parameters are ignored. Important: To avoid errors, use both startDateTime and nextToken to get the next page of inventory summaries that have changed after the date and time specified. - When the sellerSkus parameter is provided, the operation returns inventory summaries for only the specified sellerSkus. The sellerSku parameter is ignored. - When the sellerSku parameter is provided, the operation returns inventory summaries for only the specified sellerSku. Note: The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). Usage Plan: | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits).
193
+ * @param {GetInventorySummariesGranularityTypeEnum} granularityType The granularity type for the inventory aggregation level.
194
+ * @param {string} granularityId The granularity ID for the inventory aggregation level.
195
+ * @param {Array<string>} marketplaceIds The marketplace ID for the marketplace for which to return inventory summaries.
196
+ * @param {boolean} [details] true to return inventory summaries with additional summarized inventory details and quantities. Otherwise, returns inventory summaries only (default value).
197
+ * @param {string} [startDateTime] A start date and time in ISO8601 format. If specified, all inventory summaries that have changed since then are returned. You must specify a date and time that is no earlier than 18 months prior to the date and time when you call the API. Note: Changes in inboundWorkingQuantity, inboundShippedQuantity and inboundReceivingQuantity are not detected.
198
+ * @param {Array<string>} [sellerSkus] A list of seller SKUs for which to return inventory summaries. You may specify up to 50 SKUs.
199
+ * @param {string} [sellerSku] A single seller SKU used for querying the specified seller SKU inventory summaries.
200
+ * @param {string} [nextToken] String token returned in the response of your previous request. The string token will expire 30 seconds after being created.
201
+ * @param {*} [options] Override http request option.
202
+ * @throws {RequiredError}
203
+ */
204
+ getInventorySummaries: async (granularityType, granularityId, marketplaceIds, details, startDateTime, sellerSkus, sellerSku, nextToken, options = {}) => {
205
+ assertParamExists("getInventorySummaries", "granularityType", granularityType);
206
+ assertParamExists("getInventorySummaries", "granularityId", granularityId);
207
+ assertParamExists("getInventorySummaries", "marketplaceIds", marketplaceIds);
208
+ const localVarUrlObj = new URL(`/fba/inventory/v1/summaries`, DUMMY_BASE_URL);
209
+ let baseOptions;
210
+ if (configuration) baseOptions = configuration.baseOptions;
211
+ const localVarRequestOptions = {
212
+ method: "GET",
213
+ ...baseOptions,
214
+ ...options
215
+ };
216
+ const localVarHeaderParameter = {};
217
+ const localVarQueryParameter = {};
218
+ if (details !== void 0) localVarQueryParameter["details"] = details;
219
+ if (granularityType !== void 0) localVarQueryParameter["granularityType"] = granularityType;
220
+ if (granularityId !== void 0) localVarQueryParameter["granularityId"] = granularityId;
221
+ if (startDateTime !== void 0) localVarQueryParameter["startDateTime"] = startDateTime instanceof Date ? startDateTime.toISOString() : startDateTime;
222
+ if (sellerSkus) localVarQueryParameter["sellerSkus"] = sellerSkus.join(COLLECTION_FORMATS.csv);
223
+ if (sellerSku !== void 0) localVarQueryParameter["sellerSku"] = sellerSku;
224
+ if (nextToken !== void 0) localVarQueryParameter["nextToken"] = nextToken;
225
+ if (marketplaceIds) localVarQueryParameter["marketplaceIds"] = marketplaceIds.join(COLLECTION_FORMATS.csv);
226
+ localVarHeaderParameter["Accept"] = "application/json";
227
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
228
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
229
+ localVarRequestOptions.headers = {
230
+ ...localVarHeaderParameter,
231
+ ...headersFromBaseOptions,
232
+ ...options.headers
233
+ };
234
+ return {
235
+ url: toPathString(localVarUrlObj),
236
+ options: localVarRequestOptions
237
+ };
238
+ }
239
+ };
246
240
  };
247
- var FbaInventoryApiFp = function(configuration) {
248
- const localVarAxiosParamCreator = FbaInventoryApiAxiosParamCreator(configuration);
249
- return {
250
- /**
251
- * Requests that Amazon add items to the Sandbox Inventory with desired amount of quantity in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
252
- * @param {string} xAmznIdempotencyToken A unique token/requestId provided with each call to ensure idempotency.
253
- * @param {AddInventoryRequest} addInventoryRequestBody List of items to add to Sandbox inventory.
254
- * @param {*} [options] Override http request option.
255
- * @throws {RequiredError}
256
- */
257
- async addInventory(xAmznIdempotencyToken, addInventoryRequestBody, options) {
258
- const localVarAxiosArgs = await localVarAxiosParamCreator.addInventory(xAmznIdempotencyToken, addInventoryRequestBody, options);
259
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
260
- const localVarOperationServerBasePath = operationServerMap["FbaInventoryApi.addInventory"]?.[localVarOperationServerIndex]?.url;
261
- return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
262
- },
263
- /**
264
- * Requests that Amazon create product-details in the Sandbox Inventory in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
265
- * @param {CreateInventoryItemRequest} createInventoryItemRequestBody CreateInventoryItem Request Body Parameter.
266
- * @param {*} [options] Override http request option.
267
- * @throws {RequiredError}
268
- */
269
- async createInventoryItem(createInventoryItemRequestBody, options) {
270
- const localVarAxiosArgs = await localVarAxiosParamCreator.createInventoryItem(createInventoryItemRequestBody, options);
271
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
272
- const localVarOperationServerBasePath = operationServerMap["FbaInventoryApi.createInventoryItem"]?.[localVarOperationServerIndex]?.url;
273
- return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
274
- },
275
- /**
276
- * Requests that Amazon Deletes an item from the Sandbox Inventory in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
277
- * @param {string} sellerSku A single seller SKU used for querying the specified seller SKU inventory summaries.
278
- * @param {string} marketplaceId The marketplace ID for the marketplace for which the sellerSku is to be deleted.
279
- * @param {*} [options] Override http request option.
280
- * @throws {RequiredError}
281
- */
282
- async deleteInventoryItem(sellerSku, marketplaceId, options) {
283
- const localVarAxiosArgs = await localVarAxiosParamCreator.deleteInventoryItem(sellerSku, marketplaceId, options);
284
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
285
- const localVarOperationServerBasePath = operationServerMap["FbaInventoryApi.deleteInventoryItem"]?.[localVarOperationServerIndex]?.url;
286
- return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
287
- },
288
- /**
289
- * Returns a list of inventory summaries. The summaries returned depend on the presence or absence of the startDateTime, sellerSkus and sellerSku parameters: - All inventory summaries with available details are returned when the startDateTime, sellerSkus and sellerSku parameters are omitted. - When startDateTime is provided, the operation returns inventory summaries that have had changes after the date and time specified. The sellerSkus and sellerSku parameters are ignored. Important: To avoid errors, use both startDateTime and nextToken to get the next page of inventory summaries that have changed after the date and time specified. - When the sellerSkus parameter is provided, the operation returns inventory summaries for only the specified sellerSkus. The sellerSku parameter is ignored. - When the sellerSku parameter is provided, the operation returns inventory summaries for only the specified sellerSku. Note: The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). Usage Plan: | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits).
290
- * @param {GetInventorySummariesGranularityTypeEnum} granularityType The granularity type for the inventory aggregation level.
291
- * @param {string} granularityId The granularity ID for the inventory aggregation level.
292
- * @param {Array<string>} marketplaceIds The marketplace ID for the marketplace for which to return inventory summaries.
293
- * @param {boolean} [details] true to return inventory summaries with additional summarized inventory details and quantities. Otherwise, returns inventory summaries only (default value).
294
- * @param {string} [startDateTime] A start date and time in ISO8601 format. If specified, all inventory summaries that have changed since then are returned. You must specify a date and time that is no earlier than 18 months prior to the date and time when you call the API. Note: Changes in inboundWorkingQuantity, inboundShippedQuantity and inboundReceivingQuantity are not detected.
295
- * @param {Array<string>} [sellerSkus] A list of seller SKUs for which to return inventory summaries. You may specify up to 50 SKUs.
296
- * @param {string} [sellerSku] A single seller SKU used for querying the specified seller SKU inventory summaries.
297
- * @param {string} [nextToken] String token returned in the response of your previous request. The string token will expire 30 seconds after being created.
298
- * @param {*} [options] Override http request option.
299
- * @throws {RequiredError}
300
- */
301
- async getInventorySummaries(granularityType, granularityId, marketplaceIds, details, startDateTime, sellerSkus, sellerSku, nextToken, options) {
302
- const localVarAxiosArgs = await localVarAxiosParamCreator.getInventorySummaries(granularityType, granularityId, marketplaceIds, details, startDateTime, sellerSkus, sellerSku, nextToken, options);
303
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
304
- const localVarOperationServerBasePath = operationServerMap["FbaInventoryApi.getInventorySummaries"]?.[localVarOperationServerIndex]?.url;
305
- return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
306
- }
307
- };
241
+ /**
242
+ * FbaInventoryApi - functional programming interface
243
+ */
244
+ const FbaInventoryApiFp = function(configuration) {
245
+ const localVarAxiosParamCreator = FbaInventoryApiAxiosParamCreator(configuration);
246
+ return {
247
+ /**
248
+ * Requests that Amazon add items to the Sandbox Inventory with desired amount of quantity in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
249
+ * @param {string} xAmznIdempotencyToken A unique token/requestId provided with each call to ensure idempotency.
250
+ * @param {AddInventoryRequest} addInventoryRequestBody List of items to add to Sandbox inventory.
251
+ * @param {*} [options] Override http request option.
252
+ * @throws {RequiredError}
253
+ */
254
+ async addInventory(xAmznIdempotencyToken, addInventoryRequestBody, options) {
255
+ const localVarAxiosArgs = await localVarAxiosParamCreator.addInventory(xAmznIdempotencyToken, addInventoryRequestBody, options);
256
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
257
+ const localVarOperationServerBasePath = operationServerMap["FbaInventoryApi.addInventory"]?.[localVarOperationServerIndex]?.url;
258
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
259
+ },
260
+ /**
261
+ * Requests that Amazon create product-details in the Sandbox Inventory in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
262
+ * @param {CreateInventoryItemRequest} createInventoryItemRequestBody CreateInventoryItem Request Body Parameter.
263
+ * @param {*} [options] Override http request option.
264
+ * @throws {RequiredError}
265
+ */
266
+ async createInventoryItem(createInventoryItemRequestBody, options) {
267
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createInventoryItem(createInventoryItemRequestBody, options);
268
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
269
+ const localVarOperationServerBasePath = operationServerMap["FbaInventoryApi.createInventoryItem"]?.[localVarOperationServerIndex]?.url;
270
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
271
+ },
272
+ /**
273
+ * Requests that Amazon Deletes an item from the Sandbox Inventory in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
274
+ * @param {string} sellerSku A single seller SKU used for querying the specified seller SKU inventory summaries.
275
+ * @param {string} marketplaceId The marketplace ID for the marketplace for which the sellerSku is to be deleted.
276
+ * @param {*} [options] Override http request option.
277
+ * @throws {RequiredError}
278
+ */
279
+ async deleteInventoryItem(sellerSku, marketplaceId, options) {
280
+ const localVarAxiosArgs = await localVarAxiosParamCreator.deleteInventoryItem(sellerSku, marketplaceId, options);
281
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
282
+ const localVarOperationServerBasePath = operationServerMap["FbaInventoryApi.deleteInventoryItem"]?.[localVarOperationServerIndex]?.url;
283
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
284
+ },
285
+ /**
286
+ * Returns a list of inventory summaries. The summaries returned depend on the presence or absence of the startDateTime, sellerSkus and sellerSku parameters: - All inventory summaries with available details are returned when the startDateTime, sellerSkus and sellerSku parameters are omitted. - When startDateTime is provided, the operation returns inventory summaries that have had changes after the date and time specified. The sellerSkus and sellerSku parameters are ignored. Important: To avoid errors, use both startDateTime and nextToken to get the next page of inventory summaries that have changed after the date and time specified. - When the sellerSkus parameter is provided, the operation returns inventory summaries for only the specified sellerSkus. The sellerSku parameter is ignored. - When the sellerSku parameter is provided, the operation returns inventory summaries for only the specified sellerSku. Note: The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). Usage Plan: | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits).
287
+ * @param {GetInventorySummariesGranularityTypeEnum} granularityType The granularity type for the inventory aggregation level.
288
+ * @param {string} granularityId The granularity ID for the inventory aggregation level.
289
+ * @param {Array<string>} marketplaceIds The marketplace ID for the marketplace for which to return inventory summaries.
290
+ * @param {boolean} [details] true to return inventory summaries with additional summarized inventory details and quantities. Otherwise, returns inventory summaries only (default value).
291
+ * @param {string} [startDateTime] A start date and time in ISO8601 format. If specified, all inventory summaries that have changed since then are returned. You must specify a date and time that is no earlier than 18 months prior to the date and time when you call the API. Note: Changes in inboundWorkingQuantity, inboundShippedQuantity and inboundReceivingQuantity are not detected.
292
+ * @param {Array<string>} [sellerSkus] A list of seller SKUs for which to return inventory summaries. You may specify up to 50 SKUs.
293
+ * @param {string} [sellerSku] A single seller SKU used for querying the specified seller SKU inventory summaries.
294
+ * @param {string} [nextToken] String token returned in the response of your previous request. The string token will expire 30 seconds after being created.
295
+ * @param {*} [options] Override http request option.
296
+ * @throws {RequiredError}
297
+ */
298
+ async getInventorySummaries(granularityType, granularityId, marketplaceIds, details, startDateTime, sellerSkus, sellerSku, nextToken, options) {
299
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getInventorySummaries(granularityType, granularityId, marketplaceIds, details, startDateTime, sellerSkus, sellerSku, nextToken, options);
300
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
301
+ const localVarOperationServerBasePath = operationServerMap["FbaInventoryApi.getInventorySummaries"]?.[localVarOperationServerIndex]?.url;
302
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
303
+ }
304
+ };
308
305
  };
309
- var FbaInventoryApiFactory = function(configuration, basePath, axios) {
310
- const localVarFp = FbaInventoryApiFp(configuration);
311
- return {
312
- /**
313
- * Requests that Amazon add items to the Sandbox Inventory with desired amount of quantity in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
314
- * @param {FbaInventoryApiAddInventoryRequest} requestParameters Request parameters.
315
- * @param {*} [options] Override http request option.
316
- * @throws {RequiredError}
317
- */
318
- addInventory(requestParameters, options) {
319
- return localVarFp.addInventory(requestParameters.xAmznIdempotencyToken, requestParameters.addInventoryRequestBody, options).then((request) => request(axios, basePath));
320
- },
321
- /**
322
- * Requests that Amazon create product-details in the Sandbox Inventory in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
323
- * @param {FbaInventoryApiCreateInventoryItemRequest} requestParameters Request parameters.
324
- * @param {*} [options] Override http request option.
325
- * @throws {RequiredError}
326
- */
327
- createInventoryItem(requestParameters, options) {
328
- return localVarFp.createInventoryItem(requestParameters.createInventoryItemRequestBody, options).then((request) => request(axios, basePath));
329
- },
330
- /**
331
- * Requests that Amazon Deletes an item from the Sandbox Inventory in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
332
- * @param {FbaInventoryApiDeleteInventoryItemRequest} requestParameters Request parameters.
333
- * @param {*} [options] Override http request option.
334
- * @throws {RequiredError}
335
- */
336
- deleteInventoryItem(requestParameters, options) {
337
- return localVarFp.deleteInventoryItem(requestParameters.sellerSku, requestParameters.marketplaceId, options).then((request) => request(axios, basePath));
338
- },
339
- /**
340
- * Returns a list of inventory summaries. The summaries returned depend on the presence or absence of the startDateTime, sellerSkus and sellerSku parameters: - All inventory summaries with available details are returned when the startDateTime, sellerSkus and sellerSku parameters are omitted. - When startDateTime is provided, the operation returns inventory summaries that have had changes after the date and time specified. The sellerSkus and sellerSku parameters are ignored. Important: To avoid errors, use both startDateTime and nextToken to get the next page of inventory summaries that have changed after the date and time specified. - When the sellerSkus parameter is provided, the operation returns inventory summaries for only the specified sellerSkus. The sellerSku parameter is ignored. - When the sellerSku parameter is provided, the operation returns inventory summaries for only the specified sellerSku. Note: The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). Usage Plan: | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits).
341
- * @param {FbaInventoryApiGetInventorySummariesRequest} requestParameters Request parameters.
342
- * @param {*} [options] Override http request option.
343
- * @throws {RequiredError}
344
- */
345
- getInventorySummaries(requestParameters, options) {
346
- return localVarFp.getInventorySummaries(requestParameters.granularityType, requestParameters.granularityId, requestParameters.marketplaceIds, requestParameters.details, requestParameters.startDateTime, requestParameters.sellerSkus, requestParameters.sellerSku, requestParameters.nextToken, options).then((request) => request(axios, basePath));
347
- }
348
- };
306
+ /**
307
+ * FbaInventoryApi - factory interface
308
+ */
309
+ const FbaInventoryApiFactory = function(configuration, basePath, axios) {
310
+ const localVarFp = FbaInventoryApiFp(configuration);
311
+ return {
312
+ /**
313
+ * Requests that Amazon add items to the Sandbox Inventory with desired amount of quantity in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
314
+ * @param {FbaInventoryApiAddInventoryRequest} requestParameters Request parameters.
315
+ * @param {*} [options] Override http request option.
316
+ * @throws {RequiredError}
317
+ */
318
+ addInventory(requestParameters, options) {
319
+ return localVarFp.addInventory(requestParameters.xAmznIdempotencyToken, requestParameters.addInventoryRequestBody, options).then((request) => request(axios, basePath));
320
+ },
321
+ /**
322
+ * Requests that Amazon create product-details in the Sandbox Inventory in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
323
+ * @param {FbaInventoryApiCreateInventoryItemRequest} requestParameters Request parameters.
324
+ * @param {*} [options] Override http request option.
325
+ * @throws {RequiredError}
326
+ */
327
+ createInventoryItem(requestParameters, options) {
328
+ return localVarFp.createInventoryItem(requestParameters.createInventoryItemRequestBody, options).then((request) => request(axios, basePath));
329
+ },
330
+ /**
331
+ * Requests that Amazon Deletes an item from the Sandbox Inventory in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
332
+ * @param {FbaInventoryApiDeleteInventoryItemRequest} requestParameters Request parameters.
333
+ * @param {*} [options] Override http request option.
334
+ * @throws {RequiredError}
335
+ */
336
+ deleteInventoryItem(requestParameters, options) {
337
+ return localVarFp.deleteInventoryItem(requestParameters.sellerSku, requestParameters.marketplaceId, options).then((request) => request(axios, basePath));
338
+ },
339
+ /**
340
+ * Returns a list of inventory summaries. The summaries returned depend on the presence or absence of the startDateTime, sellerSkus and sellerSku parameters: - All inventory summaries with available details are returned when the startDateTime, sellerSkus and sellerSku parameters are omitted. - When startDateTime is provided, the operation returns inventory summaries that have had changes after the date and time specified. The sellerSkus and sellerSku parameters are ignored. Important: To avoid errors, use both startDateTime and nextToken to get the next page of inventory summaries that have changed after the date and time specified. - When the sellerSkus parameter is provided, the operation returns inventory summaries for only the specified sellerSkus. The sellerSku parameter is ignored. - When the sellerSku parameter is provided, the operation returns inventory summaries for only the specified sellerSku. Note: The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). Usage Plan: | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits).
341
+ * @param {FbaInventoryApiGetInventorySummariesRequest} requestParameters Request parameters.
342
+ * @param {*} [options] Override http request option.
343
+ * @throws {RequiredError}
344
+ */
345
+ getInventorySummaries(requestParameters, options) {
346
+ return localVarFp.getInventorySummaries(requestParameters.granularityType, requestParameters.granularityId, requestParameters.marketplaceIds, requestParameters.details, requestParameters.startDateTime, requestParameters.sellerSkus, requestParameters.sellerSku, requestParameters.nextToken, options).then((request) => request(axios, basePath));
347
+ }
348
+ };
349
349
  };
350
+ /**
351
+ * FbaInventoryApi - object-oriented interface
352
+ */
350
353
  var FbaInventoryApi = class extends BaseAPI {
351
- /**
352
- * Requests that Amazon add items to the Sandbox Inventory with desired amount of quantity in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
353
- * @param {FbaInventoryApiAddInventoryRequest} requestParameters Request parameters.
354
- * @param {*} [options] Override http request option.
355
- * @throws {RequiredError}
356
- */
357
- addInventory(requestParameters, options) {
358
- return FbaInventoryApiFp(this.configuration).addInventory(requestParameters.xAmznIdempotencyToken, requestParameters.addInventoryRequestBody, options).then((request) => request(this.axios, this.basePath));
359
- }
360
- /**
361
- * Requests that Amazon create product-details in the Sandbox Inventory in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
362
- * @param {FbaInventoryApiCreateInventoryItemRequest} requestParameters Request parameters.
363
- * @param {*} [options] Override http request option.
364
- * @throws {RequiredError}
365
- */
366
- createInventoryItem(requestParameters, options) {
367
- return FbaInventoryApiFp(this.configuration).createInventoryItem(requestParameters.createInventoryItemRequestBody, options).then((request) => request(this.axios, this.basePath));
368
- }
369
- /**
370
- * Requests that Amazon Deletes an item from the Sandbox Inventory in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
371
- * @param {FbaInventoryApiDeleteInventoryItemRequest} requestParameters Request parameters.
372
- * @param {*} [options] Override http request option.
373
- * @throws {RequiredError}
374
- */
375
- deleteInventoryItem(requestParameters, options) {
376
- return FbaInventoryApiFp(this.configuration).deleteInventoryItem(requestParameters.sellerSku, requestParameters.marketplaceId, options).then((request) => request(this.axios, this.basePath));
377
- }
378
- /**
379
- * Returns a list of inventory summaries. The summaries returned depend on the presence or absence of the startDateTime, sellerSkus and sellerSku parameters: - All inventory summaries with available details are returned when the startDateTime, sellerSkus and sellerSku parameters are omitted. - When startDateTime is provided, the operation returns inventory summaries that have had changes after the date and time specified. The sellerSkus and sellerSku parameters are ignored. Important: To avoid errors, use both startDateTime and nextToken to get the next page of inventory summaries that have changed after the date and time specified. - When the sellerSkus parameter is provided, the operation returns inventory summaries for only the specified sellerSkus. The sellerSku parameter is ignored. - When the sellerSku parameter is provided, the operation returns inventory summaries for only the specified sellerSku. Note: The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). Usage Plan: | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits).
380
- * @param {FbaInventoryApiGetInventorySummariesRequest} requestParameters Request parameters.
381
- * @param {*} [options] Override http request option.
382
- * @throws {RequiredError}
383
- */
384
- getInventorySummaries(requestParameters, options) {
385
- return FbaInventoryApiFp(this.configuration).getInventorySummaries(requestParameters.granularityType, requestParameters.granularityId, requestParameters.marketplaceIds, requestParameters.details, requestParameters.startDateTime, requestParameters.sellerSkus, requestParameters.sellerSku, requestParameters.nextToken, options).then((request) => request(this.axios, this.basePath));
386
- }
387
- };
388
- var GetInventorySummariesGranularityTypeEnum = {
389
- Marketplace: "Marketplace"
354
+ /**
355
+ * Requests that Amazon add items to the Sandbox Inventory with desired amount of quantity in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
356
+ * @param {FbaInventoryApiAddInventoryRequest} requestParameters Request parameters.
357
+ * @param {*} [options] Override http request option.
358
+ * @throws {RequiredError}
359
+ */
360
+ addInventory(requestParameters, options) {
361
+ return FbaInventoryApiFp(this.configuration).addInventory(requestParameters.xAmznIdempotencyToken, requestParameters.addInventoryRequestBody, options).then((request) => request(this.axios, this.basePath));
362
+ }
363
+ /**
364
+ * Requests that Amazon create product-details in the Sandbox Inventory in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
365
+ * @param {FbaInventoryApiCreateInventoryItemRequest} requestParameters Request parameters.
366
+ * @param {*} [options] Override http request option.
367
+ * @throws {RequiredError}
368
+ */
369
+ createInventoryItem(requestParameters, options) {
370
+ return FbaInventoryApiFp(this.configuration).createInventoryItem(requestParameters.createInventoryItemRequestBody, options).then((request) => request(this.axios, this.basePath));
371
+ }
372
+ /**
373
+ * Requests that Amazon Deletes an item from the Sandbox Inventory in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
374
+ * @param {FbaInventoryApiDeleteInventoryItemRequest} requestParameters Request parameters.
375
+ * @param {*} [options] Override http request option.
376
+ * @throws {RequiredError}
377
+ */
378
+ deleteInventoryItem(requestParameters, options) {
379
+ return FbaInventoryApiFp(this.configuration).deleteInventoryItem(requestParameters.sellerSku, requestParameters.marketplaceId, options).then((request) => request(this.axios, this.basePath));
380
+ }
381
+ /**
382
+ * Returns a list of inventory summaries. The summaries returned depend on the presence or absence of the startDateTime, sellerSkus and sellerSku parameters: - All inventory summaries with available details are returned when the startDateTime, sellerSkus and sellerSku parameters are omitted. - When startDateTime is provided, the operation returns inventory summaries that have had changes after the date and time specified. The sellerSkus and sellerSku parameters are ignored. Important: To avoid errors, use both startDateTime and nextToken to get the next page of inventory summaries that have changed after the date and time specified. - When the sellerSkus parameter is provided, the operation returns inventory summaries for only the specified sellerSkus. The sellerSku parameter is ignored. - When the sellerSku parameter is provided, the operation returns inventory summaries for only the specified sellerSku. Note: The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). Usage Plan: | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits).
383
+ * @param {FbaInventoryApiGetInventorySummariesRequest} requestParameters Request parameters.
384
+ * @param {*} [options] Override http request option.
385
+ * @throws {RequiredError}
386
+ */
387
+ getInventorySummaries(requestParameters, options) {
388
+ return FbaInventoryApiFp(this.configuration).getInventorySummaries(requestParameters.granularityType, requestParameters.granularityId, requestParameters.marketplaceIds, requestParameters.details, requestParameters.startDateTime, requestParameters.sellerSkus, requestParameters.sellerSku, requestParameters.nextToken, options).then((request) => request(this.axios, this.basePath));
389
+ }
390
390
  };
391
-
392
- // src/api-model/configuration.ts
391
+ const GetInventorySummariesGranularityTypeEnum = { Marketplace: "Marketplace" };
392
+ //#endregion
393
+ //#region src/api-model/configuration.ts
393
394
  var Configuration = class {
394
- /**
395
- * parameter for apiKey security
396
- * @param name security name
397
- */
398
- apiKey;
399
- /**
400
- * parameter for basic security
401
- */
402
- username;
403
- /**
404
- * parameter for basic security
405
- */
406
- password;
407
- /**
408
- * parameter for oauth2 security
409
- * @param name security name
410
- * @param scopes oauth2 scope
411
- */
412
- accessToken;
413
- /**
414
- * parameter for aws4 signature security
415
- * @param {Object} AWS4Signature - AWS4 Signature security
416
- * @param {string} options.region - aws region
417
- * @param {string} options.service - name of the service.
418
- * @param {string} credentials.accessKeyId - aws access key id
419
- * @param {string} credentials.secretAccessKey - aws access key
420
- * @param {string} credentials.sessionToken - aws session token
421
- * @memberof Configuration
422
- */
423
- awsv4;
424
- /**
425
- * override base path
426
- */
427
- basePath;
428
- /**
429
- * override server index
430
- */
431
- serverIndex;
432
- /**
433
- * base options for axios calls
434
- */
435
- baseOptions;
436
- /**
437
- * The FormData constructor that will be used to create multipart form data
438
- * requests. You can inject this here so that execution environments that
439
- * do not support the FormData class can still run the generated client.
440
- *
441
- * @type {new () => FormData}
442
- */
443
- formDataCtor;
444
- constructor(param = {}) {
445
- this.apiKey = param.apiKey;
446
- this.username = param.username;
447
- this.password = param.password;
448
- this.accessToken = param.accessToken;
449
- this.awsv4 = param.awsv4;
450
- this.basePath = param.basePath;
451
- this.serverIndex = param.serverIndex;
452
- this.baseOptions = {
453
- ...param.baseOptions,
454
- headers: {
455
- ...param.baseOptions?.headers
456
- }
457
- };
458
- this.formDataCtor = param.formDataCtor;
459
- }
460
- /**
461
- * Check if the given MIME is a JSON MIME.
462
- * JSON MIME examples:
463
- * application/json
464
- * application/json; charset=UTF8
465
- * APPLICATION/JSON
466
- * application/vnd.company+json
467
- * @param mime - MIME (Multipurpose Internet Mail Extensions)
468
- * @return True if the given MIME is JSON, false otherwise.
469
- */
470
- isJsonMime(mime) {
471
- const jsonMime = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i;
472
- return mime !== null && jsonMime.test(mime);
473
- }
395
+ /**
396
+ * parameter for apiKey security
397
+ * @param name security name
398
+ */
399
+ apiKey;
400
+ /**
401
+ * parameter for basic security
402
+ */
403
+ username;
404
+ /**
405
+ * parameter for basic security
406
+ */
407
+ password;
408
+ /**
409
+ * parameter for oauth2 security
410
+ * @param name security name
411
+ * @param scopes oauth2 scope
412
+ */
413
+ accessToken;
414
+ /**
415
+ * parameter for aws4 signature security
416
+ * @param {Object} AWS4Signature - AWS4 Signature security
417
+ * @param {string} options.region - aws region
418
+ * @param {string} options.service - name of the service.
419
+ * @param {string} credentials.accessKeyId - aws access key id
420
+ * @param {string} credentials.secretAccessKey - aws access key
421
+ * @param {string} credentials.sessionToken - aws session token
422
+ * @memberof Configuration
423
+ */
424
+ awsv4;
425
+ /**
426
+ * override base path
427
+ */
428
+ basePath;
429
+ /**
430
+ * override server index
431
+ */
432
+ serverIndex;
433
+ /**
434
+ * base options for axios calls
435
+ */
436
+ baseOptions;
437
+ /**
438
+ * The FormData constructor that will be used to create multipart form data
439
+ * requests. You can inject this here so that execution environments that
440
+ * do not support the FormData class can still run the generated client.
441
+ *
442
+ * @type {new () => FormData}
443
+ */
444
+ formDataCtor;
445
+ constructor(param = {}) {
446
+ this.apiKey = param.apiKey;
447
+ this.username = param.username;
448
+ this.password = param.password;
449
+ this.accessToken = param.accessToken;
450
+ this.awsv4 = param.awsv4;
451
+ this.basePath = param.basePath;
452
+ this.serverIndex = param.serverIndex;
453
+ this.baseOptions = {
454
+ ...param.baseOptions,
455
+ headers: { ...param.baseOptions?.headers }
456
+ };
457
+ this.formDataCtor = param.formDataCtor;
458
+ }
459
+ /**
460
+ * Check if the given MIME is a JSON MIME.
461
+ * JSON MIME examples:
462
+ * application/json
463
+ * application/json; charset=UTF8
464
+ * APPLICATION/JSON
465
+ * application/vnd.company+json
466
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
467
+ * @return True if the given MIME is JSON, false otherwise.
468
+ */
469
+ isJsonMime(mime) {
470
+ return mime !== null && /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i.test(mime);
471
+ }
474
472
  };
475
-
476
- // src/api-model/models/researching-quantity-entry.ts
477
- var ResearchingQuantityEntryNameEnum = {
478
- ResearchingQuantityInShortTerm: "researchingQuantityInShortTerm",
479
- ResearchingQuantityInMidTerm: "researchingQuantityInMidTerm",
480
- ResearchingQuantityInLongTerm: "researchingQuantityInLongTerm"
473
+ //#endregion
474
+ //#region src/api-model/models/researching-quantity-entry.ts
475
+ const ResearchingQuantityEntryNameEnum = {
476
+ ResearchingQuantityInShortTerm: "researchingQuantityInShortTerm",
477
+ ResearchingQuantityInMidTerm: "researchingQuantityInMidTerm",
478
+ ResearchingQuantityInLongTerm: "researchingQuantityInLongTerm"
481
479
  };
482
-
483
- // src/client.ts
484
- var clientRateLimits = [
485
- {
486
- method: "get",
487
- // eslint-disable-next-line prefer-regex-literals
488
- urlRegex: new RegExp("^/fba/inventory/v1/summaries$"),
489
- rate: 2,
490
- burst: 2
491
- }
492
- ];
480
+ //#endregion
481
+ //#region src/client.ts
482
+ const clientRateLimits = [{
483
+ method: "get",
484
+ urlRegex: /^\/fba\/inventory\/v1\/summaries$/v,
485
+ rate: 2,
486
+ burst: 2
487
+ }];
493
488
  var FbaInventoryApiClient = class extends FbaInventoryApi {
494
- constructor(configuration) {
495
- const { axios, endpoint } = createAxiosInstance(configuration, clientRateLimits);
496
- super(new Configuration(), endpoint, axios);
497
- }
498
- };
499
- export {
500
- FbaInventoryApi,
501
- FbaInventoryApiAxiosParamCreator,
502
- FbaInventoryApiClient,
503
- FbaInventoryApiFactory,
504
- FbaInventoryApiFp,
505
- GetInventorySummariesGranularityTypeEnum,
506
- ResearchingQuantityEntryNameEnum,
507
- clientRateLimits
489
+ constructor(configuration) {
490
+ const { axios, endpoint } = createAxiosInstance(configuration, clientRateLimits);
491
+ super(new Configuration(), endpoint, axios);
492
+ }
508
493
  };
494
+ //#endregion
495
+ export { FbaInventoryApi, FbaInventoryApiAxiosParamCreator, FbaInventoryApiClient, FbaInventoryApiFactory, FbaInventoryApiFp, GetInventorySummariesGranularityTypeEnum, ResearchingQuantityEntryNameEnum, clientRateLimits };
496
+
509
497
  //# sourceMappingURL=index.js.map