@sp-api-sdk/tokens-api-2021-03-01 3.0.21 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +4 -4
  2. package/dist/index.cjs +321 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.cts +323 -0
  5. package/dist/index.d.ts +323 -0
  6. package/dist/index.js +278 -0
  7. package/dist/index.js.map +1 -0
  8. package/package.json +23 -12
  9. package/dist/cjs/api-model/api/tokens-api.js +0 -117
  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-restricted-data-token-request.js +0 -15
  16. package/dist/cjs/api-model/models/create-restricted-data-token-response.js +0 -15
  17. package/dist/cjs/api-model/models/error-list.js +0 -15
  18. package/dist/cjs/api-model/models/index.js +0 -21
  19. package/dist/cjs/api-model/models/model-error.js +0 -15
  20. package/dist/cjs/api-model/models/restricted-resource.js +0 -22
  21. package/dist/cjs/client.js +0 -21
  22. package/dist/cjs/index.js +0 -19
  23. package/dist/es/api-model/api/tokens-api.js +0 -107
  24. package/dist/es/api-model/api.js +0 -14
  25. package/dist/es/api-model/base.js +0 -44
  26. package/dist/es/api-model/common.js +0 -110
  27. package/dist/es/api-model/configuration.js +0 -94
  28. package/dist/es/api-model/index.js +0 -16
  29. package/dist/es/api-model/models/create-restricted-data-token-request.js +0 -14
  30. package/dist/es/api-model/models/create-restricted-data-token-response.js +0 -14
  31. package/dist/es/api-model/models/error-list.js +0 -14
  32. package/dist/es/api-model/models/index.js +0 -5
  33. package/dist/es/api-model/models/model-error.js +0 -14
  34. package/dist/es/api-model/models/restricted-resource.js +0 -19
  35. package/dist/es/client.js +0 -17
  36. package/dist/es/index.js +0 -3
  37. package/dist/types/api-model/api/tokens-api.d.ts +0 -74
  38. package/dist/types/api-model/api.d.ts +0 -12
  39. package/dist/types/api-model/base.d.ts +0 -42
  40. package/dist/types/api-model/common.d.ts +0 -34
  41. package/dist/types/api-model/configuration.d.ts +0 -98
  42. package/dist/types/api-model/index.d.ts +0 -14
  43. package/dist/types/api-model/models/create-restricted-data-token-request.d.ts +0 -25
  44. package/dist/types/api-model/models/create-restricted-data-token-response.d.ts +0 -24
  45. package/dist/types/api-model/models/error-list.d.ts +0 -17
  46. package/dist/types/api-model/models/index.d.ts +0 -5
  47. package/dist/types/api-model/models/model-error.d.ts +0 -28
  48. package/dist/types/api-model/models/restricted-resource.d.ts +0 -35
  49. package/dist/types/client.d.ts +0 -6
  50. package/dist/types/index.d.ts +0 -3
