@sp-api-sdk/external-fulfillment-returns-api-2024-09-11 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,414 +1,389 @@
1
- // src/client.ts
2
1
  import { createAxiosInstance } from "@sp-api-sdk/common";
3
-
4
- // src/api-model/api/external-fulfillment-returns-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(/\/+$/, "");
3
+ //#region src/api-model/base.ts
4
+ const BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
10
5
  var BaseAPI = class {
11
- constructor(configuration, basePath = BASE_PATH, axios = globalAxios) {
12
- this.basePath = basePath;
13
- this.axios = axios;
14
- if (configuration) {
15
- this.configuration = configuration;
16
- this.basePath = configuration.basePath ?? basePath;
17
- }
18
- }
19
- basePath;
20
- axios;
21
- configuration;
6
+ basePath;
7
+ axios;
8
+ configuration;
9
+ constructor(configuration, basePath = BASE_PATH, axios = globalAxios) {
10
+ this.basePath = basePath;
11
+ this.axios = axios;
12
+ if (configuration) {
13
+ this.configuration = configuration;
14
+ this.basePath = configuration.basePath ?? basePath;
15
+ }
16
+ }
22
17
  };
23
18
  var RequiredError = class extends Error {
24
- constructor(field, msg) {
25
- super(msg);
26
- this.field = field;
27
- this.name = "RequiredError";
28
- }
29
- field;
19
+ field;
20
+ constructor(field, msg) {
21
+ super(msg);
22
+ this.field = field;
23
+ this.name = "RequiredError";
24
+ }
30
25
  };
31
- var operationServerMap = {};
32
-
33
- // src/api-model/common.ts
34
- var DUMMY_BASE_URL = "https://example.com";
35
- var assertParamExists = function(functionName, paramName, paramValue) {
36
- if (paramValue === null || paramValue === void 0) {
37
- throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
38
- }
26
+ const operationServerMap = {};
27
+ //#endregion
28
+ //#region src/api-model/common.ts
29
+ const DUMMY_BASE_URL = "https://example.com";
30
+ /**
31
+ *
32
+ * @throws {RequiredError}
33
+ */
34
+ const assertParamExists = function(functionName, paramName, paramValue) {
35
+ if (paramValue === null || paramValue === void 0) throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
39
36
  };
40
37
  function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
41
- if (parameter == null) return;
42
- if (typeof parameter === "object") {
43
- if (Array.isArray(parameter) || parameter instanceof Set) {
44
- parameter.forEach((item) => setFlattenedQueryParams(urlSearchParams, item, key));
45
- } else {
46
- Object.keys(parameter).forEach(
47
- (currentKey) => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== "" ? "." : ""}${currentKey}`)
48
- );
49
- }
50
- } else {
51
- if (urlSearchParams.has(key)) {
52
- urlSearchParams.append(key, parameter);
53
- } else {
54
- urlSearchParams.set(key, parameter);
55
- }
56
- }
38
+ if (parameter == null) return;
39
+ if (typeof parameter === "object") if (Array.isArray(parameter) || parameter instanceof Set) parameter.forEach((item) => setFlattenedQueryParams(urlSearchParams, item, key));
40
+ else Object.keys(parameter).forEach((currentKey) => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== "" ? "." : ""}${currentKey}`));
41
+ else if (urlSearchParams.has(key)) urlSearchParams.append(key, parameter);
42
+ else urlSearchParams.set(key, parameter);
57
43
  }
