@sp-api-sdk/finances-api-2024-06-19 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +97 -0
  3. package/dist/cjs/index.js +19 -0
  4. package/dist/cjs/src/api-model/api/default-api.js +143 -0
  5. package/dist/cjs/src/api-model/api.js +30 -0
  6. package/dist/cjs/src/api-model/base.js +71 -0
  7. package/dist/cjs/src/api-model/common.js +145 -0
  8. package/dist/cjs/src/api-model/configuration.js +99 -0
  9. package/dist/cjs/src/api-model/index.js +32 -0
  10. package/dist/cjs/src/api-model/models/amazon-pay-context.js +15 -0
  11. package/dist/cjs/src/api-model/models/breakdown.js +15 -0
  12. package/dist/cjs/src/api-model/models/context-all-of.js +15 -0
  13. package/dist/cjs/src/api-model/models/context.js +15 -0
  14. package/dist/cjs/src/api-model/models/currency.js +15 -0
  15. package/dist/cjs/src/api-model/models/deferred-context.js +15 -0
  16. package/dist/cjs/src/api-model/models/error-list.js +15 -0
  17. package/dist/cjs/src/api-model/models/index.js +34 -0
  18. package/dist/cjs/src/api-model/models/item-related-identifier.js +22 -0
  19. package/dist/cjs/src/api-model/models/item.js +15 -0
  20. package/dist/cjs/src/api-model/models/list-transactions-response.js +15 -0
  21. package/dist/cjs/src/api-model/models/marketplace-details.js +15 -0
  22. package/dist/cjs/src/api-model/models/model-error.js +15 -0
  23. package/dist/cjs/src/api-model/models/payments-context.js +15 -0
  24. package/dist/cjs/src/api-model/models/product-context.js +15 -0
  25. package/dist/cjs/src/api-model/models/related-identifier.js +26 -0
  26. package/dist/cjs/src/api-model/models/selling-partner-metadata.js +15 -0
  27. package/dist/cjs/src/api-model/models/time-range-context.js +15 -0
  28. package/dist/cjs/src/api-model/models/transaction.js +15 -0
  29. package/dist/cjs/src/client.js +21 -0
  30. package/dist/es/index.js +3 -0
  31. package/dist/es/src/api-model/api/default-api.js +133 -0
  32. package/dist/es/src/api-model/api.js +14 -0
  33. package/dist/es/src/api-model/base.js +63 -0
  34. package/dist/es/src/api-model/common.js +133 -0
  35. package/dist/es/src/api-model/configuration.js +95 -0
  36. package/dist/es/src/api-model/index.js +16 -0
  37. package/dist/es/src/api-model/models/amazon-pay-context.js +14 -0
  38. package/dist/es/src/api-model/models/breakdown.js +14 -0
  39. package/dist/es/src/api-model/models/context-all-of.js +14 -0
  40. package/dist/es/src/api-model/models/context.js +14 -0
  41. package/dist/es/src/api-model/models/currency.js +14 -0
  42. package/dist/es/src/api-model/models/deferred-context.js +14 -0
  43. package/dist/es/src/api-model/models/error-list.js +14 -0
  44. package/dist/es/src/api-model/models/index.js +18 -0
  45. package/dist/es/src/api-model/models/item-related-identifier.js +19 -0
  46. package/dist/es/src/api-model/models/item.js +14 -0
  47. package/dist/es/src/api-model/models/list-transactions-response.js +14 -0
  48. package/dist/es/src/api-model/models/marketplace-details.js +14 -0
  49. package/dist/es/src/api-model/models/model-error.js +14 -0
  50. package/dist/es/src/api-model/models/payments-context.js +14 -0
  51. package/dist/es/src/api-model/models/product-context.js +14 -0
  52. package/dist/es/src/api-model/models/related-identifier.js +23 -0
  53. package/dist/es/src/api-model/models/selling-partner-metadata.js +14 -0
  54. package/dist/es/src/api-model/models/time-range-context.js +14 -0
  55. package/dist/es/src/api-model/models/transaction.js +14 -0
  56. package/dist/es/src/client.js +17 -0
  57. package/dist/types/index.d.ts +3 -0
  58. package/dist/types/src/api-model/api/default-api.d.ts +108 -0
  59. package/dist/types/src/api-model/api.d.ts +12 -0
  60. package/dist/types/src/api-model/base.d.ts +66 -0
  61. package/dist/types/src/api-model/common.d.ts +65 -0
  62. package/dist/types/src/api-model/configuration.d.ts +91 -0
  63. package/dist/types/src/api-model/index.d.ts +14 -0
  64. package/dist/types/src/api-model/models/amazon-pay-context.d.ts +36 -0
  65. package/dist/types/src/api-model/models/breakdown.d.ts +37 -0
  66. package/dist/types/src/api-model/models/context-all-of.d.ts +24 -0
  67. package/dist/types/src/api-model/models/context.d.ts +23 -0
  68. package/dist/types/src/api-model/models/currency.d.ts +30 -0
  69. package/dist/types/src/api-model/models/deferred-context.d.ts +36 -0
  70. package/dist/types/src/api-model/models/error-list.d.ts +24 -0
  71. package/dist/types/src/api-model/models/index.d.ts +18 -0
  72. package/dist/types/src/api-model/models/item-related-identifier.d.ts +37 -0
  73. package/dist/types/src/api-model/models/item.d.ts +52 -0
  74. package/dist/types/src/api-model/models/list-transactions-response.d.ts +31 -0
  75. package/dist/types/src/api-model/models/marketplace-details.d.ts +30 -0
  76. package/dist/types/src/api-model/models/model-error.d.ts +36 -0
  77. package/dist/types/src/api-model/models/payments-context.d.ts +42 -0
  78. package/dist/types/src/api-model/models/product-context.d.ts +42 -0
  79. package/dist/types/src/api-model/models/related-identifier.d.ts +41 -0
  80. package/dist/types/src/api-model/models/selling-partner-metadata.d.ts +36 -0
  81. package/dist/types/src/api-model/models/time-range-context.d.ts +30 -0
  82. package/dist/types/src/api-model/models/transaction.d.ts +97 -0
  83. package/dist/types/src/client.d.ts +6 -0
  84. package/package.json +44 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Bizon
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,97 @@
1
+ # `finances-api-2024-06-19`
2
+
3
+ The Selling Partner API for Finances provides financial information relevant to a seller's business. You can obtain financial events for a given order or date range without having to wait until a statement period closes.
4
+
5
+ [![npm version](https://badgen.net/npm/v/@sp-api-sdk/finances-api-2024-06-19)](https://www.npmjs.com/package/@sp-api-sdk/finances-api-2024-06-19)
6
+ [![XO code style](https://badgen.net/badge/code%20style/XO/cyan)](https://github.com/xojs/xo)
7
+
8
+ ## Documentation
9
+
10
+ Learn more about this Selling Partner API by visiting the [official documentation](https://developer-docs.amazon.com/sp-api/docs).
11
+
12
+ Also, see the [generated documentation](https://bizon.github.io/selling-partner-api-sdk/modules/_sp_api_sdk_finances_api_2024_06_19.html) for this API client.
13
+
14
+ ## Installing
15
+
16
+ ```sh
17
+ npm install @sp-api-sdk/finances-api-2024-06-19
18
+ ```
19
+
20
+ ## Getting Started
21
+
22
+ ```javascript
23
+ import {SellingPartnerApiAuth} from '@sp-api-sdk/auth'
24
+ import {FinancesApiClient} from '@sp-api-sdk/finances-api-2024-06-19'
25
+
26
+ const auth = new SellingPartnerApiAuth({
27
+ clientId: process.env.LWA_CLIENT_ID,
28
+ clientSecret: process.env.LWA_CLIENT_SECRET,
29
+ refreshToken: 'Atzr|…',
30
+ })
31
+
32
+ const client = new FinancesApiClient({
33
+ auth,
34
+ region: 'eu',
35
+ })
36
+ ```
37
+
38
+ ## Rate Limiting
39
+
40
+ In order to retry rate limited requests (HTTP 429), you can configure the API client as such:
41
+
42
+ ```javascript
43
+ const client = new FinancesApiClient({
44
+ auth,
45
+ region: 'eu',
46
+ rateLimiting: {
47
+ retry: true,
48
+ // Optionally specify a callback that will be called on every retry.
49
+ onRetry: (retryInfo) => {
50
+ console.log(retryInfo)
51
+ },
52
+ },
53
+ })
54
+ ```
55
+
56
+ The rate limits used for each route are specified in the [API documentation](https://developer-docs.amazon.com/sp-api/docs).
57
+
58
+ ## Logging
59
+
60
+ You can enable logging for both SP-API requests and responses by configuring the `logging.request` and `logging.response` properties.
61
+
62
+ ```javascript
63
+ const client = new FinancesApiClient({
64
+ auth,
65
+ region: 'eu',
66
+ logging: {
67
+ request: {
68
+ logger: console.debug
69
+ },
70
+ response: {
71
+ logger: console.debug
72
+ },
73
+ error: true,
74
+ },
75
+ })
76
+ ```
77
+
78
+ Specifying `true` will use the default options, specifying an object will allow you to override the default options.
79
+ This uses [axios-logger](https://github.com/hg-pyun/axios-logger) under the hood.
80
+ By default, if enabled, the `request` and `response` loggers will use `console.info` and the `error` logger will use `console.error`.
81
+
82
+
83
+ ## License
84
+
85
+ MIT
86
+
87
+ ## Miscellaneous
88
+
89
+ ```
90
+ ╚⊙ ⊙╝
91
+ ╚═(███)═╝
92
+ ╚═(███)═╝
93
+ ╚═(███)═╝
94
+ ╚═(███)═╝
95
+ ╚═(███)═╝
96
+ ╚═(███)═╝
97
+ ```
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./src/client"), exports);
18
+ __exportStar(require("./src/api-model/api"), exports);
19
+ __exportStar(require("./src/api-model/models"), exports);
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * The Selling Partner API for Finances
6
+ * The Selling Partner API for Finances provides financial information relevant to a seller\'s business. You can obtain financial events for a given order or date range without having to wait until a statement period closes.
7
+ *
8
+ * The version of the OpenAPI document: 2024-06-19
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.DefaultApi = exports.DefaultApiFactory = exports.DefaultApiFp = exports.DefaultApiAxiosParamCreator = 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
+ * DefaultApi - axios parameter creator
28
+ * @export
29
+ */
30
+ const DefaultApiAxiosParamCreator = function (configuration) {
31
+ return {
32
+ /**
33
+ * Returns transactions for the given parameters. Orders from the last 48 hours might not be included in financial events. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits).
34
+ * @param {string} postedAfter The response includes financial events posted after (or on) this date. This date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The date-time must be more than two minutes before the time of the request.
35
+ * @param {string} [postedBefore] The response includes financial events posted before (but not on) this date. This date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The date-time must be later than `PostedAfter` and more than two minutes before the request was submitted. If `PostedAfter` and `PostedBefore` are more than 180 days apart, the response is empty. **Default:** Two minutes before the time of the request.
36
+ * @param {string} [marketplaceId] The ID of the marketplace from which you want to retrieve transactions.
37
+ * @param {string} [nextToken] The response includes `nextToken` when the number of results exceeds the specified `pageSize` value. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until `nextToken` is null. Note that this operation can return empty pages.
38
+ * @param {*} [options] Override http request option.
39
+ * @throws {RequiredError}
40
+ */
41
+ listTransactions: async (postedAfter, postedBefore, marketplaceId, nextToken, options = {}) => {
42
+ // verify required parameter 'postedAfter' is not null or undefined
43
+ (0, common_1.assertParamExists)('listTransactions', 'postedAfter', postedAfter);
44
+ const localVarPath = `/finances/2024-06-19/transactions`;
45
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
46
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
47
+ let baseOptions;
48
+ if (configuration) {
49
+ baseOptions = configuration.baseOptions;
50
+ }
51
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
52
+ const localVarHeaderParameter = {};
53
+ const localVarQueryParameter = {};
54
+ if (postedAfter !== undefined) {
55
+ localVarQueryParameter['postedAfter'] = (postedAfter instanceof Date) ?
56
+ postedAfter.toISOString() :
57
+ postedAfter;
58
+ }
59
+ if (postedBefore !== undefined) {
60
+ localVarQueryParameter['postedBefore'] = (postedBefore instanceof Date) ?
61
+ postedBefore.toISOString() :
62
+ postedBefore;
63
+ }
64
+ if (marketplaceId !== undefined) {
65
+ localVarQueryParameter['marketplaceId'] = marketplaceId;
66
+ }
67
+ if (nextToken !== undefined) {
68
+ localVarQueryParameter['nextToken'] = nextToken;
69
+ }
70
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
71
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
72
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
73
+ return {
74
+ url: (0, common_1.toPathString)(localVarUrlObj),
75
+ options: localVarRequestOptions,
76
+ };
77
+ },
78
+ };
79
+ };
80
+ exports.DefaultApiAxiosParamCreator = DefaultApiAxiosParamCreator;
81
+ /**
82
+ * DefaultApi - functional programming interface
83
+ * @export
84
+ */
85
+ const DefaultApiFp = function (configuration) {
86
+ const localVarAxiosParamCreator = (0, exports.DefaultApiAxiosParamCreator)(configuration);
87
+ return {
88
+ /**
89
+ * Returns transactions for the given parameters. Orders from the last 48 hours might not be included in financial events. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits).
90
+ * @param {string} postedAfter The response includes financial events posted after (or on) this date. This date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The date-time must be more than two minutes before the time of the request.
91
+ * @param {string} [postedBefore] The response includes financial events posted before (but not on) this date. This date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The date-time must be later than `PostedAfter` and more than two minutes before the request was submitted. If `PostedAfter` and `PostedBefore` are more than 180 days apart, the response is empty. **Default:** Two minutes before the time of the request.
92
+ * @param {string} [marketplaceId] The ID of the marketplace from which you want to retrieve transactions.
93
+ * @param {string} [nextToken] The response includes `nextToken` when the number of results exceeds the specified `pageSize` value. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until `nextToken` is null. Note that this operation can return empty pages.
94
+ * @param {*} [options] Override http request option.
95
+ * @throws {RequiredError}
96
+ */
97
+ async listTransactions(postedAfter, postedBefore, marketplaceId, nextToken, options) {
98
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listTransactions(postedAfter, postedBefore, marketplaceId, nextToken, options);
99
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
100
+ const localVarOperationServerBasePath = base_1.operationServerMap['DefaultApi.listTransactions']?.[localVarOperationServerIndex]?.url;
101
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
102
+ },
103
+ };
104
+ };
105
+ exports.DefaultApiFp = DefaultApiFp;
106
+ /**
107
+ * DefaultApi - factory interface
108
+ * @export
109
+ */
110
+ const DefaultApiFactory = function (configuration, basePath, axios) {
111
+ const localVarFp = (0, exports.DefaultApiFp)(configuration);
112
+ return {
113
+ /**
114
+ * Returns transactions for the given parameters. Orders from the last 48 hours might not be included in financial events. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits).
115
+ * @param {DefaultApiListTransactionsRequest} requestParameters Request parameters.
116
+ * @param {*} [options] Override http request option.
117
+ * @throws {RequiredError}
118
+ */
119
+ listTransactions(requestParameters, options) {
120
+ return localVarFp.listTransactions(requestParameters.postedAfter, requestParameters.postedBefore, requestParameters.marketplaceId, requestParameters.nextToken, options).then((request) => request(axios, basePath));
121
+ },
122
+ };
123
+ };
124
+ exports.DefaultApiFactory = DefaultApiFactory;
125
+ /**
126
+ * DefaultApi - object-oriented interface
127
+ * @export
128
+ * @class DefaultApi
129
+ * @extends {BaseAPI}
130
+ */
131
+ class DefaultApi extends base_1.BaseAPI {
132
+ /**
133
+ * Returns transactions for the given parameters. Orders from the last 48 hours might not be included in financial events. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits).
134
+ * @param {DefaultApiListTransactionsRequest} requestParameters Request parameters.
135
+ * @param {*} [options] Override http request option.
136
+ * @throws {RequiredError}
137
+ * @memberof DefaultApi
138
+ */
139
+ listTransactions(requestParameters, options) {
140
+ return (0, exports.DefaultApiFp)(this.configuration).listTransactions(requestParameters.postedAfter, requestParameters.postedBefore, requestParameters.marketplaceId, requestParameters.nextToken, options).then((request) => request(this.axios, this.basePath));
141
+ }
142
+ }
143
+ exports.DefaultApi = DefaultApi;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * The Selling Partner API for Finances
6
+ * The Selling Partner API for Finances provides financial information relevant to a seller\'s business. You can obtain financial events for a given order or date range without having to wait until a statement period closes.
7
+ *
8
+ * The version of the OpenAPI document: 2024-06-19
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/default-api"), exports);
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * The Selling Partner API for Finances
6
+ * The Selling Partner API for Finances provides financial information relevant to a seller\'s business. You can obtain financial events for a given order or date range without having to wait until a statement period closes.
7
+ *
8
+ * The version of the OpenAPI document: 2024-06-19
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
+ /**
23
+ *
24
+ * @export
25
+ */
26
+ exports.COLLECTION_FORMATS = {
27
+ csv: ",",
28
+ ssv: " ",
29
+ tsv: "\t",
30
+ pipes: "|",
31
+ };
32
+ /**
33
+ *
34
+ * @export
35
+ * @class BaseAPI
36
+ */
37
+ class BaseAPI {
38
+ basePath;
39
+ axios;
40
+ configuration;
41
+ constructor(configuration, basePath = exports.BASE_PATH, axios = axios_1.default) {
42
+ this.basePath = basePath;
43
+ this.axios = axios;
44
+ if (configuration) {
45
+ this.configuration = configuration;
46
+ this.basePath = configuration.basePath ?? basePath;
47
+ }
48
+ }
49
+ }
50
+ exports.BaseAPI = BaseAPI;
51
+ ;
52
+ /**
53
+ *
54
+ * @export
55
+ * @class RequiredError
56
+ * @extends {Error}
57
+ */
58
+ class RequiredError extends Error {
59
+ field;
60
+ constructor(field, msg) {
61
+ super(msg);
62
+ this.field = field;
63
+ this.name = "RequiredError";
64
+ }
65
+ }
66
+ exports.RequiredError = RequiredError;
67
+ /**
68
+ *
69
+ * @export
70
+ */
71
+ exports.operationServerMap = {};
@@ -0,0 +1,145 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * The Selling Partner API for Finances
6
+ * The Selling Partner API for Finances provides financial information relevant to a seller\'s business. You can obtain financial events for a given order or date range without having to wait until a statement period closes.
7
+ *
8
+ * The version of the OpenAPI document: 2024-06-19
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.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
17
+ const base_1 = require("./base");
18
+ /**
19
+ *
20
+ * @export
21
+ */
22
+ exports.DUMMY_BASE_URL = 'https://example.com';
23
+ /**
24
+ *
25
+ * @throws {RequiredError}
26
+ * @export
27
+ */
28
+ const assertParamExists = function (functionName, paramName, paramValue) {
29
+ if (paramValue === null || paramValue === undefined) {
30
+ throw new base_1.RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
31
+ }
32
+ };
33
+ exports.assertParamExists = assertParamExists;
34
+ /**
35
+ *
36
+ * @export
37
+ */
38
+ const setApiKeyToObject = async function (object, keyParamName, configuration) {
39
+ if (configuration && configuration.apiKey) {
40
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
41
+ ? await configuration.apiKey(keyParamName)
42
+ : await configuration.apiKey;
43
+ object[keyParamName] = localVarApiKeyValue;
44
+ }
45
+ };
46
+ exports.setApiKeyToObject = setApiKeyToObject;
47
+ /**
48
+ *
49
+ * @export
50
+ */
51
+ const setBasicAuthToObject = function (object, configuration) {
52
+ if (configuration && (configuration.username || configuration.password)) {
53
+ object["auth"] = { username: configuration.username, password: configuration.password };
54
+ }
55
+ };
56
+ exports.setBasicAuthToObject = setBasicAuthToObject;
57
+ /**
58
+ *
59
+ * @export
60
+ */
61
+ const setBearerAuthToObject = async function (object, configuration) {
62
+ if (configuration && configuration.accessToken) {
63
+ const accessToken = typeof configuration.accessToken === 'function'
64
+ ? await configuration.accessToken()
65
+ : await configuration.accessToken;
66
+ object["Authorization"] = "Bearer " + accessToken;
67
+ }
68
+ };
69
+ exports.setBearerAuthToObject = setBearerAuthToObject;
70
+ /**
71
+ *
72
+ * @export
73
+ */
74
+ const setOAuthToObject = async function (object, name, scopes, configuration) {
75
+ if (configuration && configuration.accessToken) {
76
+ const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
77
+ ? await configuration.accessToken(name, scopes)
78
+ : await configuration.accessToken;
79
+ object["Authorization"] = "Bearer " + localVarAccessTokenValue;
80
+ }
81
+ };
82
+ exports.setOAuthToObject = setOAuthToObject;
83
+ function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
84
+ if (parameter == null)
85
+ return;
86
+ if (typeof parameter === "object") {
87
+ if (Array.isArray(parameter)) {
88
+ parameter.forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
89
+ }
90
+ else {
91
+ Object.keys(parameter).forEach(currentKey => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`));
92
+ }
93
+ }
94
+ else {
95
+ if (urlSearchParams.has(key)) {
96
+ urlSearchParams.append(key, parameter);
97
+ }
98
+ else {
99
+ urlSearchParams.set(key, parameter);
100
+ }
101
+ }
102
+ }
103
+ /**
104
+ *
105
+ * @export
106
+ */
107
+ const setSearchParams = function (url, ...objects) {
108
+ const searchParams = new URLSearchParams(url.search);
109
+ setFlattenedQueryParams(searchParams, objects);
110
+ url.search = searchParams.toString();
111
+ };
112
+ exports.setSearchParams = setSearchParams;
113
+ /**
114
+ *
115
+ * @export
116
+ */
117
+ const serializeDataIfNeeded = function (value, requestOptions, configuration) {
118
+ const nonString = typeof value !== 'string';
119
+ const needsSerialization = nonString && configuration && configuration.isJsonMime
120
+ ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
121
+ : nonString;
122
+ return needsSerialization
123
+ ? JSON.stringify(value !== undefined ? value : {})
124
+ : (value || "");
125
+ };
126
+ exports.serializeDataIfNeeded = serializeDataIfNeeded;
127
+ /**
128
+ *
129
+ * @export
130
+ */
131
+ const toPathString = function (url) {
132
+ return url.pathname + url.search + url.hash;
133
+ };
134
+ exports.toPathString = toPathString;
135
+ /**
136
+ *
137
+ * @export
138
+ */
139
+ const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
140
+ return (axios = globalAxios, basePath = BASE_PATH) => {
141
+ const axiosRequestArgs = { ...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url };
142
+ return axios.request(axiosRequestArgs);
143
+ };
144
+ };
145
+ exports.createRequestFunction = createRequestFunction;
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * The Selling Partner API for Finances
6
+ * The Selling Partner API for Finances provides financial information relevant to a seller\'s business. You can obtain financial events for a given order or date range without having to wait until a statement period closes.
7
+ *
8
+ * The version of the OpenAPI document: 2024-06-19
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.Configuration = void 0;
17
+ class Configuration {
18
+ /**
19
+ * parameter for apiKey security
20
+ * @param name security name
21
+ * @memberof Configuration
22
+ */
23
+ apiKey;
24
+ /**
25
+ * parameter for basic security
26
+ *
27
+ * @type {string}
28
+ * @memberof Configuration
29
+ */
30
+ username;
31
+ /**
32
+ * parameter for basic security
33
+ *
34
+ * @type {string}
35
+ * @memberof Configuration
36
+ */
37
+ password;
38
+ /**
39
+ * parameter for oauth2 security
40
+ * @param name security name
41
+ * @param scopes oauth2 scope
42
+ * @memberof Configuration
43
+ */
44
+ accessToken;
45
+ /**
46
+ * override base path
47
+ *
48
+ * @type {string}
49
+ * @memberof Configuration
50
+ */
51
+ basePath;
52
+ /**
53
+ * override server index
54
+ *
55
+ * @type {number}
56
+ * @memberof Configuration
57
+ */
58
+ serverIndex;
59
+ /**
60
+ * base options for axios calls
61
+ *
62
+ * @type {any}
63
+ * @memberof Configuration
64
+ */
65
+ baseOptions;
66
+ /**
67
+ * The FormData constructor that will be used to create multipart form data
68
+ * requests. You can inject this here so that execution environments that
69
+ * do not support the FormData class can still run the generated client.
70
+ *
71
+ * @type {new () => FormData}
72
+ */
73
+ formDataCtor;
74
+ constructor(param = {}) {
75
+ this.apiKey = param.apiKey;
76
+ this.username = param.username;
77
+ this.password = param.password;
78
+ this.accessToken = param.accessToken;
79
+ this.basePath = param.basePath;
80
+ this.serverIndex = param.serverIndex;
81
+ this.baseOptions = param.baseOptions;
82
+ this.formDataCtor = param.formDataCtor;
83
+ }
84
+ /**
85
+ * Check if the given MIME is a JSON MIME.
86
+ * JSON MIME examples:
87
+ * application/json
88
+ * application/json; charset=UTF8
89
+ * APPLICATION/JSON
90
+ * application/vnd.company+json
91
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
92
+ * @return True if the given MIME is JSON, false otherwise.
93
+ */
94
+ isJsonMime(mime) {
95
+ const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
96
+ return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
97
+ }
98
+ }
99
+ exports.Configuration = Configuration;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * The Selling Partner API for Finances
6
+ * The Selling Partner API for Finances provides financial information relevant to a seller\'s business. You can obtain financial events for a given order or date range without having to wait until a statement period closes.
7
+ *
8
+ * The version of the OpenAPI document: 2024-06-19
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);