package/dist/index.js ADDED
@@ -0,0 +1,278 @@
1
+ // src/client.ts
2
+ import { createAxiosInstance } from "@sp-api-sdk/common";
3
+
4
+ // src/api-model/api/tokens-api.ts
5
+ import globalAxios2 from "axios";
6
+
7
+ // src/api-model/base.ts
8
+ import globalAxios from "axios";
9
+ var BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
10
+ var BaseAPI = class {
11
+ constructor(configuration, basePath = BASE_PATH, axios = globalAxios) {
12
+ this.basePath = basePath;
13
+ this.axios = axios;
14
+ if (configuration) {
15
+ this.configuration = configuration;
16
+ this.basePath = configuration.basePath ?? basePath;
17
+ }
18
+ }
19
+ basePath;
20
+ axios;
21
+ configuration;
22
+ };
23
+ var RequiredError = class extends Error {
24
+ constructor(field, msg) {
25
+ super(msg);
26
+ this.field = field;
27
+ this.name = "RequiredError";
28
+ }
29
+ field;
30
+ };
31
+ var operationServerMap = {};
32
+
33
+ // src/api-model/common.ts
34
+ var DUMMY_BASE_URL = "https://example.com";
35
+ var assertParamExists = function(functionName, paramName, paramValue) {
36
+ if (paramValue === null || paramValue === void 0) {
37
+ throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
38
+ }
39
+ };
40
+ function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
41
+ if (parameter == null) return;
42
+ if (typeof parameter === "object") {
43
+ if (Array.isArray(parameter) || parameter instanceof Set) {
44
+ parameter.forEach((item) => setFlattenedQueryParams(urlSearchParams, item, key));
45
+ } else {
46
+ Object.keys(parameter).forEach(
47
+ (currentKey) => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== "" ? "." : ""}${currentKey}`)
48
+ );
49
+ }
50
+ } else {
51
+ if (urlSearchParams.has(key)) {
52
+ urlSearchParams.append(key, parameter);
53
+ } else {
54
+ urlSearchParams.set(key, parameter);
55
+ }
56
+ }
57
+ }
58
+ var setSearchParams = function(url, ...objects) {
59
+ const searchParams = new URLSearchParams(url.search);
60
+ setFlattenedQueryParams(searchParams, objects);
61
+ url.search = searchParams.toString();
62
+ };
63
+ var replaceWithSerializableTypeIfNeeded = function(key, value) {
64
+ if (value instanceof Set) {
65
+ return Array.from(value);
66
+ } else {
67
+ return value;
68
+ }
69
+ };
70
+ var serializeDataIfNeeded = function(value, requestOptions, configuration) {
71
+ const nonString = typeof value !== "string";
72
+ const needsSerialization = nonString && configuration && configuration.isJsonMime ? configuration.isJsonMime(requestOptions.headers["Content-Type"]) : nonString;
73
+ return needsSerialization ? JSON.stringify(value !== void 0 ? value : {}, replaceWithSerializableTypeIfNeeded) : value || "";
74
+ };
75
+ var toPathString = function(url) {
76
+ return url.pathname + url.search + url.hash;
77
+ };
78
+ var createRequestFunction = function(axiosArgs, globalAxios3, BASE_PATH2, configuration) {
79
+ return (axios = globalAxios3, basePath = BASE_PATH2) => {
80
+ const axiosRequestArgs = { ...axiosArgs.options, url: (axios.defaults.baseURL ? "" : configuration?.basePath ?? basePath) + axiosArgs.url };
81
+ return axios.request(axiosRequestArgs);
82
+ };
83
+ };
84
+
85
+ // src/api-model/api/tokens-api.ts
86
+ var TokensApiAxiosParamCreator = function(configuration) {
87
+ return {
88
+ /**
89
+ * Returns a Restricted Data Token (RDT) for one or more restricted resources that you specify. A restricted resource is the HTTP method and path from a restricted operation that returns Personally Identifiable Information (PII), plus a dataElements value that indicates the type of PII requested. See the Tokens API Use Case Guide for a list of restricted operations. Use the RDT returned here as the access token in subsequent calls to the corresponding restricted operations. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 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, see [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).
90
+ * @param {CreateRestrictedDataTokenRequest} body The restricted data token request details.
91
+ * @param {*} [options] Override http request option.
92
+ * @throws {RequiredError}
93
+ */
94
+ createRestrictedDataToken: async (body, options = {}) => {
95
+ assertParamExists("createRestrictedDataToken", "body", body);
96
+ const localVarPath = `/tokens/2021-03-01/restrictedDataToken`;
97
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
98
+ let baseOptions;
99
+ if (configuration) {
100
+ baseOptions = configuration.baseOptions;
101
+ }
102
+ const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
103
+ const localVarHeaderParameter = {};
104
+ const localVarQueryParameter = {};
105
+ localVarHeaderParameter["Content-Type"] = "application/json";
106
+ localVarHeaderParameter["Accept"] = "application/json";
107
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
108
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
109
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
110
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration);
111
+ return {
112
+ url: toPathString(localVarUrlObj),
113
+ options: localVarRequestOptions
114
+ };
115
+ }
116
+ };
117
+ };
118
+ var TokensApiFp = function(configuration) {
119
+ const localVarAxiosParamCreator = TokensApiAxiosParamCreator(configuration);
120
+ return {
121
+ /**
122
+ * Returns a Restricted Data Token (RDT) for one or more restricted resources that you specify. A restricted resource is the HTTP method and path from a restricted operation that returns Personally Identifiable Information (PII), plus a dataElements value that indicates the type of PII requested. See the Tokens API Use Case Guide for a list of restricted operations. Use the RDT returned here as the access token in subsequent calls to the corresponding restricted operations. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 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, see [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).
123
+ * @param {CreateRestrictedDataTokenRequest} body The restricted data token request details.
124
+ * @param {*} [options] Override http request option.
125
+ * @throws {RequiredError}
126
+ */
127
+ async createRestrictedDataToken(body, options) {
128
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createRestrictedDataToken(body, options);
129
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
130
+ const localVarOperationServerBasePath = operationServerMap["TokensApi.createRestrictedDataToken"]?.[localVarOperationServerIndex]?.url;
131
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
132
+ }
133
+ };
134
+ };
135
+ var TokensApiFactory = function(configuration, basePath, axios) {
136
+ const localVarFp = TokensApiFp(configuration);
137
+ return {
138
+ /**
139
+ * Returns a Restricted Data Token (RDT) for one or more restricted resources that you specify. A restricted resource is the HTTP method and path from a restricted operation that returns Personally Identifiable Information (PII), plus a dataElements value that indicates the type of PII requested. See the Tokens API Use Case Guide for a list of restricted operations. Use the RDT returned here as the access token in subsequent calls to the corresponding restricted operations. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 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, see [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).
140
+ * @param {TokensApiCreateRestrictedDataTokenRequest} requestParameters Request parameters.
141
+ * @param {*} [options] Override http request option.
142
+ * @throws {RequiredError}
143
+ */
144
+ createRestrictedDataToken(requestParameters, options) {
145
+ return localVarFp.createRestrictedDataToken(requestParameters.body, options).then((request) => request(axios, basePath));
146
+ }
147
+ };
148
+ };
149
+ var TokensApi = class extends BaseAPI {
150
+ /**
151
+ * Returns a Restricted Data Token (RDT) for one or more restricted resources that you specify. A restricted resource is the HTTP method and path from a restricted operation that returns Personally Identifiable Information (PII), plus a dataElements value that indicates the type of PII requested. See the Tokens API Use Case Guide for a list of restricted operations. Use the RDT returned here as the access token in subsequent calls to the corresponding restricted operations. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 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, see [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).
152
+ * @param {TokensApiCreateRestrictedDataTokenRequest} requestParameters Request parameters.
153
+ * @param {*} [options] Override http request option.
154
+ * @throws {RequiredError}
155
+ */
156
+ createRestrictedDataToken(requestParameters, options) {
157
+ return TokensApiFp(this.configuration).createRestrictedDataToken(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
158
+ }
159
+ };
160
+
161
+ // src/api-model/configuration.ts
162
+ var Configuration = class {
163
+ /**
164
+ * parameter for apiKey security
165
+ * @param name security name
166
+ */
167
+ apiKey;
168
+ /**
169
+ * parameter for basic security
170
+ */
171
+ username;
172
+ /**
173
+ * parameter for basic security
174
+ */
175
+ password;
176
+ /**
177
+ * parameter for oauth2 security
178
+ * @param name security name
179
+ * @param scopes oauth2 scope
180
+ */
181
+ accessToken;
182
+ /**
183
+ * parameter for aws4 signature security
184
+ * @param {Object} AWS4Signature - AWS4 Signature security
185
+ * @param {string} options.region - aws region
186
+ * @param {string} options.service - name of the service.
187
+ * @param {string} credentials.accessKeyId - aws access key id
188
+ * @param {string} credentials.secretAccessKey - aws access key
189
+ * @param {string} credentials.sessionToken - aws session token
190
+ * @memberof Configuration
191
+ */
192
+ awsv4;
193
+ /**
194
+ * override base path
195
+ */
196
+ basePath;
197
+ /**
198
+ * override server index
199
+ */
200
+ serverIndex;
201
+ /**
202
+ * base options for axios calls
203
+ */
204
+ baseOptions;
205
+ /**
206
+ * The FormData constructor that will be used to create multipart form data
207
+ * requests. You can inject this here so that execution environments that
208
+ * do not support the FormData class can still run the generated client.
209
+ *
210
+ * @type {new () => FormData}
211
+ */
212
+ formDataCtor;
213
+ constructor(param = {}) {
214
+ this.apiKey = param.apiKey;
215
+ this.username = param.username;
216
+ this.password = param.password;
217
+ this.accessToken = param.accessToken;
218
+ this.awsv4 = param.awsv4;
219
+ this.basePath = param.basePath;
220
+ this.serverIndex = param.serverIndex;
221
+ this.baseOptions = {
222
+ ...param.baseOptions,
223
+ headers: {
224
+ ...param.baseOptions?.headers
225
+ }
226
+ };
227
+ this.formDataCtor = param.formDataCtor;
228
+ }
229
+ /**
230
+ * Check if the given MIME is a JSON MIME.
231
+ * JSON MIME examples:
232
+ * application/json
233
+ * application/json; charset=UTF8
234
+ * APPLICATION/JSON
235
+ * application/vnd.company+json
236
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
237
+ * @return True if the given MIME is JSON, false otherwise.
238
+ */
239
+ isJsonMime(mime) {
240
+ const jsonMime = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i;
241
+ return mime !== null && jsonMime.test(mime);
242
+ }
243
+ };
244
+
245
+ // src/api-model/models/restricted-resource.ts
246
+ var RestrictedResourceMethodEnum = {
247
+ Get: "GET",
248
+ Put: "PUT",
249
+ Post: "POST",
250
+ Delete: "DELETE"
251
+ };
252
+
253
+ // src/client.ts
254
+ var clientRateLimits = [
255
+ {
256
+ method: "post",
257
+ // eslint-disable-next-line prefer-regex-literals
258
+ urlRegex: new RegExp("^/tokens/2021-03-01/restrictedDataToken$"),
259
+ rate: 1,
260
+ burst: 10
261
+ }
262
+ ];
263
+ var TokensApiClient = class extends TokensApi {
264
+ constructor(configuration) {
265
+ const { axios, endpoint } = createAxiosInstance(configuration, clientRateLimits);
266
+ super(new Configuration(), endpoint, axios);
267
+ }
268
+ };
269
+ export {
270
+ RestrictedResourceMethodEnum,
271
+ TokensApi,
272
+ TokensApiAxiosParamCreator,
273
+ TokensApiClient,
274
+ TokensApiFactory,
275
+ TokensApiFp,
276
+ clientRateLimits
277
+ };
278
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/client.ts","../src/api-model/api/tokens-api.ts","../src/api-model/base.ts","../src/api-model/common.ts","../src/api-model/configuration.ts","../src/api-model/models/restricted-resource.ts"],"sourcesContent":["import {type ClientConfiguration, createAxiosInstance, type RateLimit} from '@sp-api-sdk/common'\n\nimport {Configuration, TokensApi} from './api-model/index.js'\n\nexport const clientRateLimits: RateLimit[] = [\n {\n method: 'post',\n // eslint-disable-next-line prefer-regex-literals\n urlRegex: new RegExp('^/tokens/2021-03-01/restrictedDataToken$'),\n rate: 1,\n burst: 10,\n },\n]\n\nexport class TokensApiClient extends TokensApi {\n constructor(configuration: ClientConfiguration) {\n const {axios, endpoint} = createAxiosInstance(configuration, clientRateLimits)\n\n super(new Configuration(), endpoint, axios)\n }\n}\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * Selling Partner API for Tokens \n * The Selling Partner API for Tokens provides a secure way to access a customer\\'s PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes subsequent calls to restricted operations that correspond to the restricted resources that you specified. For more information, see the [Tokens API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/tokens-api-use-case-guide).\n *\n * The version of the OpenAPI document: 2021-03-01\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n\nimport type { Configuration } from '../configuration.js';\nimport type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';\nimport globalAxios from 'axios';\n// Some imports not used depending on template conditions\n// @ts-ignore\nimport { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction, replaceWithSerializableTypeIfNeeded } from '../common.js';\n// @ts-ignore\nimport { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base.js';\n// @ts-ignore\nimport type { CreateRestrictedDataTokenRequest } from '../models/index.js';\n// @ts-ignore\nimport type { CreateRestrictedDataTokenResponse } from '../models/index.js';\n// @ts-ignore\nimport type { ErrorList } from '../models/index.js';\n/**\n * TokensApi - axios parameter creator\n */\nexport const TokensApiAxiosParamCreator = function (configuration?: Configuration) {\n return {\n /**\n * Returns a Restricted Data Token (RDT) for one or more restricted resources that you specify. A restricted resource is the HTTP method and path from a restricted operation that returns Personally Identifiable Information (PII), plus a dataElements value that indicates the type of PII requested. See the Tokens API Use Case Guide for a list of restricted operations. Use the RDT returned here as the access token in subsequent calls to the corresponding restricted operations. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 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, see [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).\n * @param {CreateRestrictedDataTokenRequest} body The restricted data token request details.\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n */\n createRestrictedDataToken: async (body: CreateRestrictedDataTokenRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {\n // verify required parameter 'body' is not null or undefined\n assertParamExists('createRestrictedDataToken', 'body', body)\n const localVarPath = `/tokens/2021-03-01/restrictedDataToken`;\n // use dummy base URL string because the URL constructor only accepts absolute URLs.\n const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);\n let baseOptions;\n if (configuration) {\n baseOptions = configuration.baseOptions;\n }\n\n const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};\n const localVarHeaderParameter = {} as any;\n const localVarQueryParameter = {} as any;\n\n localVarHeaderParameter['Content-Type'] = 'application/json';\n localVarHeaderParameter['Accept'] = 'application/json';\n\n setSearchParams(localVarUrlObj, localVarQueryParameter);\n let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};\n localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};\n localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)\n\n return {\n url: toPathString(localVarUrlObj),\n options: localVarRequestOptions,\n };\n },\n }\n};\n\n/**\n * TokensApi - functional programming interface\n */\nexport const TokensApiFp = function(configuration?: Configuration) {\n const localVarAxiosParamCreator = TokensApiAxiosParamCreator(configuration)\n return {\n /**\n * Returns a Restricted Data Token (RDT) for one or more restricted resources that you specify. A restricted resource is the HTTP method and path from a restricted operation that returns Personally Identifiable Information (PII), plus a dataElements value that indicates the type of PII requested. See the Tokens API Use Case Guide for a list of restricted operations. Use the RDT returned here as the access token in subsequent calls to the corresponding restricted operations. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 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, see [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).\n * @param {CreateRestrictedDataTokenRequest} body The restricted data token request details.\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n */\n async createRestrictedDataToken(body: CreateRestrictedDataTokenRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateRestrictedDataTokenResponse>> {\n const localVarAxiosArgs = await localVarAxiosParamCreator.createRestrictedDataToken(body, options);\n const localVarOperationServerIndex = configuration?.serverIndex ?? 0;\n const localVarOperationServerBasePath = operationServerMap['TokensApi.createRestrictedDataToken']?.[localVarOperationServerIndex]?.url;\n return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);\n },\n }\n};\n\n/**\n * TokensApi - factory interface\n */\nexport const TokensApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {\n const localVarFp = TokensApiFp(configuration)\n return {\n /**\n * Returns a Restricted Data Token (RDT) for one or more restricted resources that you specify. A restricted resource is the HTTP method and path from a restricted operation that returns Personally Identifiable Information (PII), plus a dataElements value that indicates the type of PII requested. See the Tokens API Use Case Guide for a list of restricted operations. Use the RDT returned here as the access token in subsequent calls to the corresponding restricted operations. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 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, see [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).\n * @param {TokensApiCreateRestrictedDataTokenRequest} requestParameters Request parameters.\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n */\n createRestrictedDataToken(requestParameters: TokensApiCreateRestrictedDataTokenRequest, options?: RawAxiosRequestConfig): AxiosPromise<CreateRestrictedDataTokenResponse> {\n return localVarFp.createRestrictedDataToken(requestParameters.body, options).then((request) => request(axios, basePath));\n },\n };\n};\n\n/**\n * Request parameters for createRestrictedDataToken operation in TokensApi.\n */\nexport interface TokensApiCreateRestrictedDataTokenRequest {\n /**\n * The restricted data token request details.\n */\n readonly body: CreateRestrictedDataTokenRequest\n}\n\n/**\n * TokensApi - object-oriented interface\n */\nexport class TokensApi extends BaseAPI {\n /**\n * Returns a Restricted Data Token (RDT) for one or more restricted resources that you specify. A restricted resource is the HTTP method and path from a restricted operation that returns Personally Identifiable Information (PII), plus a dataElements value that indicates the type of PII requested. See the Tokens API Use Case Guide for a list of restricted operations. Use the RDT returned here as the access token in subsequent calls to the corresponding restricted operations. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 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, see [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).\n * @param {TokensApiCreateRestrictedDataTokenRequest} requestParameters Request parameters.\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n */\n public createRestrictedDataToken(requestParameters: TokensApiCreateRestrictedDataTokenRequest, options?: RawAxiosRequestConfig) {\n return TokensApiFp(this.configuration).createRestrictedDataToken(requestParameters.body, options).then((request) => request(this.axios, this.basePath));\n }\n}\n\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * Selling Partner API for Tokens \n * The Selling Partner API for Tokens provides a secure way to access a customer\\'s PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes subsequent calls to restricted operations that correspond to the restricted resources that you specified. For more information, see the [Tokens API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/tokens-api-use-case-guide).\n *\n * The version of the OpenAPI document: 2021-03-01\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n\nimport type { Configuration } from './configuration.js';\n// Some imports not used depending on template conditions\n// @ts-ignore\nimport type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';\nimport globalAxios from 'axios';\n\nexport const BASE_PATH = \"https://sellingpartnerapi-na.amazon.com\".replace(/\\/+$/, \"\");\n\nexport const COLLECTION_FORMATS = {\n csv: \",\",\n ssv: \" \",\n tsv: \"\\t\",\n pipes: \"|\",\n};\n\nexport interface RequestArgs {\n url: string;\n options: RawAxiosRequestConfig;\n}\n\nexport class BaseAPI {\n protected configuration: Configuration | undefined;\n\n constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {\n if (configuration) {\n this.configuration = configuration;\n this.basePath = configuration.basePath ?? basePath;\n }\n }\n};\n\nexport class RequiredError extends Error {\n constructor(public field: string, msg?: string) {\n super(msg);\n this.name = \"RequiredError\"\n }\n}\n\ninterface ServerMap {\n [key: string]: {\n url: string,\n description: string,\n }[];\n}\n\nexport const operationServerMap: ServerMap = {\n}\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * Selling Partner API for Tokens \n * The Selling Partner API for Tokens provides a secure way to access a customer\\'s PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes subsequent calls to restricted operations that correspond to the restricted resources that you specified. For more information, see the [Tokens API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/tokens-api-use-case-guide).\n *\n * The version of the OpenAPI document: 2021-03-01\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport type { Configuration } from \"./configuration.js\";\nimport type { RequestArgs } from \"./base.js\";\nimport type { AxiosInstance, AxiosResponse } from 'axios';\nimport { RequiredError } from \"./base.js\";\n\nexport const DUMMY_BASE_URL = 'https://example.com'\n\n/**\n *\n * @throws {RequiredError}\n */\nexport const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) {\n if (paramValue === null || paramValue === undefined) {\n throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);\n }\n}\n\nexport const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) {\n if (configuration && configuration.apiKey) {\n const localVarApiKeyValue = typeof configuration.apiKey === 'function'\n ? await configuration.apiKey(keyParamName)\n : await configuration.apiKey;\n object[keyParamName] = localVarApiKeyValue;\n }\n}\n\nexport const setBasicAuthToObject = function (object: any, configuration?: Configuration) {\n if (configuration && (configuration.username || configuration.password)) {\n object[\"auth\"] = { username: configuration.username, password: configuration.password };\n }\n}\n\nexport const setBearerAuthToObject = async function (object: any, configuration?: Configuration) {\n if (configuration && configuration.accessToken) {\n const accessToken = typeof configuration.accessToken === 'function'\n ? await configuration.accessToken()\n : await configuration.accessToken;\n object[\"Authorization\"] = \"Bearer \" + accessToken;\n }\n}\n\nexport const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) {\n if (configuration && configuration.accessToken) {\n const localVarAccessTokenValue = typeof configuration.accessToken === 'function'\n ? await configuration.accessToken(name, scopes)\n : await configuration.accessToken;\n object[\"Authorization\"] = \"Bearer \" + localVarAccessTokenValue;\n }\n}\n\n\nfunction setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = \"\"): void {\n if (parameter == null) return;\n if (typeof parameter === \"object\") {\n if (Array.isArray(parameter) || parameter instanceof Set) {\n (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));\n }\n else {\n Object.keys(parameter).forEach(currentKey =>\n setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`)\n );\n }\n }\n else {\n if (urlSearchParams.has(key)) {\n urlSearchParams.append(key, parameter);\n }\n else {\n urlSearchParams.set(key, parameter);\n }\n }\n}\n\nexport const setSearchParams = function (url: URL, ...objects: any[]) {\n const searchParams = new URLSearchParams(url.search);\n setFlattenedQueryParams(searchParams, objects);\n url.search = searchParams.toString();\n}\n\n/**\n * JSON serialization helper function which replaces instances of unserializable types with serializable ones.\n * This function will run for every key-value pair encountered by JSON.stringify while traversing an object.\n * Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.\n */\n// @ts-ignore\nexport const replaceWithSerializableTypeIfNeeded = function(key: string, value: any) {\n if (value instanceof Set) {\n return Array.from(value);\n } else {\n return value;\n }\n}\n\nexport const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) {\n const nonString = typeof value !== 'string';\n const needsSerialization = nonString && configuration && configuration.isJsonMime\n ? configuration.isJsonMime(requestOptions.headers['Content-Type'])\n : nonString;\n return needsSerialization\n ? JSON.stringify(value !== undefined ? value : {}, replaceWithSerializableTypeIfNeeded)\n : (value || \"\");\n}\n\nexport const toPathString = function (url: URL) {\n return url.pathname + url.search + url.hash\n}\n\nexport const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {\n return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\n const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url};\n return axios.request<T, R>(axiosRequestArgs);\n };\n}\n","/* tslint:disable */\n/**\n * Selling Partner API for Tokens \n * The Selling Partner API for Tokens provides a secure way to access a customer\\'s PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes subsequent calls to restricted operations that correspond to the restricted resources that you specified. For more information, see the [Tokens API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/tokens-api-use-case-guide).\n *\n * The version of the OpenAPI document: 2021-03-01\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\ninterface AWSv4Configuration {\n options?: {\n region?: string\n service?: string\n }\n credentials?: {\n accessKeyId?: string\n secretAccessKey?: string,\n sessionToken?: string\n }\n}\n\nexport interface ConfigurationParameters {\n apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);\n username?: string;\n password?: string;\n accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);\n awsv4?: AWSv4Configuration;\n basePath?: string;\n serverIndex?: number;\n baseOptions?: any;\n formDataCtor?: new () => any;\n}\n\nexport class Configuration {\n /**\n * parameter for apiKey security\n * @param name security name\n */\n apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);\n /**\n * parameter for basic security\n */\n username?: string;\n /**\n * parameter for basic security\n */\n password?: string;\n /**\n * parameter for oauth2 security\n * @param name security name\n * @param scopes oauth2 scope\n */\n accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);\n /**\n * parameter for aws4 signature security\n * @param {Object} AWS4Signature - AWS4 Signature security\n * @param {string} options.region - aws region\n * @param {string} options.service - name of the service.\n * @param {string} credentials.accessKeyId - aws access key id\n * @param {string} credentials.secretAccessKey - aws access key\n * @param {string} credentials.sessionToken - aws session token\n * @memberof Configuration\n */\n awsv4?: AWSv4Configuration;\n /**\n * override base path\n */\n basePath?: string;\n /**\n * override server index\n */\n serverIndex?: number;\n /**\n * base options for axios calls\n */\n baseOptions?: any;\n /**\n * The FormData constructor that will be used to create multipart form data\n * requests. You can inject this here so that execution environments that\n * do not support the FormData class can still run the generated client.\n *\n * @type {new () => FormData}\n */\n formDataCtor?: new () => any;\n\n constructor(param: ConfigurationParameters = {}) {\n this.apiKey = param.apiKey;\n this.username = param.username;\n this.password = param.password;\n this.accessToken = param.accessToken;\n this.awsv4 = param.awsv4;\n this.basePath = param.basePath;\n this.serverIndex = param.serverIndex;\n this.baseOptions = {\n ...param.baseOptions,\n headers: {\n ...param.baseOptions?.headers,\n },\n };\n this.formDataCtor = param.formDataCtor;\n }\n\n /**\n * Check if the given MIME is a JSON MIME.\n * JSON MIME examples:\n * application/json\n * application/json; charset=UTF8\n * APPLICATION/JSON\n * application/vnd.company+json\n * @param mime - MIME (Multipurpose Internet Mail Extensions)\n * @return True if the given MIME is JSON, false otherwise.\n */\n public isJsonMime(mime: string): boolean {\n const jsonMime: RegExp = /^(application\\/json|[^;/ \\t]+\\/[^;/ \\t]+[+]json)[ \\t]*(;.*)?$/i;\n return mime !== null && jsonMime.test(mime);\n }\n}\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * Selling Partner API for Tokens \n * The Selling Partner API for Tokens provides a secure way to access a customer\\'s PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes subsequent calls to restricted operations that correspond to the restricted resources that you specified. For more information, see the [Tokens API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/tokens-api-use-case-guide).\n *\n * The version of the OpenAPI document: 2021-03-01\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n\n\n/**\n * Model of a restricted resource.\n */\nexport interface RestrictedResource {\n /**\n * The HTTP method in the restricted resource.\n */\n 'method': RestrictedResourceMethodEnum;\n /**\n * The path in the restricted resource. Here are some path examples: - ```/orders/v0/orders```. For getting an RDT for the getOrders operation of the Orders API. For bulk orders. - ```/orders/v0/orders/123-1234567-1234567```. For getting an RDT for the getOrder operation of the Orders API. For a specific order. - ```/orders/v0/orders/123-1234567-1234567/orderItems```. For getting an RDT for the getOrderItems operation of the Orders API. For the order items in a specific order. - ```/mfn/v0/shipments/FBA1234ABC5D```. For getting an RDT for the getShipment operation of the Shipping API. For a specific shipment. - ```/mfn/v0/shipments/{shipmentId}```. For getting an RDT for the getShipment operation of the Shipping API. For any of a selling partner\\'s shipments that you specify when you call the getShipment operation.\n */\n 'path': string;\n /**\n * Indicates the type of Personally Identifiable Information requested. This parameter is required only when getting an RDT for use with the getOrder, getOrders, or getOrderItems operation of the Orders API. For more information, see the [Tokens API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/tokens-api-use-case-guide). Possible values include: - **buyerInfo**. On the order level this includes general identifying information about the buyer and tax-related information. On the order item level this includes gift wrap information and custom order information, if available. - **shippingAddress**. This includes information for fulfilling orders. - **buyerTaxInformation**. This includes information for issuing tax invoices.\n */\n 'dataElements'?: Array<string>;\n}\n\nexport const RestrictedResourceMethodEnum = {\n Get: 'GET',\n Put: 'PUT',\n Post: 'POST',\n Delete: 'DELETE',\n} as const;\n\nexport type RestrictedResourceMethodEnum = typeof RestrictedResourceMethodEnum[keyof typeof RestrictedResourceMethodEnum];\n\n\n"],"mappings":";AAAA,SAAkC,2BAA0C;;;ACiB5E,OAAOA,kBAAiB;;;ACExB,OAAO,iBAAiB;AAEjB,IAAM,YAAY,0CAA0C,QAAQ,QAAQ,EAAE;AAc9E,IAAM,UAAN,MAAc;AAAA,EAGjB,YAAY,eAAyC,WAAmB,WAAqB,QAAuB,aAAa;AAA5E;AAAwC;AACzF,QAAI,eAAe;AACf,WAAK,gBAAgB;AACrB,WAAK,WAAW,cAAc,YAAY;AAAA,IAC9C;AAAA,EACJ;AAAA,EALqD;AAAA,EAAwC;AAAA,EAFnF;AAQd;AAEO,IAAM,gBAAN,cAA4B,MAAM;AAAA,EACrC,YAAmB,OAAe,KAAc;AAC5C,UAAM,GAAG;AADM;AAEf,SAAK,OAAO;AAAA,EAChB;AAAA,EAHmB;AAIvB;AASO,IAAM,qBAAgC,CAC7C;;;AC1CO,IAAM,iBAAiB;AAMvB,IAAM,oBAAoB,SAAU,cAAsB,WAAmB,YAAqB;AACrG,MAAI,eAAe,QAAQ,eAAe,QAAW;AACjD,UAAM,IAAI,cAAc,WAAW,sBAAsB,SAAS,uCAAuC,YAAY,GAAG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AK,SAAS,MAAM;AACpB,SAAK,WAAW,MAAM;AACtB,SAAK,WAAW,MAAM;AACtB,SAAK,cAAc,MAAM;AACzB,SAAK,QAAQ,MAAM;AACnB,SAAK,WAAW,MAAM;AACtB,SAAK,cAAc,MAAM;AACzB,SAAK,cAAc;AAAA,MACf,GAAG,MAAM;AAAA,MACT,SAAS;AAAA,QACL,GAAG,MAAM,aAAa;AAAA,MAC1B;AAAA,IACJ;AACA,SAAK,eAAe,MAAM;AAAA,EAC9B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYO,WAAW,MAAuB;AACrC,UAAM,WAAmB;AACzB,WAAO,SAAS,QAAQ,SAAS,KAAK,IAAI;AAAA,EAC9C;AACJ;;;ACtFO,IAAM,+BAA+B;AAAA,EACxC,KAAK;AAAA,EACL,KAAK;AAAA,EACL,MAAM;AAAA,EACN,QAAQ;AACZ;;;ALnCO,IAAM,mBAAgC;AAAA,EAC3C;AAAA,IACE,QAAQ;AAAA;AAAA,IAER,UAAU,IAAI,OAAO,0CAA0C;AAAA,IAC/D,MAAM;AAAA,IACN,OAAO;AAAA,EACT;AACF;AAEO,IAAM,kBAAN,cAA8B,UAAU;AAAA,EAC7C,YAAY,eAAoC;AAC9C,UAAM,EAAC,OAAO,SAAQ,IAAI,oBAAoB,eAAe,gBAAgB;AAE7E,UAAM,IAAI,cAAc,GAAG,UAAU,KAAK;AAAA,EAC5C;AACF;","names":["globalAxios","globalAxios","BASE_PATH","globalAxios"]}
package/package.json CHANGED
@@ -2,24 +2,35 @@
2
2
  "name": "@sp-api-sdk/tokens-api-2021-03-01",
