@sp-api-sdk/finances-api-2024-06-19 3.3.4 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/README.md +7 -8
  2. package/dist/index.cjs +307 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.cts +730 -0
  5. package/dist/index.d.ts +730 -0
  6. package/dist/index.js +275 -0
  7. package/dist/index.js.map +1 -0
  8. package/package.json +26 -12
  9. package/dist/cjs/api-model/api/finances-api.js +0 -150
  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/amazon-pay-context.js +0 -15
  16. package/dist/cjs/api-model/models/breakdown.js +0 -15
  17. package/dist/cjs/api-model/models/business-context.js +0 -19
  18. package/dist/cjs/api-model/models/context-all-of.js +0 -15
  19. package/dist/cjs/api-model/models/context.js +0 -15
  20. package/dist/cjs/api-model/models/currency.js +0 -15
  21. package/dist/cjs/api-model/models/deferred-context.js +0 -15
  22. package/dist/cjs/api-model/models/error-list.js +0 -15
  23. package/dist/cjs/api-model/models/index.js +0 -36
  24. package/dist/cjs/api-model/models/item-related-identifier.js +0 -22
  25. package/dist/cjs/api-model/models/item.js +0 -15
  26. package/dist/cjs/api-model/models/list-transactions-response.js +0 -15
  27. package/dist/cjs/api-model/models/marketplace-details.js +0 -15
  28. package/dist/cjs/api-model/models/model-error.js +0 -15
  29. package/dist/cjs/api-model/models/payments-context.js +0 -15
  30. package/dist/cjs/api-model/models/product-context.js +0 -15
  31. package/dist/cjs/api-model/models/related-identifier.js +0 -28
  32. package/dist/cjs/api-model/models/selling-partner-metadata.js +0 -15
  33. package/dist/cjs/api-model/models/time-range-context.js +0 -15
  34. package/dist/cjs/api-model/models/transaction.js +0 -15
  35. package/dist/cjs/api-model/models/transactions-payload.js +0 -15
  36. package/dist/cjs/client.js +0 -21
  37. package/dist/cjs/index.js +0 -19
  38. package/dist/es/api-model/api/finances-api.js +0 -140
  39. package/dist/es/api-model/api.js +0 -14
  40. package/dist/es/api-model/base.js +0 -44
  41. package/dist/es/api-model/common.js +0 -110
  42. package/dist/es/api-model/configuration.js +0 -94
  43. package/dist/es/api-model/index.js +0 -16
  44. package/dist/es/api-model/models/amazon-pay-context.js +0 -14
  45. package/dist/es/api-model/models/breakdown.js +0 -14
  46. package/dist/es/api-model/models/business-context.js +0 -16
  47. package/dist/es/api-model/models/context-all-of.js +0 -14
  48. package/dist/es/api-model/models/context.js +0 -14
  49. package/dist/es/api-model/models/currency.js +0 -14
  50. package/dist/es/api-model/models/deferred-context.js +0 -14
  51. package/dist/es/api-model/models/error-list.js +0 -14
  52. package/dist/es/api-model/models/index.js +0 -20
  53. package/dist/es/api-model/models/item-related-identifier.js +0 -19
  54. package/dist/es/api-model/models/item.js +0 -14
  55. package/dist/es/api-model/models/list-transactions-response.js +0 -14
  56. package/dist/es/api-model/models/marketplace-details.js +0 -14
  57. package/dist/es/api-model/models/model-error.js +0 -14
  58. package/dist/es/api-model/models/payments-context.js +0 -14
  59. package/dist/es/api-model/models/product-context.js +0 -14
  60. package/dist/es/api-model/models/related-identifier.js +0 -25
  61. package/dist/es/api-model/models/selling-partner-metadata.js +0 -14
  62. package/dist/es/api-model/models/time-range-context.js +0 -14
  63. package/dist/es/api-model/models/transaction.js +0 -14
  64. package/dist/es/api-model/models/transactions-payload.js +0 -14
  65. package/dist/es/client.js +0 -17
  66. package/dist/es/index.js +0 -3
  67. package/dist/types/api-model/api/finances-api.d.ts +0 -109
  68. package/dist/types/api-model/api.d.ts +0 -12
  69. package/dist/types/api-model/base.d.ts +0 -42
  70. package/dist/types/api-model/common.d.ts +0 -34
  71. package/dist/types/api-model/configuration.d.ts +0 -98
  72. package/dist/types/api-model/index.d.ts +0 -14
  73. package/dist/types/api-model/models/amazon-pay-context.d.ts +0 -28
  74. package/dist/types/api-model/models/breakdown.d.ts +0 -26
  75. package/dist/types/api-model/models/business-context.d.ts +0 -24
  76. package/dist/types/api-model/models/context-all-of.d.ts +0 -14
  77. package/dist/types/api-model/models/context.d.ts +0 -23
  78. package/dist/types/api-model/models/currency.d.ts +0 -24
  79. package/dist/types/api-model/models/deferred-context.d.ts +0 -24
  80. package/dist/types/api-model/models/error-list.d.ts +0 -20
  81. package/dist/types/api-model/models/index.d.ts +0 -20
  82. package/dist/types/api-model/models/item-related-identifier.d.ts +0 -31
  83. package/dist/types/api-model/models/item.d.ts +0 -37
  84. package/dist/types/api-model/models/list-transactions-response.d.ts +0 -18
  85. package/dist/types/api-model/models/marketplace-details.d.ts +0 -24
  86. package/dist/types/api-model/models/model-error.d.ts +0 -28
  87. package/dist/types/api-model/models/payments-context.d.ts +0 -32
  88. package/dist/types/api-model/models/product-context.d.ts +0 -32
  89. package/dist/types/api-model/models/related-identifier.d.ts +0 -37
  90. package/dist/types/api-model/models/selling-partner-metadata.d.ts +0 -28
  91. package/dist/types/api-model/models/time-range-context.d.ts +0 -24
  92. package/dist/types/api-model/models/transaction.d.ts +0 -62
  93. package/dist/types/api-model/models/transactions-payload.d.ts +0 -25
  94. package/dist/types/client.d.ts +0 -6
  95. package/dist/types/index.d.ts +0 -3
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # `finances-api-2024-06-19`
1
+ # `@sp-api-sdk/finances-api-2024-06-19`
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@sp-api-sdk/finances-api-2024-06-19)](https://www.npmjs.com/package/@sp-api-sdk/finances-api-2024-06-19)
4
4
  [![XO code style](https://img.shields.io/badge/code_style-xo-cyan)](https://github.com/xojs/xo)
@@ -25,10 +25,10 @@ npm install @sp-api-sdk/finances-api-2024-06-19
25
25
  import {SellingPartnerApiAuth} from '@sp-api-sdk/auth'
26
26
  import {FinancesApiClient} from '@sp-api-sdk/finances-api-2024-06-19'
27
27
 
28
+ // `clientId` and `clientSecret` default to the `LWA_CLIENT_ID` and
29
+ // `LWA_CLIENT_SECRET` environment variables.
28
30
  const auth = new SellingPartnerApiAuth({
29
- clientId: process.env.LWA_CLIENT_ID,
30
- clientSecret: process.env.LWA_CLIENT_SECRET,
31
- refreshToken: 'Atzr|…',
31
+ refreshToken: await getRefreshTokenForSeller(sellerId),
32
32
  })
33
33
 
34
34
  const client = new FinancesApiClient({
@@ -67,10 +67,10 @@ const client = new FinancesApiClient({
67
67
  region: 'eu',
68
68
  logging: {
69
69
  request: {
70
- logger: console.debug
70
+ logger: console.debug,
71
71
  },
72
72
  response: {
73
- logger: console.debug
73
+ logger: console.debug,
74
74
  },
75
75
  error: true,
76
76
  },
@@ -81,14 +81,13 @@ Specifying `true` will use the default options, specifying an object will allow
81
81
  This uses [axios-logger](https://github.com/hg-pyun/axios-logger) under the hood.
82
82
  By default, if enabled, the `request` and `response` loggers will use `console.info` and the `error` logger will use `console.error`.
83
83
 
84
-
85
84
  ## License
86
85
 
87
86
  MIT
88
87
 
89
88
  ## Miscellaneous
90
89
 
91
- ```
90
+ ```text
92
91
  ╚⊙ ⊙╝
93
92
  ╚═(███)═╝
94
93
  ╚═(███)═╝
package/dist/index.cjs ADDED
@@ -0,0 +1,307 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region \0rolldown/runtime.js
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
+ get: ((k) => from[k]).bind(null, key),
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
20
+ value: mod,
21
+ enumerable: true
22
+ }) : target, mod));
23
+ //#endregion
24
+ let _sp_api_sdk_common = require("@sp-api-sdk/common");
25
+ let axios = require("axios");
26
+ axios = __toESM(axios, 1);
27
+ //#region src/api-model/base.ts
28
+ const BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
29
+ var BaseAPI = class {
30
+ basePath;
31
+ axios;
32
+ configuration;
33
+ constructor(configuration, basePath = BASE_PATH, axios$3 = axios.default) {
34
+ this.basePath = basePath;
35
+ this.axios = axios$3;
36
+ if (configuration) {
37
+ this.configuration = configuration;
38
+ this.basePath = configuration.basePath ?? basePath;
39
+ }
40
+ }
41
+ };
42
+ const operationServerMap = {};
43
+ //#endregion
44
+ //#region src/api-model/common.ts
45
+ const DUMMY_BASE_URL = "https://example.com";
46
+ function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
47
+ if (parameter == null) return;
48
+ if (typeof parameter === "object") if (Array.isArray(parameter) || parameter instanceof Set) parameter.forEach((item) => setFlattenedQueryParams(urlSearchParams, item, key));
49
+ else Object.keys(parameter).forEach((currentKey) => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== "" ? "." : ""}${currentKey}`));
50
+ else if (urlSearchParams.has(key)) urlSearchParams.append(key, parameter);
51
+ else urlSearchParams.set(key, parameter);
52
+ }
53
+ const setSearchParams = function(url, ...objects) {
54
+ const searchParams = new URLSearchParams(url.search);
55
+ setFlattenedQueryParams(searchParams, objects);
56
+ url.search = searchParams.toString();
57
+ };
58
+ const toPathString = function(url) {
59
+ return url.pathname + url.search + url.hash;
60
+ };
61
+ const createRequestFunction = function(axiosArgs, globalAxios, BASE_PATH, configuration) {
62
+ return (axios = globalAxios, basePath = BASE_PATH) => {
63
+ const axiosRequestArgs = {
64
+ ...axiosArgs.options,
65
+ url: (axios.defaults.baseURL ? "" : configuration?.basePath ?? basePath) + axiosArgs.url
66
+ };
67
+ return axios.request(axiosRequestArgs);
68
+ };
69
+ };
70
+ //#endregion
71
+ //#region src/api-model/api/finances-api.ts
72
+ /**
73
+ * FinancesApi - axios parameter creator
74
+ */
75
+ const FinancesApiAxiosParamCreator = function(configuration) {
76
+ return {
77
+ /**
78
+ * Returns transactions for the given parameters. Financial events might not include orders from the last 48 hours. **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).
79
+ * @param {string} [postedAfter] The response includes financial events posted on or after 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. This field is required if you do not specify a related identifier.
80
+ * @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 &#x60;PostedAfter&#x60; and more than two minutes before the request was submitted. If &#x60;PostedAfter&#x60; and &#x60;PostedBefore&#x60; are more than 180 days apart, the response is empty. **Default:** Two minutes before the time of the request.
81
+ * @param {string} [marketplaceId] The identifier of the marketplace from which you want to retrieve transactions. The marketplace ID is the globally unique identifier of a marketplace. To find the ID for your marketplace, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
82
+ * @param {string} [transactionStatus] The status of the transaction. **Possible values:** * &#x60;DEFERRED&#x60;: the transaction is currently deferred. * &#x60;RELEASED&#x60;: the transaction is currently released. * &#x60;DEFERRED_RELEASED&#x60;: the transaction was deferred in the past, but is now released. The status of a deferred transaction is updated to &#x60;DEFERRED_RELEASED&#x60; when the transaction is released.
83
+ * @param {string} [relatedIdentifierName] The name of the &#x60;relatedIdentifier&#x60;. **Possible values:** * &#x60;FINANCIAL_EVENT_GROUP_ID&#x60;: the financial event group ID associated with the transaction. * &#x60;ORDER_ID&#x60;: the order ID associated with the transaction. **Note:** FINANCIAL_EVENT_GROUP_ID and ORDER_ID are the only &#x60;relatedIdentifier&#x60; with filtering capabilities at the moment. While other &#x60;relatedIdentifier&#x60; values will be included in the response when available, they cannot be used for filtering purposes.
84
+ * @param {string} [relatedIdentifierValue] The value of the &#x60;relatedIdentifier&#x60;.
85
+ * @param {string} [nextToken] The response includes &#x60;nextToken&#x60; when the number of results exceeds the specified &#x60;pageSize&#x60; 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 &#x60;nextToken&#x60; is null. Note that this operation can return empty pages.
86
+ * @param {*} [options] Override http request option.
87
+ * @throws {RequiredError}
88
+ */
89
+ listTransactions: async (postedAfter, postedBefore, marketplaceId, transactionStatus, relatedIdentifierName, relatedIdentifierValue, nextToken, options = {}) => {
90
+ const localVarUrlObj = new URL(`/finances/2024-06-19/transactions`, DUMMY_BASE_URL);
91
+ let baseOptions;
92
+ if (configuration) baseOptions = configuration.baseOptions;
93
+ const localVarRequestOptions = {
94
+ method: "GET",
95
+ ...baseOptions,
96
+ ...options
97
+ };
98
+ const localVarHeaderParameter = {};
99
+ const localVarQueryParameter = {};
100
+ if (postedAfter !== void 0) localVarQueryParameter["postedAfter"] = postedAfter instanceof Date ? postedAfter.toISOString() : postedAfter;
101
+ if (postedBefore !== void 0) localVarQueryParameter["postedBefore"] = postedBefore instanceof Date ? postedBefore.toISOString() : postedBefore;
102
+ if (marketplaceId !== void 0) localVarQueryParameter["marketplaceId"] = marketplaceId;
103
+ if (transactionStatus !== void 0) localVarQueryParameter["transactionStatus"] = transactionStatus;
104
+ if (relatedIdentifierName !== void 0) localVarQueryParameter["relatedIdentifierName"] = relatedIdentifierName;
105
+ if (relatedIdentifierValue !== void 0) localVarQueryParameter["relatedIdentifierValue"] = relatedIdentifierValue;
106
+ if (nextToken !== void 0) localVarQueryParameter["nextToken"] = nextToken;
107
+ localVarHeaderParameter["Accept"] = "application/json";
108
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
109
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
110
+ localVarRequestOptions.headers = {
111
+ ...localVarHeaderParameter,
112
+ ...headersFromBaseOptions,
113
+ ...options.headers
114
+ };
115
+ return {
116
+ url: toPathString(localVarUrlObj),
117
+ options: localVarRequestOptions
118
+ };
119
+ } };
120
+ };
121
+ /**
122
+ * FinancesApi - functional programming interface
123
+ */
124
+ const FinancesApiFp = function(configuration) {
125
+ const localVarAxiosParamCreator = FinancesApiAxiosParamCreator(configuration);
126
+ return {
127
+ /**
128
+ * Returns transactions for the given parameters. Financial events might not include orders from the last 48 hours. **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).
129
+ * @param {string} [postedAfter] The response includes financial events posted on or after 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. This field is required if you do not specify a related identifier.
130
+ * @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 &#x60;PostedAfter&#x60; and more than two minutes before the request was submitted. If &#x60;PostedAfter&#x60; and &#x60;PostedBefore&#x60; are more than 180 days apart, the response is empty. **Default:** Two minutes before the time of the request.
131
+ * @param {string} [marketplaceId] The identifier of the marketplace from which you want to retrieve transactions. The marketplace ID is the globally unique identifier of a marketplace. To find the ID for your marketplace, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
132
+ * @param {string} [transactionStatus] The status of the transaction. **Possible values:** * &#x60;DEFERRED&#x60;: the transaction is currently deferred. * &#x60;RELEASED&#x60;: the transaction is currently released. * &#x60;DEFERRED_RELEASED&#x60;: the transaction was deferred in the past, but is now released. The status of a deferred transaction is updated to &#x60;DEFERRED_RELEASED&#x60; when the transaction is released.
133
+ * @param {string} [relatedIdentifierName] The name of the &#x60;relatedIdentifier&#x60;. **Possible values:** * &#x60;FINANCIAL_EVENT_GROUP_ID&#x60;: the financial event group ID associated with the transaction. * &#x60;ORDER_ID&#x60;: the order ID associated with the transaction. **Note:** FINANCIAL_EVENT_GROUP_ID and ORDER_ID are the only &#x60;relatedIdentifier&#x60; with filtering capabilities at the moment. While other &#x60;relatedIdentifier&#x60; values will be included in the response when available, they cannot be used for filtering purposes.
134
+ * @param {string} [relatedIdentifierValue] The value of the &#x60;relatedIdentifier&#x60;.
135
+ * @param {string} [nextToken] The response includes &#x60;nextToken&#x60; when the number of results exceeds the specified &#x60;pageSize&#x60; 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 &#x60;nextToken&#x60; is null. Note that this operation can return empty pages.
136
+ * @param {*} [options] Override http request option.
137
+ * @throws {RequiredError}
138
+ */
139
+ async listTransactions(postedAfter, postedBefore, marketplaceId, transactionStatus, relatedIdentifierName, relatedIdentifierValue, nextToken, options) {
140
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listTransactions(postedAfter, postedBefore, marketplaceId, transactionStatus, relatedIdentifierName, relatedIdentifierValue, nextToken, options);
141
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
142
+ const localVarOperationServerBasePath = operationServerMap["FinancesApi.listTransactions"]?.[localVarOperationServerIndex]?.url;
143
+ return (axios$1, basePath) => createRequestFunction(localVarAxiosArgs, axios.default, BASE_PATH, configuration)(axios$1, localVarOperationServerBasePath || basePath);
144
+ } };
145
+ };
146
+ /**
147
+ * FinancesApi - factory interface
148
+ */
149
+ const FinancesApiFactory = function(configuration, basePath, axios$2) {
150
+ const localVarFp = FinancesApiFp(configuration);
151
+ return {
152
+ /**
153
+ * Returns transactions for the given parameters. Financial events might not include orders from the last 48 hours. **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).
154
+ * @param {FinancesApiListTransactionsRequest} requestParameters Request parameters.
155
+ * @param {*} [options] Override http request option.
156
+ * @throws {RequiredError}
157
+ */
158
+ listTransactions(requestParameters = {}, options) {
159
+ return localVarFp.listTransactions(requestParameters.postedAfter, requestParameters.postedBefore, requestParameters.marketplaceId, requestParameters.transactionStatus, requestParameters.relatedIdentifierName, requestParameters.relatedIdentifierValue, requestParameters.nextToken, options).then((request) => request(axios$2, basePath));
160
+ } };
161
+ };
162
+ /**
163
+ * FinancesApi - object-oriented interface
164
+ */
165
+ var FinancesApi = class extends BaseAPI {
166
+ /**
167
+ * Returns transactions for the given parameters. Financial events might not include orders from the last 48 hours. **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).
168
+ * @param {FinancesApiListTransactionsRequest} requestParameters Request parameters.
169
+ * @param {*} [options] Override http request option.
170
+ * @throws {RequiredError}
171
+ */
172
+ listTransactions(requestParameters = {}, options) {
173
+ return FinancesApiFp(this.configuration).listTransactions(requestParameters.postedAfter, requestParameters.postedBefore, requestParameters.marketplaceId, requestParameters.transactionStatus, requestParameters.relatedIdentifierName, requestParameters.relatedIdentifierValue, requestParameters.nextToken, options).then((request) => request(this.axios, this.basePath));
174
+ }
175
+ };
176
+ //#endregion
177
+ //#region src/api-model/configuration.ts
178
+ var Configuration = class {
179
+ /**
180
+ * parameter for apiKey security
181
+ * @param name security name
182
+ */
183
+ apiKey;
184
+ /**
185
+ * parameter for basic security
186
+ */
187
+ username;
188
+ /**
189
+ * parameter for basic security
190
+ */
191
+ password;
192
+ /**
193
+ * parameter for oauth2 security
194
+ * @param name security name
195
+ * @param scopes oauth2 scope
196
+ */
197
+ accessToken;
198
+ /**
199
+ * parameter for aws4 signature security
200
+ * @param {Object} AWS4Signature - AWS4 Signature security
201
+ * @param {string} options.region - aws region
202
+ * @param {string} options.service - name of the service.
203
+ * @param {string} credentials.accessKeyId - aws access key id
204
+ * @param {string} credentials.secretAccessKey - aws access key
205
+ * @param {string} credentials.sessionToken - aws session token
206
+ * @memberof Configuration
207
+ */
208
+ awsv4;
209
+ /**
210
+ * override base path
211
+ */
212
+ basePath;
213
+ /**
214
+ * override server index
215
+ */
216
+ serverIndex;
217
+ /**
218
+ * base options for axios calls
219
+ */
220
+ baseOptions;
221
+ /**
222
+ * The FormData constructor that will be used to create multipart form data
223
+ * requests. You can inject this here so that execution environments that
224
+ * do not support the FormData class can still run the generated client.
225
+ *
226
+ * @type {new () => FormData}
227
+ */
228
+ formDataCtor;
229
+ constructor(param = {}) {
230
+ this.apiKey = param.apiKey;
231
+ this.username = param.username;
232
+ this.password = param.password;
233
+ this.accessToken = param.accessToken;
234
+ this.awsv4 = param.awsv4;
235
+ this.basePath = param.basePath;
236
+ this.serverIndex = param.serverIndex;
237
+ this.baseOptions = {
238
+ ...param.baseOptions,
239
+ headers: { ...param.baseOptions?.headers }
240
+ };
241
+ this.formDataCtor = param.formDataCtor;
242
+ }
243
+ /**
244
+ * Check if the given MIME is a JSON MIME.
245
+ * JSON MIME examples:
246
+ * application/json
247
+ * application/json; charset=UTF8
248
+ * APPLICATION/JSON
249
+ * application/vnd.company+json
250
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
251
+ * @return True if the given MIME is JSON, false otherwise.
252
+ */
253
+ isJsonMime(mime) {
254
+ return mime !== null && /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i.test(mime);
255
+ }
256
+ };
257
+ //#endregion
258
+ //#region src/api-model/models/business-context.ts
259
+ const BusinessContextStoreNameEnum = { AmazonHaul: "AMAZON_HAUL" };
260
+ //#endregion
261
+ //#region src/api-model/models/item-related-identifier.ts
262
+ const ItemRelatedIdentifierItemRelatedIdentifierNameEnum = {
263
+ OrderAdjustmentItemId: "ORDER_ADJUSTMENT_ITEM_ID",
264
+ CouponId: "COUPON_ID",
265
+ RemovalShipmentItemId: "REMOVAL_SHIPMENT_ITEM_ID",
266
+ TransactionId: "TRANSACTION_ID"
267
+ };
268
+ //#endregion
269
+ //#region src/api-model/models/related-identifier.ts
270
+ const RelatedIdentifierRelatedIdentifierNameEnum = {
271
+ OrderId: "ORDER_ID",
272
+ ShipmentId: "SHIPMENT_ID",
273
+ FinancialEventGroupId: "FINANCIAL_EVENT_GROUP_ID",
274
+ RefundId: "REFUND_ID",
275
+ InvoiceId: "INVOICE_ID",
276
+ DisbursementId: "DISBURSEMENT_ID",
277
+ TransferId: "TRANSFER_ID",
278
+ DeferredTransactionId: "DEFERRED_TRANSACTION_ID",
279
+ ReleaseTransactionId: "RELEASE_TRANSACTION_ID",
280
+ SettlementId: "SETTLEMENT_ID"
281
+ };
282
+ //#endregion
283
+ //#region src/client.ts
284
+ const clientRateLimits = [{
285
+ method: "get",
286
+ urlRegex: /^\/finances\/2024\u{2D}06\u{2D}19\/transactions$/v,
287
+ rate: .5,
288
+ burst: 10
289
+ }];
290
+ var FinancesApiClient = class extends FinancesApi {
291
+ constructor(configuration) {
292
+ const { axios, endpoint } = (0, _sp_api_sdk_common.createAxiosInstance)(configuration, clientRateLimits);
293
+ super(new Configuration(), endpoint, axios);
294
+ }
295
+ };
296
+ //#endregion
297
+ exports.BusinessContextStoreNameEnum = BusinessContextStoreNameEnum;
298
+ exports.FinancesApi = FinancesApi;
299
+ exports.FinancesApiAxiosParamCreator = FinancesApiAxiosParamCreator;
300
+ exports.FinancesApiClient = FinancesApiClient;
301
+ exports.FinancesApiFactory = FinancesApiFactory;
302
+ exports.FinancesApiFp = FinancesApiFp;
303
+ exports.ItemRelatedIdentifierItemRelatedIdentifierNameEnum = ItemRelatedIdentifierItemRelatedIdentifierNameEnum;
304
+ exports.RelatedIdentifierRelatedIdentifierNameEnum = RelatedIdentifierRelatedIdentifierNameEnum;
305
+ exports.clientRateLimits = clientRateLimits;
306
+
307
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":["axios","globalAxios","globalAxios","axios"],"sources":["../src/api-model/base.ts","../src/api-model/common.ts","../src/api-model/api/finances-api.ts","../src/api-model/configuration.ts","../src/api-model/models/business-context.ts","../src/api-model/models/item-related-identifier.ts","../src/api-model/models/related-identifier.ts","../src/client.ts"],"sourcesContent":["/* tslint:disable */\n/* eslint-disable */\n/**\n * The Selling Partner API for Finances\n * 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.\n *\n * The version of the OpenAPI document: 2024-06-19\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 * The Selling Partner API for Finances\n * 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.\n *\n * The version of the OpenAPI document: 2024-06-19\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/* eslint-disable */\n/**\n * The Selling Partner API for Finances\n * 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.\n *\n * The version of the OpenAPI document: 2024-06-19\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 { ErrorList } from '../models/index.js';\n// @ts-ignore\nimport type { ListTransactionsResponse } from '../models/index.js';\n/**\n * FinancesApi - axios parameter creator\n */\nexport const FinancesApiAxiosParamCreator = function (configuration?: Configuration) {\n return {\n /**\n * Returns transactions for the given parameters. Financial events might not include orders from the last 48 hours. **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).\n * @param {string} [postedAfter] The response includes financial events posted on or after 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. This field is required if you do not specify a related identifier.\n * @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 &#x60;PostedAfter&#x60; and more than two minutes before the request was submitted. If &#x60;PostedAfter&#x60; and &#x60;PostedBefore&#x60; are more than 180 days apart, the response is empty. **Default:** Two minutes before the time of the request.\n * @param {string} [marketplaceId] The identifier of the marketplace from which you want to retrieve transactions. The marketplace ID is the globally unique identifier of a marketplace. To find the ID for your marketplace, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).\n * @param {string} [transactionStatus] The status of the transaction. **Possible values:** * &#x60;DEFERRED&#x60;: the transaction is currently deferred. * &#x60;RELEASED&#x60;: the transaction is currently released. * &#x60;DEFERRED_RELEASED&#x60;: the transaction was deferred in the past, but is now released. The status of a deferred transaction is updated to &#x60;DEFERRED_RELEASED&#x60; when the transaction is released.\n * @param {string} [relatedIdentifierName] The name of the &#x60;relatedIdentifier&#x60;. **Possible values:** * &#x60;FINANCIAL_EVENT_GROUP_ID&#x60;: the financial event group ID associated with the transaction. * &#x60;ORDER_ID&#x60;: the order ID associated with the transaction. **Note:** FINANCIAL_EVENT_GROUP_ID and ORDER_ID are the only &#x60;relatedIdentifier&#x60; with filtering capabilities at the moment. While other &#x60;relatedIdentifier&#x60; values will be included in the response when available, they cannot be used for filtering purposes.\n * @param {string} [relatedIdentifierValue] The value of the &#x60;relatedIdentifier&#x60;.\n * @param {string} [nextToken] The response includes &#x60;nextToken&#x60; when the number of results exceeds the specified &#x60;pageSize&#x60; 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 &#x60;nextToken&#x60; is null. Note that this operation can return empty pages.\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n */\n listTransactions: async (postedAfter?: string, postedBefore?: string, marketplaceId?: string, transactionStatus?: string, relatedIdentifierName?: string, relatedIdentifierValue?: string, nextToken?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {\n const localVarPath = `/finances/2024-06-19/transactions`;\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: 'GET', ...baseOptions, ...options};\n const localVarHeaderParameter = {} as any;\n const localVarQueryParameter = {} as any;\n\n if (postedAfter !== undefined) {\n localVarQueryParameter['postedAfter'] = (postedAfter as any instanceof Date) ?\n (postedAfter as any).toISOString() :\n postedAfter;\n }\n\n if (postedBefore !== undefined) {\n localVarQueryParameter['postedBefore'] = (postedBefore as any instanceof Date) ?\n (postedBefore as any).toISOString() :\n postedBefore;\n }\n\n if (marketplaceId !== undefined) {\n localVarQueryParameter['marketplaceId'] = marketplaceId;\n }\n\n if (transactionStatus !== undefined) {\n localVarQueryParameter['transactionStatus'] = transactionStatus;\n }\n\n if (relatedIdentifierName !== undefined) {\n localVarQueryParameter['relatedIdentifierName'] = relatedIdentifierName;\n }\n\n if (relatedIdentifierValue !== undefined) {\n localVarQueryParameter['relatedIdentifierValue'] = relatedIdentifierValue;\n }\n\n if (nextToken !== undefined) {\n localVarQueryParameter['nextToken'] = nextToken;\n }\n\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\n return {\n url: toPathString(localVarUrlObj),\n options: localVarRequestOptions,\n };\n },\n }\n};\n\n/**\n * FinancesApi - functional programming interface\n */\nexport const FinancesApiFp = function(configuration?: Configuration) {\n const localVarAxiosParamCreator = FinancesApiAxiosParamCreator(configuration)\n return {\n /**\n * Returns transactions for the given parameters. Financial events might not include orders from the last 48 hours. **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).\n * @param {string} [postedAfter] The response includes financial events posted on or after 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. This field is required if you do not specify a related identifier.\n * @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 &#x60;PostedAfter&#x60; and more than two minutes before the request was submitted. If &#x60;PostedAfter&#x60; and &#x60;PostedBefore&#x60; are more than 180 days apart, the response is empty. **Default:** Two minutes before the time of the request.\n * @param {string} [marketplaceId] The identifier of the marketplace from which you want to retrieve transactions. The marketplace ID is the globally unique identifier of a marketplace. To find the ID for your marketplace, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).\n * @param {string} [transactionStatus] The status of the transaction. **Possible values:** * &#x60;DEFERRED&#x60;: the transaction is currently deferred. * &#x60;RELEASED&#x60;: the transaction is currently released. * &#x60;DEFERRED_RELEASED&#x60;: the transaction was deferred in the past, but is now released. The status of a deferred transaction is updated to &#x60;DEFERRED_RELEASED&#x60; when the transaction is released.\n * @param {string} [relatedIdentifierName] The name of the &#x60;relatedIdentifier&#x60;. **Possible values:** * &#x60;FINANCIAL_EVENT_GROUP_ID&#x60;: the financial event group ID associated with the transaction. * &#x60;ORDER_ID&#x60;: the order ID associated with the transaction. **Note:** FINANCIAL_EVENT_GROUP_ID and ORDER_ID are the only &#x60;relatedIdentifier&#x60; with filtering capabilities at the moment. While other &#x60;relatedIdentifier&#x60; values will be included in the response when available, they cannot be used for filtering purposes.\n * @param {string} [relatedIdentifierValue] The value of the &#x60;relatedIdentifier&#x60;.\n * @param {string} [nextToken] The response includes &#x60;nextToken&#x60; when the number of results exceeds the specified &#x60;pageSize&#x60; 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 &#x60;nextToken&#x60; is null. Note that this operation can return empty pages.\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n */\n async listTransactions(postedAfter?: string, postedBefore?: string, marketplaceId?: string, transactionStatus?: string, relatedIdentifierName?: string, relatedIdentifierValue?: string, nextToken?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListTransactionsResponse>> {\n const localVarAxiosArgs = await localVarAxiosParamCreator.listTransactions(postedAfter, postedBefore, marketplaceId, transactionStatus, relatedIdentifierName, relatedIdentifierValue, nextToken, options);\n const localVarOperationServerIndex = configuration?.serverIndex ?? 0;\n const localVarOperationServerBasePath = operationServerMap['FinancesApi.listTransactions']?.[localVarOperationServerIndex]?.url;\n return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);\n },\n }\n};\n\n/**\n * FinancesApi - factory interface\n */\nexport const FinancesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {\n const localVarFp = FinancesApiFp(configuration)\n return {\n /**\n * Returns transactions for the given parameters. Financial events might not include orders from the last 48 hours. **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).\n * @param {FinancesApiListTransactionsRequest} requestParameters Request parameters.\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n */\n listTransactions(requestParameters: FinancesApiListTransactionsRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise<ListTransactionsResponse> {\n return localVarFp.listTransactions(requestParameters.postedAfter, requestParameters.postedBefore, requestParameters.marketplaceId, requestParameters.transactionStatus, requestParameters.relatedIdentifierName, requestParameters.relatedIdentifierValue, requestParameters.nextToken, options).then((request) => request(axios, basePath));\n },\n };\n};\n\n/**\n * Request parameters for listTransactions operation in FinancesApi.\n */\nexport interface FinancesApiListTransactionsRequest {\n /**\n * The response includes financial events posted on or after 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. This field is required if you do not specify a related identifier.\n */\n readonly postedAfter?: string\n\n /**\n * 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 &#x60;PostedAfter&#x60; and more than two minutes before the request was submitted. If &#x60;PostedAfter&#x60; and &#x60;PostedBefore&#x60; are more than 180 days apart, the response is empty. **Default:** Two minutes before the time of the request.\n */\n readonly postedBefore?: string\n\n /**\n * The identifier of the marketplace from which you want to retrieve transactions. The marketplace ID is the globally unique identifier of a marketplace. To find the ID for your marketplace, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).\n */\n readonly marketplaceId?: string\n\n /**\n * The status of the transaction. **Possible values:** * &#x60;DEFERRED&#x60;: the transaction is currently deferred. * &#x60;RELEASED&#x60;: the transaction is currently released. * &#x60;DEFERRED_RELEASED&#x60;: the transaction was deferred in the past, but is now released. The status of a deferred transaction is updated to &#x60;DEFERRED_RELEASED&#x60; when the transaction is released.\n */\n readonly transactionStatus?: string\n\n /**\n * The name of the &#x60;relatedIdentifier&#x60;. **Possible values:** * &#x60;FINANCIAL_EVENT_GROUP_ID&#x60;: the financial event group ID associated with the transaction. * &#x60;ORDER_ID&#x60;: the order ID associated with the transaction. **Note:** FINANCIAL_EVENT_GROUP_ID and ORDER_ID are the only &#x60;relatedIdentifier&#x60; with filtering capabilities at the moment. While other &#x60;relatedIdentifier&#x60; values will be included in the response when available, they cannot be used for filtering purposes.\n */\n readonly relatedIdentifierName?: string\n\n /**\n * The value of the &#x60;relatedIdentifier&#x60;.\n */\n readonly relatedIdentifierValue?: string\n\n /**\n * The response includes &#x60;nextToken&#x60; when the number of results exceeds the specified &#x60;pageSize&#x60; 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 &#x60;nextToken&#x60; is null. Note that this operation can return empty pages.\n */\n readonly nextToken?: string\n}\n\n/**\n * FinancesApi - object-oriented interface\n */\nexport class FinancesApi extends BaseAPI {\n /**\n * Returns transactions for the given parameters. Financial events might not include orders from the last 48 hours. **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).\n * @param {FinancesApiListTransactionsRequest} requestParameters Request parameters.\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n */\n public listTransactions(requestParameters: FinancesApiListTransactionsRequest = {}, options?: RawAxiosRequestConfig) {\n return FinancesApiFp(this.configuration).listTransactions(requestParameters.postedAfter, requestParameters.postedBefore, requestParameters.marketplaceId, requestParameters.transactionStatus, requestParameters.relatedIdentifierName, requestParameters.relatedIdentifierValue, requestParameters.nextToken, options).then((request) => request(this.axios, this.basePath));\n }\n}\n\n","/* tslint:disable */\n/**\n * The Selling Partner API for Finances\n * 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.\n *\n * The version of the OpenAPI document: 2024-06-19\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 * The Selling Partner API for Finances\n * 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.\n *\n * The version of the OpenAPI document: 2024-06-19\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 * Information about the line of business associated with a transaction.\n */\nexport interface BusinessContext {\n /**\n * The store name associated with the transaction.\n */\n 'storeName'?: BusinessContextStoreNameEnum;\n}\n\nexport const BusinessContextStoreNameEnum = {\n AmazonHaul: 'AMAZON_HAUL',\n} as const;\n\nexport type BusinessContextStoreNameEnum = typeof BusinessContextStoreNameEnum[keyof typeof BusinessContextStoreNameEnum];\n\n\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * The Selling Partner API for Finances\n * 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.\n *\n * The version of the OpenAPI document: 2024-06-19\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 * Related business identifiers of the item.\n */\nexport interface ItemRelatedIdentifier {\n /**\n * Enumerated set of related item identifier names for the item.\n */\n 'itemRelatedIdentifierName'?: ItemRelatedIdentifierItemRelatedIdentifierNameEnum;\n /**\n * Corresponding value to `ItemRelatedIdentifierName`.\n */\n 'itemRelatedIdentifierValue'?: string;\n}\n\nexport const ItemRelatedIdentifierItemRelatedIdentifierNameEnum = {\n OrderAdjustmentItemId: 'ORDER_ADJUSTMENT_ITEM_ID',\n CouponId: 'COUPON_ID',\n RemovalShipmentItemId: 'REMOVAL_SHIPMENT_ITEM_ID',\n TransactionId: 'TRANSACTION_ID',\n} as const;\n\nexport type ItemRelatedIdentifierItemRelatedIdentifierNameEnum = typeof ItemRelatedIdentifierItemRelatedIdentifierNameEnum[keyof typeof ItemRelatedIdentifierItemRelatedIdentifierNameEnum];\n\n\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * The Selling Partner API for Finances\n * 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.\n *\n * The version of the OpenAPI document: 2024-06-19\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 * Related business identifier of the transaction.\n */\nexport interface RelatedIdentifier {\n /**\n * An enumerated set of related business identifier names.\n */\n 'relatedIdentifierName'?: RelatedIdentifierRelatedIdentifierNameEnum;\n /**\n * Corresponding value of `RelatedIdentifierName`.\n */\n 'relatedIdentifierValue'?: string;\n}\n\nexport const RelatedIdentifierRelatedIdentifierNameEnum = {\n OrderId: 'ORDER_ID',\n ShipmentId: 'SHIPMENT_ID',\n FinancialEventGroupId: 'FINANCIAL_EVENT_GROUP_ID',\n RefundId: 'REFUND_ID',\n InvoiceId: 'INVOICE_ID',\n DisbursementId: 'DISBURSEMENT_ID',\n TransferId: 'TRANSFER_ID',\n DeferredTransactionId: 'DEFERRED_TRANSACTION_ID',\n ReleaseTransactionId: 'RELEASE_TRANSACTION_ID',\n SettlementId: 'SETTLEMENT_ID',\n} as const;\n\nexport type RelatedIdentifierRelatedIdentifierNameEnum = typeof RelatedIdentifierRelatedIdentifierNameEnum[keyof typeof RelatedIdentifierRelatedIdentifierNameEnum];\n\n\n","import {type ClientConfiguration, createAxiosInstance, type RateLimit} from '@sp-api-sdk/common'\n\nimport {Configuration, FinancesApi} from './api-model/index.js'\n\nexport const clientRateLimits: RateLimit[] = [\n {\n method: 'get',\n urlRegex: /^\\/finances\\/2024\\u{2D}06\\u{2D}19\\/transactions$/v,\n rate: 0.5,\n burst: 10,\n },\n]\n\nexport class FinancesApiClient extends FinancesApi {\n constructor(configuration: ClientConfiguration) {\n const {axios, endpoint} = createAxiosInstance(configuration, clientRateLimits)\n\n super(new Configuration(), endpoint, axios)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAa,YAAY,0CAA0C,QAAQ,QAAQ,EAAE;AAcrF,IAAa,UAAb,MAAqB;CAGoC;CAAwC;CAF7F;CAEA,YAAY,eAA+B,WAA6B,WAAW,UAAiCC,MAAAA,SAAa;EAA5E,KAAA,WAAA;EAAwC,KAAA,QAAA;EACzF,IAAI,eAAe;GACf,KAAK,gBAAgB;GACrB,KAAK,WAAW,cAAc,YAAY;EAC9C;CACJ;AACJ;AAgBA,MAAa,qBAAgC,CAC7C;;;AC1CA,MAAa,iBAAiB;AA8C9B,SAAS,wBAAwB,iBAAkC,WAAgB,MAAc,IAAU;CACvG,IAAI,aAAa,MAAM;CACvB,IAAI,OAAO,cAAc,UACrB,IAAI,MAAM,QAAQ,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