@sp-api-sdk/data-kiosk-api-2023-11-15 1.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 (57) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +97 -0
  3. package/dist/cjs/index.js +18 -0
  4. package/dist/cjs/src/api-model/api/queries-api.js +373 -0
  5. package/dist/cjs/src/api-model/api.js +30 -0
  6. package/dist/cjs/src/api-model/base.js +66 -0
  7. package/dist/cjs/src/api-model/common.js +145 -0
  8. package/dist/cjs/src/api-model/configuration.js +91 -0
  9. package/dist/cjs/src/api-model/index.js +32 -0
  10. package/dist/cjs/src/api-model/models/create-query-response.js +15 -0
  11. package/dist/cjs/src/api-model/models/create-query-specification.js +15 -0
  12. package/dist/cjs/src/api-model/models/error-list.js +15 -0
  13. package/dist/cjs/src/api-model/models/get-document-response.js +15 -0
  14. package/dist/cjs/src/api-model/models/get-queries-response-pagination.js +15 -0
  15. package/dist/cjs/src/api-model/models/get-queries-response.js +15 -0
  16. package/dist/cjs/src/api-model/models/index.js +25 -0
  17. package/dist/cjs/src/api-model/models/model-error.js +15 -0
  18. package/dist/cjs/src/api-model/models/query-pagination.js +15 -0
  19. package/dist/cjs/src/api-model/models/query.js +23 -0
  20. package/dist/cjs/src/client.js +49 -0
  21. package/dist/es/index.js +2 -0
  22. package/dist/es/src/api-model/api/queries-api.js +363 -0
  23. package/dist/es/src/api-model/api.js +14 -0
  24. package/dist/es/src/api-model/base.js +58 -0
  25. package/dist/es/src/api-model/common.js +133 -0
  26. package/dist/es/src/api-model/configuration.js +87 -0
  27. package/dist/es/src/api-model/index.js +16 -0
  28. package/dist/es/src/api-model/models/create-query-response.js +14 -0
  29. package/dist/es/src/api-model/models/create-query-specification.js +14 -0
  30. package/dist/es/src/api-model/models/error-list.js +14 -0
  31. package/dist/es/src/api-model/models/get-document-response.js +14 -0
  32. package/dist/es/src/api-model/models/get-queries-response-pagination.js +14 -0
  33. package/dist/es/src/api-model/models/get-queries-response.js +14 -0
  34. package/dist/es/src/api-model/models/index.js +9 -0
  35. package/dist/es/src/api-model/models/model-error.js +14 -0
  36. package/dist/es/src/api-model/models/query-pagination.js +14 -0
  37. package/dist/es/src/api-model/models/query.js +20 -0
  38. package/dist/es/src/client.js +45 -0
  39. package/dist/types/index.d.ts +2 -0
  40. package/dist/types/src/api-model/api/queries-api.d.ts +287 -0
  41. package/dist/types/src/api-model/api.d.ts +12 -0
  42. package/dist/types/src/api-model/base.d.ts +54 -0
  43. package/dist/types/src/api-model/common.d.ts +66 -0
  44. package/dist/types/src/api-model/configuration.d.ts +83 -0
  45. package/dist/types/src/api-model/index.d.ts +14 -0
  46. package/dist/types/src/api-model/models/create-query-response.d.ts +24 -0
  47. package/dist/types/src/api-model/models/create-query-specification.d.ts +30 -0
  48. package/dist/types/src/api-model/models/error-list.d.ts +24 -0
  49. package/dist/types/src/api-model/models/get-document-response.d.ts +30 -0
  50. package/dist/types/src/api-model/models/get-queries-response-pagination.d.ts +24 -0
  51. package/dist/types/src/api-model/models/get-queries-response.d.ts +32 -0
  52. package/dist/types/src/api-model/models/index.d.ts +9 -0
  53. package/dist/types/src/api-model/models/model-error.d.ts +36 -0
  54. package/dist/types/src/api-model/models/query-pagination.d.ts +24 -0
  55. package/dist/types/src/api-model/models/query.d.ts +81 -0
  56. package/dist/types/src/client.d.ts +6 -0
  57. package/package.json +44 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Bizon
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,97 @@
1
+ # `data-kiosk-api-2023-11-15`
2
+
3
+ The Selling Partner API for Data Kiosk lets you submit GraphQL queries from a variety of schemas to help selling partners manage their businesses.
4
+
5
+ [![npm version](https://badgen.net/npm/v/@sp-api-sdk/data-kiosk-api-2023-11-15)](https://www.npmjs.com/package/@sp-api-sdk/data-kiosk-api-2023-11-15)
6
+ [![XO code style](https://badgen.net/badge/code%20style/XO/cyan)](https://github.com/xojs/xo)
7
+
8
+ ## Documentation
9
+
10
+ Learn more about this Selling Partner API by visiting the [official documentation](https://developer-docs.amazon.com/sp-api/docs).
11
+
12
+ Also, see the [generated documentation](https://bizon.github.io/selling-partner-api-sdk/modules/_sp_api_sdk_data_kiosk_api_2023_11_15.html) for this API client.
13
+
14
+ ## Installing
15
+
16
+ ```sh
17
+ npm install @sp-api-sdk/data-kiosk-api-2023-11-15
18
+ ```
19
+
20
+ ## Getting Started
21
+
22
+ ```javascript
23
+ import {SellingPartnerApiAuth} from '@sp-api-sdk/auth'
24
+ import {DataKioskApiClient} from '@sp-api-sdk/data-kiosk-api-2023-11-15'
25
+
26
+ const auth = new SellingPartnerApiAuth({
27
+ clientId: process.env.LWA_CLIENT_ID,
28
+ clientSecret: process.env.LWA_CLIENT_SECRET,
29
+ refreshToken: 'Atzr|…',
30
+ })
31
+
32
+ const client = new DataKioskApiClient({
33
+ auth,
34
+ region: 'eu',
35
+ })
36
+ ```
37
+
38
+ ## Rate Limiting
39
+
40
+ In order to retry rate limited requests (HTTP 429), you can configure the API client as such:
41
+
42
+ ```javascript
43
+ const client = new DataKioskApiClient({
44
+ auth,
45
+ region: 'eu',
46
+ rateLimiting: {
47
+ retry: true,
48
+ // Optionally specify a callback that will be called on every retry.
49
+ onRetry: (retryInfo) => {
50
+ console.log(retryInfo)
51
+ },
52
+ },
53
+ })
54
+ ```
55
+
56
+ The rate limits used for each route are specified in the [API documentation](https://developer-docs.amazon.com/sp-api/docs).
57
+
58
+ ## Logging
59
+
60
+ You can enable logging for both SP-API requests and responses by configuring the `logging.request` and `logging.response` properties.
61
+
62
+ ```javascript
63
+ const client = new DataKioskApiClient({
64
+ auth,
65
+ region: 'eu',
66
+ logging: {
67
+ request: {
68
+ logger: console.debug
69
+ },
70
+ response: {
71
+ logger: console.debug
72
+ },
73
+ error: true,
74
+ },
75
+ })
76
+ ```
77
+
78
+ Specifying `true` will use the default options, specifying an object will allow you to override the default options.
79
+ This uses [axios-logger](https://github.com/hg-pyun/axios-logger) under the hood.
80
+ By default, if enabled, the `request` and `response` loggers will use `console.info` and the `error` logger will use `console.error`.
81
+
82
+
83
+ ## License
84
+
85
+ MIT
86
+
87
+ ## Miscellaneous
88
+
89
+ ```
90
+ ╚⊙ ⊙╝
91
+ ╚═(███)═╝
92
+ ╚═(███)═╝
93
+ ╚═(███)═╝
94
+ ╚═(███)═╝
95
+ ╚═(███)═╝
96
+ ╚═(███)═╝
97
+ ```
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./src/client"), exports);
18
+ __exportStar(require("./src/api-model/models"), exports);
@@ -0,0 +1,373 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Selling Partner API for Data Kiosk
6
+ * The Selling Partner API for Data Kiosk lets you submit GraphQL queries from a variety of schemas to help selling partners manage their businesses.
7
+ *
8
+ * The version of the OpenAPI document: 2023-11-15
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __importDefault = (this && this.__importDefault) || function (mod) {
16
+ return (mod && mod.__esModule) ? mod : { "default": mod };
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.QueriesApi = exports.QueriesApiFactory = exports.QueriesApiFp = exports.QueriesApiAxiosParamCreator = void 0;
20
+ const axios_1 = __importDefault(require("axios"));
21
+ // Some imports not used depending on template conditions
22
+ // @ts-ignore
23
+ const common_1 = require("../common");
24
+ // @ts-ignore
25
+ const base_1 = require("../base");
26
+ /**
27
+ * QueriesApi - axios parameter creator
28
+ * @export
29
+ */
30
+ const QueriesApiAxiosParamCreator = function (configuration) {
31
+ return {
32
+ /**
33
+ * 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).
34
+ * @param {string} queryId The identifier for the query. This identifier is unique only in combination with a selling partner account ID.
35
+ * @param {*} [options] Override http request option.
36
+ * @throws {RequiredError}
37
+ */
38
+ cancelQuery: async (queryId, options = {}) => {
39
+ // verify required parameter 'queryId' is not null or undefined
40
+ (0, common_1.assertParamExists)('cancelQuery', 'queryId', queryId);
41
+ const localVarPath = `/dataKiosk/2023-11-15/queries/{queryId}`
42
+ .replace(`{${"queryId"}}`, encodeURIComponent(String(queryId)));
43
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
44
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
45
+ let baseOptions;
46
+ if (configuration) {
47
+ baseOptions = configuration.baseOptions;
48
+ }
49
+ const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options };
50
+ const localVarHeaderParameter = {};
51
+ const localVarQueryParameter = {};
52
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
53
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
54
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
55
+ return {
56
+ url: (0, common_1.toPathString)(localVarUrlObj),
57
+ options: localVarRequestOptions,
58
+ };
59
+ },
60
+ /**
61
+ * 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).
62
+ * @param {CreateQuerySpecification} body
63
+ * @param {*} [options] Override http request option.
64
+ * @throws {RequiredError}
65
+ */
66
+ createQuery: async (body, options = {}) => {
67
+ // verify required parameter 'body' is not null or undefined
68
+ (0, common_1.assertParamExists)('createQuery', 'body', body);
69
+ const localVarPath = `/dataKiosk/2023-11-15/queries`;
70
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
71
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
72
+ let baseOptions;
73
+ if (configuration) {
74
+ baseOptions = configuration.baseOptions;
75
+ }
76
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
77
+ const localVarHeaderParameter = {};
78
+ const localVarQueryParameter = {};
79
+ localVarHeaderParameter['Content-Type'] = 'application/json';
80
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
81
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
82
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
83
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration);
84
+ return {
85
+ url: (0, common_1.toPathString)(localVarUrlObj),
86
+ options: localVarRequestOptions,
87
+ };
88
+ },
89
+ /**
90
+ * 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).
91
+ * @param {string} documentId The identifier for the Data Kiosk document.
92
+ * @param {*} [options] Override http request option.
93
+ * @throws {RequiredError}
94
+ */
95
+ getDocument: async (documentId, options = {}) => {
96
+ // verify required parameter 'documentId' is not null or undefined
97
+ (0, common_1.assertParamExists)('getDocument', 'documentId', documentId);
98
+ const localVarPath = `/dataKiosk/2023-11-15/documents/{documentId}`
99
+ .replace(`{${"documentId"}}`, encodeURIComponent(String(documentId)));
100
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
101
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
102
+ let baseOptions;
103
+ if (configuration) {
104
+ baseOptions = configuration.baseOptions;
105
+ }
106
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
107
+ const localVarHeaderParameter = {};
108
+ const localVarQueryParameter = {};
109
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
110
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
111
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
112
+ return {
113
+ url: (0, common_1.toPathString)(localVarUrlObj),
114
+ options: localVarRequestOptions,
115
+ };
116
+ },
117
+ /**
118
+ * 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).
119
+ * @param {Array<'CANCELLED' | 'DONE' | 'FATAL' | 'IN_PROGRESS' | 'IN_QUEUE'>} [processingStatuses] A list of processing statuses used to filter queries.
120
+ * @param {number} [pageSize] The maximum number of queries to return in a single call.
121
+ * @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.
122
+ * @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.
123
+ * @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.
124
+ * @param {*} [options] Override http request option.
125
+ * @throws {RequiredError}
126
+ */
127
+ getQueries: async (processingStatuses, pageSize, createdSince, createdUntil, paginationToken, options = {}) => {
128
+ const localVarPath = `/dataKiosk/2023-11-15/queries`;
129
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
130
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
131
+ let baseOptions;
132
+ if (configuration) {
133
+ baseOptions = configuration.baseOptions;
134
+ }
135
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
136
+ const localVarHeaderParameter = {};
137
+ const localVarQueryParameter = {};
138
+ if (processingStatuses) {
139
+ localVarQueryParameter['processingStatuses'] = processingStatuses.join(base_1.COLLECTION_FORMATS.csv);
140
+ }
141
+ if (pageSize !== undefined) {
142
+ localVarQueryParameter['pageSize'] = pageSize;
143
+ }
144
+ if (createdSince !== undefined) {
145
+ localVarQueryParameter['createdSince'] = (createdSince instanceof Date) ?
146
+ createdSince.toISOString() :
147
+ createdSince;
148
+ }
149
+ if (createdUntil !== undefined) {
150
+ localVarQueryParameter['createdUntil'] = (createdUntil instanceof Date) ?
151
+ createdUntil.toISOString() :
152
+ createdUntil;
153
+ }
154
+ if (paginationToken !== undefined) {
155
+ localVarQueryParameter['paginationToken'] = paginationToken;
156
+ }
157
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
158
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
159
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
160
+ return {
161
+ url: (0, common_1.toPathString)(localVarUrlObj),
162
+ options: localVarRequestOptions,
163
+ };
164
+ },
165
+ /**
166
+ * 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).
167
+ * @param {string} queryId The query identifier.
168
+ * @param {*} [options] Override http request option.
169
+ * @throws {RequiredError}
170
+ */
171
+ getQuery: async (queryId, options = {}) => {
172
+ // verify required parameter 'queryId' is not null or undefined
173
+ (0, common_1.assertParamExists)('getQuery', 'queryId', queryId);
174
+ const localVarPath = `/dataKiosk/2023-11-15/queries/{queryId}`
175
+ .replace(`{${"queryId"}}`, encodeURIComponent(String(queryId)));
176
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
177
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
178
+ let baseOptions;
179
+ if (configuration) {
180
+ baseOptions = configuration.baseOptions;
181
+ }
182
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
183
+ const localVarHeaderParameter = {};
184
+ const localVarQueryParameter = {};
185
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
186
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
187
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
188
+ return {
189
+ url: (0, common_1.toPathString)(localVarUrlObj),
190
+ options: localVarRequestOptions,
191
+ };
192
+ },
193
+ };
194
+ };
195
+ exports.QueriesApiAxiosParamCreator = QueriesApiAxiosParamCreator;
196
+ /**
197
+ * QueriesApi - functional programming interface
198
+ * @export
199
+ */
200
+ const QueriesApiFp = function (configuration) {
201
+ const localVarAxiosParamCreator = (0, exports.QueriesApiAxiosParamCreator)(configuration);
202
+ return {
203
+ /**
204
+ * 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).
205
+ * @param {string} queryId The identifier for the query. This identifier is unique only in combination with a selling partner account ID.
206
+ * @param {*} [options] Override http request option.
207
+ * @throws {RequiredError}
208
+ */
209
+ async cancelQuery(queryId, options) {
210
+ const localVarAxiosArgs = await localVarAxiosParamCreator.cancelQuery(queryId, options);
211
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
212
+ },
213
+ /**
214
+ * 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).
215
+ * @param {CreateQuerySpecification} body
216
+ * @param {*} [options] Override http request option.
217
+ * @throws {RequiredError}
218
+ */
219
+ async createQuery(body, options) {
220
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createQuery(body, options);
221
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
222
+ },
223
+ /**
224
+ * 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).
225
+ * @param {string} documentId The identifier for the Data Kiosk document.
226
+ * @param {*} [options] Override http request option.
227
+ * @throws {RequiredError}
228
+ */
229
+ async getDocument(documentId, options) {
230
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getDocument(documentId, options);
231
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
232
+ },
233
+ /**
234
+ * 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).
235
+ * @param {Array<'CANCELLED' | 'DONE' | 'FATAL' | 'IN_PROGRESS' | 'IN_QUEUE'>} [processingStatuses] A list of processing statuses used to filter queries.
236
+ * @param {number} [pageSize] The maximum number of queries to return in a single call.
237
+ * @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.
238
+ * @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.
239
+ * @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.
240
+ * @param {*} [options] Override http request option.
241
+ * @throws {RequiredError}
242
+ */
243
+ async getQueries(processingStatuses, pageSize, createdSince, createdUntil, paginationToken, options) {
244
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getQueries(processingStatuses, pageSize, createdSince, createdUntil, paginationToken, options);
245
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
246
+ },
247
+ /**
248
+ * 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).
249
+ * @param {string} queryId The query identifier.
250
+ * @param {*} [options] Override http request option.
251
+ * @throws {RequiredError}
252
+ */
253
+ async getQuery(queryId, options) {
254
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getQuery(queryId, options);
255
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
256
+ },
257
+ };
258
+ };
259
+ exports.QueriesApiFp = QueriesApiFp;
260
+ /**
261
+ * QueriesApi - factory interface
262
+ * @export
263
+ */
264
+ const QueriesApiFactory = function (configuration, basePath, axios) {
265
+ const localVarFp = (0, exports.QueriesApiFp)(configuration);
266
+ return {
267
+ /**
268
+ * 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).
269
+ * @param {QueriesApiCancelQueryRequest} requestParameters Request parameters.
270
+ * @param {*} [options] Override http request option.
271
+ * @throws {RequiredError}
272
+ */
273
+ cancelQuery(requestParameters, options) {
274
+ return localVarFp.cancelQuery(requestParameters.queryId, options).then((request) => request(axios, basePath));
275
+ },
276
+ /**
277
+ * 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).
278
+ * @param {QueriesApiCreateQueryRequest} requestParameters Request parameters.
279
+ * @param {*} [options] Override http request option.
280
+ * @throws {RequiredError}
281
+ */
282
+ createQuery(requestParameters, options) {
283
+ return localVarFp.createQuery(requestParameters.body, options).then((request) => request(axios, basePath));
284
+ },
285
+ /**
286
+ * 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).
287
+ * @param {QueriesApiGetDocumentRequest} requestParameters Request parameters.
288
+ * @param {*} [options] Override http request option.
289
+ * @throws {RequiredError}
290
+ */
291
+ getDocument(requestParameters, options) {
292
+ return localVarFp.getDocument(requestParameters.documentId, options).then((request) => request(axios, basePath));
293
+ },
294
+ /**
295
+ * 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).
296
+ * @param {QueriesApiGetQueriesRequest} requestParameters Request parameters.
297
+ * @param {*} [options] Override http request option.
298
+ * @throws {RequiredError}
299
+ */
300
+ getQueries(requestParameters = {}, options) {
301
+ return localVarFp.getQueries(requestParameters.processingStatuses, requestParameters.pageSize, requestParameters.createdSince, requestParameters.createdUntil, requestParameters.paginationToken, options).then((request) => request(axios, basePath));
302
+ },
303
+ /**
304
+ * 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).
305
+ * @param {QueriesApiGetQueryRequest} requestParameters Request parameters.
306
+ * @param {*} [options] Override http request option.
307
+ * @throws {RequiredError}
308
+ */
309
+ getQuery(requestParameters, options) {
310
+ return localVarFp.getQuery(requestParameters.queryId, options).then((request) => request(axios, basePath));
311
+ },
312
+ };
313
+ };
314
+ exports.QueriesApiFactory = QueriesApiFactory;
315
+ /**
316
+ * QueriesApi - object-oriented interface
317
+ * @export
318
+ * @class QueriesApi
319
+ * @extends {BaseAPI}
320
+ */
321
+ class QueriesApi extends base_1.BaseAPI {
322
+ /**
323
+ * 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).
324
+ * @param {QueriesApiCancelQueryRequest} requestParameters Request parameters.
325
+ * @param {*} [options] Override http request option.
326
+ * @throws {RequiredError}
327
+ * @memberof QueriesApi
328
+ */
329
+ cancelQuery(requestParameters, options) {
330
+ return (0, exports.QueriesApiFp)(this.configuration).cancelQuery(requestParameters.queryId, options).then((request) => request(this.axios, this.basePath));
331
+ }
332
+ /**
333
+ * 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).
334
+ * @param {QueriesApiCreateQueryRequest} requestParameters Request parameters.
335
+ * @param {*} [options] Override http request option.
336
+ * @throws {RequiredError}
337
+ * @memberof QueriesApi
338
+ */
339
+ createQuery(requestParameters, options) {
340
+ return (0, exports.QueriesApiFp)(this.configuration).createQuery(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
341
+ }
342
+ /**
343
+ * 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).
344
+ * @param {QueriesApiGetDocumentRequest} requestParameters Request parameters.
345
+ * @param {*} [options] Override http request option.
346
+ * @throws {RequiredError}
347
+ * @memberof QueriesApi
348
+ */
349
+ getDocument(requestParameters, options) {
350
+ return (0, exports.QueriesApiFp)(this.configuration).getDocument(requestParameters.documentId, options).then((request) => request(this.axios, this.basePath));
351
+ }
352
+ /**
353
+ * 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).
354
+ * @param {QueriesApiGetQueriesRequest} requestParameters Request parameters.
355
+ * @param {*} [options] Override http request option.
356
+ * @throws {RequiredError}
357
+ * @memberof QueriesApi
358
+ */
359
+ getQueries(requestParameters = {}, options) {
360
+ return (0, exports.QueriesApiFp)(this.configuration).getQueries(requestParameters.processingStatuses, requestParameters.pageSize, requestParameters.createdSince, requestParameters.createdUntil, requestParameters.paginationToken, options).then((request) => request(this.axios, this.basePath));
361
+ }
362
+ /**
363
+ * 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).
364
+ * @param {QueriesApiGetQueryRequest} requestParameters Request parameters.
365
+ * @param {*} [options] Override http request option.
366
+ * @throws {RequiredError}
367
+ * @memberof QueriesApi
368
+ */
369
+ getQuery(requestParameters, options) {
370
+ return (0, exports.QueriesApiFp)(this.configuration).getQuery(requestParameters.queryId, options).then((request) => request(this.axios, this.basePath));
371
+ }
372
+ }
373
+ exports.QueriesApi = QueriesApi;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Selling Partner API for Data Kiosk
6
+ * The Selling Partner API for Data Kiosk lets you submit GraphQL queries from a variety of schemas to help selling partners manage their businesses.
7
+ *
8
+ * The version of the OpenAPI document: 2023-11-15
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16
+ if (k2 === undefined) k2 = k;
17
+ var desc = Object.getOwnPropertyDescriptor(m, k);
18
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
19
+ desc = { enumerable: true, get: function() { return m[k]; } };
20
+ }
21
+ Object.defineProperty(o, k2, desc);
22
+ }) : (function(o, m, k, k2) {
23
+ if (k2 === undefined) k2 = k;
24
+ o[k2] = m[k];
25
+ }));
26
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
27
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
28
+ };
29
+ Object.defineProperty(exports, "__esModule", { value: true });
30
+ __exportStar(require("./api/queries-api"), exports);
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Selling Partner API for Data Kiosk
6
+ * The Selling Partner API for Data Kiosk lets you submit GraphQL queries from a variety of schemas to help selling partners manage their businesses.
7
+ *
8
+ * The version of the OpenAPI document: 2023-11-15
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __importDefault = (this && this.__importDefault) || function (mod) {
16
+ return (mod && mod.__esModule) ? mod : { "default": mod };
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
20
+ const axios_1 = __importDefault(require("axios"));
21
+ exports.BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
22
+ /**
23
+ *
24
+ * @export
25
+ */
26
+ exports.COLLECTION_FORMATS = {
27
+ csv: ",",
28
+ ssv: " ",
29
+ tsv: "\t",
30
+ pipes: "|",
31
+ };
32
+ /**
33
+ *
34
+ * @export
35
+ * @class BaseAPI
36
+ */
37
+ class BaseAPI {
38
+ basePath;
39
+ axios;
40
+ configuration;
41
+ constructor(configuration, basePath = exports.BASE_PATH, axios = axios_1.default) {
42
+ this.basePath = basePath;
43
+ this.axios = axios;
44
+ if (configuration) {
45
+ this.configuration = configuration;
46
+ this.basePath = configuration.basePath || this.basePath;
47
+ }
48
+ }
49
+ }
50
+ exports.BaseAPI = BaseAPI;
51
+ ;
52
+ /**
53
+ *
54
+ * @export
55
+ * @class RequiredError
56
+ * @extends {Error}
57
+ */
58
+ class RequiredError extends Error {
59
+ field;
60
+ constructor(field, msg) {
61
+ super(msg);
62
+ this.field = field;
63
+ this.name = "RequiredError";
64
+ }
65
+ }
66
+ exports.RequiredError = RequiredError;