3
3
  "author": "Bertrand Marron <bertrand@bizon.solutions>",
4
4
  "description": "The Selling Partner API for Tokens provides a secure way to access a customer's PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes subsequent calls to restricted operations that correspond to the restricted resources that you specified. For more information, see the Tokens API Use Case Guide.",
5
- "version": "3.0.21",
6
- "main": "dist/cjs/index.js",
7
- "module": "dist/es/index.js",
8
- "types": "dist/types/index.d.ts",
5
+ "version": "4.0.0",
9
6
  "license": "MIT",
7
+ "type": "module",
8
+ "sideEffects": false,
9
+ "source": "./src/index.ts",
10
+ "main": "./dist/index.cjs",
11
+ "module": "./dist/index.js",
12
+ "types": "./dist/index.d.ts",
13
+ "exports": {
14
+ ".": {
15
+ "import": {
16
+ "types": "./dist/index.d.ts",
17
+ "default": "./dist/index.js"
18
+ },
19
+ "require": {
20
+ "types": "./dist/index.d.cts",
21
+ "default": "./dist/index.cjs"
22
+ }
23
+ }
24
+ },
10
25
  "publishConfig": {
11
26
  "access": "public"
12
27
  },
13
- "directories": {
14
- "lib": "dist"
15
- },
16
28
  "files": [
17
- "dist/**/*.js",
18
- "dist/**/*.d.ts"
29
+ "dist"
19
30
  ],
