@amazon-sp-api-release/amazon-sp-api-sdk-js 1.1.0 → 1.3.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 (144) hide show
  1. package/README.md +2 -3
  2. package/helper/DefaultRateLimitMap.mjs +14 -1
  3. package/index.js +2 -0
  4. package/package.json +1 -1
  5. package/src/apluscontent_v2020_11_01/ApiClient.js +5 -1
  6. package/src/appintegrations_v2024_04_01/ApiClient.js +5 -1
  7. package/src/applications_v2023_11_30/ApiClient.js +5 -1
  8. package/src/awd_v2024_05_09/ApiClient.js +5 -1
  9. package/src/catalogitems_v2022_04_01/ApiClient.js +5 -1
  10. package/src/datakiosk_v2023_11_15/ApiClient.js +5 -1
  11. package/src/easyship_v2022_03_23/ApiClient.js +5 -1
  12. package/src/fbaeligibility_v1/ApiClient.js +5 -1
  13. package/src/fbainventory_v1/ApiClient.js +5 -1
  14. package/src/feeds_v2021_06_30/ApiClient.js +5 -1
  15. package/src/finances_2024_06_19/ApiClient.js +827 -0
  16. package/src/finances_2024_06_19/api/DefaultApi.js +125 -0
  17. package/src/finances_2024_06_19/index.js +168 -0
  18. package/src/finances_2024_06_19/model/AmazonPayContext.js +76 -0
  19. package/src/finances_2024_06_19/model/Breakdown.js +76 -0
  20. package/src/finances_2024_06_19/model/BusinessContext.js +76 -0
  21. package/src/finances_2024_06_19/model/Context.js +308 -0
  22. package/src/finances_2024_06_19/model/Currency.js +69 -0
  23. package/src/finances_2024_06_19/model/DeferredContext.js +69 -0
  24. package/src/finances_2024_06_19/model/Error.js +80 -0
  25. package/src/finances_2024_06_19/model/ErrorList.js +65 -0
  26. package/src/finances_2024_06_19/model/Item.js +93 -0
  27. package/src/finances_2024_06_19/model/ItemRelatedIdentifier.js +101 -0
  28. package/src/finances_2024_06_19/model/ListTransactionsResponse.js +62 -0
  29. package/src/finances_2024_06_19/model/MarketplaceDetails.js +69 -0
  30. package/src/finances_2024_06_19/model/PaymentsContext.js +83 -0
  31. package/src/finances_2024_06_19/model/ProductContext.js +83 -0
  32. package/src/finances_2024_06_19/model/RelatedIdentifier.js +137 -0
  33. package/src/finances_2024_06_19/model/SellingPartnerMetadata.js +76 -0
  34. package/src/finances_2024_06_19/model/TimeRangeContext.js +69 -0
  35. package/src/finances_2024_06_19/model/Transaction.js +143 -0
  36. package/src/finances_2024_06_19/model/TransactionsPayload.js +70 -0
  37. package/src/finances_v0/ApiClient.js +5 -1
  38. package/src/fulfillmentinbound_v0/ApiClient.js +5 -1
  39. package/src/fulfillmentinbound_v2024_03_20/ApiClient.js +5 -1
  40. package/src/fulfillmentoutbound_v2020_07_01/ApiClient.js +5 -1
  41. package/src/invoices_v2024_06_19/ApiClient.js +5 -1
  42. package/src/invoicing_v0/ApiClient.js +5 -1
  43. package/src/listingsitems_v2021_08_01/ApiClient.js +5 -1
  44. package/src/listingsitems_v2021_08_01/api/ListingsApi.js +6 -6
  45. package/src/listingsitems_v2021_08_01/model/FulfillmentAvailability.js +2 -2
  46. package/src/listingsitems_v2021_08_01/model/Issue.js +2 -2
  47. package/src/listingsitems_v2021_08_01/model/IssueExemption.js +1 -1
  48. package/src/listingsitems_v2021_08_01/model/ItemRelationship.js +1 -1
  49. package/src/listingsitems_v2021_08_01/model/ItemSearchResults.js +2 -2
  50. package/src/listingsitems_v2021_08_01/model/Pagination.js +1 -1
  51. package/src/listingsitems_v2021_08_01/model/PatchOperation.js +9 -3
  52. package/src/listingsrestrictions_v2021_08_01/ApiClient.js +5 -1
  53. package/src/merchantfulfillment_v0/ApiClient.js +5 -1
  54. package/src/messaging_v1/ApiClient.js +5 -1
  55. package/src/notifications_v1/ApiClient.js +5 -1
  56. package/src/orders_v0/ApiClient.js +5 -1
  57. package/src/orders_v0/api/OrdersV0Api.js +26 -26
  58. package/src/orders_v0/api/ShipmentApi.js +2 -2
  59. package/src/orders_v0/index.js +0 -7
  60. package/src/orders_v0/model/AmazonPrograms.js +3 -3
  61. package/src/orders_v0/model/OrderItem.js +0 -7
  62. package/src/orders_v0/model/OrdersList.js +1 -1
  63. package/src/orders_v0/model/PackageDetail.js +1 -1
  64. package/src/pricing_v0/ApiClient.js +5 -1
  65. package/src/pricing_v2022_05_01/ApiClient.js +5 -1
  66. package/src/pricing_v2022_05_01/model/CompetitiveSummaryRequest.js +2 -2
  67. package/src/pricing_v2022_05_01/model/CompetitiveSummaryResponseBody.js +2 -2
  68. package/src/pricing_v2022_05_01/model/FeaturedOfferExpectedPriceRequest.js +3 -3
  69. package/src/pricing_v2022_05_01/model/FeaturedOfferExpectedPriceRequestParams.js +2 -2
  70. package/src/pricing_v2022_05_01/model/FeaturedOfferSegment.js +7 -1
  71. package/src/pricing_v2022_05_01/model/LowestPricedOffersInput.js +2 -2
  72. package/src/pricing_v2022_05_01/model/OfferIdentifier.js +2 -2
  73. package/src/pricing_v2022_05_01/model/ReferencePrice.js +2 -2
  74. package/src/productfees_v0/ApiClient.js +5 -1
  75. package/src/producttypedefinitions_v2020_09_01/ApiClient.js +5 -1
  76. package/src/replenishment_v2022_11_07/ApiClient.js +5 -1
  77. package/src/reports_v2021_06_30/ApiClient.js +5 -1
  78. package/src/sales_v1/ApiClient.js +5 -1
  79. package/src/sales_v1/api/SalesApi.js +4 -1
  80. package/src/sellerWallet_2024_03_01/ApiClient.js +827 -0
  81. package/src/sellerWallet_2024_03_01/api/AccountsApi.js +212 -0
  82. package/src/sellerWallet_2024_03_01/api/TransactionsApi.js +233 -0
  83. package/src/sellerWallet_2024_03_01/api/TransferPreviewApi.js +144 -0
  84. package/src/sellerWallet_2024_03_01/api/TransferScheduleApi.js +347 -0
  85. package/src/sellerWallet_2024_03_01/index.js +322 -0
  86. package/src/sellerWallet_2024_03_01/model/AccountHolderAddress.js +114 -0
  87. package/src/sellerWallet_2024_03_01/model/Balance.js +98 -0
  88. package/src/sellerWallet_2024_03_01/model/BalanceListing.js +63 -0
  89. package/src/sellerWallet_2024_03_01/model/BalanceType.js +54 -0
  90. package/src/sellerWallet_2024_03_01/model/BankAccount.js +148 -0
  91. package/src/sellerWallet_2024_03_01/model/BankAccountHolderStatus.js +54 -0
  92. package/src/sellerWallet_2024_03_01/model/BankAccountListing.js +65 -0
  93. package/src/sellerWallet_2024_03_01/model/BankAccountNumberFormat.js +42 -0
  94. package/src/sellerWallet_2024_03_01/model/BankAccountOwnershipType.js +48 -0
  95. package/src/sellerWallet_2024_03_01/model/BankNumberFormat.js +42 -0
  96. package/src/sellerWallet_2024_03_01/model/Currency.js +69 -0
  97. package/src/sellerWallet_2024_03_01/model/DeleteTransferSchedule.js +80 -0
  98. package/src/sellerWallet_2024_03_01/model/Error.js +80 -0
  99. package/src/sellerWallet_2024_03_01/model/ErrorList.js +65 -0
  100. package/src/sellerWallet_2024_03_01/model/Fee.js +91 -0
  101. package/src/sellerWallet_2024_03_01/model/FeeType.js +48 -0
  102. package/src/sellerWallet_2024_03_01/model/FxRateDetails.js +91 -0
  103. package/src/sellerWallet_2024_03_01/model/PaymentPreference.js +73 -0
  104. package/src/sellerWallet_2024_03_01/model/PaymentPreferencePaymentType.js +42 -0
  105. package/src/sellerWallet_2024_03_01/model/RateDirection.js +42 -0
  106. package/src/sellerWallet_2024_03_01/model/RecurringFrequency.js +54 -0
  107. package/src/sellerWallet_2024_03_01/model/ScheduleExpression.js +71 -0
  108. package/src/sellerWallet_2024_03_01/model/ScheduleExpressionType.js +42 -0
  109. package/src/sellerWallet_2024_03_01/model/ScheduleTransferType.js +36 -0
  110. package/src/sellerWallet_2024_03_01/model/Transaction.js +187 -0
  111. package/src/sellerWallet_2024_03_01/model/TransactionAccount.js +112 -0
  112. package/src/sellerWallet_2024_03_01/model/TransactionInitiationRequest.js +121 -0
  113. package/src/sellerWallet_2024_03_01/model/TransactionInstrumentDetails.js +73 -0
  114. package/src/sellerWallet_2024_03_01/model/TransactionListing.js +72 -0
  115. package/src/sellerWallet_2024_03_01/model/TransactionStatus.js +66 -0
  116. package/src/sellerWallet_2024_03_01/model/TransactionType.js +42 -0
  117. package/src/sellerWallet_2024_03_01/model/TransferRatePreview.js +91 -0
  118. package/src/sellerWallet_2024_03_01/model/TransferSchedule.js +123 -0
  119. package/src/sellerWallet_2024_03_01/model/TransferScheduleFailures.js +73 -0
  120. package/src/sellerWallet_2024_03_01/model/TransferScheduleInformation.js +83 -0
  121. package/src/sellerWallet_2024_03_01/model/TransferScheduleListing.js +72 -0
  122. package/src/sellerWallet_2024_03_01/model/TransferScheduleRequest.js +125 -0
  123. package/src/sellerWallet_2024_03_01/model/TransferScheduleStatus.js +54 -0
  124. package/src/sellers_v1/ApiClient.js +5 -1
  125. package/src/services_v1/ApiClient.js +5 -1
  126. package/src/shipping_v2/ApiClient.js +5 -1
  127. package/src/solicitations_v1/ApiClient.js +5 -1
  128. package/src/supplysources_v2020_07_01/ApiClient.js +5 -1
  129. package/src/tokens_v2021_03_01/ApiClient.js +5 -1
  130. package/src/transfers_v2024_06_01/ApiClient.js +5 -1
  131. package/src/uploads_v2020_11_01/ApiClient.js +5 -1
  132. package/src/vehicles_v2024_11_01/ApiClient.js +5 -1
  133. package/src/vendordfinventory_v1/ApiClient.js +5 -1
  134. package/src/vendordforders_v2021_12_28/ApiClient.js +5 -1
  135. package/src/vendordfpayments_v1/ApiClient.js +5 -1
  136. package/src/vendordfshipping_v2021_12_28/ApiClient.js +5 -1
  137. package/src/vendordftransactions_v2021_12_28/ApiClient.js +5 -1
  138. package/src/vendorinvoices_v1/ApiClient.js +5 -1
  139. package/src/vendororders_v1/ApiClient.js +5 -1
  140. package/src/vendorshipments_v1/ApiClient.js +5 -1
  141. package/src/vendorshipments_v1/api/VendorShippingApi.js +2 -2
  142. package/src/vendorshipments_v1/model/Shipment.js +3 -3
  143. package/src/vendortransactionstatus_v1/ApiClient.js +5 -1
  144. package/src/orders_v0/model/ExportInfo.js +0 -69
