@sp-api-sdk/application-integrations-api-2024-04-01 4.0.0 → 4.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 +417 -427
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +262 -265
- package/dist/index.d.ts +262 -265
- package/dist/index.js +392 -389
- package/dist/index.js.map +1 -1
- package/package.json +7 -4
package/dist/index.js
CHANGED
|
@@ -1,415 +1,418 @@
|
|
|
1
|
-
// src/client.ts
|
|
2
1
|
import { createAxiosInstance } from "@sp-api-sdk/common";
|
|
3
|
-
|
|
4
|
-
// src/api-model/api/application-integrations-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
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
49
|
+
/**
|
|
50
|
+
* JSON serialization helper function which replaces instances of unserializable types with serializable ones.
|
|
51
|
+
* This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
|
|
52
|
+
* Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
|
|
53
|
+
*/
|
|
54
|
+
const replaceWithSerializableTypeIfNeeded = function(key, value) {
|
|
55
|
+
if (value instanceof Set) return Array.from(value);
|
|
56
|
+
else return value;
|
|
69
57
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return needsSerialization ? JSON.stringify(value !== void 0 ? value : {}, replaceWithSerializableTypeIfNeeded) : value || "";
|
|
58
|
+
const serializeDataIfNeeded = function(value, requestOptions, configuration) {
|
|
59
|
+
const nonString = typeof value !== "string";
|
|
60
|
+
return (nonString && configuration && configuration.isJsonMime ? configuration.isJsonMime(requestOptions.headers["Content-Type"]) : nonString) ? JSON.stringify(value !== void 0 ? value : {}, replaceWithSerializableTypeIfNeeded) : value || "";
|
|
74
61
|
};
|
|
75
|
-
|
|
76
|
-
|
|
62
|
+
const toPathString = function(url) {
|
|
63
|
+
return url.pathname + url.search + url.hash;
|
|
77
64
|
};
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
65
|
+
const createRequestFunction = function(axiosArgs, globalAxios, BASE_PATH, configuration) {
|
|
66
|
+
return (axios = globalAxios, basePath = BASE_PATH) => {
|
|
67
|
+
const axiosRequestArgs = {
|
|
68
|
+
...axiosArgs.options,
|
|
69
|
+
url: (axios.defaults.baseURL ? "" : configuration?.basePath ?? basePath) + axiosArgs.url
|
|
70
|
+
};
|
|
71
|
+
return axios.request(axiosRequestArgs);
|
|
72
|
+
};
|
|
83
73
|
};
|
|
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
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region src/api-model/api/application-integrations-api.ts
|
|
76
|
+
/**
|
|
77
|
+
* ApplicationIntegrationsApi - axios parameter creator
|
|
78
|
+
*/
|
|
79
|
+
const ApplicationIntegrationsApiAxiosParamCreator = function(configuration) {
|
|
80
|
+
return {
|
|
81
|
+
/**
|
|
82
|
+
* Create a notification for sellers in Seller Central. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Sellers whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
83
|
+
* @param {CreateNotificationRequest} body The request body for the `createNotification` operation.
|
|
84
|
+
* @param {*} [options] Override http request option.
|
|
85
|
+
* @throws {RequiredError}
|
|
86
|
+
*/
|
|
87
|
+
createNotification: async (body, options = {}) => {
|
|
88
|
+
assertParamExists("createNotification", "body", body);
|
|
89
|
+
const localVarUrlObj = new URL(`/appIntegrations/2024-04-01/notifications`, DUMMY_BASE_URL);
|
|
90
|
+
let baseOptions;
|
|
91
|
+
if (configuration) baseOptions = configuration.baseOptions;
|
|
92
|
+
const localVarRequestOptions = {
|
|
93
|
+
method: "POST",
|
|
94
|
+
...baseOptions,
|
|
95
|
+
...options
|
|
96
|
+
};
|
|
97
|
+
const localVarHeaderParameter = {};
|
|
98
|
+
const localVarQueryParameter = {};
|
|
99
|
+
localVarHeaderParameter["Content-Type"] = "application/json";
|
|
100
|
+
localVarHeaderParameter["Accept"] = "application/json";
|
|
101
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
102
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
103
|
+
localVarRequestOptions.headers = {
|
|
104
|
+
...localVarHeaderParameter,
|
|
105
|
+
...headersFromBaseOptions,
|
|
106
|
+
...options.headers
|
|
107
|
+
};
|
|
108
|
+
localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration);
|
|
109
|
+
return {
|
|
110
|
+
url: toPathString(localVarUrlObj),
|
|
111
|
+
options: localVarRequestOptions
|
|
112
|
+
};
|
|
113
|
+
},
|
|
114
|
+
/**
|
|
115
|
+
* Remove your application\'s notifications from the Appstore notifications dashboard. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Sellers whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
116
|
+
* @param {DeleteNotificationsRequest} body The request body for the `deleteNotifications` operation.
|
|
117
|
+
* @param {*} [options] Override http request option.
|
|
118
|
+
* @throws {RequiredError}
|
|
119
|
+
*/
|
|
120
|
+
deleteNotifications: async (body, options = {}) => {
|
|
121
|
+
assertParamExists("deleteNotifications", "body", body);
|
|
122
|
+
const localVarUrlObj = new URL(`/appIntegrations/2024-04-01/notifications/deletion`, DUMMY_BASE_URL);
|
|
123
|
+
let baseOptions;
|
|
124
|
+
if (configuration) baseOptions = configuration.baseOptions;
|
|
125
|
+
const localVarRequestOptions = {
|
|
126
|
+
method: "POST",
|
|
127
|
+
...baseOptions,
|
|
128
|
+
...options
|
|
129
|
+
};
|
|
130
|
+
const localVarHeaderParameter = {};
|
|
131
|
+
const localVarQueryParameter = {};
|
|
132
|
+
localVarHeaderParameter["Content-Type"] = "application/json";
|
|
133
|
+
localVarHeaderParameter["Accept"] = "application/json";
|
|
134
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
135
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
136
|
+
localVarRequestOptions.headers = {
|
|
137
|
+
...localVarHeaderParameter,
|
|
138
|
+
...headersFromBaseOptions,
|
|
139
|
+
...options.headers
|
|
140
|
+
};
|
|
141
|
+
localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration);
|
|
142
|
+
return {
|
|
143
|
+
url: toPathString(localVarUrlObj),
|
|
144
|
+
options: localVarRequestOptions
|
|
145
|
+
};
|
|
146
|
+
},
|
|
147
|
+
/**
|
|
148
|
+
* Records the seller\'s response to a notification. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Sellers whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
149
|
+
* @param {string} notificationId A `notificationId` uniquely identifies a notification.
|
|
150
|
+
* @param {RecordActionFeedbackRequest} body The request body for the `recordActionFeedback` operation.
|
|
151
|
+
* @param {*} [options] Override http request option.
|
|
152
|
+
* @throws {RequiredError}
|
|
153
|
+
*/
|
|
154
|
+
recordActionFeedback: async (notificationId, body, options = {}) => {
|
|
155
|
+
assertParamExists("recordActionFeedback", "notificationId", notificationId);
|
|
156
|
+
assertParamExists("recordActionFeedback", "body", body);
|
|
157
|
+
const localVarPath = `/appIntegrations/2024-04-01/notifications/{notificationId}/feedback`.replace("{notificationId}", encodeURIComponent(String(notificationId)));
|
|
158
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
159
|
+
let baseOptions;
|
|
160
|
+
if (configuration) baseOptions = configuration.baseOptions;
|
|
161
|
+
const localVarRequestOptions = {
|
|
162
|
+
method: "POST",
|
|
163
|
+
...baseOptions,
|
|
164
|
+
...options
|
|
165
|
+
};
|
|
166
|
+
const localVarHeaderParameter = {};
|
|
167
|
+
const localVarQueryParameter = {};
|
|
168
|
+
localVarHeaderParameter["Content-Type"] = "application/json";
|
|
169
|
+
localVarHeaderParameter["Accept"] = "application/json";
|
|
170
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
171
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
172
|
+
localVarRequestOptions.headers = {
|
|
173
|
+
...localVarHeaderParameter,
|
|
174
|
+
...headersFromBaseOptions,
|
|
175
|
+
...options.headers
|
|
176
|
+
};
|
|
177
|
+
localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration);
|
|
178
|
+
return {
|
|
179
|
+
url: toPathString(localVarUrlObj),
|
|
180
|
+
options: localVarRequestOptions
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
};
|
|
175
184
|
};
|
|
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
|
-
|
|
215
|
-
|
|
216
|
-
|
|
185
|
+
/**
|
|
186
|
+
* ApplicationIntegrationsApi - functional programming interface
|
|
187
|
+
*/
|
|
188
|
+
const ApplicationIntegrationsApiFp = function(configuration) {
|
|
189
|
+
const localVarAxiosParamCreator = ApplicationIntegrationsApiAxiosParamCreator(configuration);
|
|
190
|
+
return {
|
|
191
|
+
/**
|
|
192
|
+
* Create a notification for sellers in Seller Central. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Sellers whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
193
|
+
* @param {CreateNotificationRequest} body The request body for the `createNotification` operation.
|
|
194
|
+
* @param {*} [options] Override http request option.
|
|
195
|
+
* @throws {RequiredError}
|
|
196
|
+
*/
|
|
197
|
+
async createNotification(body, options) {
|
|
198
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.createNotification(body, options);
|
|
199
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
200
|
+
const localVarOperationServerBasePath = operationServerMap["ApplicationIntegrationsApi.createNotification"]?.[localVarOperationServerIndex]?.url;
|
|
201
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
202
|
+
},
|
|
203
|
+
/**
|
|
204
|
+
* Remove your application\'s notifications from the Appstore notifications dashboard. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Sellers whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
205
|
+
* @param {DeleteNotificationsRequest} body The request body for the `deleteNotifications` operation.
|
|
206
|
+
* @param {*} [options] Override http request option.
|
|
207
|
+
* @throws {RequiredError}
|
|
208
|
+
*/
|
|
209
|
+
async deleteNotifications(body, options) {
|
|
210
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteNotifications(body, options);
|
|
211
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
212
|
+
const localVarOperationServerBasePath = operationServerMap["ApplicationIntegrationsApi.deleteNotifications"]?.[localVarOperationServerIndex]?.url;
|
|
213
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
214
|
+
},
|
|
215
|
+
/**
|
|
216
|
+
* Records the seller\'s response to a notification. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Sellers whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
217
|
+
* @param {string} notificationId A `notificationId` uniquely identifies a notification.
|
|
218
|
+
* @param {RecordActionFeedbackRequest} body The request body for the `recordActionFeedback` operation.
|
|
219
|
+
* @param {*} [options] Override http request option.
|
|
220
|
+
* @throws {RequiredError}
|
|
221
|
+
*/
|
|
222
|
+
async recordActionFeedback(notificationId, body, options) {
|
|
223
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.recordActionFeedback(notificationId, body, options);
|
|
224
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
225
|
+
const localVarOperationServerBasePath = operationServerMap["ApplicationIntegrationsApi.recordActionFeedback"]?.[localVarOperationServerIndex]?.url;
|
|
226
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
227
|
+
}
|
|
228
|
+
};
|
|
217
229
|
};
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
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
|
-
|
|
230
|
+
/**
|
|
231
|
+
* ApplicationIntegrationsApi - factory interface
|
|
232
|
+
*/
|
|
233
|
+
const ApplicationIntegrationsApiFactory = function(configuration, basePath, axios) {
|
|
234
|
+
const localVarFp = ApplicationIntegrationsApiFp(configuration);
|
|
235
|
+
return {
|
|
236
|
+
/**
|
|
237
|
+
* Create a notification for sellers in Seller Central. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Sellers whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
238
|
+
* @param {ApplicationIntegrationsApiCreateNotificationRequest} requestParameters Request parameters.
|
|
239
|
+
* @param {*} [options] Override http request option.
|
|
240
|
+
* @throws {RequiredError}
|
|
241
|
+
*/
|
|
242
|
+
createNotification(requestParameters, options) {
|
|
243
|
+
return localVarFp.createNotification(requestParameters.body, options).then((request) => request(axios, basePath));
|
|
244
|
+
},
|
|
245
|
+
/**
|
|
246
|
+
* Remove your application\'s notifications from the Appstore notifications dashboard. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Sellers whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
247
|
+
* @param {ApplicationIntegrationsApiDeleteNotificationsRequest} requestParameters Request parameters.
|
|
248
|
+
* @param {*} [options] Override http request option.
|
|
249
|
+
* @throws {RequiredError}
|
|
250
|
+
*/
|
|
251
|
+
deleteNotifications(requestParameters, options) {
|
|
252
|
+
return localVarFp.deleteNotifications(requestParameters.body, options).then((request) => request(axios, basePath));
|
|
253
|
+
},
|
|
254
|
+
/**
|
|
255
|
+
* Records the seller\'s response to a notification. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Sellers whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
256
|
+
* @param {ApplicationIntegrationsApiRecordActionFeedbackRequest} requestParameters Request parameters.
|
|
257
|
+
* @param {*} [options] Override http request option.
|
|
258
|
+
* @throws {RequiredError}
|
|
259
|
+
*/
|
|
260
|
+
recordActionFeedback(requestParameters, options) {
|
|
261
|
+
return localVarFp.recordActionFeedback(requestParameters.notificationId, requestParameters.body, options).then((request) => request(axios, basePath));
|
|
262
|
+
}
|
|
263
|
+
};
|
|
249
264
|
};
|
|
265
|
+
/**
|
|
266
|
+
* ApplicationIntegrationsApi - object-oriented interface
|
|
267
|
+
*/
|
|
250
268
|
var ApplicationIntegrationsApi = class extends BaseAPI {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
269
|
+
/**
|
|
270
|
+
* Create a notification for sellers in Seller Central. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Sellers whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
271
|
+
* @param {ApplicationIntegrationsApiCreateNotificationRequest} requestParameters Request parameters.
|
|
272
|
+
* @param {*} [options] Override http request option.
|
|
273
|
+
* @throws {RequiredError}
|
|
274
|
+
*/
|
|
275
|
+
createNotification(requestParameters, options) {
|
|
276
|
+
return ApplicationIntegrationsApiFp(this.configuration).createNotification(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Remove your application\'s notifications from the Appstore notifications dashboard. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Sellers whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
280
|
+
* @param {ApplicationIntegrationsApiDeleteNotificationsRequest} requestParameters Request parameters.
|
|
281
|
+
* @param {*} [options] Override http request option.
|
|
282
|
+
* @throws {RequiredError}
|
|
283
|
+
*/
|
|
284
|
+
deleteNotifications(requestParameters, options) {
|
|
285
|
+
return ApplicationIntegrationsApiFp(this.configuration).deleteNotifications(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Records the seller\'s response to a notification. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Sellers whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
289
|
+
* @param {ApplicationIntegrationsApiRecordActionFeedbackRequest} requestParameters Request parameters.
|
|
290
|
+
* @param {*} [options] Override http request option.
|
|
291
|
+
* @throws {RequiredError}
|
|
292
|
+
*/
|
|
293
|
+
recordActionFeedback(requestParameters, options) {
|
|
294
|
+
return ApplicationIntegrationsApiFp(this.configuration).recordActionFeedback(requestParameters.notificationId, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
|
|
295
|
+
}
|
|
278
296
|
};
|
|
279
|
-
|
|
280
|
-
|
|
297
|
+
//#endregion
|
|
298
|
+
//#region src/api-model/configuration.ts
|
|
281
299
|
var Configuration = class {
|
|
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
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
const jsonMime = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i;
|
|
360
|
-
return mime !== null && jsonMime.test(mime);
|
|
361
|
-
}
|
|
300
|
+
/**
|
|
301
|
+
* parameter for apiKey security
|
|
302
|
+
* @param name security name
|
|
303
|
+
*/
|
|
304
|
+
apiKey;
|
|
305
|
+
/**
|
|
306
|
+
* parameter for basic security
|
|
307
|
+
*/
|
|
308
|
+
username;
|
|
309
|
+
/**
|
|
310
|
+
* parameter for basic security
|
|
311
|
+
*/
|
|
312
|
+
password;
|
|
313
|
+
/**
|
|
314
|
+
* parameter for oauth2 security
|
|
315
|
+
* @param name security name
|
|
316
|
+
* @param scopes oauth2 scope
|
|
317
|
+
*/
|
|
318
|
+
accessToken;
|
|
319
|
+
/**
|
|
320
|
+
* parameter for aws4 signature security
|
|
321
|
+
* @param {Object} AWS4Signature - AWS4 Signature security
|
|
322
|
+
* @param {string} options.region - aws region
|
|
323
|
+
* @param {string} options.service - name of the service.
|
|
324
|
+
* @param {string} credentials.accessKeyId - aws access key id
|
|
325
|
+
* @param {string} credentials.secretAccessKey - aws access key
|
|
326
|
+
* @param {string} credentials.sessionToken - aws session token
|
|
327
|
+
* @memberof Configuration
|
|
328
|
+
*/
|
|
329
|
+
awsv4;
|
|
330
|
+
/**
|
|
331
|
+
* override base path
|
|
332
|
+
*/
|
|
333
|
+
basePath;
|
|
334
|
+
/**
|
|
335
|
+
* override server index
|
|
336
|
+
*/
|
|
337
|
+
serverIndex;
|
|
338
|
+
/**
|
|
339
|
+
* base options for axios calls
|
|
340
|
+
*/
|
|
341
|
+
baseOptions;
|
|
342
|
+
/**
|
|
343
|
+
* The FormData constructor that will be used to create multipart form data
|
|
344
|
+
* requests. You can inject this here so that execution environments that
|
|
345
|
+
* do not support the FormData class can still run the generated client.
|
|
346
|
+
*
|
|
347
|
+
* @type {new () => FormData}
|
|
348
|
+
*/
|
|
349
|
+
formDataCtor;
|
|
350
|
+
constructor(param = {}) {
|
|
351
|
+
this.apiKey = param.apiKey;
|
|
352
|
+
this.username = param.username;
|
|
353
|
+
this.password = param.password;
|
|
354
|
+
this.accessToken = param.accessToken;
|
|
355
|
+
this.awsv4 = param.awsv4;
|
|
356
|
+
this.basePath = param.basePath;
|
|
357
|
+
this.serverIndex = param.serverIndex;
|
|
358
|
+
this.baseOptions = {
|
|
359
|
+
...param.baseOptions,
|
|
360
|
+
headers: { ...param.baseOptions?.headers }
|
|
361
|
+
};
|
|
362
|
+
this.formDataCtor = param.formDataCtor;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Check if the given MIME is a JSON MIME.
|
|
366
|
+
* JSON MIME examples:
|
|
367
|
+
* application/json
|
|
368
|
+
* application/json; charset=UTF8
|
|
369
|
+
* APPLICATION/JSON
|
|
370
|
+
* application/vnd.company+json
|
|
371
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
372
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
373
|
+
*/
|
|
374
|
+
isJsonMime(mime) {
|
|
375
|
+
return mime !== null && /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i.test(mime);
|
|
376
|
+
}
|
|
362
377
|
};
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
378
|
+
//#endregion
|
|
379
|
+
//#region src/api-model/models/delete-notifications-request.ts
|
|
380
|
+
const DeleteNotificationsRequestDeletionReasonEnum = {
|
|
381
|
+
IncorrectContent: "INCORRECT_CONTENT",
|
|
382
|
+
IncorrectRecipient: "INCORRECT_RECIPIENT"
|
|
368
383
|
};
|
|
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
|
-
// eslint-disable-next-line prefer-regex-literals
|
|
394
|
-
urlRegex: new RegExp("^/appIntegrations/2024-04-01/notifications/[^/]*/feedback$"),
|
|
395
|
-
rate: 1,
|
|
396
|
-
burst: 5
|
|
397
|
-
}
|
|
384
|
+
//#endregion
|
|
385
|
+
//#region src/api-model/models/record-action-feedback-request.ts
|
|
386
|
+
const RecordActionFeedbackRequestFeedbackActionCodeEnum = { SellerActionCompleted: "SELLER_ACTION_COMPLETED" };
|
|
387
|
+
//#endregion
|
|
388
|
+
//#region src/client.ts
|
|
389
|
+
const clientRateLimits = [
|
|
390
|
+
{
|
|
391
|
+
method: "post",
|
|
392
|
+
urlRegex: /^\/appIntegrations\/2024\u{2D}04\u{2D}01\/notifications$/v,
|
|
393
|
+
rate: 1,
|
|
394
|
+
burst: 5
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
method: "post",
|
|
398
|
+
urlRegex: /^\/appIntegrations\/2024\u{2D}04\u{2D}01\/notifications\/deletion$/v,
|
|
399
|
+
rate: 1,
|
|
400
|
+
burst: 5
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
method: "post",
|
|
404
|
+
urlRegex: /^\/appIntegrations\/2024\u{2D}04\u{2D}01\/notifications\/[^\/]*\/feedback$/v,
|
|
405
|
+
rate: 1,
|
|
406
|
+
burst: 5
|
|
407
|
+
}
|
|
398
408
|
];
|
|
399
409
|
var ApplicationIntegrationsApiClient = class extends ApplicationIntegrationsApi {
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
};
|
|
405
|
-
export {
|
|
406
|
-
ApplicationIntegrationsApi,
|
|
407
|
-
ApplicationIntegrationsApiAxiosParamCreator,
|
|
408
|
-
ApplicationIntegrationsApiClient,
|
|
409
|
-
ApplicationIntegrationsApiFactory,
|
|
410
|
-
ApplicationIntegrationsApiFp,
|
|
411
|
-
DeleteNotificationsRequestDeletionReasonEnum,
|
|
412
|
-
RecordActionFeedbackRequestFeedbackActionCodeEnum,
|
|
413
|
-
clientRateLimits
|
|
410
|
+
constructor(configuration) {
|
|
411
|
+
const { axios, endpoint } = createAxiosInstance(configuration, clientRateLimits);
|
|
412
|
+
super(new Configuration(), endpoint, axios);
|
|
413
|
+
}
|
|
414
414
|
};
|
|
415
|
+
//#endregion
|
|
416
|
+
export { ApplicationIntegrationsApi, ApplicationIntegrationsApiAxiosParamCreator, ApplicationIntegrationsApiClient, ApplicationIntegrationsApiFactory, ApplicationIntegrationsApiFp, DeleteNotificationsRequestDeletionReasonEnum, RecordActionFeedbackRequestFeedbackActionCodeEnum, clientRateLimits };
|
|
417
|
+
|
|
415
418
|
//# sourceMappingURL=index.js.map
|