58
- var setSearchParams = function(url, ...objects) {
59
- const searchParams = new URLSearchParams(url.search);
60
- setFlattenedQueryParams(searchParams, objects);
61
- url.search = searchParams.toString();
44
+ const setSearchParams = function(url, ...objects) {
45
+ const searchParams = new URLSearchParams(url.search);
46
+ setFlattenedQueryParams(searchParams, objects);
47
+ url.search = searchParams.toString();
62
48
  };
63
- var toPathString = function(url) {
64
- return url.pathname + url.search + url.hash;
49
+ const toPathString = function(url) {
50
+ return url.pathname + url.search + url.hash;
65
51
  };
66
- var createRequestFunction = function(axiosArgs, globalAxios3, BASE_PATH2, configuration) {
67
- return (axios = globalAxios3, basePath = BASE_PATH2) => {
68
- const axiosRequestArgs = { ...axiosArgs.options, url: (axios.defaults.baseURL ? "" : configuration?.basePath ?? basePath) + axiosArgs.url };
69
- return axios.request(axiosRequestArgs);
70
- };
52
+ const createRequestFunction = function(axiosArgs, globalAxios, BASE_PATH, configuration) {
53
+ return (axios = globalAxios, basePath = BASE_PATH) => {
54
+ const axiosRequestArgs = {
55
+ ...axiosArgs.options,
56
+ url: (axios.defaults.baseURL ? "" : configuration?.basePath ?? basePath) + axiosArgs.url
57
+ };
58
+ return axios.request(axiosRequestArgs);
59
+ };
71
60
  };
72
-
73
- // src/api-model/api/external-fulfillment-returns-api.ts
74
- var ExternalFulfillmentReturnsApiAxiosParamCreator = function(configuration) {
75
- return {
76
- /**
77
- * Retrieve the return item with the specified ID.
78
- * @param {string} returnId The ID of the return item you want.
79
- * @param {*} [options] Override http request option.
80
- * @throws {RequiredError}
81
- */
82
- getReturn: async (returnId, options = {}) => {
83
- assertParamExists("getReturn", "returnId", returnId);
84
- const localVarPath = `/externalFulfillment/2024-09-11/returns/{returnId}`.replace("{returnId}", encodeURIComponent(String(returnId)));
85
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
86
- let baseOptions;
87
- if (configuration) {
88
- baseOptions = configuration.baseOptions;
89
- }
90
- const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
91
- const localVarHeaderParameter = {};
92
- const localVarQueryParameter = {};
93
- localVarHeaderParameter["Accept"] = "application/json";
94
- setSearchParams(localVarUrlObj, localVarQueryParameter);
95
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
96
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
97
- return {
98
- url: toPathString(localVarUrlObj),
99
- options: localVarRequestOptions
100
- };
101
- },
102
- /**
103
- * Retrieve a list of return items. You can filter results by location, RMA ID, status, or time.
104
- * @param {string} [returnLocationId] The SmartConnect location ID of the location from which you want to retrieve return items.
105
- * @param {string} [rmaId] The RMA ID of the return items you want to list.
106
- * @param {ListReturnsStatusEnum} [status] The status of return items you want to list. You can retrieve all new return items with the `CREATED` status.
107
- * @param {string} [reverseTrackingId] The reverse tracking ID of the return items you want to list.
108
- * @param {string} [createdSince] Return items created after the specified date are included in the response. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format.
109
- * @param {string} [createdUntil] Return items created before the specified date are included in the response. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format.
110
- * @param {string} [lastUpdatedSince] Return items updated after the specified date are included in the response. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. If you supply this parameter, you must also supply `returnLocationId` and `status`.
111
- * @param {string} [lastUpdatedUntil] Return items whose most recent update is before the specified date are included in the response. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. If you supply this parameter, you must also supply `returnLocationId` and `status`.
112
- * @param {string} [lastUpdatedAfter] DEPRECATED. Use the `createdSince` parameter.
113
- * @param {string} [lastUpdatedBefore] DEPRECATED. Use the `createdUntil` parameter.
114
- * @param {number} [maxResults] The number of return items you want to include in the response. **Default:** 10 **Maximum:** 100
115
- * @param {string} [nextToken] A token that you use to retrieve the next page of results. The response includes `nextToken` when there are multiple pages of results. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until `nextToken` is null. Note that this operation can return empty pages.
116
- * @param {*} [options] Override http request option.
117
- * @throws {RequiredError}
118
- */
119
- listReturns: async (returnLocationId, rmaId, status, reverseTrackingId, createdSince, createdUntil, lastUpdatedSince, lastUpdatedUntil, lastUpdatedAfter, lastUpdatedBefore, maxResults, nextToken, options = {}) => {
120
- const localVarPath = `/externalFulfillment/2024-09-11/returns`;
121
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
122
- let baseOptions;
123
- if (configuration) {
124
- baseOptions = configuration.baseOptions;
125
- }
126
- const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
127
- const localVarHeaderParameter = {};
128
- const localVarQueryParameter = {};
129
- if (returnLocationId !== void 0) {
130
- localVarQueryParameter["returnLocationId"] = returnLocationId;
131
- }
132
- if (rmaId !== void 0) {
133
- localVarQueryParameter["rmaId"] = rmaId;
134
- }
135
- if (status !== void 0) {
136
- localVarQueryParameter["status"] = status;
137
- }
138
- if (reverseTrackingId !== void 0) {
139
- localVarQueryParameter["reverseTrackingId"] = reverseTrackingId;
140
- }
141
- if (createdSince !== void 0) {
142
- localVarQueryParameter["createdSince"] = createdSince instanceof Date ? createdSince.toISOString() : createdSince;
143
- }
144
- if (createdUntil !== void 0) {
145
- localVarQueryParameter["createdUntil"] = createdUntil instanceof Date ? createdUntil.toISOString() : createdUntil;
146
- }
147
- if (lastUpdatedSince !== void 0) {
148
- localVarQueryParameter["lastUpdatedSince"] = lastUpdatedSince instanceof Date ? lastUpdatedSince.toISOString() : lastUpdatedSince;
149
- }
150
- if (lastUpdatedUntil !== void 0) {
151
- localVarQueryParameter["lastUpdatedUntil"] = lastUpdatedUntil instanceof Date ? lastUpdatedUntil.toISOString() : lastUpdatedUntil;
152
- }
153
- if (lastUpdatedAfter !== void 0) {
154
- localVarQueryParameter["lastUpdatedAfter"] = lastUpdatedAfter instanceof Date ? lastUpdatedAfter.toISOString() : lastUpdatedAfter;
155
- }
156
- if (lastUpdatedBefore !== void 0) {
157
- localVarQueryParameter["lastUpdatedBefore"] = lastUpdatedBefore instanceof Date ? lastUpdatedBefore.toISOString() : lastUpdatedBefore;
158
- }
159
- if (maxResults !== void 0) {
160
- localVarQueryParameter["maxResults"] = maxResults;
161
- }
162
- if (nextToken !== void 0) {
163
- localVarQueryParameter["nextToken"] = nextToken;
164
- }
165
- localVarHeaderParameter["Accept"] = "application/json";
166
- setSearchParams(localVarUrlObj, localVarQueryParameter);
167
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
168
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
169
- return {
170
- url: toPathString(localVarUrlObj),
171
- options: localVarRequestOptions
172
- };
173
- }
174
- };
61
+ //#endregion
62
+ //#region src/api-model/api/external-fulfillment-returns-api.ts
63
+ /**
64
+ * ExternalFulfillmentReturnsApi - axios parameter creator
65
+ */
66
+ const ExternalFulfillmentReturnsApiAxiosParamCreator = function(configuration) {
67
+ return {
68
+ /**
69
+ * Retrieve the return item with the specified ID.
70
+ * @param {string} returnId The ID of the return item you want.
71
+ * @param {*} [options] Override http request option.
72
+ * @throws {RequiredError}
73
+ */
74
+ getReturn: async (returnId, options = {}) => {
75
+ assertParamExists("getReturn", "returnId", returnId);
76
+ const localVarPath = `/externalFulfillment/2024-09-11/returns/{returnId}`.replace("{returnId}", encodeURIComponent(String(returnId)));
77
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
78
+ let baseOptions;
79
+ if (configuration) baseOptions = configuration.baseOptions;
80
+ const localVarRequestOptions = {
81
+ method: "GET",
82
+ ...baseOptions,
83
+ ...options
84
+ };
85
+ const localVarHeaderParameter = {};
86
+ const localVarQueryParameter = {};
87
+ localVarHeaderParameter["Accept"] = "application/json";
88
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
89
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
90
+ localVarRequestOptions.headers = {
91
+ ...localVarHeaderParameter,
92
+ ...headersFromBaseOptions,
93
+ ...options.headers
94
+ };
95
+ return {
96
+ url: toPathString(localVarUrlObj),
97
+ options: localVarRequestOptions
98
+ };
99
+ },
100
+ /**
101
+ * Retrieve a list of return items. You can filter results by location, RMA ID, status, or time.
102
+ * @param {string} [returnLocationId] The SmartConnect location ID of the location from which you want to retrieve return items.
103
+ * @param {string} [rmaId] The RMA ID of the return items you want to list.
104
+ * @param {ListReturnsStatusEnum} [status] The status of return items you want to list. You can retrieve all new return items with the `CREATED` status.
105
+ * @param {string} [reverseTrackingId] The reverse tracking ID of the return items you want to list.
106
+ * @param {string} [createdSince] Return items created after the specified date are included in the response. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format.
107
+ * @param {string} [createdUntil] Return items created before the specified date are included in the response. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format.
108
+ * @param {string} [lastUpdatedSince] Return items updated after the specified date are included in the response. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. If you supply this parameter, you must also supply `returnLocationId` and `status`.
109
+ * @param {string} [lastUpdatedUntil] Return items whose most recent update is before the specified date are included in the response. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. If you supply this parameter, you must also supply `returnLocationId` and `status`.
110
+ * @param {string} [lastUpdatedAfter] DEPRECATED. Use the `createdSince` parameter.
111
+ * @param {string} [lastUpdatedBefore] DEPRECATED. Use the `createdUntil` parameter.
112
+ * @param {number} [maxResults] The number of return items you want to include in the response. **Default:** 10 **Maximum:** 100
113
+ * @param {string} [nextToken] A token that you use to retrieve the next page of results. The response includes `nextToken` when there are multiple pages of results. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until `nextToken` is null. Note that this operation can return empty pages.
114
+ * @param {*} [options] Override http request option.
115
+ * @throws {RequiredError}
116
+ */
117
+ listReturns: async (returnLocationId, rmaId, status, reverseTrackingId, createdSince, createdUntil, lastUpdatedSince, lastUpdatedUntil, lastUpdatedAfter, lastUpdatedBefore, maxResults, nextToken, options = {}) => {
118
+ const localVarUrlObj = new URL(`/externalFulfillment/2024-09-11/returns`, DUMMY_BASE_URL);
119
+ let baseOptions;
120
+ if (configuration) baseOptions = configuration.baseOptions;
121
+ const localVarRequestOptions = {
122
+ method: "GET",
123
+ ...baseOptions,
124
+ ...options
125
+ };
126
+ const localVarHeaderParameter = {};
127
+ const localVarQueryParameter = {};
128
+ if (returnLocationId !== void 0) localVarQueryParameter["returnLocationId"] = returnLocationId;
129
+ if (rmaId !== void 0) localVarQueryParameter["rmaId"] = rmaId;
130
+ if (status !== void 0) localVarQueryParameter["status"] = status;
131
+ if (reverseTrackingId !== void 0) localVarQueryParameter["reverseTrackingId"] = reverseTrackingId;
132
+ if (createdSince !== void 0) localVarQueryParameter["createdSince"] = createdSince instanceof Date ? createdSince.toISOString() : createdSince;
133
+ if (createdUntil !== void 0) localVarQueryParameter["createdUntil"] = createdUntil instanceof Date ? createdUntil.toISOString() : createdUntil;
134
+ if (lastUpdatedSince !== void 0) localVarQueryParameter["lastUpdatedSince"] = lastUpdatedSince instanceof Date ? lastUpdatedSince.toISOString() : lastUpdatedSince;
135
+ if (lastUpdatedUntil !== void 0) localVarQueryParameter["lastUpdatedUntil"] = lastUpdatedUntil instanceof Date ? lastUpdatedUntil.toISOString() : lastUpdatedUntil;
136
+ if (lastUpdatedAfter !== void 0) localVarQueryParameter["lastUpdatedAfter"] = lastUpdatedAfter instanceof Date ? lastUpdatedAfter.toISOString() : lastUpdatedAfter;
137
+ if (lastUpdatedBefore !== void 0) localVarQueryParameter["lastUpdatedBefore"] = lastUpdatedBefore instanceof Date ? lastUpdatedBefore.toISOString() : lastUpdatedBefore;
138
+ if (maxResults !== void 0) localVarQueryParameter["maxResults"] = maxResults;
139
+ if (nextToken !== void 0) localVarQueryParameter["nextToken"] = nextToken;
140
+ localVarHeaderParameter["Accept"] = "application/json";
141
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
142
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
143
+ localVarRequestOptions.headers = {
144
+ ...localVarHeaderParameter,
145
+ ...headersFromBaseOptions,
146
+ ...options.headers
147
+ };
148
+ return {
149
+ url: toPathString(localVarUrlObj),
150
+ options: localVarRequestOptions
151
+ };
152
+ }
153
+ };
175
154
  };
176
- var ExternalFulfillmentReturnsApiFp = function(configuration) {
177
- const localVarAxiosParamCreator = ExternalFulfillmentReturnsApiAxiosParamCreator(configuration);
178
- return {
179
- /**
180
- * Retrieve the return item with the specified ID.
181
- * @param {string} returnId The ID of the return item you want.
182
- * @param {*} [options] Override http request option.
183
- * @throws {RequiredError}
184
- */
185
- async getReturn(returnId, options) {
186
- const localVarAxiosArgs = await localVarAxiosParamCreator.getReturn(returnId, options);
187
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
188
- const localVarOperationServerBasePath = operationServerMap["ExternalFulfillmentReturnsApi.getReturn"]?.[localVarOperationServerIndex]?.url;
189
- return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
190
- },
191
- /**
192
- * Retrieve a list of return items. You can filter results by location, RMA ID, status, or time.
193
- * @param {string} [returnLocationId] The SmartConnect location ID of the location from which you want to retrieve return items.
194
- * @param {string} [rmaId] The RMA ID of the return items you want to list.
195
- * @param {ListReturnsStatusEnum} [status] The status of return items you want to list. You can retrieve all new return items with the `CREATED` status.
196
- * @param {string} [reverseTrackingId] The reverse tracking ID of the return items you want to list.
197
- * @param {string} [createdSince] Return items created after the specified date are included in the response. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format.
198
- * @param {string} [createdUntil] Return items created before the specified date are included in the response. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format.
199
- * @param {string} [lastUpdatedSince] Return items updated after the specified date are included in the response. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. If you supply this parameter, you must also supply `returnLocationId` and `status`.
200
- * @param {string} [lastUpdatedUntil] Return items whose most recent update is before the specified date are included in the response. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. If you supply this parameter, you must also supply `returnLocationId` and `status`.
201
- * @param {string} [lastUpdatedAfter] DEPRECATED. Use the `createdSince` parameter.
202
- * @param {string} [lastUpdatedBefore] DEPRECATED. Use the `createdUntil` parameter.
203
- * @param {number} [maxResults] The number of return items you want to include in the response. **Default:** 10 **Maximum:** 100
204
- * @param {string} [nextToken] A token that you use to retrieve the next page of results. The response includes `nextToken` when there are multiple pages of results. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until `nextToken` is null. Note that this operation can return empty pages.
205
- * @param {*} [options] Override http request option.
206
- * @throws {RequiredError}
207
- */
208
- async listReturns(returnLocationId, rmaId, status, reverseTrackingId, createdSince, createdUntil, lastUpdatedSince, lastUpdatedUntil, lastUpdatedAfter, lastUpdatedBefore, maxResults, nextToken, options) {
209
- const localVarAxiosArgs = await localVarAxiosParamCreator.listReturns(returnLocationId, rmaId, status, reverseTrackingId, createdSince, createdUntil, lastUpdatedSince, lastUpdatedUntil, lastUpdatedAfter, lastUpdatedBefore, maxResults, nextToken, options);
210
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
211
- const localVarOperationServerBasePath = operationServerMap["ExternalFulfillmentReturnsApi.listReturns"]?.[localVarOperationServerIndex]?.url;
212
- return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
213
- }
214
- };
155
+ /**
156
+ * ExternalFulfillmentReturnsApi - functional programming interface
157
+ */
158
+ const ExternalFulfillmentReturnsApiFp = function(configuration) {
159
+ const localVarAxiosParamCreator = ExternalFulfillmentReturnsApiAxiosParamCreator(configuration);
160
+ return {
161
+ /**
162
+ * Retrieve the return item with the specified ID.
163
+ * @param {string} returnId The ID of the return item you want.
164
+ * @param {*} [options] Override http request option.
165
+ * @throws {RequiredError}
166
+ */
167
+ async getReturn(returnId, options) {
168
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getReturn(returnId, options);
169
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
170
+ const localVarOperationServerBasePath = operationServerMap["ExternalFulfillmentReturnsApi.getReturn"]?.[localVarOperationServerIndex]?.url;
171
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
172
+ },
173
+ /**
174
+ * Retrieve a list of return items. You can filter results by location, RMA ID, status, or time.
175
+ * @param {string} [returnLocationId] The SmartConnect location ID of the location from which you want to retrieve return items.
176
+ * @param {string} [rmaId] The RMA ID of the return items you want to list.
177
+ * @param {ListReturnsStatusEnum} [status] The status of return items you want to list. You can retrieve all new return items with the `CREATED` status.
178
+ * @param {string} [reverseTrackingId] The reverse tracking ID of the return items you want to list.
179
+ * @param {string} [createdSince] Return items created after the specified date are included in the response. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format.
180
+ * @param {string} [createdUntil] Return items created before the specified date are included in the response. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format.
181
+ * @param {string} [lastUpdatedSince] Return items updated after the specified date are included in the response. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. If you supply this parameter, you must also supply `returnLocationId` and `status`.
182
+ * @param {string} [lastUpdatedUntil] Return items whose most recent update is before the specified date are included in the response. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. If you supply this parameter, you must also supply `returnLocationId` and `status`.
183
+ * @param {string} [lastUpdatedAfter] DEPRECATED. Use the `createdSince` parameter.
184
+ * @param {string} [lastUpdatedBefore] DEPRECATED. Use the `createdUntil` parameter.
185
+ * @param {number} [maxResults] The number of return items you want to include in the response. **Default:** 10 **Maximum:** 100
186
+ * @param {string} [nextToken] A token that you use to retrieve the next page of results. The response includes `nextToken` when there are multiple pages of results. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until `nextToken` is null. Note that this operation can return empty pages.
187
+ * @param {*} [options] Override http request option.
188
+ * @throws {RequiredError}
189
+ */
190
+ async listReturns(returnLocationId, rmaId, status, reverseTrackingId, createdSince, createdUntil, lastUpdatedSince, lastUpdatedUntil, lastUpdatedAfter, lastUpdatedBefore, maxResults, nextToken, options) {
191
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listReturns(returnLocationId, rmaId, status, reverseTrackingId, createdSince, createdUntil, lastUpdatedSince, lastUpdatedUntil, lastUpdatedAfter, lastUpdatedBefore, maxResults, nextToken, options);
192
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
193
+ const localVarOperationServerBasePath = operationServerMap["ExternalFulfillmentReturnsApi.listReturns"]?.[localVarOperationServerIndex]?.url;
194
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
195
+ }
196
+ };
215
197
  };
216
- var ExternalFulfillmentReturnsApiFactory = function(configuration, basePath, axios) {
217
- const localVarFp = ExternalFulfillmentReturnsApiFp(configuration);
218
- return {
219
- /**
220
- * Retrieve the return item with the specified ID.
221
- * @param {ExternalFulfillmentReturnsApiGetReturnRequest} requestParameters Request parameters.
222
- * @param {*} [options] Override http request option.
223
- * @throws {RequiredError}
224
- */
225
- getReturn(requestParameters, options) {
226
- return localVarFp.getReturn(requestParameters.returnId, options).then((request) => request(axios, basePath));
227
- },
228
- /**
229
- * Retrieve a list of return items. You can filter results by location, RMA ID, status, or time.
230
- * @param {ExternalFulfillmentReturnsApiListReturnsRequest} requestParameters Request parameters.
231
- * @param {*} [options] Override http request option.
232
- * @throws {RequiredError}
233
- */
234
- listReturns(requestParameters = {}, options) {
235
- return localVarFp.listReturns(requestParameters.returnLocationId, requestParameters.rmaId, requestParameters.status, requestParameters.reverseTrackingId, requestParameters.createdSince, requestParameters.createdUntil, requestParameters.lastUpdatedSince, requestParameters.lastUpdatedUntil, requestParameters.lastUpdatedAfter, requestParameters.lastUpdatedBefore, requestParameters.maxResults, requestParameters.nextToken, options).then((request) => request(axios, basePath));
236
- }
237
- };
198
+ /**
199
+ * ExternalFulfillmentReturnsApi - factory interface
200
+ */
201
+ const ExternalFulfillmentReturnsApiFactory = function(configuration, basePath, axios) {
202
+ const localVarFp = ExternalFulfillmentReturnsApiFp(configuration);
203
+ return {
204
+ /**
205
+ * Retrieve the return item with the specified ID.
206
+ * @param {ExternalFulfillmentReturnsApiGetReturnRequest} requestParameters Request parameters.
207
+ * @param {*} [options] Override http request option.
208
+ * @throws {RequiredError}
209
+ */
210
+ getReturn(requestParameters, options) {
211
+ return localVarFp.getReturn(requestParameters.returnId, options).then((request) => request(axios, basePath));
212
+ },
213
+ /**
214
+ * Retrieve a list of return items. You can filter results by location, RMA ID, status, or time.
215
+ * @param {ExternalFulfillmentReturnsApiListReturnsRequest} requestParameters Request parameters.
216
+ * @param {*} [options] Override http request option.
217
+ * @throws {RequiredError}
218
+ */
219
+ listReturns(requestParameters = {}, options) {
220
+ return localVarFp.listReturns(requestParameters.returnLocationId, requestParameters.rmaId, requestParameters.status, requestParameters.reverseTrackingId, requestParameters.createdSince, requestParameters.createdUntil, requestParameters.lastUpdatedSince, requestParameters.lastUpdatedUntil, requestParameters.lastUpdatedAfter, requestParameters.lastUpdatedBefore, requestParameters.maxResults, requestParameters.nextToken, options).then((request) => request(axios, basePath));
221
+ }
222
+ };
238
223
  };
224
+ /**
225
+ * ExternalFulfillmentReturnsApi - object-oriented interface
226
+ */
239
227
  var ExternalFulfillmentReturnsApi = class extends BaseAPI {
240
- /**
241
- * Retrieve the return item with the specified ID.
242
- * @param {ExternalFulfillmentReturnsApiGetReturnRequest} requestParameters Request parameters.
243
- * @param {*} [options] Override http request option.
244
- * @throws {RequiredError}
245
- */
246
- getReturn(requestParameters, options) {
247
- return ExternalFulfillmentReturnsApiFp(this.configuration).getReturn(requestParameters.returnId, options).then((request) => request(this.axios, this.basePath));
248
- }
249
- /**
250
- * Retrieve a list of return items. You can filter results by location, RMA ID, status, or time.
251
- * @param {ExternalFulfillmentReturnsApiListReturnsRequest} requestParameters Request parameters.
252
- * @param {*} [options] Override http request option.
253
- * @throws {RequiredError}
254
- */
255
- listReturns(requestParameters = {}, options) {
256
- return ExternalFulfillmentReturnsApiFp(this.configuration).listReturns(requestParameters.returnLocationId, requestParameters.rmaId, requestParameters.status, requestParameters.reverseTrackingId, requestParameters.createdSince, requestParameters.createdUntil, requestParameters.lastUpdatedSince, requestParameters.lastUpdatedUntil, requestParameters.lastUpdatedAfter, requestParameters.lastUpdatedBefore, requestParameters.maxResults, requestParameters.nextToken, options).then((request) => request(this.axios, this.basePath));
257
- }
228
+ /**
229
+ * Retrieve the return item with the specified ID.
230
+ * @param {ExternalFulfillmentReturnsApiGetReturnRequest} requestParameters Request parameters.
231
+ * @param {*} [options] Override http request option.
232
+ * @throws {RequiredError}
233
+ */
234
+ getReturn(requestParameters, options) {
235
+ return ExternalFulfillmentReturnsApiFp(this.configuration).getReturn(requestParameters.returnId, options).then((request) => request(this.axios, this.basePath));
236
+ }
237
+ /**
238
+ * Retrieve a list of return items. You can filter results by location, RMA ID, status, or time.
239
+ * @param {ExternalFulfillmentReturnsApiListReturnsRequest} requestParameters Request parameters.
240
+ * @param {*} [options] Override http request option.
241
+ * @throws {RequiredError}
242
+ */
243
+ listReturns(requestParameters = {}, options) {
244
+ return ExternalFulfillmentReturnsApiFp(this.configuration).listReturns(requestParameters.returnLocationId, requestParameters.rmaId, requestParameters.status, requestParameters.reverseTrackingId, requestParameters.createdSince, requestParameters.createdUntil, requestParameters.lastUpdatedSince, requestParameters.lastUpdatedUntil, requestParameters.lastUpdatedAfter, requestParameters.lastUpdatedBefore, requestParameters.maxResults, requestParameters.nextToken, options).then((request) => request(this.axios, this.basePath));
245
+ }
258
246
  };
259
- var ListReturnsStatusEnum = {
260
- Created: "CREATED",
261
- CarrierNotifiedToPickUpFromCustomer: "CARRIER_NOTIFIED_TO_PICK_UP_FROM_CUSTOMER",
262
- CarrierOutForPickUpFromCustomer: "CARRIER_OUT_FOR_PICK_UP_FROM_CUSTOMER",
263
- CustomerCancelledPickUp: "CUSTOMER_CANCELLED_PICK_UP",
264
- CustomerRescheduledPickUp: "CUSTOMER_RESCHEDULED_PICK_UP",
265
- PickedFromCustomer: "PICKED_FROM_CUSTOMER",
266
- InTransit: "IN_TRANSIT",
267
- OutForDelivery: "OUT_FOR_DELIVERY",
268
- Delivered: "DELIVERED",
269
- Replanned: "REPLANNED",
270
- CustomerDroppedOff: "CUSTOMER_DROPPED_OFF",
271
- PartiallyProcessed: "PARTIALLY_PROCESSED",
272
- Processed: "PROCESSED",
273
- Rejected: "REJECTED",
274
- Cancelled: "CANCELLED"
247
+ const ListReturnsStatusEnum = {
248
+ Created: "CREATED",
249
+ CarrierNotifiedToPickUpFromCustomer: "CARRIER_NOTIFIED_TO_PICK_UP_FROM_CUSTOMER",
250
+ CarrierOutForPickUpFromCustomer: "CARRIER_OUT_FOR_PICK_UP_FROM_CUSTOMER",
251
+ CustomerCancelledPickUp: "CUSTOMER_CANCELLED_PICK_UP",
252
+ CustomerRescheduledPickUp: "CUSTOMER_RESCHEDULED_PICK_UP",
253
+ PickedFromCustomer: "PICKED_FROM_CUSTOMER",
254
+ InTransit: "IN_TRANSIT",
255
+ OutForDelivery: "OUT_FOR_DELIVERY",
256
+ Delivered: "DELIVERED",
257
+ Replanned: "REPLANNED",
258
+ CustomerDroppedOff: "CUSTOMER_DROPPED_OFF",
259
+ PartiallyProcessed: "PARTIALLY_PROCESSED",
260
+ Processed: "PROCESSED",
261
+ Rejected: "REJECTED",
262
+ Cancelled: "CANCELLED"
275
263
  };
276
-
277
- // src/api-model/configuration.ts
264
+ //#endregion
265
+ //#region src/api-model/configuration.ts
278
266
  var Configuration = class {
279
- /**
280
- * parameter for apiKey security
281
- * @param name security name
282
- */
283
- apiKey;
284
- /**
285
- * parameter for basic security
286
- */
287
- username;
288
- /**
289
- * parameter for basic security
290
- */
291
- password;
292
- /**
293
- * parameter for oauth2 security
294
- * @param name security name
295
- * @param scopes oauth2 scope
296
- */
297
- accessToken;
298
- /**
299
- * parameter for aws4 signature security
300
- * @param {Object} AWS4Signature - AWS4 Signature security
301
- * @param {string} options.region - aws region
302
- * @param {string} options.service - name of the service.
303
- * @param {string} credentials.accessKeyId - aws access key id
304
- * @param {string} credentials.secretAccessKey - aws access key
305
- * @param {string} credentials.sessionToken - aws session token
306
- * @memberof Configuration
307
- */
308
- awsv4;
309
- /**
310
- * override base path
311
- */
312
- basePath;
313
- /**
314
- * override server index
315
- */
316
- serverIndex;
317
- /**
318
- * base options for axios calls
319
- */
320
- baseOptions;
321
- /**
322
- * The FormData constructor that will be used to create multipart form data
323
- * requests. You can inject this here so that execution environments that
324
- * do not support the FormData class can still run the generated client.
325
- *
326
- * @type {new () => FormData}
327
- */
328
- formDataCtor;
329
- constructor(param = {}) {
330
- this.apiKey = param.apiKey;
331
- this.username = param.username;
332
- this.password = param.password;
333
- this.accessToken = param.accessToken;
334
- this.awsv4 = param.awsv4;
335
- this.basePath = param.basePath;
336
- this.serverIndex = param.serverIndex;
337
- this.baseOptions = {
338
- ...param.baseOptions,
339
- headers: {
340
- ...param.baseOptions?.headers
341
- }
342
- };
343
- this.formDataCtor = param.formDataCtor;
344
- }
345
- /**
346
- * Check if the given MIME is a JSON MIME.
347
- * JSON MIME examples:
348
- * application/json
349
- * application/json; charset=UTF8
350
- * APPLICATION/JSON
351
- * application/vnd.company+json
352
- * @param mime - MIME (Multipurpose Internet Mail Extensions)
353
- * @return True if the given MIME is JSON, false otherwise.
354
- */
355
- isJsonMime(mime) {
356
- const jsonMime = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i;
357
- return mime !== null && jsonMime.test(mime);
358
- }
267
+ /**
268
+ * parameter for apiKey security
269
+ * @param name security name
270
+ */
271
+ apiKey;
272
+ /**
273
+ * parameter for basic security
274
+ */
275
+ username;
276
+ /**
277
+ * parameter for basic security
278
+ */
279
+ password;
280
+ /**
281
+ * parameter for oauth2 security
282
+ * @param name security name
283
+ * @param scopes oauth2 scope
284
+ */
285
+ accessToken;
286
+ /**
287
+ * parameter for aws4 signature security
288
+ * @param {Object} AWS4Signature - AWS4 Signature security
289
+ * @param {string} options.region - aws region
290
+ * @param {string} options.service - name of the service.
291
+ * @param {string} credentials.accessKeyId - aws access key id
292
+ * @param {string} credentials.secretAccessKey - aws access key
293
+ * @param {string} credentials.sessionToken - aws session token
294
+ * @memberof Configuration
295
+ */
296
+ awsv4;
297
+ /**
298
+ * override base path
299
+ */
300
+ basePath;
301
+ /**
302
+ * override server index
303
+ */
304
+ serverIndex;
305
+ /**
306
+ * base options for axios calls
307
+ */
308
+ baseOptions;
309
+ /**
310
+ * The FormData constructor that will be used to create multipart form data
311
+ * requests. You can inject this here so that execution environments that
312
+ * do not support the FormData class can still run the generated client.
313
+ *
314
+ * @type {new () => FormData}
315
+ */
316
+ formDataCtor;
317
+ constructor(param = {}) {
318
+ this.apiKey = param.apiKey;
319
+ this.username = param.username;
320
+ this.password = param.password;
321
+ this.accessToken = param.accessToken;
322
+ this.awsv4 = param.awsv4;
323
+ this.basePath = param.basePath;
324
+ this.serverIndex = param.serverIndex;
325
+ this.baseOptions = {
326
+ ...param.baseOptions,
327
+ headers: { ...param.baseOptions?.headers }
328
+ };
329
+ this.formDataCtor = param.formDataCtor;
330
+ }
331
+ /**
332
+ * Check if the given MIME is a JSON MIME.
333
+ * JSON MIME examples:
334
+ * application/json
335
+ * application/json; charset=UTF8
336
+ * APPLICATION/JSON
337
+ * application/vnd.company+json
338
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
339
+ * @return True if the given MIME is JSON, false otherwise.
340
+ */
341
+ isJsonMime(mime) {
342
+ return mime !== null && /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i.test(mime);
343
+ }
359
344
  };
360
-
361
- // src/api-model/models/return.ts
362
- var ReturnReturnTypeEnum = {
363
- Customer: "CUSTOMER",
364
- Reject: "REJECT"
345
+ //#endregion
346
+ //#region src/api-model/models/return.ts
347
+ const ReturnReturnTypeEnum = {
348
+ Customer: "CUSTOMER",
349
+ Reject: "REJECT"
365
350
  };
366
- var ReturnReturnSubTypeEnum = {
367
- Normal: "NORMAL",
368
- Replacement: "REPLACEMENT",
369
- Exchange: "EXCHANGE"
351
+ const ReturnReturnSubTypeEnum = {
352
+ Normal: "NORMAL",
353
+ Replacement: "REPLACEMENT",
354
+ Exchange: "EXCHANGE"
370
355
  };
371
- var ReturnStatusEnum = {
372
- Created: "CREATED",
373
- CarrierNotifiedToPickUpFromCustomer: "CARRIER_NOTIFIED_TO_PICK_UP_FROM_CUSTOMER",
374
- CarrierOutForPickUpFromCustomer: "CARRIER_OUT_FOR_PICK_UP_FROM_CUSTOMER",
375
- CustomerCancelledPickUp: "CUSTOMER_CANCELLED_PICK_UP",
376
- CustomerRescheduledPickUp: "CUSTOMER_RESCHEDULED_PICK_UP",
377
- PickedFromCustomer: "PICKED_FROM_CUSTOMER",
378
- InTransit: "IN_TRANSIT",
379
- OutForDelivery: "OUT_FOR_DELIVERY",
380
- Delivered: "DELIVERED",
381
- Replanned: "REPLANNED",
382
- CustomerDroppedOff: "CUSTOMER_DROPPED_OFF",
383
- PartiallyProcessed: "PARTIALLY_PROCESSED",
384
- Processed: "PROCESSED",
385
- Rejected: "REJECTED",
386
- Cancelled: "CANCELLED"
356
+ const ReturnStatusEnum = {
357
+ Created: "CREATED",
358
+ CarrierNotifiedToPickUpFromCustomer: "CARRIER_NOTIFIED_TO_PICK_UP_FROM_CUSTOMER",
359
+ CarrierOutForPickUpFromCustomer: "CARRIER_OUT_FOR_PICK_UP_FROM_CUSTOMER",
360
+ CustomerCancelledPickUp: "CUSTOMER_CANCELLED_PICK_UP",
361
+ CustomerRescheduledPickUp: "CUSTOMER_RESCHEDULED_PICK_UP",
362
+ PickedFromCustomer: "PICKED_FROM_CUSTOMER",
363
+ InTransit: "IN_TRANSIT",
364
+ OutForDelivery: "OUT_FOR_DELIVERY",
365
+ Delivered: "DELIVERED",
366
+ Replanned: "REPLANNED",
367
+ CustomerDroppedOff: "CUSTOMER_DROPPED_OFF",
368
+ PartiallyProcessed: "PARTIALLY_PROCESSED",
369
+ Processed: "PROCESSED",
370
+ Rejected: "REJECTED",
371
+ Cancelled: "CANCELLED"
387
372
  };
388
- var ReturnPackageDeliveryModeEnum = {
389
- WithOtp: "WITH_OTP",
390
- WithoutOtp: "WITHOUT_OTP"
373
+ const ReturnPackageDeliveryModeEnum = {
374
+ WithOtp: "WITH_OTP",
375
+ WithoutOtp: "WITHOUT_OTP"
391
376
  };
392
-
393
- // src/client.ts
394
- var clientRateLimits = [];
377
+ //#endregion
378
+ //#region src/client.ts
379
+ const clientRateLimits = [];
395
380
  var ExternalFulfillmentReturnsApiClient = class extends ExternalFulfillmentReturnsApi {
396
- constructor(configuration) {
397
- const { axios, endpoint } = createAxiosInstance(configuration, clientRateLimits);
398
- super(new Configuration(), endpoint, axios);
399
- }
400
- };
401
- export {
402
- ExternalFulfillmentReturnsApi,
403
- ExternalFulfillmentReturnsApiAxiosParamCreator,
404
- ExternalFulfillmentReturnsApiClient,
405
- ExternalFulfillmentReturnsApiFactory,
406
- ExternalFulfillmentReturnsApiFp,
407
- ListReturnsStatusEnum,
408
- ReturnPackageDeliveryModeEnum,
409
- ReturnReturnSubTypeEnum,
410
- ReturnReturnTypeEnum,
411
- ReturnStatusEnum,
412
- clientRateLimits
381
+ constructor(configuration) {
382
+ const { axios, endpoint } = createAxiosInstance(configuration, clientRateLimits);
383
+ super(new Configuration(), endpoint, axios);
384
+ }
413
385
  };
386
+ //#endregion
387
+ export { ExternalFulfillmentReturnsApi, ExternalFulfillmentReturnsApiAxiosParamCreator, ExternalFulfillmentReturnsApiClient, ExternalFulfillmentReturnsApiFactory, ExternalFulfillmentReturnsApiFp, ListReturnsStatusEnum, ReturnPackageDeliveryModeEnum, ReturnReturnSubTypeEnum, ReturnReturnTypeEnum, ReturnStatusEnum, clientRateLimits };
388
+
414
389
  //# sourceMappingURL=index.js.map