20
31
  "dependencies": {
21
- "@sp-api-sdk/common": "2.1.30",
22
- "axios": "^1.13.6"
32
+ "@sp-api-sdk/common": "3.0.0",
33
+ "axios": "^1.16.1"
23
34
  },
24
35
  "repository": {
25
36
  "type": "git",
@@ -40,5 +51,5 @@
40
51
  "sp sdk",
41
52
  "tokens api"
42
53
  ],
43
- "gitHead": "ed62de76baf24107227aacb576cd494b2ecbf0b5"
54
+ "gitHead": "fc6f28dc89089e9987831b8a1a008f1871e55289"
44
55
  }
@@ -1,117 +0,0 @@
1
- "use strict";
2
- /* tslint:disable */
3
- /* eslint-disable */
4
- /**
5
- * Selling Partner API for Tokens
6
- * The Selling Partner API for Tokens provides a secure way to access a customer\'s PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes subsequent calls to restricted operations that correspond to the restricted resources that you specified. For more information, see the [Tokens API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/tokens-api-use-case-guide).
7
- *
8
- * The version of the OpenAPI document: 2021-03-01
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.TokensApi = exports.TokensApiFactory = exports.TokensApiFp = exports.TokensApiAxiosParamCreator = 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
- * TokensApi - axios parameter creator
28
- */
29
- const TokensApiAxiosParamCreator = function (configuration) {
30
- return {
31
- /**
32
- * Returns a Restricted Data Token (RDT) for one or more restricted resources that you specify. A restricted resource is the HTTP method and path from a restricted operation that returns Personally Identifiable Information (PII), plus a dataElements value that indicates the type of PII requested. See the Tokens API Use Case Guide for a list of restricted operations. Use the RDT returned here as the access token in subsequent calls to the corresponding restricted operations. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 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, see [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).
33
- * @param {CreateRestrictedDataTokenRequest} body The restricted data token request details.
34
- * @param {*} [options] Override http request option.
35
- * @throws {RequiredError}
36
- */
37
- createRestrictedDataToken: async (body, options = {}) => {
38
- // verify required parameter 'body' is not null or undefined
39
- (0, common_1.assertParamExists)('createRestrictedDataToken', 'body', body);
40
- const localVarPath = `/tokens/2021-03-01/restrictedDataToken`;
41
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
42
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
43
- let baseOptions;
44
- if (configuration) {
45
- baseOptions = configuration.baseOptions;
46
- }
47
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
48
- const localVarHeaderParameter = {};
49
- const localVarQueryParameter = {};
50
- localVarHeaderParameter['Content-Type'] = 'application/json';
51
- localVarHeaderParameter['Accept'] = 'application/json';
52
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
53
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
54
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
55
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration);
56
- return {
57
- url: (0, common_1.toPathString)(localVarUrlObj),
58
- options: localVarRequestOptions,
59
- };
60
- },
61
- };
62
- };
63
- exports.TokensApiAxiosParamCreator = TokensApiAxiosParamCreator;
64
- /**
65
- * TokensApi - functional programming interface
66
- */
67
- const TokensApiFp = function (configuration) {
68
- const localVarAxiosParamCreator = (0, exports.TokensApiAxiosParamCreator)(configuration);
69
- return {
70
- /**
71
- * Returns a Restricted Data Token (RDT) for one or more restricted resources that you specify. A restricted resource is the HTTP method and path from a restricted operation that returns Personally Identifiable Information (PII), plus a dataElements value that indicates the type of PII requested. See the Tokens API Use Case Guide for a list of restricted operations. Use the RDT returned here as the access token in subsequent calls to the corresponding restricted operations. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 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, see [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).
72
- * @param {CreateRestrictedDataTokenRequest} body The restricted data token request details.
73
- * @param {*} [options] Override http request option.
74
- * @throws {RequiredError}
75
- */
76
- async createRestrictedDataToken(body, options) {
77
- const localVarAxiosArgs = await localVarAxiosParamCreator.createRestrictedDataToken(body, options);
78
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
79
- const localVarOperationServerBasePath = base_1.operationServerMap['TokensApi.createRestrictedDataToken']?.[localVarOperationServerIndex]?.url;
80
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
81
- },
82
- };
83
- };
84
- exports.TokensApiFp = TokensApiFp;
85
- /**
86
- * TokensApi - factory interface
87
- */
88
- const TokensApiFactory = function (configuration, basePath, axios) {
89
- const localVarFp = (0, exports.TokensApiFp)(configuration);
90
- return {
91
- /**
92
- * Returns a Restricted Data Token (RDT) for one or more restricted resources that you specify. A restricted resource is the HTTP method and path from a restricted operation that returns Personally Identifiable Information (PII), plus a dataElements value that indicates the type of PII requested. See the Tokens API Use Case Guide for a list of restricted operations. Use the RDT returned here as the access token in subsequent calls to the corresponding restricted operations. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 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, see [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).
93
- * @param {TokensApiCreateRestrictedDataTokenRequest} requestParameters Request parameters.
94
- * @param {*} [options] Override http request option.
95
- * @throws {RequiredError}
96
- */
97
- createRestrictedDataToken(requestParameters, options) {
98
- return localVarFp.createRestrictedDataToken(requestParameters.body, options).then((request) => request(axios, basePath));
99
- },
100
- };
101
- };
102
- exports.TokensApiFactory = TokensApiFactory;
103
- /**
104
- * TokensApi - object-oriented interface
105
- */
106
- class TokensApi extends base_1.BaseAPI {
107
- /**
108
- * Returns a Restricted Data Token (RDT) for one or more restricted resources that you specify. A restricted resource is the HTTP method and path from a restricted operation that returns Personally Identifiable Information (PII), plus a dataElements value that indicates the type of PII requested. See the Tokens API Use Case Guide for a list of restricted operations. Use the RDT returned here as the access token in subsequent calls to the corresponding restricted operations. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 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, see [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).
109
- * @param {TokensApiCreateRestrictedDataTokenRequest} requestParameters Request parameters.
110
- * @param {*} [options] Override http request option.
111
- * @throws {RequiredError}
112
- */
113
- createRestrictedDataToken(requestParameters, options) {
114
- return (0, exports.TokensApiFp)(this.configuration).createRestrictedDataToken(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
115
- }
116
- }
117
- exports.TokensApi = TokensApi;
@@ -1,30 +0,0 @@
1
- "use strict";
2
- /* tslint:disable */
3
- /* eslint-disable */
4
- /**
5
- * Selling Partner API for Tokens
6
- * The Selling Partner API for Tokens provides a secure way to access a customer\'s PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes subsequent calls to restricted operations that correspond to the restricted resources that you specified. For more information, see the [Tokens API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/tokens-api-use-case-guide).
7
- *
8
- * The version of the OpenAPI document: 2021-03-01
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/tokens-api"), exports);
@@ -1,52 +0,0 @@
1
- "use strict";
2
- /* tslint:disable */
3
- /* eslint-disable */
4
- /**
5
- * Selling Partner API for Tokens
6
- * The Selling Partner API for Tokens provides a secure way to access a customer\'s PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes subsequent calls to restricted operations that correspond to the restricted resources that you specified. For more information, see the [Tokens API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/tokens-api-use-case-guide).
7
- *
8
- * The version of the OpenAPI document: 2021-03-01
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.operationServerMap = 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
- exports.COLLECTION_FORMATS = {
23
- csv: ",",
24
- ssv: " ",
25
- tsv: "\t",
26
- pipes: "|",
27
- };
28
- class BaseAPI {
29
- basePath;
30
- axios;
31
- configuration;
32
- constructor(configuration, basePath = exports.BASE_PATH, axios = axios_1.default) {
33
- this.basePath = basePath;
34
- this.axios = axios;
35
- if (configuration) {
36
- this.configuration = configuration;
37
- this.basePath = configuration.basePath ?? basePath;
38
- }
39
- }
40
- }
41
- exports.BaseAPI = BaseAPI;
42
- ;
43
- class RequiredError extends Error {
44
- field;
45
- constructor(field, msg) {
46
- super(msg);
47
- this.field = field;
48
- this.name = "RequiredError";
49
- }
50
- }
51
- exports.RequiredError = RequiredError;
52
- exports.operationServerMap = {};