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