@commercelayer/sdk 5.28.0 → 5.29.0-alfa.1

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 (211) hide show
  1. package/lib/cjs/api.d.ts +3 -2
  2. package/lib/cjs/api.js +5 -2
  3. package/lib/cjs/client.js +5 -5
  4. package/lib/cjs/commercelayer.d.ts +3 -2
  5. package/lib/cjs/commercelayer.js +5 -4
  6. package/lib/cjs/common.js +1 -1
  7. package/lib/cjs/error.js +1 -2
  8. package/lib/cjs/model.d.ts +1 -0
  9. package/lib/cjs/query.d.ts +1 -1
  10. package/lib/cjs/query.js +1 -1
  11. package/lib/cjs/resource.js +22 -25
  12. package/lib/cjs/resources/adjustments.d.ts +3 -0
  13. package/lib/cjs/resources/adyen_gateways.d.ts +2 -2
  14. package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +4 -14
  15. package/lib/cjs/resources/buy_x_pay_y_promotions.js +4 -4
  16. package/lib/cjs/resources/external_gateways.d.ts +5 -1
  17. package/lib/cjs/resources/external_gateways.js +3 -0
  18. package/lib/cjs/resources/external_promotions.d.ts +8 -14
  19. package/lib/cjs/resources/external_promotions.js +7 -4
  20. package/lib/cjs/resources/external_tax_calculators.d.ts +4 -0
  21. package/lib/cjs/resources/external_tax_calculators.js +3 -0
  22. package/lib/cjs/resources/fixed_amount_promotions.d.ts +4 -14
  23. package/lib/cjs/resources/fixed_amount_promotions.js +4 -4
  24. package/lib/cjs/resources/fixed_price_promotions.d.ts +4 -14
  25. package/lib/cjs/resources/fixed_price_promotions.js +4 -4
  26. package/lib/cjs/resources/free_gift_promotions.d.ts +4 -14
  27. package/lib/cjs/resources/free_gift_promotions.js +4 -4
  28. package/lib/cjs/resources/free_shipping_promotions.d.ts +9 -14
  29. package/lib/cjs/resources/free_shipping_promotions.js +4 -4
  30. package/lib/cjs/resources/gift_cards.d.ts +3 -0
  31. package/lib/cjs/resources/line_items.d.ts +12 -4
  32. package/lib/cjs/resources/line_items.js +3 -0
  33. package/lib/cjs/resources/markets.d.ts +1 -1
  34. package/lib/cjs/resources/order_subscriptions.d.ts +1 -4
  35. package/lib/cjs/resources/orders.d.ts +14 -1
  36. package/lib/cjs/resources/orders.js +10 -0
  37. package/lib/cjs/resources/parcel_line_items.d.ts +0 -8
  38. package/lib/cjs/resources/payment_methods.d.ts +8 -5
  39. package/lib/cjs/resources/percentage_discount_promotions.d.ts +4 -14
  40. package/lib/cjs/resources/percentage_discount_promotions.js +4 -4
  41. package/lib/cjs/resources/promotions.d.ts +3 -3
  42. package/lib/cjs/resources/promotions.js +4 -4
  43. package/lib/cjs/resources/resource_errors.d.ts +22 -0
  44. package/lib/cjs/resources/resource_errors.js +16 -0
  45. package/lib/cjs/resources/shipments.d.ts +0 -4
  46. package/lib/cjs/resources/shipping_methods.d.ts +9 -5
  47. package/lib/cjs/resources/shipping_methods.js +3 -0
  48. package/lib/cjs/resources/stock_transfers.d.ts +1 -1
  49. package/lib/cjs/resources/stripe_payments.d.ts +4 -1
  50. package/lib/cjs/resources/webhooks.d.ts +3 -3
  51. package/lib/cjs/resources/webhooks.js +3 -3
  52. package/lib/esm/api.d.ts +3 -2
  53. package/lib/esm/api.js +2 -0
  54. package/lib/esm/client.js +19 -30
  55. package/lib/esm/commercelayer.d.ts +3 -2
  56. package/lib/esm/commercelayer.js +261 -149
  57. package/lib/esm/common.js +1 -1
  58. package/lib/esm/error.js +10 -5
  59. package/lib/esm/model.d.ts +1 -0
  60. package/lib/esm/query.d.ts +1 -1
  61. package/lib/esm/query.js +1 -1
  62. package/lib/esm/resource.js +37 -50
  63. package/lib/esm/resources/addresses.js +1 -1
  64. package/lib/esm/resources/adjustments.d.ts +3 -0
  65. package/lib/esm/resources/adjustments.js +1 -1
  66. package/lib/esm/resources/adyen_gateways.d.ts +2 -2
  67. package/lib/esm/resources/adyen_gateways.js +1 -1
  68. package/lib/esm/resources/adyen_payments.js +1 -1
  69. package/lib/esm/resources/application.js +1 -1
  70. package/lib/esm/resources/attachments.js +1 -1
  71. package/lib/esm/resources/authorizations.js +1 -1
  72. package/lib/esm/resources/avalara_accounts.js +1 -1
  73. package/lib/esm/resources/axerve_gateways.js +1 -1
  74. package/lib/esm/resources/axerve_payments.js +1 -1
  75. package/lib/esm/resources/billing_info_validation_rules.js +1 -1
  76. package/lib/esm/resources/bing_geocoders.js +1 -1
  77. package/lib/esm/resources/braintree_gateways.js +1 -1
  78. package/lib/esm/resources/braintree_payments.js +1 -1
  79. package/lib/esm/resources/bundles.js +1 -1
  80. package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +4 -14
  81. package/lib/esm/resources/buy_x_pay_y_promotions.js +5 -5
  82. package/lib/esm/resources/captures.js +1 -1
  83. package/lib/esm/resources/carrier_accounts.js +1 -1
  84. package/lib/esm/resources/checkout_com_gateways.js +1 -1
  85. package/lib/esm/resources/checkout_com_payments.js +1 -1
  86. package/lib/esm/resources/cleanups.js +1 -1
  87. package/lib/esm/resources/coupon_codes_promotion_rules.js +1 -1
  88. package/lib/esm/resources/coupon_recipients.js +1 -1
  89. package/lib/esm/resources/coupons.js +1 -1
  90. package/lib/esm/resources/custom_promotion_rules.js +1 -1
  91. package/lib/esm/resources/customer_addresses.js +1 -1
  92. package/lib/esm/resources/customer_groups.js +1 -1
  93. package/lib/esm/resources/customer_password_resets.js +1 -1
  94. package/lib/esm/resources/customer_payment_sources.js +1 -1
  95. package/lib/esm/resources/customer_subscriptions.js +1 -1
  96. package/lib/esm/resources/customers.js +1 -1
  97. package/lib/esm/resources/delivery_lead_times.js +1 -1
  98. package/lib/esm/resources/event_callbacks.js +1 -1
  99. package/lib/esm/resources/events.js +1 -1
  100. package/lib/esm/resources/exports.js +1 -1
  101. package/lib/esm/resources/external_gateways.d.ts +5 -1
  102. package/lib/esm/resources/external_gateways.js +4 -1
  103. package/lib/esm/resources/external_payments.js +1 -1
  104. package/lib/esm/resources/external_promotions.d.ts +8 -14
  105. package/lib/esm/resources/external_promotions.js +8 -5
  106. package/lib/esm/resources/external_tax_calculators.d.ts +4 -0
  107. package/lib/esm/resources/external_tax_calculators.js +4 -1
  108. package/lib/esm/resources/fixed_amount_promotions.d.ts +4 -14
  109. package/lib/esm/resources/fixed_amount_promotions.js +5 -5
  110. package/lib/esm/resources/fixed_price_promotions.d.ts +4 -14
  111. package/lib/esm/resources/fixed_price_promotions.js +5 -5
  112. package/lib/esm/resources/free_gift_promotions.d.ts +4 -14
  113. package/lib/esm/resources/free_gift_promotions.js +5 -5
  114. package/lib/esm/resources/free_shipping_promotions.d.ts +9 -14
  115. package/lib/esm/resources/free_shipping_promotions.js +5 -5
  116. package/lib/esm/resources/geocoders.js +1 -1
  117. package/lib/esm/resources/gift_card_recipients.js +1 -1
  118. package/lib/esm/resources/gift_cards.d.ts +3 -0
  119. package/lib/esm/resources/gift_cards.js +1 -1
  120. package/lib/esm/resources/google_geocoders.js +1 -1
  121. package/lib/esm/resources/imports.js +1 -1
  122. package/lib/esm/resources/in_stock_subscriptions.js +1 -1
  123. package/lib/esm/resources/inventory_models.js +1 -1
  124. package/lib/esm/resources/inventory_return_locations.js +1 -1
  125. package/lib/esm/resources/inventory_stock_locations.js +1 -1
  126. package/lib/esm/resources/klarna_gateways.js +1 -1
  127. package/lib/esm/resources/klarna_payments.js +1 -1
  128. package/lib/esm/resources/line_item_options.js +1 -1
  129. package/lib/esm/resources/line_items.d.ts +12 -4
  130. package/lib/esm/resources/line_items.js +4 -1
  131. package/lib/esm/resources/manual_gateways.js +1 -1
  132. package/lib/esm/resources/manual_tax_calculators.js +1 -1
  133. package/lib/esm/resources/markets.d.ts +1 -1
  134. package/lib/esm/resources/markets.js +1 -1
  135. package/lib/esm/resources/merchants.js +1 -1
  136. package/lib/esm/resources/order_amount_promotion_rules.js +1 -1
  137. package/lib/esm/resources/order_copies.js +1 -1
  138. package/lib/esm/resources/order_factories.js +1 -1
  139. package/lib/esm/resources/order_subscription_items.js +1 -1
  140. package/lib/esm/resources/order_subscriptions.d.ts +1 -4
  141. package/lib/esm/resources/order_subscriptions.js +1 -1
  142. package/lib/esm/resources/order_validation_rules.js +1 -1
  143. package/lib/esm/resources/orders.d.ts +14 -1
  144. package/lib/esm/resources/orders.js +11 -1
  145. package/lib/esm/resources/organization.js +1 -1
  146. package/lib/esm/resources/packages.js +1 -1
  147. package/lib/esm/resources/parcel_line_items.d.ts +0 -8
  148. package/lib/esm/resources/parcel_line_items.js +1 -1
  149. package/lib/esm/resources/parcels.js +1 -1
  150. package/lib/esm/resources/payment_gateways.js +1 -1
  151. package/lib/esm/resources/payment_methods.d.ts +8 -5
  152. package/lib/esm/resources/payment_methods.js +1 -1
  153. package/lib/esm/resources/payment_options.js +1 -1
  154. package/lib/esm/resources/paypal_gateways.js +1 -1
  155. package/lib/esm/resources/paypal_payments.js +1 -1
  156. package/lib/esm/resources/percentage_discount_promotions.d.ts +4 -14
  157. package/lib/esm/resources/percentage_discount_promotions.js +5 -5
  158. package/lib/esm/resources/price_frequency_tiers.js +1 -1
  159. package/lib/esm/resources/price_lists.js +1 -1
  160. package/lib/esm/resources/price_tiers.js +1 -1
  161. package/lib/esm/resources/price_volume_tiers.js +1 -1
  162. package/lib/esm/resources/prices.js +1 -1
  163. package/lib/esm/resources/promotion_rules.js +1 -1
  164. package/lib/esm/resources/promotions.d.ts +3 -3
  165. package/lib/esm/resources/promotions.js +5 -5
  166. package/lib/esm/resources/recurring_order_copies.js +1 -1
  167. package/lib/esm/resources/refunds.js +1 -1
  168. package/lib/esm/resources/reserved_stocks.js +1 -1
  169. package/lib/esm/resources/resource_errors.d.ts +22 -0
  170. package/lib/esm/resources/resource_errors.js +14 -0
  171. package/lib/esm/resources/return_line_items.js +1 -1
  172. package/lib/esm/resources/returns.js +1 -1
  173. package/lib/esm/resources/satispay_gateways.js +1 -1
  174. package/lib/esm/resources/satispay_payments.js +1 -1
  175. package/lib/esm/resources/shipments.d.ts +0 -4
  176. package/lib/esm/resources/shipments.js +1 -1
  177. package/lib/esm/resources/shipping_categories.js +1 -1
  178. package/lib/esm/resources/shipping_method_tiers.js +1 -1
  179. package/lib/esm/resources/shipping_methods.d.ts +9 -5
  180. package/lib/esm/resources/shipping_methods.js +4 -1
  181. package/lib/esm/resources/shipping_weight_tiers.js +1 -1
  182. package/lib/esm/resources/shipping_zones.js +1 -1
  183. package/lib/esm/resources/sku_list_items.js +1 -1
  184. package/lib/esm/resources/sku_list_promotion_rules.js +1 -1
  185. package/lib/esm/resources/sku_lists.js +1 -1
  186. package/lib/esm/resources/sku_options.js +1 -1
  187. package/lib/esm/resources/skus.js +1 -1
  188. package/lib/esm/resources/stock_items.js +1 -1
  189. package/lib/esm/resources/stock_line_items.js +1 -1
  190. package/lib/esm/resources/stock_locations.js +1 -1
  191. package/lib/esm/resources/stock_reservations.js +1 -1
  192. package/lib/esm/resources/stock_transfers.d.ts +1 -1
  193. package/lib/esm/resources/stock_transfers.js +1 -1
  194. package/lib/esm/resources/stripe_gateways.js +1 -1
  195. package/lib/esm/resources/stripe_payments.d.ts +4 -1
  196. package/lib/esm/resources/stripe_payments.js +1 -1
  197. package/lib/esm/resources/subscription_models.js +1 -1
  198. package/lib/esm/resources/tags.js +1 -1
  199. package/lib/esm/resources/tax_calculators.js +1 -1
  200. package/lib/esm/resources/tax_categories.js +1 -1
  201. package/lib/esm/resources/tax_rules.js +1 -1
  202. package/lib/esm/resources/taxjar_accounts.js +1 -1
  203. package/lib/esm/resources/transactions.js +1 -1
  204. package/lib/esm/resources/versions.js +1 -1
  205. package/lib/esm/resources/voids.js +1 -1
  206. package/lib/esm/resources/webhooks.d.ts +3 -3
  207. package/lib/esm/resources/webhooks.js +4 -4
  208. package/lib/esm/resources/wire_transfers.js +1 -1
  209. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  210. package/lib/tsconfig.tsbuildinfo +1 -1
  211. package/package.json +16 -16
