@sp-api-sdk/data-kiosk-api-2023-11-15 3.0.17 → 4.0.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.
Files changed (61) hide show
  1. package/README.md +4 -4
  2. package/dist/index.cjs +611 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/{types/api-model/api/data-kiosk-api.d.ts → index.d.cts} +382 -25
  5. package/dist/index.d.ts +614 -0
  6. package/dist/index.js +567 -0
  7. package/dist/index.js.map +1 -0
  8. package/package.json +23 -12
  9. package/dist/cjs/api-model/api/data-kiosk-api.js +0 -384
  10. package/dist/cjs/api-model/api.js +0 -30
  11. package/dist/cjs/api-model/base.js +0 -52
  12. package/dist/cjs/api-model/common.js +0 -123
  13. package/dist/cjs/api-model/configuration.js +0 -98
  14. package/dist/cjs/api-model/index.js +0 -32
  15. package/dist/cjs/api-model/models/create-query-response.js +0 -15
  16. package/dist/cjs/api-model/models/create-query-specification.js +0 -15
  17. package/dist/cjs/api-model/models/error-list.js +0 -15
  18. package/dist/cjs/api-model/models/get-document-response.js +0 -15
  19. package/dist/cjs/api-model/models/get-queries-response-pagination.js +0 -15
  20. package/dist/cjs/api-model/models/get-queries-response.js +0 -15
  21. package/dist/cjs/api-model/models/index.js +0 -25
  22. package/dist/cjs/api-model/models/model-error.js +0 -15
  23. package/dist/cjs/api-model/models/query-pagination.js +0 -15
  24. package/dist/cjs/api-model/models/query.js +0 -23
  25. package/dist/cjs/client.js +0 -49
  26. package/dist/cjs/index.js +0 -19
  27. package/dist/es/api-model/api/data-kiosk-api.js +0 -374
  28. package/dist/es/api-model/api.js +0 -14
  29. package/dist/es/api-model/base.js +0 -44
  30. package/dist/es/api-model/common.js +0 -110
  31. package/dist/es/api-model/configuration.js +0 -94
  32. package/dist/es/api-model/index.js +0 -16
  33. package/dist/es/api-model/models/create-query-response.js +0 -14
  34. package/dist/es/api-model/models/create-query-specification.js +0 -14
  35. package/dist/es/api-model/models/error-list.js +0 -14
  36. package/dist/es/api-model/models/get-document-response.js +0 -14
  37. package/dist/es/api-model/models/get-queries-response-pagination.js +0 -14
  38. package/dist/es/api-model/models/get-queries-response.js +0 -14
  39. package/dist/es/api-model/models/index.js +0 -9
  40. package/dist/es/api-model/models/model-error.js +0 -14
  41. package/dist/es/api-model/models/query-pagination.js +0 -14
  42. package/dist/es/api-model/models/query.js +0 -20
  43. package/dist/es/client.js +0 -45
  44. package/dist/es/index.js +0 -3
  45. package/dist/types/api-model/api.d.ts +0 -12
  46. package/dist/types/api-model/base.d.ts +0 -42
  47. package/dist/types/api-model/common.d.ts +0 -34
  48. package/dist/types/api-model/configuration.d.ts +0 -98
  49. package/dist/types/api-model/index.d.ts +0 -14
  50. package/dist/types/api-model/models/create-query-response.d.ts +0 -20
  51. package/dist/types/api-model/models/create-query-specification.d.ts +0 -24
  52. package/dist/types/api-model/models/error-list.d.ts +0 -20
  53. package/dist/types/api-model/models/get-document-response.d.ts +0 -24
  54. package/dist/types/api-model/models/get-queries-response-pagination.d.ts +0 -20
  55. package/dist/types/api-model/models/get-queries-response.d.ts +0 -23
  56. package/dist/types/api-model/models/index.d.ts +0 -9
  57. package/dist/types/api-model/models/model-error.d.ts +0 -28
  58. package/dist/types/api-model/models/query-pagination.d.ts +0 -20
  59. package/dist/types/api-model/models/query.d.ts +0 -58
  60. package/dist/types/client.d.ts +0 -6
  61. package/dist/types/index.d.ts +0 -3
