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