@sp-api-sdk/product-pricing-api-2022-05-01 4.0.0 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -4
- package/dist/index.cjs +463 -437
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +561 -922
- package/dist/index.d.ts +561 -922
- package/dist/index.js +430 -391
- package/dist/index.js.map +1 -1
- package/package.json +14 -6
package/dist/index.js
CHANGED
|
@@ -1,422 +1,461 @@
|
|
|
1
|
-
// src/client.ts
|
|
2
1
|
import { createAxiosInstance } from "@sp-api-sdk/common";
|
|
3
|
-
|
|
4
|
-
// src/api-model/api/product-pricing-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
|
-
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region src/api-model/api/product-pricing-api.ts
|
|
76
|
+
/**
|
|
77
|
+
* ProductPricingApi - axios parameter creator
|
|
78
|
+
*/
|
|
79
|
+
const ProductPricingApiAxiosParamCreator = function(configuration) {
|
|
80
|
+
return {
|
|
81
|
+
/**
|
|
82
|
+
* Returns the competitive summary response, including featured buying options for the ASIN and `marketplaceId` combination. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.033 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API.
|
|
83
|
+
* @param {CompetitiveSummaryBatchRequest} requests The batch of `getCompetitiveSummary` requests.
|
|
84
|
+
* @param {*} [options] Override http request option.
|
|
85
|
+
* @throws {RequiredError}
|
|
86
|
+
*/
|
|
87
|
+
getCompetitiveSummary: async (requests, options = {}) => {
|
|
88
|
+
assertParamExists("getCompetitiveSummary", "requests", requests);
|
|
89
|
+
const localVarUrlObj = new URL(`/batches/products/pricing/2022-05-01/items/competitiveSummary`, 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(requests, localVarRequestOptions, configuration);
|
|
109
|
+
return {
|
|
110
|
+
url: toPathString(localVarUrlObj),
|
|
111
|
+
options: localVarRequestOptions
|
|
112
|
+
};
|
|
113
|
+
},
|
|
114
|
+
/**
|
|
115
|
+
* Returns the set of responses that correspond to the batched list of up to 40 requests defined in the request body. The response for each successful (HTTP status code 200) request in the set includes the computed listing price at or below which a seller can expect to become the featured offer (before applicable promotions). This is called the featured offer expected price (FOEP). Featured offer is not guaranteed because competing offers might change. Other offers might be featured based on factors such as fulfillment capabilities to a specific customer. The response to an unsuccessful request includes the available error text. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.033 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API.
|
|
116
|
+
* @param {GetFeaturedOfferExpectedPriceBatchRequest} getFeaturedOfferExpectedPriceBatchRequestBody The batch of `getFeaturedOfferExpectedPrice` requests.
|
|
117
|
+
* @param {*} [options] Override http request option.
|
|
118
|
+
* @throws {RequiredError}
|
|
119
|
+
*/
|
|
120
|
+
getFeaturedOfferExpectedPriceBatch: async (getFeaturedOfferExpectedPriceBatchRequestBody, options = {}) => {
|
|
121
|
+
assertParamExists("getFeaturedOfferExpectedPriceBatch", "getFeaturedOfferExpectedPriceBatchRequestBody", getFeaturedOfferExpectedPriceBatchRequestBody);
|
|
122
|
+
const localVarUrlObj = new URL(`/batches/products/pricing/2022-05-01/offer/featuredOfferExpectedPrice`, 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(getFeaturedOfferExpectedPriceBatchRequestBody, localVarRequestOptions, configuration);
|
|
142
|
+
return {
|
|
143
|
+
url: toPathString(localVarUrlObj),
|
|
144
|
+
options: localVarRequestOptions
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
};
|
|
145
148
|
};
|
|
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
|
-
|
|
149
|
+
/**
|
|
150
|
+
* ProductPricingApi - functional programming interface
|
|
151
|
+
*/
|
|
152
|
+
const ProductPricingApiFp = function(configuration) {
|
|
153
|
+
const localVarAxiosParamCreator = ProductPricingApiAxiosParamCreator(configuration);
|
|
154
|
+
return {
|
|
155
|
+
/**
|
|
156
|
+
* Returns the competitive summary response, including featured buying options for the ASIN and `marketplaceId` combination. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.033 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API.
|
|
157
|
+
* @param {CompetitiveSummaryBatchRequest} requests The batch of `getCompetitiveSummary` requests.
|
|
158
|
+
* @param {*} [options] Override http request option.
|
|
159
|
+
* @throws {RequiredError}
|
|
160
|
+
*/
|
|
161
|
+
async getCompetitiveSummary(requests, options) {
|
|
162
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getCompetitiveSummary(requests, options);
|
|
163
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
164
|
+
const localVarOperationServerBasePath = operationServerMap["ProductPricingApi.getCompetitiveSummary"]?.[localVarOperationServerIndex]?.url;
|
|
165
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
166
|
+
},
|
|
167
|
+
/**
|
|
168
|
+
* Returns the set of responses that correspond to the batched list of up to 40 requests defined in the request body. The response for each successful (HTTP status code 200) request in the set includes the computed listing price at or below which a seller can expect to become the featured offer (before applicable promotions). This is called the featured offer expected price (FOEP). Featured offer is not guaranteed because competing offers might change. Other offers might be featured based on factors such as fulfillment capabilities to a specific customer. The response to an unsuccessful request includes the available error text. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.033 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API.
|
|
169
|
+
* @param {GetFeaturedOfferExpectedPriceBatchRequest} getFeaturedOfferExpectedPriceBatchRequestBody The batch of `getFeaturedOfferExpectedPrice` requests.
|
|
170
|
+
* @param {*} [options] Override http request option.
|
|
171
|
+
* @throws {RequiredError}
|
|
172
|
+
*/
|
|
173
|
+
async getFeaturedOfferExpectedPriceBatch(getFeaturedOfferExpectedPriceBatchRequestBody, options) {
|
|
174
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getFeaturedOfferExpectedPriceBatch(getFeaturedOfferExpectedPriceBatchRequestBody, options);
|
|
175
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
176
|
+
const localVarOperationServerBasePath = operationServerMap["ProductPricingApi.getFeaturedOfferExpectedPriceBatch"]?.[localVarOperationServerIndex]?.url;
|
|
177
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
178
|
+
}
|
|
179
|
+
};
|
|
174
180
|
};
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
181
|
+
/**
|
|
182
|
+
* ProductPricingApi - factory interface
|
|
183
|
+
*/
|
|
184
|
+
const ProductPricingApiFactory = function(configuration, basePath, axios) {
|
|
185
|
+
const localVarFp = ProductPricingApiFp(configuration);
|
|
186
|
+
return {
|
|
187
|
+
/**
|
|
188
|
+
* Returns the competitive summary response, including featured buying options for the ASIN and `marketplaceId` combination. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.033 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API.
|
|
189
|
+
* @param {ProductPricingApiGetCompetitiveSummaryRequest} requestParameters Request parameters.
|
|
190
|
+
* @param {*} [options] Override http request option.
|
|
191
|
+
* @throws {RequiredError}
|
|
192
|
+
*/
|
|
193
|
+
getCompetitiveSummary(requestParameters, options) {
|
|
194
|
+
return localVarFp.getCompetitiveSummary(requestParameters.requests, options).then((request) => request(axios, basePath));
|
|
195
|
+
},
|
|
196
|
+
/**
|
|
197
|
+
* Returns the set of responses that correspond to the batched list of up to 40 requests defined in the request body. The response for each successful (HTTP status code 200) request in the set includes the computed listing price at or below which a seller can expect to become the featured offer (before applicable promotions). This is called the featured offer expected price (FOEP). Featured offer is not guaranteed because competing offers might change. Other offers might be featured based on factors such as fulfillment capabilities to a specific customer. The response to an unsuccessful request includes the available error text. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.033 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API.
|
|
198
|
+
* @param {ProductPricingApiGetFeaturedOfferExpectedPriceBatchRequest} requestParameters Request parameters.
|
|
199
|
+
* @param {*} [options] Override http request option.
|
|
200
|
+
* @throws {RequiredError}
|
|
201
|
+
*/
|
|
202
|
+
getFeaturedOfferExpectedPriceBatch(requestParameters, options) {
|
|
203
|
+
return localVarFp.getFeaturedOfferExpectedPriceBatch(requestParameters.getFeaturedOfferExpectedPriceBatchRequestBody, options).then((request) => request(axios, basePath));
|
|
204
|
+
}
|
|
205
|
+
};
|
|
197
206
|
};
|
|
207
|
+
/**
|
|
208
|
+
* ProductPricingApi - object-oriented interface
|
|
209
|
+
*/
|
|
198
210
|
var ProductPricingApi = class extends BaseAPI {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
211
|
+
/**
|
|
212
|
+
* Returns the competitive summary response, including featured buying options for the ASIN and `marketplaceId` combination. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.033 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API.
|
|
213
|
+
* @param {ProductPricingApiGetCompetitiveSummaryRequest} requestParameters Request parameters.
|
|
214
|
+
* @param {*} [options] Override http request option.
|
|
215
|
+
* @throws {RequiredError}
|
|
216
|
+
*/
|
|
217
|
+
getCompetitiveSummary(requestParameters, options) {
|
|
218
|
+
return ProductPricingApiFp(this.configuration).getCompetitiveSummary(requestParameters.requests, options).then((request) => request(this.axios, this.basePath));
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Returns the set of responses that correspond to the batched list of up to 40 requests defined in the request body. The response for each successful (HTTP status code 200) request in the set includes the computed listing price at or below which a seller can expect to become the featured offer (before applicable promotions). This is called the featured offer expected price (FOEP). Featured offer is not guaranteed because competing offers might change. Other offers might be featured based on factors such as fulfillment capabilities to a specific customer. The response to an unsuccessful request includes the available error text. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.033 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API.
|
|
222
|
+
* @param {ProductPricingApiGetFeaturedOfferExpectedPriceBatchRequest} requestParameters Request parameters.
|
|
223
|
+
* @param {*} [options] Override http request option.
|
|
224
|
+
* @throws {RequiredError}
|
|
225
|
+
*/
|
|
226
|
+
getFeaturedOfferExpectedPriceBatch(requestParameters, options) {
|
|
227
|
+
return ProductPricingApiFp(this.configuration).getFeaturedOfferExpectedPriceBatch(requestParameters.getFeaturedOfferExpectedPriceBatchRequestBody, options).then((request) => request(this.axios, this.basePath));
|
|
228
|
+
}
|
|
217
229
|
};
|
|
218
|
-
|
|
219
|
-
|
|
230
|
+
//#endregion
|
|
231
|
+
//#region src/api-model/configuration.ts
|
|
220
232
|
var Configuration = class {
|
|
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
|
-
|
|
249
|
-
|
|
250
|
-
|
|
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
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
const jsonMime = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i;
|
|
299
|
-
return mime !== null && jsonMime.test(mime);
|
|
300
|
-
}
|
|
233
|
+
/**
|
|
234
|
+
* parameter for apiKey security
|
|
235
|
+
* @param name security name
|
|
236
|
+
*/
|
|
237
|
+
apiKey;
|
|
238
|
+
/**
|
|
239
|
+
* parameter for basic security
|
|
240
|
+
*/
|
|
241
|
+
username;
|
|
242
|
+
/**
|
|
243
|
+
* parameter for basic security
|
|
244
|
+
*/
|
|
245
|
+
password;
|
|
246
|
+
/**
|
|
247
|
+
* parameter for oauth2 security
|
|
248
|
+
* @param name security name
|
|
249
|
+
* @param scopes oauth2 scope
|
|
250
|
+
*/
|
|
251
|
+
accessToken;
|
|
252
|
+
/**
|
|
253
|
+
* parameter for aws4 signature security
|
|
254
|
+
* @param {Object} AWS4Signature - AWS4 Signature security
|
|
255
|
+
* @param {string} options.region - aws region
|
|
256
|
+
* @param {string} options.service - name of the service.
|
|
257
|
+
* @param {string} credentials.accessKeyId - aws access key id
|
|
258
|
+
* @param {string} credentials.secretAccessKey - aws access key
|
|
259
|
+
* @param {string} credentials.sessionToken - aws session token
|
|
260
|
+
* @memberof Configuration
|
|
261
|
+
*/
|
|
262
|
+
awsv4;
|
|
263
|
+
/**
|
|
264
|
+
* override base path
|
|
265
|
+
*/
|
|
266
|
+
basePath;
|
|
267
|
+
/**
|
|
268
|
+
* override server index
|
|
269
|
+
*/
|
|
270
|
+
serverIndex;
|
|
271
|
+
/**
|
|
272
|
+
* base options for axios calls
|
|
273
|
+
*/
|
|
274
|
+
baseOptions;
|
|
275
|
+
/**
|
|
276
|
+
* The FormData constructor that will be used to create multipart form data
|
|
277
|
+
* requests. You can inject this here so that execution environments that
|
|
278
|
+
* do not support the FormData class can still run the generated client.
|
|
279
|
+
*
|
|
280
|
+
* @type {new () => FormData}
|
|
281
|
+
*/
|
|
282
|
+
formDataCtor;
|
|
283
|
+
constructor(param = {}) {
|
|
284
|
+
this.apiKey = param.apiKey;
|
|
285
|
+
this.username = param.username;
|
|
286
|
+
this.password = param.password;
|
|
287
|
+
this.accessToken = param.accessToken;
|
|
288
|
+
this.awsv4 = param.awsv4;
|
|
289
|
+
this.basePath = param.basePath;
|
|
290
|
+
this.serverIndex = param.serverIndex;
|
|
291
|
+
this.baseOptions = {
|
|
292
|
+
...param.baseOptions,
|
|
293
|
+
headers: { ...param.baseOptions?.headers }
|
|
294
|
+
};
|
|
295
|
+
this.formDataCtor = param.formDataCtor;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Check if the given MIME is a JSON MIME.
|
|
299
|
+
* JSON MIME examples:
|
|
300
|
+
* application/json
|
|
301
|
+
* application/json; charset=UTF8
|
|
302
|
+
* APPLICATION/JSON
|
|
303
|
+
* application/vnd.company+json
|
|
304
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
305
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
306
|
+
*/
|
|
307
|
+
isJsonMime(mime) {
|
|
308
|
+
return mime !== null && /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i.test(mime);
|
|
309
|
+
}
|
|
301
310
|
};
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
311
|
+
//#endregion
|
|
312
|
+
//#region src/api-model/models/competitive-summary-included-data.ts
|
|
313
|
+
/**
|
|
314
|
+
* Selling Partner API for Pricing
|
|
315
|
+
* The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer pricing information for Amazon Marketplace products. For more information, refer to the [Product Pricing v2022-05-01 Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/product-pricing-api-v2022-05-01-use-case-guide).
|
|
316
|
+
*
|
|
317
|
+
* The version of the OpenAPI document: 2022-05-01
|
|
318
|
+
*
|
|
319
|
+
*
|
|
320
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
321
|
+
* https://openapi-generator.tech
|
|
322
|
+
* Do not edit the class manually.
|
|
323
|
+
*/
|
|
324
|
+
/**
|
|
325
|
+
* The supported data types in the `getCompetitiveSummary` API.
|
|
326
|
+
*/
|
|
327
|
+
const CompetitiveSummaryIncludedData = {
|
|
328
|
+
FeaturedBuyingOptions: "featuredBuyingOptions",
|
|
329
|
+
ReferencePrices: "referencePrices",
|
|
330
|
+
LowestPricedOffers: "lowestPricedOffers",
|
|
331
|
+
SimilarItems: "similarItems"
|
|
309
332
|
};
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
333
|
+
//#endregion
|
|
334
|
+
//#region src/api-model/models/condition.ts
|
|
335
|
+
/**
|
|
336
|
+
* Selling Partner API for Pricing
|
|
337
|
+
* The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer pricing information for Amazon Marketplace products. For more information, refer to the [Product Pricing v2022-05-01 Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/product-pricing-api-v2022-05-01-use-case-guide).
|
|
338
|
+
*
|
|
339
|
+
* The version of the OpenAPI document: 2022-05-01
|
|
340
|
+
*
|
|
341
|
+
*
|
|
342
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
343
|
+
* https://openapi-generator.tech
|
|
344
|
+
* Do not edit the class manually.
|
|
345
|
+
*/
|
|
346
|
+
/**
|
|
347
|
+
* The condition of the item.
|
|
348
|
+
*/
|
|
349
|
+
const Condition = {
|
|
350
|
+
New: "New",
|
|
351
|
+
Used: "Used",
|
|
352
|
+
Collectible: "Collectible",
|
|
353
|
+
Refurbished: "Refurbished",
|
|
354
|
+
Club: "Club"
|
|
318
355
|
};
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
356
|
+
//#endregion
|
|
357
|
+
//#region src/api-model/models/featured-buying-option.ts
|
|
358
|
+
const FeaturedBuyingOptionBuyingOptionTypeEnum = { New: "New" };
|
|
359
|
+
//#endregion
|
|
360
|
+
//#region src/api-model/models/featured-offer-segment.ts
|
|
361
|
+
const FeaturedOfferSegmentCustomerMembershipEnum = {
|
|
362
|
+
Prime: "PRIME",
|
|
363
|
+
NonPrime: "NON_PRIME",
|
|
364
|
+
Default: "DEFAULT"
|
|
323
365
|
};
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
366
|
+
//#endregion
|
|
367
|
+
//#region src/api-model/models/fulfillment-type.ts
|
|
368
|
+
/**
|
|
369
|
+
* Selling Partner API for Pricing
|
|
370
|
+
* The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer pricing information for Amazon Marketplace products. For more information, refer to the [Product Pricing v2022-05-01 Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/product-pricing-api-v2022-05-01-use-case-guide).
|
|
371
|
+
*
|
|
372
|
+
* The version of the OpenAPI document: 2022-05-01
|
|
373
|
+
*
|
|
374
|
+
*
|
|
375
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
376
|
+
* https://openapi-generator.tech
|
|
377
|
+
* Do not edit the class manually.
|
|
378
|
+
*/
|
|
379
|
+
/**
|
|
380
|
+
* Indicates whether the item is fulfilled by Amazon or by the seller (merchant).
|
|
381
|
+
*/
|
|
382
|
+
const FulfillmentType = {
|
|
383
|
+
Afn: "AFN",
|
|
384
|
+
Mfn: "MFN"
|
|
330
385
|
};
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
386
|
+
//#endregion
|
|
387
|
+
//#region src/api-model/models/http-method.ts
|
|
388
|
+
/**
|
|
389
|
+
* Selling Partner API for Pricing
|
|
390
|
+
* The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer pricing information for Amazon Marketplace products. For more information, refer to the [Product Pricing v2022-05-01 Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/product-pricing-api-v2022-05-01-use-case-guide).
|
|
391
|
+
*
|
|
392
|
+
* The version of the OpenAPI document: 2022-05-01
|
|
393
|
+
*
|
|
394
|
+
*
|
|
395
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
396
|
+
* https://openapi-generator.tech
|
|
397
|
+
* Do not edit the class manually.
|
|
398
|
+
*/
|
|
399
|
+
/**
|
|
400
|
+
* The HTTP method associated with an individual request within a batch.
|
|
401
|
+
*/
|
|
402
|
+
const HttpMethod = {
|
|
403
|
+
Get: "GET",
|
|
404
|
+
Put: "PUT",
|
|
405
|
+
Patch: "PATCH",
|
|
406
|
+
Delete: "DELETE",
|
|
407
|
+
Post: "POST"
|
|
336
408
|
};
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
409
|
+
//#endregion
|
|
410
|
+
//#region src/api-model/models/lowest-priced-offers-input.ts
|
|
411
|
+
const LowestPricedOffersInputOfferTypeEnum = { Consumer: "Consumer" };
|
|
412
|
+
//#endregion
|
|
413
|
+
//#region src/api-model/models/offer.ts
|
|
414
|
+
const OfferSubConditionEnum = {
|
|
415
|
+
New: "New",
|
|
416
|
+
Mint: "Mint",
|
|
417
|
+
VeryGood: "VeryGood",
|
|
418
|
+
Good: "Good",
|
|
419
|
+
Acceptable: "Acceptable",
|
|
420
|
+
Poor: "Poor",
|
|
421
|
+
Club: "Club",
|
|
422
|
+
Oem: "OEM",
|
|
423
|
+
Warranty: "Warranty",
|
|
424
|
+
RefurbishedWarranty: "RefurbishedWarranty",
|
|
425
|
+
Refurbished: "Refurbished",
|
|
426
|
+
OpenBox: "OpenBox",
|
|
427
|
+
Other: "Other"
|
|
345
428
|
};
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
// src/api-model/models/offer.ts
|
|
353
|
-
var OfferSubConditionEnum = {
|
|
354
|
-
New: "New",
|
|
355
|
-
Mint: "Mint",
|
|
356
|
-
VeryGood: "VeryGood",
|
|
357
|
-
Good: "Good",
|
|
358
|
-
Acceptable: "Acceptable",
|
|
359
|
-
Poor: "Poor",
|
|
360
|
-
Club: "Club",
|
|
361
|
-
Oem: "OEM",
|
|
362
|
-
Warranty: "Warranty",
|
|
363
|
-
RefurbishedWarranty: "RefurbishedWarranty",
|
|
364
|
-
Refurbished: "Refurbished",
|
|
365
|
-
OpenBox: "OpenBox",
|
|
366
|
-
Other: "Other"
|
|
367
|
-
};
|
|
368
|
-
|
|
369
|
-
// src/api-model/models/prime-details.ts
|
|
370
|
-
var PrimeDetailsEligibilityEnum = {
|
|
371
|
-
National: "NATIONAL",
|
|
372
|
-
Regional: "REGIONAL",
|
|
373
|
-
None: "NONE"
|
|
429
|
+
//#endregion
|
|
430
|
+
//#region src/api-model/models/prime-details.ts
|
|
431
|
+
const PrimeDetailsEligibilityEnum = {
|
|
432
|
+
National: "NATIONAL",
|
|
433
|
+
Regional: "REGIONAL",
|
|
434
|
+
None: "NONE"
|
|
374
435
|
};
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
method: "post",
|
|
392
|
-
// eslint-disable-next-line prefer-regex-literals
|
|
393
|
-
urlRegex: new RegExp("^/batches/products/pricing/2022-05-01/items/competitiveSummary$"),
|
|
394
|
-
rate: 0.033,
|
|
395
|
-
burst: 1
|
|
396
|
-
}
|
|
397
|
-
];
|
|
436
|
+
//#endregion
|
|
437
|
+
//#region src/api-model/models/shipping-option.ts
|
|
438
|
+
const ShippingOptionShippingOptionTypeEnum = { Default: "DEFAULT" };
|
|
439
|
+
//#endregion
|
|
440
|
+
//#region src/client.ts
|
|
441
|
+
const clientRateLimits = [{
|
|
442
|
+
method: "post",
|
|
443
|
+
urlRegex: /^\/batches\/products\/pricing\/2022\u{2D}05\u{2D}01\/offer\/featuredOfferExpectedPrice$/v,
|
|
444
|
+
rate: .033,
|
|
445
|
+
burst: 1
|
|
446
|
+
}, {
|
|
447
|
+
method: "post",
|
|
448
|
+
urlRegex: /^\/batches\/products\/pricing\/2022\u{2D}05\u{2D}01\/items\/competitiveSummary$/v,
|
|
449
|
+
rate: .033,
|
|
450
|
+
burst: 1
|
|
451
|
+
}];
|
|
398
452
|
var ProductPricingApiClient = class extends ProductPricingApi {
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
};
|
|
404
|
-
export {
|
|
405
|
-
CompetitiveSummaryIncludedData,
|
|
406
|
-
Condition,
|
|
407
|
-
FeaturedBuyingOptionBuyingOptionTypeEnum,
|
|
408
|
-
FeaturedOfferSegmentCustomerMembershipEnum,
|
|
409
|
-
FulfillmentType,
|
|
410
|
-
HttpMethod,
|
|
411
|
-
LowestPricedOffersInputOfferTypeEnum,
|
|
412
|
-
OfferSubConditionEnum,
|
|
413
|
-
PrimeDetailsEligibilityEnum,
|
|
414
|
-
ProductPricingApi,
|
|
415
|
-
ProductPricingApiAxiosParamCreator,
|
|
416
|
-
ProductPricingApiClient,
|
|
417
|
-
ProductPricingApiFactory,
|
|
418
|
-
ProductPricingApiFp,
|
|
419
|
-
ShippingOptionShippingOptionTypeEnum,
|
|
420
|
-
clientRateLimits
|
|
453
|
+
constructor(configuration) {
|
|
454
|
+
const { axios, endpoint } = createAxiosInstance(configuration, clientRateLimits);
|
|
455
|
+
super(new Configuration(), endpoint, axios);
|
|
456
|
+
}
|
|
421
457
|
};
|
|
458
|
+
//#endregion
|
|
459
|
+
export { CompetitiveSummaryIncludedData, Condition, FeaturedBuyingOptionBuyingOptionTypeEnum, FeaturedOfferSegmentCustomerMembershipEnum, FulfillmentType, HttpMethod, LowestPricedOffersInputOfferTypeEnum, OfferSubConditionEnum, PrimeDetailsEligibilityEnum, ProductPricingApi, ProductPricingApiAxiosParamCreator, ProductPricingApiClient, ProductPricingApiFactory, ProductPricingApiFp, ShippingOptionShippingOptionTypeEnum, clientRateLimits };
|
|
460
|
+
|
|
422
461
|
//# sourceMappingURL=index.js.map
|