@sp-api-sdk/external-fulfillment-returns-api-2024-09-11 2.0.0 → 2.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/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 +14 -6
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
|
-
|
|
3
|
+
//#region src/api-model/base.ts
|
|
4
|
+
const BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
|
|
10
5
|
var BaseAPI = class {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
19
|
+
field;
|
|
20
|
+
constructor(field, msg) {
|
|
21
|
+
super(msg);
|
|
22
|
+
this.field = field;
|
|
23
|
+
this.name = "RequiredError";
|
|
24
|
+
}
|
|
30
25
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
-
|
|
64
|
-
|
|
49
|
+
const toPathString = function(url) {
|
|
50
|
+
return url.pathname + url.search + url.hash;
|
|
65
51
|
};
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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
|
-
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
|
-
|
|
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
|
-
|
|
212
|
-
|
|
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
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
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
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
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
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
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
|
-
|
|
264
|
+
//#endregion
|
|
265
|
+
//#region src/api-model/configuration.ts
|
|
278
266
|
var Configuration = class {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
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
|
-
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
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
345
|
+
//#endregion
|
|
346
|
+
//#region src/api-model/models/return.ts
|
|
347
|
+
const ReturnReturnTypeEnum = {
|
|
348
|
+
Customer: "CUSTOMER",
|
|
349
|
+
Reject: "REJECT"
|
|
365
350
|
};
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
351
|
+
const ReturnReturnSubTypeEnum = {
|
|
352
|
+
Normal: "NORMAL",
|
|
353
|
+
Replacement: "REPLACEMENT",
|
|
354
|
+
Exchange: "EXCHANGE"
|
|
370
355
|
};
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
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
|
-
|
|
389
|
-
|
|
390
|
-
|
|
373
|
+
const ReturnPackageDeliveryModeEnum = {
|
|
374
|
+
WithOtp: "WITH_OTP",
|
|
375
|
+
WithoutOtp: "WITHOUT_OTP"
|
|
391
376
|
};
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
377
|
+
//#endregion
|
|
378
|
+
//#region src/client.ts
|
|
379
|
+
const clientRateLimits = [];
|
|
395
380
|
var ExternalFulfillmentReturnsApiClient = class extends ExternalFulfillmentReturnsApi {
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
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
|