package/dist/index.js ADDED
@@ -0,0 +1,567 @@
1
+ // src/client.ts
2
+ import { createAxiosInstance } from "@sp-api-sdk/common";
3
+
4
+ // src/api-model/api/data-kiosk-api.ts
5
+ import globalAxios2 from "axios";
6
+
7
+ // src/api-model/base.ts
8
+ import globalAxios from "axios";
9
+ var BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
10
+ var COLLECTION_FORMATS = {
11
+ csv: ",",
12
+ ssv: " ",
13
+ tsv: " ",
14
+ pipes: "|"
15
+ };
16
+ var BaseAPI = class {
17
+ constructor(configuration, basePath = BASE_PATH, axios = globalAxios) {
18
+ this.basePath = basePath;
19
+ this.axios = axios;
20
+ if (configuration) {
21
+ this.configuration = configuration;
22
+ this.basePath = configuration.basePath ?? basePath;
23
+ }
24
+ }
25
+ basePath;
26
+ axios;
27
+ configuration;
28
+ };
29
+ var RequiredError = class extends Error {
30
+ constructor(field, msg) {
31
+ super(msg);
32
+ this.field = field;
33
+ this.name = "RequiredError";
34
+ }
35
+ field;
36
+ };
37
+ var operationServerMap = {};
38
+
39
+ // src/api-model/common.ts
40
+ var DUMMY_BASE_URL = "https://example.com";
41
+ var assertParamExists = function(functionName, paramName, paramValue) {
42
+ if (paramValue === null || paramValue === void 0) {
43
+ throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
44
+ }
45
+ };
46
+ function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
47
+ if (parameter == null) return;
48
+ if (typeof parameter === "object") {
49
+ if (Array.isArray(parameter) || parameter instanceof Set) {
50
+ parameter.forEach((item) => setFlattenedQueryParams(urlSearchParams, item, key));
51
+ } else {
52
+ Object.keys(parameter).forEach(
53
+ (currentKey) => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== "" ? "." : ""}${currentKey}`)
54
+ );
55
+ }
56
+ } else {
57
+ if (urlSearchParams.has(key)) {
58
+ urlSearchParams.append(key, parameter);
59
+ } else {
60
+ urlSearchParams.set(key, parameter);
61
+ }
62
+ }
63
+ }
64
+ var setSearchParams = function(url, ...objects) {
65
+ const searchParams = new URLSearchParams(url.search);
66
+ setFlattenedQueryParams(searchParams, objects);
67
+ url.search = searchParams.toString();
68
+ };
69
+ var replaceWithSerializableTypeIfNeeded = function(key, value) {
70
+ if (value instanceof Set) {
71
+ return Array.from(value);
72
+ } else {
73
+ return value;
74
+ }
75
+ };
76
+ var serializeDataIfNeeded = function(value, requestOptions, configuration) {
77
+ const nonString = typeof value !== "string";
78
+ const needsSerialization = nonString && configuration && configuration.isJsonMime ? configuration.isJsonMime(requestOptions.headers["Content-Type"]) : nonString;
79
+ return needsSerialization ? JSON.stringify(value !== void 0 ? value : {}, replaceWithSerializableTypeIfNeeded) : value || "";
80
+ };
81
+ var toPathString = function(url) {
82
+ return url.pathname + url.search + url.hash;
83
+ };
84
+ var createRequestFunction = function(axiosArgs, globalAxios3, BASE_PATH2, configuration) {
85
+ return (axios = globalAxios3, basePath = BASE_PATH2) => {
86
+ const axiosRequestArgs = { ...axiosArgs.options, url: (axios.defaults.baseURL ? "" : configuration?.basePath ?? basePath) + axiosArgs.url };
87
+ return axios.request(axiosRequestArgs);
88
+ };
89
+ };
90
+
91
+ // src/api-model/api/data-kiosk-api.ts
92
+ var DataKioskApiAxiosParamCreator = function(configuration) {
93
+ return {
94
+ /**
95
+ * Cancels the query specified by the `queryId` parameter. Only queries with a non-terminal `processingStatus` (`IN_QUEUE`, `IN_PROGRESS`) can be cancelled. Cancelling a query that already has a `processingStatus` of `CANCELLED` will no-op. Cancelled queries are returned in subsequent calls to the `getQuery` and `getQueries` operations. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0222 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see 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).
96
+ * @param {string} queryId The identifier for the query. This identifier is unique only in combination with a selling partner account ID.
97
+ * @param {*} [options] Override http request option.
98
+ * @throws {RequiredError}
99
+ */
100
+ cancelQuery: async (queryId, options = {}) => {
101
+ assertParamExists("cancelQuery", "queryId", queryId);
102
+ const localVarPath = `/dataKiosk/2023-11-15/queries/{queryId}`.replace("{queryId}", encodeURIComponent(String(queryId)));
103
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
104
+ let baseOptions;
105
+ if (configuration) {
106
+ baseOptions = configuration.baseOptions;
107
+ }
108
+ const localVarRequestOptions = { method: "DELETE", ...baseOptions, ...options };
109
+ const localVarHeaderParameter = {};
110
+ const localVarQueryParameter = {};
111
+ localVarHeaderParameter["Accept"] = "application/json";
112
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
113
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
114
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
115
+ return {
116
+ url: toPathString(localVarUrlObj),
117
+ options: localVarRequestOptions
118
+ };
119
+ },
120
+ /**
121
+ * Creates a Data Kiosk query request. **Note:** The retention of a query varies based on the fields requested. Each field within a schema is annotated with a `@resultRetention` directive that defines how long a query containing that field will be retained. When a query contains multiple fields with different retentions, the shortest (minimum) retention is applied. The retention of a query\'s resulting documents always matches the retention of the query. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0167 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see 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).
122
+ * @param {CreateQuerySpecification} body The body of the request.
123
+ * @param {*} [options] Override http request option.
124
+ * @throws {RequiredError}
125
+ */
126
+ createQuery: async (body, options = {}) => {
127
+ assertParamExists("createQuery", "body", body);
128
+ const localVarPath = `/dataKiosk/2023-11-15/queries`;
129
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
130
+ let baseOptions;
131
+ if (configuration) {
132
+ baseOptions = configuration.baseOptions;
133
+ }
134
+ const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
135
+ const localVarHeaderParameter = {};
136
+ const localVarQueryParameter = {};
137
+ localVarHeaderParameter["Content-Type"] = "application/json";
138
+ localVarHeaderParameter["Accept"] = "application/json";
139
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
140
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
141
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
142
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration);
143
+ return {
144
+ url: toPathString(localVarUrlObj),
145
+ options: localVarRequestOptions
146
+ };
147
+ },
148
+ /**
149
+ * Returns the information required for retrieving a Data Kiosk document\'s contents. See the `createQuery` operation for details about document retention. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0167 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see 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).
150
+ * @param {string} documentId The identifier for the Data Kiosk document.
151
+ * @param {*} [options] Override http request option.
152
+ * @throws {RequiredError}
153
+ */
154
+ getDocument: async (documentId, options = {}) => {
155
+ assertParamExists("getDocument", "documentId", documentId);
156
+ const localVarPath = `/dataKiosk/2023-11-15/documents/{documentId}`.replace("{documentId}", encodeURIComponent(String(documentId)));
157
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
158
+ let baseOptions;
159
+ if (configuration) {
160
+ baseOptions = configuration.baseOptions;
161
+ }
162
+ const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
163
+ const localVarHeaderParameter = {};
164
+ const localVarQueryParameter = {};
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
+ /**
175
+ * Returns details for the Data Kiosk queries that match the specified filters. See the `createQuery` operation for details about query retention. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0222 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see 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).
176
+ * @param {Array<GetQueriesProcessingStatusesEnum>} [processingStatuses] A list of processing statuses used to filter queries.
177
+ * @param {number} [pageSize] The maximum number of queries to return in a single call.
178
+ * @param {string} [createdSince] The earliest query creation date and time for queries to include in the response, in ISO 8601 date time format. The default is 90 days ago.
179
+ * @param {string} [createdUntil] The latest query creation date and time for queries to include in the response, in ISO 8601 date time format. The default is the time of the &#x60;getQueries&#x60; request.
180
+ * @param {string} [paginationToken] A token to fetch a certain page of results when there are multiple pages of results available. The value of this token is fetched from the &#x60;pagination.nextToken&#x60; field returned in the &#x60;GetQueriesResponse&#x60; object. All other parameters must be provided with the same values that were provided with the request that generated this token, with the exception of &#x60;pageSize&#x60; which can be modified between calls to &#x60;getQueries&#x60;. In the absence of this token value, &#x60;getQueries&#x60; returns the first page of results.
181
+ * @param {*} [options] Override http request option.
182
+ * @throws {RequiredError}
183
+ */
184
+ getQueries: async (processingStatuses, pageSize, createdSince, createdUntil, paginationToken, options = {}) => {
185
+ const localVarPath = `/dataKiosk/2023-11-15/queries`;
186
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
187
+ let baseOptions;
188
+ if (configuration) {
189
+ baseOptions = configuration.baseOptions;
190
+ }
191
+ const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
192
+ const localVarHeaderParameter = {};
193
+ const localVarQueryParameter = {};
194
+ if (processingStatuses) {
195
+ localVarQueryParameter["processingStatuses"] = processingStatuses.join(COLLECTION_FORMATS.csv);
196
+ }
197
+ if (pageSize !== void 0) {
198
+ localVarQueryParameter["pageSize"] = pageSize;
199
+ }
200
+ if (createdSince !== void 0) {
201
+ localVarQueryParameter["createdSince"] = createdSince instanceof Date ? createdSince.toISOString() : createdSince;
202
+ }
203
+ if (createdUntil !== void 0) {
204
+ localVarQueryParameter["createdUntil"] = createdUntil instanceof Date ? createdUntil.toISOString() : createdUntil;
205
+ }
206
+ if (paginationToken !== void 0) {
207
+ localVarQueryParameter["paginationToken"] = paginationToken;
208
+ }
209
+ localVarHeaderParameter["Accept"] = "application/json";
210
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
211
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
212
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
213
+ return {
214
+ url: toPathString(localVarUrlObj),
215
+ options: localVarRequestOptions
216
+ };
217
+ },
218
+ /**
219
+ * Returns query details for the query specified by the `queryId` parameter. See the `createQuery` operation for details about query retention. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2.0 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see 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).
220
+ * @param {string} queryId The query identifier.
221
+ * @param {*} [options] Override http request option.
222
+ * @throws {RequiredError}
223
+ */
224
+ getQuery: async (queryId, options = {}) => {
225
+ assertParamExists("getQuery", "queryId", queryId);
226
+ const localVarPath = `/dataKiosk/2023-11-15/queries/{queryId}`.replace("{queryId}", encodeURIComponent(String(queryId)));
227
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
228
+ let baseOptions;
229
+ if (configuration) {
230
+ baseOptions = configuration.baseOptions;
231
+ }
232
+ const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
233
+ const localVarHeaderParameter = {};
234
+ const localVarQueryParameter = {};
235
+ localVarHeaderParameter["Accept"] = "application/json";
236
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
237
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
238
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
239
+ return {
240
+ url: toPathString(localVarUrlObj),
241
+ options: localVarRequestOptions
242
+ };
243
+ }
244
+ };
245
+ };
246
+ var DataKioskApiFp = function(configuration) {
247
+ const localVarAxiosParamCreator = DataKioskApiAxiosParamCreator(configuration);
248
+ return {
249
+ /**
250
+ * Cancels the query specified by the `queryId` parameter. Only queries with a non-terminal `processingStatus` (`IN_QUEUE`, `IN_PROGRESS`) can be cancelled. Cancelling a query that already has a `processingStatus` of `CANCELLED` will no-op. Cancelled queries are returned in subsequent calls to the `getQuery` and `getQueries` operations. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0222 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see 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).
251
+ * @param {string} queryId The identifier for the query. This identifier is unique only in combination with a selling partner account ID.
252
+ * @param {*} [options] Override http request option.
253
+ * @throws {RequiredError}
254
+ */
255
+ async cancelQuery(queryId, options) {
256
+ const localVarAxiosArgs = await localVarAxiosParamCreator.cancelQuery(queryId, options);
257
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
258
+ const localVarOperationServerBasePath = operationServerMap["DataKioskApi.cancelQuery"]?.[localVarOperationServerIndex]?.url;
259
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
260
+ },
261
+ /**
262
+ * Creates a Data Kiosk query request. **Note:** The retention of a query varies based on the fields requested. Each field within a schema is annotated with a `@resultRetention` directive that defines how long a query containing that field will be retained. When a query contains multiple fields with different retentions, the shortest (minimum) retention is applied. The retention of a query\'s resulting documents always matches the retention of the query. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0167 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see 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).
263
+ * @param {CreateQuerySpecification} body The body of the request.
264
+ * @param {*} [options] Override http request option.
265
+ * @throws {RequiredError}
266
+ */
267
+ async createQuery(body, options) {
268
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createQuery(body, options);
269
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
270
+ const localVarOperationServerBasePath = operationServerMap["DataKioskApi.createQuery"]?.[localVarOperationServerIndex]?.url;
271
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
272
+ },
273
+ /**
274
+ * Returns the information required for retrieving a Data Kiosk document\'s contents. See the `createQuery` operation for details about document retention. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0167 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see 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).
275
+ * @param {string} documentId The identifier for the Data Kiosk document.
276
+ * @param {*} [options] Override http request option.
277
+ * @throws {RequiredError}
278
+ */
279
+ async getDocument(documentId, options) {
280
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getDocument(documentId, options);
281
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
282
+ const localVarOperationServerBasePath = operationServerMap["DataKioskApi.getDocument"]?.[localVarOperationServerIndex]?.url;
283
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
284
+ },
285
+ /**
286
+ * Returns details for the Data Kiosk queries that match the specified filters. See the `createQuery` operation for details about query retention. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0222 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see 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).
287
+ * @param {Array<GetQueriesProcessingStatusesEnum>} [processingStatuses] A list of processing statuses used to filter queries.
288
+ * @param {number} [pageSize] The maximum number of queries to return in a single call.
289
+ * @param {string} [createdSince] The earliest query creation date and time for queries to include in the response, in ISO 8601 date time format. The default is 90 days ago.
290
+ * @param {string} [createdUntil] The latest query creation date and time for queries to include in the response, in ISO 8601 date time format. The default is the time of the &#x60;getQueries&#x60; request.
291
+ * @param {string} [paginationToken] A token to fetch a certain page of results when there are multiple pages of results available. The value of this token is fetched from the &#x60;pagination.nextToken&#x60; field returned in the &#x60;GetQueriesResponse&#x60; object. All other parameters must be provided with the same values that were provided with the request that generated this token, with the exception of &#x60;pageSize&#x60; which can be modified between calls to &#x60;getQueries&#x60;. In the absence of this token value, &#x60;getQueries&#x60; returns the first page of results.
292
+ * @param {*} [options] Override http request option.
293
+ * @throws {RequiredError}
294
+ */
295
+ async getQueries(processingStatuses, pageSize, createdSince, createdUntil, paginationToken, options) {
296
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getQueries(processingStatuses, pageSize, createdSince, createdUntil, paginationToken, options);
297
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
298
+ const localVarOperationServerBasePath = operationServerMap["DataKioskApi.getQueries"]?.[localVarOperationServerIndex]?.url;
299
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
300
+ },
301
+ /**
302
+ * Returns query details for the query specified by the `queryId` parameter. See the `createQuery` operation for details about query retention. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2.0 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see 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).
303
+ * @param {string} queryId The query identifier.
304
+ * @param {*} [options] Override http request option.
305
+ * @throws {RequiredError}
306
+ */
307
+ async getQuery(queryId, options) {
308
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getQuery(queryId, options);
309
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
310
+ const localVarOperationServerBasePath = operationServerMap["DataKioskApi.getQuery"]?.[localVarOperationServerIndex]?.url;
311
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
312
+ }
313
+ };
314
+ };
315
+ var DataKioskApiFactory = function(configuration, basePath, axios) {
316
+ const localVarFp = DataKioskApiFp(configuration);
317
+ return {
318
+ /**
319
+ * Cancels the query specified by the `queryId` parameter. Only queries with a non-terminal `processingStatus` (`IN_QUEUE`, `IN_PROGRESS`) can be cancelled. Cancelling a query that already has a `processingStatus` of `CANCELLED` will no-op. Cancelled queries are returned in subsequent calls to the `getQuery` and `getQueries` operations. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0222 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see 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).
320
+ * @param {DataKioskApiCancelQueryRequest} requestParameters Request parameters.
321
+ * @param {*} [options] Override http request option.
322
+ * @throws {RequiredError}
323
+ */
324
+ cancelQuery(requestParameters, options) {
325
+ return localVarFp.cancelQuery(requestParameters.queryId, options).then((request) => request(axios, basePath));
326
+ },
327
+ /**
328
+ * Creates a Data Kiosk query request. **Note:** The retention of a query varies based on the fields requested. Each field within a schema is annotated with a `@resultRetention` directive that defines how long a query containing that field will be retained. When a query contains multiple fields with different retentions, the shortest (minimum) retention is applied. The retention of a query\'s resulting documents always matches the retention of the query. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0167 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see 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).
329
+ * @param {DataKioskApiCreateQueryRequest} requestParameters Request parameters.
330
+ * @param {*} [options] Override http request option.
331
+ * @throws {RequiredError}
332
+ */
333
+ createQuery(requestParameters, options) {
334
+ return localVarFp.createQuery(requestParameters.body, options).then((request) => request(axios, basePath));
335
+ },
336
+ /**
337
+ * Returns the information required for retrieving a Data Kiosk document\'s contents. See the `createQuery` operation for details about document retention. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0167 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see 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).
338
+ * @param {DataKioskApiGetDocumentRequest} requestParameters Request parameters.
339
+ * @param {*} [options] Override http request option.
340
+ * @throws {RequiredError}
341
+ */
342
+ getDocument(requestParameters, options) {
343
+ return localVarFp.getDocument(requestParameters.documentId, options).then((request) => request(axios, basePath));
344
+ },
345
+ /**
346
+ * Returns details for the Data Kiosk queries that match the specified filters. See the `createQuery` operation for details about query retention. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0222 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see 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).
347
+ * @param {DataKioskApiGetQueriesRequest} requestParameters Request parameters.
348
+ * @param {*} [options] Override http request option.
349
+ * @throws {RequiredError}
350
+ */
351
+ getQueries(requestParameters = {}, options) {
352
+ return localVarFp.getQueries(requestParameters.processingStatuses, requestParameters.pageSize, requestParameters.createdSince, requestParameters.createdUntil, requestParameters.paginationToken, options).then((request) => request(axios, basePath));
353
+ },
354
+ /**
355
+ * Returns query details for the query specified by the `queryId` parameter. See the `createQuery` operation for details about query retention. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2.0 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see 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).
356
+ * @param {DataKioskApiGetQueryRequest} requestParameters Request parameters.
357
+ * @param {*} [options] Override http request option.
358
+ * @throws {RequiredError}
359
+ */
360
+ getQuery(requestParameters, options) {
361
+ return localVarFp.getQuery(requestParameters.queryId, options).then((request) => request(axios, basePath));
362
+ }
363
+ };
364
+ };
365
+ var DataKioskApi = class extends BaseAPI {
366
+ /**
367
+ * Cancels the query specified by the `queryId` parameter. Only queries with a non-terminal `processingStatus` (`IN_QUEUE`, `IN_PROGRESS`) can be cancelled. Cancelling a query that already has a `processingStatus` of `CANCELLED` will no-op. Cancelled queries are returned in subsequent calls to the `getQuery` and `getQueries` operations. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0222 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see 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).
368
+ * @param {DataKioskApiCancelQueryRequest} requestParameters Request parameters.
369
+ * @param {*} [options] Override http request option.
370
+ * @throws {RequiredError}
371
+ */
372
+ cancelQuery(requestParameters, options) {
373
+ return DataKioskApiFp(this.configuration).cancelQuery(requestParameters.queryId, options).then((request) => request(this.axios, this.basePath));
374
+ }
375
+ /**
376
+ * Creates a Data Kiosk query request. **Note:** The retention of a query varies based on the fields requested. Each field within a schema is annotated with a `@resultRetention` directive that defines how long a query containing that field will be retained. When a query contains multiple fields with different retentions, the shortest (minimum) retention is applied. The retention of a query\'s resulting documents always matches the retention of the query. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0167 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see 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).
377
+ * @param {DataKioskApiCreateQueryRequest} requestParameters Request parameters.
378
+ * @param {*} [options] Override http request option.
379
+ * @throws {RequiredError}
380
+ */
381
+ createQuery(requestParameters, options) {
382
+ return DataKioskApiFp(this.configuration).createQuery(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
383
+ }
384
+ /**
385
+ * Returns the information required for retrieving a Data Kiosk document\'s contents. See the `createQuery` operation for details about document retention. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0167 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see 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).
386
+ * @param {DataKioskApiGetDocumentRequest} requestParameters Request parameters.
387
+ * @param {*} [options] Override http request option.
388
+ * @throws {RequiredError}
389
+ */
390
+ getDocument(requestParameters, options) {
391
+ return DataKioskApiFp(this.configuration).getDocument(requestParameters.documentId, options).then((request) => request(this.axios, this.basePath));
392
+ }
393
+ /**
394
+ * Returns details for the Data Kiosk queries that match the specified filters. See the `createQuery` operation for details about query retention. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0222 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see 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).
395
+ * @param {DataKioskApiGetQueriesRequest} requestParameters Request parameters.
396
+ * @param {*} [options] Override http request option.
397
+ * @throws {RequiredError}
398
+ */
399
+ getQueries(requestParameters = {}, options) {
400
+ return DataKioskApiFp(this.configuration).getQueries(requestParameters.processingStatuses, requestParameters.pageSize, requestParameters.createdSince, requestParameters.createdUntil, requestParameters.paginationToken, options).then((request) => request(this.axios, this.basePath));
401
+ }
402
+ /**
403
+ * Returns query details for the query specified by the `queryId` parameter. See the `createQuery` operation for details about query retention. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2.0 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see 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).
404
+ * @param {DataKioskApiGetQueryRequest} requestParameters Request parameters.
405
+ * @param {*} [options] Override http request option.
406
+ * @throws {RequiredError}
407
+ */
408
+ getQuery(requestParameters, options) {
409
+ return DataKioskApiFp(this.configuration).getQuery(requestParameters.queryId, options).then((request) => request(this.axios, this.basePath));
410
+ }
411
+ };
412
+ var GetQueriesProcessingStatusesEnum = {
413
+ Cancelled: "CANCELLED",
414
+ Done: "DONE",
415
+ Fatal: "FATAL",
416
+ InProgress: "IN_PROGRESS",
417
+ InQueue: "IN_QUEUE"
418
+ };
419
+
420
+ // src/api-model/configuration.ts
421
+ var Configuration = class {
422
+ /**
423
+ * parameter for apiKey security
424
+ * @param name security name
425
+ */
426
+ apiKey;
427
+ /**
428
+ * parameter for basic security
429
+ */
430
+ username;
431
+ /**
432
+ * parameter for basic security
433
+ */
434
+ password;
435
+ /**
436
+ * parameter for oauth2 security
437
+ * @param name security name
438
+ * @param scopes oauth2 scope
439
+ */
440
+ accessToken;
441
+ /**
442
+ * parameter for aws4 signature security
443
+ * @param {Object} AWS4Signature - AWS4 Signature security
444
+ * @param {string} options.region - aws region
445
+ * @param {string} options.service - name of the service.
446
+ * @param {string} credentials.accessKeyId - aws access key id
447
+ * @param {string} credentials.secretAccessKey - aws access key
448
+ * @param {string} credentials.sessionToken - aws session token
449
+ * @memberof Configuration
450
+ */
451
+ awsv4;
452
+ /**
453
+ * override base path
454
+ */
455
+ basePath;
456
+ /**
457
+ * override server index
458
+ */
459
+ serverIndex;
460
+ /**
461
+ * base options for axios calls
462
+ */
463
+ baseOptions;
464
+ /**
465
+ * The FormData constructor that will be used to create multipart form data
466
+ * requests. You can inject this here so that execution environments that
467
+ * do not support the FormData class can still run the generated client.
468
+ *
469
+ * @type {new () => FormData}
470
+ */
471
+ formDataCtor;
472
+ constructor(param = {}) {
473
+ this.apiKey = param.apiKey;
474
+ this.username = param.username;
475
+ this.password = param.password;
476
+ this.accessToken = param.accessToken;
477
+ this.awsv4 = param.awsv4;
478
+ this.basePath = param.basePath;
479
+ this.serverIndex = param.serverIndex;
480
+ this.baseOptions = {
481
+ ...param.baseOptions,
482
+ headers: {
483
+ ...param.baseOptions?.headers
484
+ }
485
+ };
486
+ this.formDataCtor = param.formDataCtor;
487
+ }
488
+ /**
489
+ * Check if the given MIME is a JSON MIME.
490
+ * JSON MIME examples:
491
+ * application/json
492
+ * application/json; charset=UTF8
493
+ * APPLICATION/JSON
494
+ * application/vnd.company+json
495
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
496
+ * @return True if the given MIME is JSON, false otherwise.
497
+ */
498
+ isJsonMime(mime) {
499
+ const jsonMime = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i;
500
+ return mime !== null && jsonMime.test(mime);
501
+ }
502
+ };
503
+
504
+ // src/api-model/models/query.ts
505
+ var QueryProcessingStatusEnum = {
506
+ Cancelled: "CANCELLED",
507
+ Done: "DONE",
508
+ Fatal: "FATAL",
509
+ InProgress: "IN_PROGRESS",
510
+ InQueue: "IN_QUEUE"
511
+ };
512
+
513
+ // src/client.ts
514
+ var clientRateLimits = [
515
+ {
516
+ method: "get",
517
+ // eslint-disable-next-line prefer-regex-literals
518
+ urlRegex: new RegExp("^/dataKiosk/2023-11-15/queries$"),
519
+ rate: 0.0222,
520
+ burst: 10
521
+ },
522
+ {
523
+ method: "post",
524
+ // eslint-disable-next-line prefer-regex-literals
525
+ urlRegex: new RegExp("^/dataKiosk/2023-11-15/queries$"),
526
+ rate: 0.0167,
527
+ burst: 15
528
+ },
529
+ {
530
+ method: "delete",
531
+ // eslint-disable-next-line prefer-regex-literals
532
+ urlRegex: new RegExp("^/dataKiosk/2023-11-15/queries/[^/]*$"),
533
+ rate: 0.0222,
534
+ burst: 10
535
+ },
536
+ {
537
+ method: "get",
538
+ // eslint-disable-next-line prefer-regex-literals
539
+ urlRegex: new RegExp("^/dataKiosk/2023-11-15/queries/[^/]*$"),
540
+ rate: 2,
541
+ burst: 15
542
+ },
543
+ {
544
+ method: "get",
545
+ // eslint-disable-next-line prefer-regex-literals
546
+ urlRegex: new RegExp("^/dataKiosk/2023-11-15/documents/[^/]*$"),
547
+ rate: 0.0167,
548
+ burst: 15
549
+ }
550
+ ];
551
+ var DataKioskApiClient = class extends DataKioskApi {
552
+ constructor(configuration) {
553
+ const { axios, endpoint } = createAxiosInstance(configuration, clientRateLimits);
554
+ super(new Configuration(), endpoint, axios);
555
+ }
556
+ };
557
+ export {
558
+ DataKioskApi,
559
+ DataKioskApiAxiosParamCreator,
560
+ DataKioskApiClient,
561
+ DataKioskApiFactory,
562
+ DataKioskApiFp,
563
+ GetQueriesProcessingStatusesEnum,
564
+ QueryProcessingStatusEnum,
565
+ clientRateLimits
566
+ };
567
+ //# sourceMappingURL=index.js.map