@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
@@ -1,123 +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
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.replaceWithSerializableTypeIfNeeded = exports.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
17
- const base_1 = require("./base");
18
- exports.DUMMY_BASE_URL = 'https://example.com';
19
- /**
20
- *
21
- * @throws {RequiredError}
22
- */
23
- const assertParamExists = function (functionName, paramName, paramValue) {
24
- if (paramValue === null || paramValue === undefined) {
25
- throw new base_1.RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
26
- }
27
- };
28
- exports.assertParamExists = assertParamExists;
29
- const setApiKeyToObject = async function (object, keyParamName, configuration) {
30
- if (configuration && configuration.apiKey) {
31
- const localVarApiKeyValue = typeof configuration.apiKey === 'function'
32
- ? await configuration.apiKey(keyParamName)
33
- : await configuration.apiKey;
34
- object[keyParamName] = localVarApiKeyValue;
35
- }
36
- };
37
- exports.setApiKeyToObject = setApiKeyToObject;
38
- const setBasicAuthToObject = function (object, configuration) {
39
- if (configuration && (configuration.username || configuration.password)) {
40
- object["auth"] = { username: configuration.username, password: configuration.password };
41
- }
42
- };
43
- exports.setBasicAuthToObject = setBasicAuthToObject;
44
- const setBearerAuthToObject = async function (object, configuration) {
45
- if (configuration && configuration.accessToken) {
46
- const accessToken = typeof configuration.accessToken === 'function'
47
- ? await configuration.accessToken()
48
- : await configuration.accessToken;
49
- object["Authorization"] = "Bearer " + accessToken;
50
- }
51
- };
52
- exports.setBearerAuthToObject = setBearerAuthToObject;
53
- const setOAuthToObject = async function (object, name, scopes, configuration) {
54
- if (configuration && configuration.accessToken) {
55
- const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
56
- ? await configuration.accessToken(name, scopes)
57
- : await configuration.accessToken;
58
- object["Authorization"] = "Bearer " + localVarAccessTokenValue;
59
- }
60
- };
61
- exports.setOAuthToObject = setOAuthToObject;
62
- function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
63
- if (parameter == null)
64
- return;
65
- if (typeof parameter === "object") {
66
- if (Array.isArray(parameter) || parameter instanceof Set) {
67
- parameter.forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
68
- }
69
- else {
70
- Object.keys(parameter).forEach(currentKey => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`));
71
- }
72
- }
73
- else {
74
- if (urlSearchParams.has(key)) {
75
- urlSearchParams.append(key, parameter);
76
- }
77
- else {
78
- urlSearchParams.set(key, parameter);
79
- }
80
- }
81
- }
82
- const setSearchParams = function (url, ...objects) {
83
- const searchParams = new URLSearchParams(url.search);
84
- setFlattenedQueryParams(searchParams, objects);
85
- url.search = searchParams.toString();
86
- };
87
- exports.setSearchParams = setSearchParams;
88
- /**
89
- * JSON serialization helper function which replaces instances of unserializable types with serializable ones.
90
- * This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
91
- * Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
92
- */
93
- // @ts-ignore
94
- const replaceWithSerializableTypeIfNeeded = function (key, value) {
95
- if (value instanceof Set) {
96
- return Array.from(value);
97
- }
98
- else {
99
- return value;
100
- }
101
- };
102
- exports.replaceWithSerializableTypeIfNeeded = replaceWithSerializableTypeIfNeeded;
103
- const serializeDataIfNeeded = function (value, requestOptions, configuration) {
104
- const nonString = typeof value !== 'string';
105
- const needsSerialization = nonString && configuration && configuration.isJsonMime
106
- ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
107
- : nonString;
108
- return needsSerialization
109
- ? JSON.stringify(value !== undefined ? value : {}, exports.replaceWithSerializableTypeIfNeeded)
110
- : (value || "");
111
- };
112
- exports.serializeDataIfNeeded = serializeDataIfNeeded;
113
- const toPathString = function (url) {
114
- return url.pathname + url.search + url.hash;
115
- };
116
- exports.toPathString = toPathString;
117
- const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
118
- return (axios = globalAxios, basePath = BASE_PATH) => {
119
- const axiosRequestArgs = { ...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url };
120
- return axios.request(axiosRequestArgs);
121
- };
122
- };
123
- exports.createRequestFunction = createRequestFunction;
@@ -1,98 +0,0 @@
1
- "use strict";
2
- /* tslint:disable */
3
- /**
4
- * Selling Partner API for Tokens
5
- * 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).
6
- *
7
- * The version of the OpenAPI document: 2021-03-01
8
- *
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
13
- */
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.Configuration = void 0;
16
- class Configuration {
17
- /**
18
- * parameter for apiKey security
19
- * @param name security name
20
- */
21
- apiKey;
22
- /**
23
- * parameter for basic security
24
- */
25
- username;
26
- /**
27
- * parameter for basic security
28
- */
29
- password;
30
- /**
31
- * parameter for oauth2 security
32
- * @param name security name
33
- * @param scopes oauth2 scope
34
- */
35
- accessToken;
36
- /**
37
- * parameter for aws4 signature security
38
- * @param {Object} AWS4Signature - AWS4 Signature security
39
- * @param {string} options.region - aws region
40
- * @param {string} options.service - name of the service.
41
- * @param {string} credentials.accessKeyId - aws access key id
42
- * @param {string} credentials.secretAccessKey - aws access key
43
- * @param {string} credentials.sessionToken - aws session token
44
- * @memberof Configuration
45
- */
46
- awsv4;
47
- /**
48
- * override base path
49
- */
50
- basePath;
51
- /**
52
- * override server index
53
- */
54
- serverIndex;
55
- /**
56
- * base options for axios calls
57
- */
58
- baseOptions;
59
- /**
60
- * The FormData constructor that will be used to create multipart form data
61
- * requests. You can inject this here so that execution environments that
62
- * do not support the FormData class can still run the generated client.
63
- *
64
- * @type {new () => FormData}
65
- */
66
- formDataCtor;
67
- constructor(param = {}) {
68
- this.apiKey = param.apiKey;
69
- this.username = param.username;
70
- this.password = param.password;
71
- this.accessToken = param.accessToken;
72
- this.awsv4 = param.awsv4;
73
- this.basePath = param.basePath;
74
- this.serverIndex = param.serverIndex;
75
- this.baseOptions = {
76
- ...param.baseOptions,
77
- headers: {
78
- ...param.baseOptions?.headers,
79
- },
80
- };
81
- this.formDataCtor = param.formDataCtor;
82
- }
83
- /**
84
- * Check if the given MIME is a JSON MIME.
85
- * JSON MIME examples:
86
- * application/json
87
- * application/json; charset=UTF8
88
- * APPLICATION/JSON
89
- * application/vnd.company+json
90
- * @param mime - MIME (Multipurpose Internet Mail Extensions)
91
- * @return True if the given MIME is JSON, false otherwise.
92
- */
93
- isJsonMime(mime) {
94
- const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
95
- return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
96
- }
97
- }
98
- exports.Configuration = Configuration;
@@ -1,32 +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"), exports);
31
- __exportStar(require("./configuration"), exports);
32
- __exportStar(require("./models"), exports);
@@ -1,15 +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
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,15 +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
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,15 +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
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,21 +0,0 @@
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("./create-restricted-data-token-request"), exports);
18
- __exportStar(require("./create-restricted-data-token-response"), exports);
19
- __exportStar(require("./error-list"), exports);
20
- __exportStar(require("./model-error"), exports);
21
- __exportStar(require("./restricted-resource"), exports);
@@ -1,15 +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
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,22 +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
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.RestrictedResourceMethodEnum = void 0;
17
- exports.RestrictedResourceMethodEnum = {
18
- Get: 'GET',
19
- Put: 'PUT',
20
- Post: 'POST',
21
- Delete: 'DELETE'
22
- };
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TokensApiClient = exports.clientRateLimits = void 0;
4
- const common_1 = require("@sp-api-sdk/common");
5
- const api_model_1 = require("./api-model");
6
- exports.clientRateLimits = [
7
- {
8
- method: 'post',
9
- // eslint-disable-next-line prefer-regex-literals
10
- urlRegex: new RegExp('^/tokens/2021-03-01/restrictedDataToken$'),
11
- rate: 1,
12
- burst: 10,
13
- },
14
- ];
15
- class TokensApiClient extends api_model_1.TokensApi {
16
- constructor(configuration) {
17
- const { axios, endpoint } = (0, common_1.createAxiosInstance)(configuration, exports.clientRateLimits);
18
- super(new api_model_1.Configuration(), endpoint, axios);
19
- }
20
- }
21
- exports.TokensApiClient = TokensApiClient;
package/dist/cjs/index.js DELETED
@@ -1,19 +0,0 @@
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("./client"), exports);
18
- __exportStar(require("./api-model/api"), exports);
19
- __exportStar(require("./api-model/models"), exports);
@@ -1,107 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * Selling Partner API for Tokens
5
- * 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).
6
- *
7
- * The version of the OpenAPI document: 2021-03-01
8
- *
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
13
- */
14
- import globalAxios from 'axios';
15
- // Some imports not used depending on template conditions
16
- // @ts-ignore
17
- import { DUMMY_BASE_URL, assertParamExists, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
18
- // @ts-ignore
19
- import { BASE_PATH, BaseAPI, operationServerMap } from '../base';
20
- /**
21
- * TokensApi - axios parameter creator
22
- */
23
- export const TokensApiAxiosParamCreator = function (configuration) {
24
- return {
25
- /**
26
- * 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).
27
- * @param {CreateRestrictedDataTokenRequest} body The restricted data token request details.
28
- * @param {*} [options] Override http request option.
29
- * @throws {RequiredError}
30
- */
31
- createRestrictedDataToken: async (body, options = {}) => {
32
- // verify required parameter 'body' is not null or undefined
33
- assertParamExists('createRestrictedDataToken', 'body', body);
34
- const localVarPath = `/tokens/2021-03-01/restrictedDataToken`;
35
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
36
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
37
- let baseOptions;
38
- if (configuration) {
39
- baseOptions = configuration.baseOptions;
40
- }
41
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
42
- const localVarHeaderParameter = {};
43
- const localVarQueryParameter = {};
44
- localVarHeaderParameter['Content-Type'] = 'application/json';
45
- localVarHeaderParameter['Accept'] = 'application/json';
46
- setSearchParams(localVarUrlObj, localVarQueryParameter);
47
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
48
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
49
- localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration);
50
- return {
51
- url: toPathString(localVarUrlObj),
52
- options: localVarRequestOptions,
53
- };
54
- },
55
- };
56
- };
57
- /**
58
- * TokensApi - functional programming interface
59
- */
60
- export const TokensApiFp = function (configuration) {
61
- const localVarAxiosParamCreator = TokensApiAxiosParamCreator(configuration);
62
- return {
63
- /**
64
- * 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).
65
- * @param {CreateRestrictedDataTokenRequest} body The restricted data token request details.
66
- * @param {*} [options] Override http request option.
67
- * @throws {RequiredError}
68
- */
69
- async createRestrictedDataToken(body, options) {
70
- const localVarAxiosArgs = await localVarAxiosParamCreator.createRestrictedDataToken(body, options);
71
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
72
- const localVarOperationServerBasePath = operationServerMap['TokensApi.createRestrictedDataToken']?.[localVarOperationServerIndex]?.url;
73
- return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
74
- },
75
- };
76
- };
77
- /**
78
- * TokensApi - factory interface
79
- */
80
- export const TokensApiFactory = function (configuration, basePath, axios) {
81
- const localVarFp = TokensApiFp(configuration);
82
- return {
83
- /**
84
- * 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).
85
- * @param {TokensApiCreateRestrictedDataTokenRequest} requestParameters Request parameters.
86
- * @param {*} [options] Override http request option.
87
- * @throws {RequiredError}
88
- */
89
- createRestrictedDataToken(requestParameters, options) {
90
- return localVarFp.createRestrictedDataToken(requestParameters.body, options).then((request) => request(axios, basePath));
91
- },
92
- };
93
- };
94
- /**
95
- * TokensApi - object-oriented interface
96
- */
97
- export class TokensApi extends BaseAPI {
98
- /**
99
- * 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).
100
- * @param {TokensApiCreateRestrictedDataTokenRequest} requestParameters Request parameters.
101
- * @param {*} [options] Override http request option.
102
- * @throws {RequiredError}
103
- */
104
- createRestrictedDataToken(requestParameters, options) {
105
- return TokensApiFp(this.configuration).createRestrictedDataToken(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
106
- }
107
- }
@@ -1,14 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * Selling Partner API for Tokens
5
- * 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).
6
- *
7
- * The version of the OpenAPI document: 2021-03-01
8
- *
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
13
- */
14
- export * from './api/tokens-api';
@@ -1,44 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * Selling Partner API for Tokens
5
- * 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).
6
- *
7
- * The version of the OpenAPI document: 2021-03-01
8
- *
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
13
- */
14
- import globalAxios from 'axios';
15
- export const BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
16
- export const COLLECTION_FORMATS = {
17
- csv: ",",
18
- ssv: " ",
19
- tsv: "\t",
20
- pipes: "|",
21
- };
22
- export class BaseAPI {
23
- basePath;
24
- axios;
25
- configuration;
26
- constructor(configuration, basePath = BASE_PATH, axios = globalAxios) {
27
- this.basePath = basePath;
28
- this.axios = axios;
29
- if (configuration) {
30
- this.configuration = configuration;
31
- this.basePath = configuration.basePath ?? basePath;
32
- }
33
- }
34
- }
35
- ;
36
- export class RequiredError extends Error {
37
- field;
38
- constructor(field, msg) {
39
- super(msg);
40
- this.field = field;
41
- this.name = "RequiredError";
42
- }
43
- }
44
- export const operationServerMap = {};