package/lib/esm/client.js CHANGED
@@ -1,15 +1,3 @@
1
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
2
- if (kind === "m") throw new TypeError("Private method is not writable");
3
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
4
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
5
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
6
- };
7
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
- };
12
- var _ApiClient_accessToken, _ApiClient_client;
13
1
  import axios from 'axios';
14
2
  import { SdkError, handleError } from './error';
15
3
  import config from './config';
@@ -28,12 +16,14 @@ class ApiClient {
28
16
  throw new SdkError({ message: `Undefined '${attr}' parameter` });
29
17
  return new ApiClient(options);
30
18
  }
19
+ baseUrl;
20
+ #accessToken;
21
+ #client;
22
+ interceptors;
31
23
  constructor(options) {
32
- _ApiClient_accessToken.set(this, void 0);
33
- _ApiClient_client.set(this, void 0);
34
24
  debug('new client instance %O', options);
35
25
  this.baseUrl = baseURL(options.organization, options.domain);
36
- __classPrivateFieldSet(this, _ApiClient_accessToken, options.accessToken, "f");
26
+ this.#accessToken = options.accessToken;
37
27
  const axiosConfig = {
38
28
  timeout: options.timeout || config.client.timeout,
39
29
  proxy: options.proxy,
@@ -47,7 +37,7 @@ class ApiClient {
47
37
  ...customHeaders,
48
38
  'Accept': 'application/vnd.api+json',
49
39
  'Content-Type': 'application/vnd.api+json',
50
- 'Authorization': 'Bearer ' + __classPrivateFieldGet(this, _ApiClient_accessToken, "f")
40
+ 'Authorization': 'Bearer ' + this.#accessToken
51
41
  };
52
42
  // Set User-Agent
53
43
  let userAgent = options.userAgent; // || `SDK-core axios/${axios.VERSION}`
@@ -65,12 +55,12 @@ class ApiClient {
65
55
  if (options.adapter)
66
56
  axiosOptions.adapter = options.adapter;
67
57
  debug('axios options: %O', axiosOptions);
68
- __classPrivateFieldSet(this, _ApiClient_client, axios.create(axiosOptions), "f");
69
- this.interceptors = __classPrivateFieldGet(this, _ApiClient_client, "f").interceptors;
58
+ this.#client = axios.create(axiosOptions);
59
+ this.interceptors = this.#client.interceptors;
70
60
  }
71
61
  config(config) {
72
62
  debug('config %o', config);
73
- const def = __classPrivateFieldGet(this, _ApiClient_client, "f").defaults;
63
+ const def = this.#client.defaults;
74
64
  // Axios config
75
65
  if (config.timeout)
76
66
  def.timeout = config.timeout;
@@ -88,8 +78,8 @@ class ApiClient {
88
78
  if (config.organization)
89
79
  this.baseUrl = baseURL(config.organization, config.domain);
90
80
  if (config.accessToken) {
91
- __classPrivateFieldSet(this, _ApiClient_accessToken, config.accessToken, "f");
92
- def.headers.common.Authorization = 'Bearer ' + __classPrivateFieldGet(this, _ApiClient_accessToken, "f");
81
+ this.#accessToken = config.accessToken;
82
+ def.headers.common.Authorization = 'Bearer ' + this.#accessToken;
93
83
  }
94
84
  if (config.headers)
95
85
  def.headers.common = this.customHeaders(config.headers);
@@ -103,34 +93,34 @@ class ApiClient {
103
93
  if (axios.VERSION)
104
94
  ua += ` axios/${axios.VERSION}`;
105
95
  }
106
- __classPrivateFieldGet(this, _ApiClient_client, "f").defaults.headers['User-Agent'] = ua;
96
+ this.#client.defaults.headers['User-Agent'] = ua;
107
97
  }
108
98
  return this;
109
99
  }
110
100
  adapter(adapter) {
111
101
  if (adapter)
112
- __classPrivateFieldGet(this, _ApiClient_client, "f").defaults.adapter = adapter;
102
+ this.#client.defaults.adapter = adapter;
113
103
  return this;
114
104
  }
115
105
  async request(method, path, body, options) {
116
106
  debug('request %s %s, %O, %O', method, path, body || {}, options || {});
117
107
  // Ignored params alerts (in debug mode)
118
- if (options === null || options === void 0 ? void 0 : options.adapter)
108
+ if (options?.adapter)
119
109
  debug('Adapter ignored in request config');
120
- if (options === null || options === void 0 ? void 0 : options.userAgent)
110
+ if (options?.userAgent)
121
111
  debug('User-Agent header ignored in request config');
122
112
  const data = body ? { data: body } : undefined;
123
113
  const url = path;
124
114
  // Runtime request parameters
125
- const baseUrl = (options === null || options === void 0 ? void 0 : options.organization) ? baseURL(options.organization, options.domain) : undefined;
126
- const accessToken = (options === null || options === void 0 ? void 0 : options.accessToken) || __classPrivateFieldGet(this, _ApiClient_accessToken, "f");
127
- const headers = this.customHeaders(options === null || options === void 0 ? void 0 : options.headers);
115
+ const baseUrl = options?.organization ? baseURL(options.organization, options.domain) : undefined;
116
+ const accessToken = options?.accessToken || this.#accessToken;
117
+ const headers = this.customHeaders(options?.headers);
128
118
  if (accessToken)
129
119
  headers.Authorization = 'Bearer ' + accessToken;
130
120
  const requestParams = { method, baseURL: baseUrl, url, data, ...options, headers };
131
121
  debug('request params: %O', requestParams);
132
122
  // const start = Date.now()
133
- return __classPrivateFieldGet(this, _ApiClient_client, "f").request(requestParams)
123
+ return this.#client.request(requestParams)
134
124
  .then(response => response.data)
135
125
  .catch((error) => handleError(error));
136
126
  // .finally(() => console.log(`<<-- ${method} ${path} ${Date.now() - start}`))
@@ -145,5 +135,4 @@ class ApiClient {
145
135
  return customHeaders;
146
136
  }
147
137
  }
148
- _ApiClient_accessToken = new WeakMap(), _ApiClient_client = new WeakMap();
149
138
  export default ApiClient;
@@ -2,14 +2,14 @@ import * as api from './api';
2
2
  import type { ApiError } from './error';
3
3
  import type { ErrorInterceptor, InterceptorType, RawResponseReader, RequestInterceptor, ResponseInterceptor } from './interceptor';
4
4
  import { type ResourcesInitConfig } from './resource';
5
- declare const OPEN_API_SCHEMA_VERSION = "4.24.0";
5
+ declare const OPEN_API_SCHEMA_VERSION = "5.0.0";
6
6
  export { OPEN_API_SCHEMA_VERSION };
7
7
  type SdkConfig = {};
8
8
  type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
9
9
  type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
10
10
  declare class CommerceLayerClient {
11
11
  #private;
12
- readonly openApiSchemaVersion = "4.24.0";
12
+ readonly openApiSchemaVersion = "5.0.0";
13
13
  addresses: api.Addresses;
14
14
  adjustments: api.Adjustments;
15
15
  adyen_gateways: api.AdyenGateways;
@@ -97,6 +97,7 @@ declare class CommerceLayerClient {
97
97
  recurring_order_copies: api.RecurringOrderCopies;
98
98
  refunds: api.Refunds;
99
99
  reserved_stocks: api.ReservedStocks;
100
+ resource_errors: api.ResourceErrors;
100
101
  return_line_items: api.ReturnLineItems;
101
102
  returns: api.Returns;
102
103
  satispay_gateways: api.SatispayGateways;
@@ -1,164 +1,277 @@
1
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
2
- if (kind === "m") throw new TypeError("Private method is not writable");
3
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
4
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
5
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
6
- };
7
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
- };
12
- var _CommerceLayerClient_adapter, _CommerceLayerClient_organization;
13
1
  import * as api from './api';
14
2
  import { CommerceLayerStatic } from './static';
15
3
  import ResourceAdapter from './resource';
16
4
  import Debug from './debug';
17
5
  const debug = Debug('commercelayer');
18
6
  // Autogenerated schema version number, do not remove this line
19
- const OPEN_API_SCHEMA_VERSION = '4.24.0';
7
+ const OPEN_API_SCHEMA_VERSION = '5.0.0';
20
8
  export { OPEN_API_SCHEMA_VERSION };
21
9
  class CommerceLayerClient {
10
+ // static get openApiSchemaVersion(): string { return OPEN_API_SCHEMA_VERSION }
11
+ openApiSchemaVersion = OPEN_API_SCHEMA_VERSION;
12
+ #adapter;
13
+ #organization;
14
+ // #environment: ApiMode = sdkConfig.default.environment
15
+ // ##__CL_RESOURCES_DEF_START__##
16
+ // ##__CL_RESOURCES_DEF_TEMPLATE:: ##__TAB__####__RESOURCE_TYPE__##: api.##__RESOURCE_CLASS__##
17
+ addresses;
18
+ adjustments;
19
+ adyen_gateways;
20
+ adyen_payments;
21
+ application;
22
+ attachments;
23
+ authorizations;
24
+ avalara_accounts;
25
+ axerve_gateways;
26
+ axerve_payments;
27
+ billing_info_validation_rules;
28
+ bing_geocoders;
29
+ braintree_gateways;
30
+ braintree_payments;
31
+ bundles;
32
+ buy_x_pay_y_promotions;
33
+ captures;
34
+ carrier_accounts;
35
+ checkout_com_gateways;
36
+ checkout_com_payments;
37
+ cleanups;
38
+ coupon_codes_promotion_rules;
39
+ coupon_recipients;
40
+ coupons;
41
+ custom_promotion_rules;
42
+ customer_addresses;
43
+ customer_groups;
44
+ customer_password_resets;
45
+ customer_payment_sources;
46
+ customer_subscriptions;
47
+ customers;
48
+ delivery_lead_times;
49
+ event_callbacks;
50
+ events;
51
+ exports;
52
+ external_gateways;
53
+ external_payments;
54
+ external_promotions;
55
+ external_tax_calculators;
56
+ fixed_amount_promotions;
57
+ fixed_price_promotions;
58
+ free_gift_promotions;
59
+ free_shipping_promotions;
60
+ geocoders;
61
+ gift_card_recipients;
62
+ gift_cards;
63
+ google_geocoders;
64
+ imports;
65
+ in_stock_subscriptions;
66
+ inventory_models;
67
+ inventory_return_locations;
68
+ inventory_stock_locations;
69
+ klarna_gateways;
70
+ klarna_payments;
71
+ line_item_options;
72
+ line_items;
73
+ manual_gateways;
74
+ manual_tax_calculators;
75
+ markets;
76
+ merchants;
77
+ order_amount_promotion_rules;
78
+ order_copies;
79
+ order_factories;
80
+ order_subscription_items;
81
+ order_subscriptions;
82
+ order_validation_rules;
83
+ orders;
84
+ organization;
85
+ packages;
86
+ parcel_line_items;
87
+ parcels;
88
+ payment_gateways;
89
+ payment_methods;
90
+ payment_options;
91
+ paypal_gateways;
92
+ paypal_payments;
93
+ percentage_discount_promotions;
94
+ price_frequency_tiers;
95
+ price_lists;
96
+ price_tiers;
97
+ price_volume_tiers;
98
+ prices;
99
+ promotion_rules;
100
+ promotions;
101
+ recurring_order_copies;
102
+ refunds;
103
+ reserved_stocks;
104
+ resource_errors;
105
+ return_line_items;
106
+ returns;
107
+ satispay_gateways;
108
+ satispay_payments;
109
+ shipments;
110
+ shipping_categories;
111
+ shipping_method_tiers;
112
+ shipping_methods;
113
+ shipping_weight_tiers;
114
+ shipping_zones;
115
+ sku_list_items;
116
+ sku_list_promotion_rules;
117
+ sku_lists;
118
+ sku_options;
119
+ skus;
120
+ stock_items;
121
+ stock_line_items;
122
+ stock_locations;
123
+ stock_reservations;
124
+ stock_transfers;
125
+ stripe_gateways;
126
+ stripe_payments;
127
+ subscription_models;
128
+ tags;
129
+ tax_calculators;
130
+ tax_categories;
131
+ tax_rules;
132
+ taxjar_accounts;
133
+ transactions;
134
+ versions;
135
+ voids;
136
+ webhooks;
137
+ wire_transfers;
22
138
  // ##__CL_RESOURCES_DEF_STOP__##
23
139
  constructor(config) {
24
- // static get openApiSchemaVersion(): string { return OPEN_API_SCHEMA_VERSION }
25
- this.openApiSchemaVersion = OPEN_API_SCHEMA_VERSION;
26
- _CommerceLayerClient_adapter.set(this, void 0);
27
- _CommerceLayerClient_organization.set(this, void 0);
28
140
  debug('new commercelayer instance %O', config);
29
- __classPrivateFieldSet(this, _CommerceLayerClient_adapter, new ResourceAdapter(config), "f");
30
- __classPrivateFieldSet(this, _CommerceLayerClient_organization, config.organization, "f");
141
+ this.#adapter = new ResourceAdapter(config);
142
+ this.#organization = config.organization;
31
143
  // this.#environment = 'test'
32
144
  // ##__CL_RESOURCES_INIT_START__##
33
145
  // ##__CL_RESOURCES_INIT_TEMPLATE:: ##__TAB__####__TAB__##this.##__RESOURCE_TYPE__## = new api.##__RESOURCE_CLASS__##(this.#adapter)
34
- this.addresses = new api.Addresses(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
35
- this.adjustments = new api.Adjustments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
36
- this.adyen_gateways = new api.AdyenGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
37
- this.adyen_payments = new api.AdyenPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
38
- this.application = new api.Applications(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
39
- this.attachments = new api.Attachments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
40
- this.authorizations = new api.Authorizations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
41
- this.avalara_accounts = new api.AvalaraAccounts(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
42
- this.axerve_gateways = new api.AxerveGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
43
- this.axerve_payments = new api.AxervePayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
44
- this.billing_info_validation_rules = new api.BillingInfoValidationRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
45
- this.bing_geocoders = new api.BingGeocoders(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
46
- this.braintree_gateways = new api.BraintreeGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
47
- this.braintree_payments = new api.BraintreePayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
48
- this.bundles = new api.Bundles(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
49
- this.buy_x_pay_y_promotions = new api.BuyXPayYPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
50
- this.captures = new api.Captures(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
51
- this.carrier_accounts = new api.CarrierAccounts(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
52
- this.checkout_com_gateways = new api.CheckoutComGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
53
- this.checkout_com_payments = new api.CheckoutComPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
54
- this.cleanups = new api.Cleanups(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
55
- this.coupon_codes_promotion_rules = new api.CouponCodesPromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
56
- this.coupon_recipients = new api.CouponRecipients(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
57
- this.coupons = new api.Coupons(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
58
- this.custom_promotion_rules = new api.CustomPromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
59
- this.customer_addresses = new api.CustomerAddresses(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
60
- this.customer_groups = new api.CustomerGroups(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
61
- this.customer_password_resets = new api.CustomerPasswordResets(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
62
- this.customer_payment_sources = new api.CustomerPaymentSources(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
63
- this.customer_subscriptions = new api.CustomerSubscriptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
64
- this.customers = new api.Customers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
65
- this.delivery_lead_times = new api.DeliveryLeadTimes(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
66
- this.event_callbacks = new api.EventCallbacks(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
67
- this.events = new api.Events(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
68
- this.exports = new api.Exports(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
69
- this.external_gateways = new api.ExternalGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
70
- this.external_payments = new api.ExternalPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
71
- this.external_promotions = new api.ExternalPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
72
- this.external_tax_calculators = new api.ExternalTaxCalculators(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
73
- this.fixed_amount_promotions = new api.FixedAmountPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
74
- this.fixed_price_promotions = new api.FixedPricePromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
75
- this.free_gift_promotions = new api.FreeGiftPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
76
- this.free_shipping_promotions = new api.FreeShippingPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
77
- this.geocoders = new api.Geocoders(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
78
- this.gift_card_recipients = new api.GiftCardRecipients(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
79
- this.gift_cards = new api.GiftCards(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
80
- this.google_geocoders = new api.GoogleGeocoders(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
81
- this.imports = new api.Imports(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
82
- this.in_stock_subscriptions = new api.InStockSubscriptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
83
- this.inventory_models = new api.InventoryModels(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
84
- this.inventory_return_locations = new api.InventoryReturnLocations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
85
- this.inventory_stock_locations = new api.InventoryStockLocations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
86
- this.klarna_gateways = new api.KlarnaGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
87
- this.klarna_payments = new api.KlarnaPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
88
- this.line_item_options = new api.LineItemOptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
89
- this.line_items = new api.LineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
90
- this.manual_gateways = new api.ManualGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
91
- this.manual_tax_calculators = new api.ManualTaxCalculators(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
92
- this.markets = new api.Markets(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
93
- this.merchants = new api.Merchants(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
94
- this.order_amount_promotion_rules = new api.OrderAmountPromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
95
- this.order_copies = new api.OrderCopies(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
96
- this.order_factories = new api.OrderFactories(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
97
- this.order_subscription_items = new api.OrderSubscriptionItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
98
- this.order_subscriptions = new api.OrderSubscriptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
99
- this.order_validation_rules = new api.OrderValidationRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
100
- this.orders = new api.Orders(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
101
- this.organization = new api.Organizations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
102
- this.packages = new api.Packages(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
103
- this.parcel_line_items = new api.ParcelLineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
104
- this.parcels = new api.Parcels(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
105
- this.payment_gateways = new api.PaymentGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
106
- this.payment_methods = new api.PaymentMethods(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
107
- this.payment_options = new api.PaymentOptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
108
- this.paypal_gateways = new api.PaypalGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
109
- this.paypal_payments = new api.PaypalPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
110
- this.percentage_discount_promotions = new api.PercentageDiscountPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
111
- this.price_frequency_tiers = new api.PriceFrequencyTiers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
112
- this.price_lists = new api.PriceLists(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
113
- this.price_tiers = new api.PriceTiers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
114
- this.price_volume_tiers = new api.PriceVolumeTiers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
115
- this.prices = new api.Prices(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
116
- this.promotion_rules = new api.PromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
117
- this.promotions = new api.Promotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
118
- this.recurring_order_copies = new api.RecurringOrderCopies(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
119
- this.refunds = new api.Refunds(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
120
- this.reserved_stocks = new api.ReservedStocks(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
121
- this.return_line_items = new api.ReturnLineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
122
- this.returns = new api.Returns(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
123
- this.satispay_gateways = new api.SatispayGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
124
- this.satispay_payments = new api.SatispayPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
125
- this.shipments = new api.Shipments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
126
- this.shipping_categories = new api.ShippingCategories(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
127
- this.shipping_method_tiers = new api.ShippingMethodTiers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
128
- this.shipping_methods = new api.ShippingMethods(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
129
- this.shipping_weight_tiers = new api.ShippingWeightTiers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
130
- this.shipping_zones = new api.ShippingZones(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
131
- this.sku_list_items = new api.SkuListItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
132
- this.sku_list_promotion_rules = new api.SkuListPromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
133
- this.sku_lists = new api.SkuLists(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
134
- this.sku_options = new api.SkuOptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
135
- this.skus = new api.Skus(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
136
- this.stock_items = new api.StockItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
137
- this.stock_line_items = new api.StockLineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
138
- this.stock_locations = new api.StockLocations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
139
- this.stock_reservations = new api.StockReservations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
140
- this.stock_transfers = new api.StockTransfers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
141
- this.stripe_gateways = new api.StripeGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
142
- this.stripe_payments = new api.StripePayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
143
- this.subscription_models = new api.SubscriptionModels(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
144
- this.tags = new api.Tags(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
145
- this.tax_calculators = new api.TaxCalculators(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
146
- this.tax_categories = new api.TaxCategories(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
147
- this.tax_rules = new api.TaxRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
148
- this.taxjar_accounts = new api.TaxjarAccounts(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
149
- this.transactions = new api.Transactions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
150
- this.versions = new api.Versions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
151
- this.voids = new api.Voids(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
152
- this.webhooks = new api.Webhooks(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
153
- this.wire_transfers = new api.WireTransfers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
146
+ this.addresses = new api.Addresses(this.#adapter);
147
+ this.adjustments = new api.Adjustments(this.#adapter);
148
+ this.adyen_gateways = new api.AdyenGateways(this.#adapter);
149
+ this.adyen_payments = new api.AdyenPayments(this.#adapter);
150
+ this.application = new api.Applications(this.#adapter);
151
+ this.attachments = new api.Attachments(this.#adapter);
152
+ this.authorizations = new api.Authorizations(this.#adapter);
153
+ this.avalara_accounts = new api.AvalaraAccounts(this.#adapter);
154
+ this.axerve_gateways = new api.AxerveGateways(this.#adapter);
155
+ this.axerve_payments = new api.AxervePayments(this.#adapter);
156
+ this.billing_info_validation_rules = new api.BillingInfoValidationRules(this.#adapter);
157
+ this.bing_geocoders = new api.BingGeocoders(this.#adapter);
158
+ this.braintree_gateways = new api.BraintreeGateways(this.#adapter);
159
+ this.braintree_payments = new api.BraintreePayments(this.#adapter);
160
+ this.bundles = new api.Bundles(this.#adapter);
161
+ this.buy_x_pay_y_promotions = new api.BuyXPayYPromotions(this.#adapter);
162
+ this.captures = new api.Captures(this.#adapter);
163
+ this.carrier_accounts = new api.CarrierAccounts(this.#adapter);
164
+ this.checkout_com_gateways = new api.CheckoutComGateways(this.#adapter);
165
+ this.checkout_com_payments = new api.CheckoutComPayments(this.#adapter);
166
+ this.cleanups = new api.Cleanups(this.#adapter);
167
+ this.coupon_codes_promotion_rules = new api.CouponCodesPromotionRules(this.#adapter);
168
+ this.coupon_recipients = new api.CouponRecipients(this.#adapter);
169
+ this.coupons = new api.Coupons(this.#adapter);
170
+ this.custom_promotion_rules = new api.CustomPromotionRules(this.#adapter);
171
+ this.customer_addresses = new api.CustomerAddresses(this.#adapter);
172
+ this.customer_groups = new api.CustomerGroups(this.#adapter);
173
+ this.customer_password_resets = new api.CustomerPasswordResets(this.#adapter);
174
+ this.customer_payment_sources = new api.CustomerPaymentSources(this.#adapter);
175
+ this.customer_subscriptions = new api.CustomerSubscriptions(this.#adapter);
176
+ this.customers = new api.Customers(this.#adapter);
177
+ this.delivery_lead_times = new api.DeliveryLeadTimes(this.#adapter);
178
+ this.event_callbacks = new api.EventCallbacks(this.#adapter);
179
+ this.events = new api.Events(this.#adapter);
180
+ this.exports = new api.Exports(this.#adapter);
181
+ this.external_gateways = new api.ExternalGateways(this.#adapter);
182
+ this.external_payments = new api.ExternalPayments(this.#adapter);
183
+ this.external_promotions = new api.ExternalPromotions(this.#adapter);
184
+ this.external_tax_calculators = new api.ExternalTaxCalculators(this.#adapter);
185
+ this.fixed_amount_promotions = new api.FixedAmountPromotions(this.#adapter);
186
+ this.fixed_price_promotions = new api.FixedPricePromotions(this.#adapter);
187
+ this.free_gift_promotions = new api.FreeGiftPromotions(this.#adapter);
188
+ this.free_shipping_promotions = new api.FreeShippingPromotions(this.#adapter);
189
+ this.geocoders = new api.Geocoders(this.#adapter);
190
+ this.gift_card_recipients = new api.GiftCardRecipients(this.#adapter);
191
+ this.gift_cards = new api.GiftCards(this.#adapter);
192
+ this.google_geocoders = new api.GoogleGeocoders(this.#adapter);
193
+ this.imports = new api.Imports(this.#adapter);
194
+ this.in_stock_subscriptions = new api.InStockSubscriptions(this.#adapter);
195
+ this.inventory_models = new api.InventoryModels(this.#adapter);
196
+ this.inventory_return_locations = new api.InventoryReturnLocations(this.#adapter);
197
+ this.inventory_stock_locations = new api.InventoryStockLocations(this.#adapter);
198
+ this.klarna_gateways = new api.KlarnaGateways(this.#adapter);
199
+ this.klarna_payments = new api.KlarnaPayments(this.#adapter);
200
+ this.line_item_options = new api.LineItemOptions(this.#adapter);
201
+ this.line_items = new api.LineItems(this.#adapter);
202
+ this.manual_gateways = new api.ManualGateways(this.#adapter);
203
+ this.manual_tax_calculators = new api.ManualTaxCalculators(this.#adapter);
204
+ this.markets = new api.Markets(this.#adapter);
205
+ this.merchants = new api.Merchants(this.#adapter);
206
+ this.order_amount_promotion_rules = new api.OrderAmountPromotionRules(this.#adapter);
207
+ this.order_copies = new api.OrderCopies(this.#adapter);
208
+ this.order_factories = new api.OrderFactories(this.#adapter);
209
+ this.order_subscription_items = new api.OrderSubscriptionItems(this.#adapter);
210
+ this.order_subscriptions = new api.OrderSubscriptions(this.#adapter);
211
+ this.order_validation_rules = new api.OrderValidationRules(this.#adapter);
212
+ this.orders = new api.Orders(this.#adapter);
213
+ this.organization = new api.Organizations(this.#adapter);
214
+ this.packages = new api.Packages(this.#adapter);
215
+ this.parcel_line_items = new api.ParcelLineItems(this.#adapter);
216
+ this.parcels = new api.Parcels(this.#adapter);
217
+ this.payment_gateways = new api.PaymentGateways(this.#adapter);
218
+ this.payment_methods = new api.PaymentMethods(this.#adapter);
219
+ this.payment_options = new api.PaymentOptions(this.#adapter);
220
+ this.paypal_gateways = new api.PaypalGateways(this.#adapter);
221
+ this.paypal_payments = new api.PaypalPayments(this.#adapter);
222
+ this.percentage_discount_promotions = new api.PercentageDiscountPromotions(this.#adapter);
223
+ this.price_frequency_tiers = new api.PriceFrequencyTiers(this.#adapter);
224
+ this.price_lists = new api.PriceLists(this.#adapter);
225
+ this.price_tiers = new api.PriceTiers(this.#adapter);
226
+ this.price_volume_tiers = new api.PriceVolumeTiers(this.#adapter);
227
+ this.prices = new api.Prices(this.#adapter);
228
+ this.promotion_rules = new api.PromotionRules(this.#adapter);
229
+ this.promotions = new api.Promotions(this.#adapter);
230
+ this.recurring_order_copies = new api.RecurringOrderCopies(this.#adapter);
231
+ this.refunds = new api.Refunds(this.#adapter);
232
+ this.reserved_stocks = new api.ReservedStocks(this.#adapter);
233
+ this.resource_errors = new api.ResourceErrors(this.#adapter);
234
+ this.return_line_items = new api.ReturnLineItems(this.#adapter);
235
+ this.returns = new api.Returns(this.#adapter);
236
+ this.satispay_gateways = new api.SatispayGateways(this.#adapter);
237
+ this.satispay_payments = new api.SatispayPayments(this.#adapter);
238
+ this.shipments = new api.Shipments(this.#adapter);
239
+ this.shipping_categories = new api.ShippingCategories(this.#adapter);
240
+ this.shipping_method_tiers = new api.ShippingMethodTiers(this.#adapter);
241
+ this.shipping_methods = new api.ShippingMethods(this.#adapter);
242
+ this.shipping_weight_tiers = new api.ShippingWeightTiers(this.#adapter);
243
+ this.shipping_zones = new api.ShippingZones(this.#adapter);
244
+ this.sku_list_items = new api.SkuListItems(this.#adapter);
245
+ this.sku_list_promotion_rules = new api.SkuListPromotionRules(this.#adapter);
246
+ this.sku_lists = new api.SkuLists(this.#adapter);
247
+ this.sku_options = new api.SkuOptions(this.#adapter);
248
+ this.skus = new api.Skus(this.#adapter);
249
+ this.stock_items = new api.StockItems(this.#adapter);
250
+ this.stock_line_items = new api.StockLineItems(this.#adapter);
251
+ this.stock_locations = new api.StockLocations(this.#adapter);
252
+ this.stock_reservations = new api.StockReservations(this.#adapter);
253
+ this.stock_transfers = new api.StockTransfers(this.#adapter);
254
+ this.stripe_gateways = new api.StripeGateways(this.#adapter);
255
+ this.stripe_payments = new api.StripePayments(this.#adapter);
256
+ this.subscription_models = new api.SubscriptionModels(this.#adapter);
257
+ this.tags = new api.Tags(this.#adapter);
258
+ this.tax_calculators = new api.TaxCalculators(this.#adapter);
259
+ this.tax_categories = new api.TaxCategories(this.#adapter);
260
+ this.tax_rules = new api.TaxRules(this.#adapter);
261
+ this.taxjar_accounts = new api.TaxjarAccounts(this.#adapter);
262
+ this.transactions = new api.Transactions(this.#adapter);
263
+ this.versions = new api.Versions(this.#adapter);
264
+ this.voids = new api.Voids(this.#adapter);
265
+ this.webhooks = new api.Webhooks(this.#adapter);
266
+ this.wire_transfers = new api.WireTransfers(this.#adapter);
154
267
  // ##__CL_RESOURCES_INIT_STOP__##
155
268
  }
156
- get currentOrganization() { return __classPrivateFieldGet(this, _CommerceLayerClient_organization, "f"); }
269
+ get currentOrganization() { return this.#organization; }
157
270
  // get currentAccessToken(): string { return this.#adapter?.clientInstance?.currentAccessToken}
158
271
  // get environment(): ApiMode { return this.#environment }
159
272
  localConfig(config) {
160
273
  if (config.organization)
161
- __classPrivateFieldSet(this, _CommerceLayerClient_organization, config.organization, "f");
274
+ this.#organization = config.organization;
162
275
  }
163
276
  config(config) {
164
277
  debug('config %o', config);
@@ -168,7 +281,7 @@ class CommerceLayerClient {
168
281
  // To rebuild baseUrl in client in case only the domain is defined
169
282
  if (!config.organization)
170
283
  config.organization = this.currentOrganization;
171
- __classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f").config(config);
284
+ this.#adapter.config(config);
172
285
  return this;
173
286
  }
174
287
  resources() {
@@ -185,13 +298,13 @@ class CommerceLayerClient {
185
298
  return CommerceLayerStatic.isApiError(error);
186
299
  }
187
300
  addRequestInterceptor(onFulfilled, onRejected) {
188
- return __classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f").interceptors.request.use(onFulfilled, onRejected);
301
+ return this.#adapter.interceptors.request.use(onFulfilled, onRejected);
189
302
  }
190
303
  addResponseInterceptor(onFulfilled, onRejected) {
191
- return __classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f").interceptors.response.use(onFulfilled, onRejected);
304
+ return this.#adapter.interceptors.response.use(onFulfilled, onRejected);
192
305
  }
193
306
  removeInterceptor(type, id) {
194
- __classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f").interceptors[type].eject(id);
307
+ this.#adapter.interceptors[type].eject(id);
195
308
  }
196
309
  addRawResponseReader(options) {
197
310
  const reader = {
@@ -200,8 +313,8 @@ class CommerceLayerClient {
200
313
  headers: undefined,
201
314
  };
202
315
  function rawResponseInterceptor(response) {
203
- reader.rawResponse = response === null || response === void 0 ? void 0 : response.data;
204
- if (options === null || options === void 0 ? void 0 : options.headers)
316
+ reader.rawResponse = response?.data;
317
+ if (options?.headers)
205
318
  reader.headers = response.headers;
206
319
  return response;
207
320
  }
@@ -210,12 +323,11 @@ class CommerceLayerClient {
210
323
  return reader;
211
324
  }
212
325
  removeRawResponseReader(reader) {
213
- const id = (typeof reader === 'number') ? reader : reader === null || reader === void 0 ? void 0 : reader.id;
326
+ const id = (typeof reader === 'number') ? reader : reader?.id;
214
327
  if (id && (id >= 0))
215
328
  this.removeInterceptor('response', id);
216
329
  }
217
330
  }
218
- _CommerceLayerClient_adapter = new WeakMap(), _CommerceLayerClient_organization = new WeakMap();
219
331
  const CommerceLayer = (config) => {
220
332
  return new CommerceLayerClient(config);
221
333
  };