package/README.md CHANGED
@@ -1,10 +1,9 @@
1
1
  ## JavaScript SDK for Selling Partner API
2
2
  [![npm version](https://badge.fury.io/js/@amazon-sp-api-release%2Famazon-sp-api-sdk-js.svg)](https://www.npmjs.com/package/@amazon-sp-api-release/amazon-sp-api-sdk-js)
3
3
 
4
- <!-- youtube video is under creating -->
5
- <!-- [![Video Thumbnail](docs/video-thumbnail.png)](https://www.youtube.com/watch?v=OmYTAA80V_4)
4
+ [![Video Thumbnail](docs/video-thumbnail.png)](https://www.youtube.com/watch?v=5pRZXYhjNIQ)
6
5
 
7
- *Click on the image to watch the video.* -->
6
+ *Click on the image to watch the video.*
8
7
 
9
8
  The Selling Partner API SDK for JavaScript enables you to easily connect your JavaScript/Node.js application to Amazon's REST-based Selling Partner API.
10
9
 
@@ -51,6 +51,7 @@ export const defaultRateLimitMap = {
51
51
  "DefaultApi-listFinancialEventsByGroupId": [1, 30, 2],
52
52
  "DefaultApi-listFinancialEventsByOrderId": [1, 30, 2],
53
53
  "DefaultApi-listFinancialEvents": [1, 30, 2],
54
+ "DefaultApi-listTransactions": [1, 10, 2],
54
55
  "DefaultApi-initiatePayout": [1, 2, 60],
55
56
  "DefaultApi-getPaymentMethods": [1, 30, 2],
56
57
  "FbaInboundApi-getPrepInstructions": [2, 30],
@@ -280,6 +281,18 @@ export const defaultRateLimitMap = {
280
281
  "VendorShippingApi-GetShipmentDetails": [10, 10],
281
282
  "VendorShippingApi-GetShipmentLabels": [10, 10],
282
283
  "VendorTransactionApi-getTransaction": [10, 10],
283
- "VendorTransactionApi-getTransactionStatus": [10, 10]
284
+ "VendorTransactionApi-getTransactionStatus": [10, 10],
285
+ "AccountsApi-listAccounts": [1, 15, 2],
286
+ "AccountsApi-getAccount": [1, 15, 2],
287
+ "AccountsApi-listAccountBalances": [1, 15, 2],
288
+ "TransferPreviewApi-getTransferPreview": [1, 10, 2],
289
+ "TransactionsApi-listAccountTransactions": [1, 15, 2],
290
+ "TransactionsApi-createTransaction": [1, 10],
291
+ "TransactionsApi-getTransaction": [1, 10, 2],
292
+ "TransferScheduleApi-listTransferSchedules": [1, 10, 2],
293
+ "TransferScheduleApi-createTransferSchedule": [1, 10, 2],
294
+ "TransferScheduleApi-updateTransferSchedule": [1, 10, 2],
295
+ "TransferScheduleApi-getTransferSchedule": [1, 10, 2],
296
+ "TransferScheduleApi-deleteScheduleTransaction": [1, 10, 2]
284
297
  }
285
298
 
package/index.js CHANGED
@@ -8,6 +8,7 @@ export * as EasyshipSpApi from './src/easyship_v2022_03_23/index.js';
8
8
  export * as FbaeligibilitySpApi from './src/fbaeligibility_v1/index.js';
9
9
  export * as FbainventorySpApi from './src/fbainventory_v1/index.js';
10
10
  export * as FeedsSpApi from './src/feeds_v2021_06_30/index.js';
11
+ export * as Finances20240619SpApi from './src/finances_2024_06_19/index.js';
11
12
  export * as FinancesSpApi from './src/finances_v0/index.js';
12
13
  export * as FulfillmentinboundSpApi from './src/fulfillmentinbound_v2024_03_20/index.js';
13
14
  export * as Fulfillmentinbound_v0SpApi from './src/fulfillmentinbound_v0/index.js';
@@ -27,6 +28,7 @@ export * as ProducttypedefinitionsSpApi from './src/producttypedefinitions_v2020
27
28
  export * as ReplenishmentSpApi from './src/replenishment_v2022_11_07/index.js';
28
29
  export * as ReportsSpApi from './src/reports_v2021_06_30/index.js';
29
30
  export * as SalesSpApi from './src/sales_v1/index.js';
31
+ export * as SellerWallet20240301SpApi from './src/sellerWallet_2024_03_01/index.js';
30
32
  export * as SellersSpApi from './src/sellers_v1/index.js';
31
33
  export * as ServicesSpApi from './src/services_v1/index.js';
32
34
  export * as ShippingSpApi from './src/shipping_v2/index.js';
package/package.json CHANGED
@@ -56,5 +56,5 @@
56
56
  "engines": {
57
57
  "node": ">=14.18.0"
58
58
  },
59
- "version": "1.1.0"
59
+ "version": "1.3.0"
60
60
  }
@@ -13,6 +13,7 @@
13
13
 
14
14
  import superagent from 'superagent'
15
15
  import querystring from 'querystring'
16
+ import { readFileSync } from 'node:fs'
16
17
  import { URL } from 'node:url'
17
18
  import { RateLimitConfiguration } from '../../helper/RateLimitConfiguration.mjs'
18
19
  import { SuperagentRateLimiter } from '../../helper/SuperagentRateLimiter.mjs'
@@ -214,13 +215,16 @@ export class ApiClient {
214
215
  this.authentications = {
215
216
  }
216
217
 
218
+ const pkg = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url)))
219
+ const version = pkg.version ? pkg.version : 'undefined'
220
+
217
221
  /**
218
222
  * The default HTTP headers to be included for all API calls.
219
223
  * @type {Array<String>}
220
224
  * @default {}
221
225
  */
222
226
  this.defaultHeaders = {
223
- 'User-Agent': 'amazon-selling-partner-api-sdk/1.0.0/JavaScript'
227
+ 'User-Agent': `amazon-selling-partner-api-sdk/${version}/JavaScript`
224
228
  }
225
229
 
226
230
  /**
@@ -13,6 +13,7 @@
13
13
 
14
14
  import superagent from 'superagent'
15
15
  import querystring from 'querystring'
16
+ import { readFileSync } from 'node:fs'
16
17
  import { URL } from 'node:url'
17
18
  import { RateLimitConfiguration } from '../../helper/RateLimitConfiguration.mjs'
18
19
  import { SuperagentRateLimiter } from '../../helper/SuperagentRateLimiter.mjs'
@@ -214,13 +215,16 @@ export class ApiClient {
214
215
  this.authentications = {
215
216
  }
216
217
 
218
+ const pkg = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url)))
219
+ const version = pkg.version ? pkg.version : 'undefined'
220
+
217
221
  /**
218
222
  * The default HTTP headers to be included for all API calls.
219
223
  * @type {Array<String>}
220
224
  * @default {}
221
225
  */
222
226
  this.defaultHeaders = {
223
- 'User-Agent': 'amazon-selling-partner-api-sdk/1.0.0/JavaScript'
227
+ 'User-Agent': `amazon-selling-partner-api-sdk/${version}/JavaScript`
224
228
  }
225
229
 
226
230
  /**
@@ -13,6 +13,7 @@
13
13
 
14
14
  import superagent from 'superagent'
15
15
  import querystring from 'querystring'
16
+ import { readFileSync } from 'node:fs'
16
17
  import { URL } from 'node:url'
17
18
  import { RateLimitConfiguration } from '../../helper/RateLimitConfiguration.mjs'
18
19
  import { SuperagentRateLimiter } from '../../helper/SuperagentRateLimiter.mjs'
@@ -214,13 +215,16 @@ export class ApiClient {
214
215
  this.authentications = {
215
216
  }
216
217
 
218
+ const pkg = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url)))
219
+ const version = pkg.version ? pkg.version : 'undefined'
220
+
217
221
  /**
218
222
  * The default HTTP headers to be included for all API calls.
219
223
  * @type {Array<String>}
220
224
  * @default {}
221
225
  */
222
226
  this.defaultHeaders = {
223
- 'User-Agent': 'amazon-selling-partner-api-sdk/1.0.0/JavaScript'
227
+ 'User-Agent': `amazon-selling-partner-api-sdk/${version}/JavaScript`
224
228
  }
225
229
 
226
230
  /**
@@ -13,6 +13,7 @@
13
13
 
14
14
  import superagent from 'superagent'
15
15
  import querystring from 'querystring'
16
+ import { readFileSync } from 'node:fs'
16
17
  import { URL } from 'node:url'
17
18
  import { RateLimitConfiguration } from '../../helper/RateLimitConfiguration.mjs'
18
19
  import { SuperagentRateLimiter } from '../../helper/SuperagentRateLimiter.mjs'
@@ -214,13 +215,16 @@ export class ApiClient {
214
215
  this.authentications = {
215
216
  }
216
217
 
218
+ const pkg = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url)))
219
+ const version = pkg.version ? pkg.version : 'undefined'
220
+
217
221
  /**
218
222
  * The default HTTP headers to be included for all API calls.
219
223
  * @type {Array<String>}
220
224
  * @default {}
221
225
  */
222
226
  this.defaultHeaders = {
223
- 'User-Agent': 'amazon-selling-partner-api-sdk/1.0.0/JavaScript'
227
+ 'User-Agent': `amazon-selling-partner-api-sdk/${version}/JavaScript`
224
228
  }
225
229
 
226
230
  /**
@@ -13,6 +13,7 @@
13
13
 
14
14
  import superagent from 'superagent'
15
15
  import querystring from 'querystring'
16
+ import { readFileSync } from 'node:fs'
16
17
  import { URL } from 'node:url'
17
18
  import { RateLimitConfiguration } from '../../helper/RateLimitConfiguration.mjs'
18
19
  import { SuperagentRateLimiter } from '../../helper/SuperagentRateLimiter.mjs'
@@ -214,13 +215,16 @@ export class ApiClient {
214
215
  this.authentications = {
215
216
  }
216
217
 
218
+ const pkg = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url)))
219
+ const version = pkg.version ? pkg.version : 'undefined'
220
+
217
221
  /**
218
222
  * The default HTTP headers to be included for all API calls.
219
223
  * @type {Array<String>}
220
224
  * @default {}
221
225
  */
222
226
  this.defaultHeaders = {
223
- 'User-Agent': 'amazon-selling-partner-api-sdk/1.0.0/JavaScript'
227
+ 'User-Agent': `amazon-selling-partner-api-sdk/${version}/JavaScript`
224
228
  }
225
229
 
226
230
  /**
@@ -13,6 +13,7 @@
13
13
 
14
14
  import superagent from 'superagent'
15
15
  import querystring from 'querystring'
16
+ import { readFileSync } from 'node:fs'
16
17
  import { URL } from 'node:url'
17
18
  import { RateLimitConfiguration } from '../../helper/RateLimitConfiguration.mjs'
18
19
  import { SuperagentRateLimiter } from '../../helper/SuperagentRateLimiter.mjs'
@@ -214,13 +215,16 @@ export class ApiClient {
214
215
  this.authentications = {
215
216
  }
216
217
 
218
+ const pkg = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url)))
219
+ const version = pkg.version ? pkg.version : 'undefined'
220
+
217
221
  /**
218
222
  * The default HTTP headers to be included for all API calls.
219
223
  * @type {Array<String>}
220
224
  * @default {}
221
225
  */
222
226
  this.defaultHeaders = {
223
- 'User-Agent': 'amazon-selling-partner-api-sdk/1.0.0/JavaScript'
227
+ 'User-Agent': `amazon-selling-partner-api-sdk/${version}/JavaScript`
224
228
  }
225
229
 
226
230
  /**
@@ -13,6 +13,7 @@
13
13
 
14
14
  import superagent from 'superagent'
15
15
  import querystring from 'querystring'
16
+ import { readFileSync } from 'node:fs'
16
17
  import { URL } from 'node:url'
17
18
  import { RateLimitConfiguration } from '../../helper/RateLimitConfiguration.mjs'
18
19
  import { SuperagentRateLimiter } from '../../helper/SuperagentRateLimiter.mjs'
@@ -214,13 +215,16 @@ export class ApiClient {
214
215
  this.authentications = {
215
216
  }
216
217
 
218
+ const pkg = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url)))
219
+ const version = pkg.version ? pkg.version : 'undefined'
220
+
217
221
  /**
218
222
  * The default HTTP headers to be included for all API calls.
219
223
  * @type {Array<String>}
220
224
  * @default {}
221
225
  */
222
226
  this.defaultHeaders = {
223
- 'User-Agent': 'amazon-selling-partner-api-sdk/1.0.0/JavaScript'
227
+ 'User-Agent': `amazon-selling-partner-api-sdk/${version}/JavaScript`
224
228
  }
225
229
 
226
230
  /**
@@ -13,6 +13,7 @@
13
13
 
14
14
  import superagent from 'superagent'
15
15
  import querystring from 'querystring'
16
+ import { readFileSync } from 'node:fs'
16
17
  import { URL } from 'node:url'
17
18
  import { RateLimitConfiguration } from '../../helper/RateLimitConfiguration.mjs'
18
19
  import { SuperagentRateLimiter } from '../../helper/SuperagentRateLimiter.mjs'
@@ -214,13 +215,16 @@ export class ApiClient {
214
215
  this.authentications = {
215
216
  }
216
217
 
218
+ const pkg = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url)))
219
+ const version = pkg.version ? pkg.version : 'undefined'
220
+
217
221
  /**
218
222
  * The default HTTP headers to be included for all API calls.
219
223
  * @type {Array<String>}
220
224
  * @default {}
221
225
  */
222
226
  this.defaultHeaders = {
223
- 'User-Agent': 'amazon-selling-partner-api-sdk/1.0.0/JavaScript'
227
+ 'User-Agent': `amazon-selling-partner-api-sdk/${version}/JavaScript`
224
228
  }
225
229
 
226
230
  /**
@@ -13,6 +13,7 @@
13
13
 
14
14
  import superagent from 'superagent'
15
15
  import querystring from 'querystring'
16
+ import { readFileSync } from 'node:fs'
16
17
  import { URL } from 'node:url'
17
18
  import { RateLimitConfiguration } from '../../helper/RateLimitConfiguration.mjs'
18
19
  import { SuperagentRateLimiter } from '../../helper/SuperagentRateLimiter.mjs'
@@ -214,13 +215,16 @@ export class ApiClient {
214
215
  this.authentications = {
215
216
  }
216
217
 
218
+ const pkg = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url)))
219
+ const version = pkg.version ? pkg.version : 'undefined'
220
+
217
221
  /**
218
222
  * The default HTTP headers to be included for all API calls.
219
223
  * @type {Array<String>}
220
224
  * @default {}
221
225
  */
222
226
  this.defaultHeaders = {
223
- 'User-Agent': 'amazon-selling-partner-api-sdk/1.0.0/JavaScript'
227
+ 'User-Agent': `amazon-selling-partner-api-sdk/${version}/JavaScript`
224
228
  }
225
229
 
226
230
  /**
@@ -13,6 +13,7 @@
13
13
 
14
14
  import superagent from 'superagent'
15
15
  import querystring from 'querystring'
16
+ import { readFileSync } from 'node:fs'
16
17
  import { URL } from 'node:url'
17
18
  import { RateLimitConfiguration } from '../../helper/RateLimitConfiguration.mjs'
18
19
  import { SuperagentRateLimiter } from '../../helper/SuperagentRateLimiter.mjs'
@@ -214,13 +215,16 @@ export class ApiClient {
214
215
  this.authentications = {
215
216
  }
216
217
 
218
+ const pkg = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url)))
219
+ const version = pkg.version ? pkg.version : 'undefined'
220
+
217
221
  /**
218
222
  * The default HTTP headers to be included for all API calls.
219
223
  * @type {Array<String>}
220
224
  * @default {}
221
225
  */
222
226
  this.defaultHeaders = {
223
- 'User-Agent': 'amazon-selling-partner-api-sdk/1.0.0/JavaScript'
227
+ 'User-Agent': `amazon-selling-partner-api-sdk/${version}/JavaScript`
224
228
  }
225
229
 
226
230
  /**