@commercelayer/sdk 7.0.0-beta.17 → 7.0.0-beta.18

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 (297) hide show
  1. package/lib/api.cjs +7460 -792
  2. package/lib/api.js +7331 -132
  3. package/lib/client.cjs +253 -78
  4. package/lib/client.js +252 -72
  5. package/lib/commercelayer.cjs +777 -31
  6. package/lib/commercelayer.js +773 -23
  7. package/lib/common.cjs +143 -7
  8. package/lib/common.js +141 -5
  9. package/lib/config.cjs +2 -3
  10. package/lib/config.js +2 -3
  11. package/lib/debug.cjs +12 -6
  12. package/lib/debug.js +12 -6
  13. package/lib/enum.cjs +9 -10
  14. package/lib/enum.js +9 -10
  15. package/lib/error.cjs +75 -26
  16. package/lib/error.js +74 -25
  17. package/lib/fetch.cjs +85 -33
  18. package/lib/fetch.js +87 -31
  19. package/lib/index.cjs +8104 -23
  20. package/lib/index.d.cts +1 -1
  21. package/lib/index.d.ts +1 -1
  22. package/lib/index.js +7977 -4
  23. package/lib/jsonapi.cjs +188 -21
  24. package/lib/jsonapi.js +186 -14
  25. package/lib/query.cjs +75 -17
  26. package/lib/query.js +77 -15
  27. package/lib/resource.cjs +660 -71
  28. package/lib/resource.js +646 -51
  29. package/lib/resources/addresses.cjs +794 -6
  30. package/lib/resources/addresses.js +794 -6
  31. package/lib/resources/adjustments.cjs +794 -6
  32. package/lib/resources/adjustments.js +794 -6
  33. package/lib/resources/adyen_gateways.cjs +794 -6
  34. package/lib/resources/adyen_gateways.js +794 -6
  35. package/lib/resources/adyen_payments.cjs +794 -6
  36. package/lib/resources/adyen_payments.js +794 -6
  37. package/lib/resources/applications.cjs +786 -6
  38. package/lib/resources/applications.js +786 -6
  39. package/lib/resources/attachments.cjs +794 -6
  40. package/lib/resources/attachments.js +794 -6
  41. package/lib/resources/authorizations.cjs +794 -6
  42. package/lib/resources/authorizations.js +794 -6
  43. package/lib/resources/avalara_accounts.cjs +794 -6
  44. package/lib/resources/avalara_accounts.js +794 -6
  45. package/lib/resources/axerve_gateways.cjs +794 -6
  46. package/lib/resources/axerve_gateways.js +794 -6
  47. package/lib/resources/axerve_payments.cjs +794 -6
  48. package/lib/resources/axerve_payments.js +794 -6
  49. package/lib/resources/bing_geocoders.cjs +794 -6
  50. package/lib/resources/bing_geocoders.js +794 -6
  51. package/lib/resources/braintree_gateways.cjs +794 -6
  52. package/lib/resources/braintree_gateways.js +794 -6
  53. package/lib/resources/braintree_payments.cjs +794 -6
  54. package/lib/resources/braintree_payments.js +794 -6
  55. package/lib/resources/bundles.cjs +794 -6
  56. package/lib/resources/bundles.js +794 -6
  57. package/lib/resources/buy_x_pay_y_promotions.cjs +794 -6
  58. package/lib/resources/buy_x_pay_y_promotions.js +794 -6
  59. package/lib/resources/captures.cjs +794 -6
  60. package/lib/resources/captures.js +794 -6
  61. package/lib/resources/carrier_accounts.cjs +794 -6
  62. package/lib/resources/carrier_accounts.js +794 -6
  63. package/lib/resources/checkout_com_gateways.cjs +794 -6
  64. package/lib/resources/checkout_com_gateways.js +794 -6
  65. package/lib/resources/checkout_com_payments.cjs +794 -6
  66. package/lib/resources/checkout_com_payments.js +794 -6
  67. package/lib/resources/cleanups.cjs +794 -6
  68. package/lib/resources/cleanups.js +794 -6
  69. package/lib/resources/coupon_codes_promotion_rules.cjs +794 -6
  70. package/lib/resources/coupon_codes_promotion_rules.js +794 -6
  71. package/lib/resources/coupon_recipients.cjs +794 -6
  72. package/lib/resources/coupon_recipients.js +794 -6
  73. package/lib/resources/coupons.cjs +794 -6
  74. package/lib/resources/coupons.js +794 -6
  75. package/lib/resources/custom_promotion_rules.cjs +794 -6
  76. package/lib/resources/custom_promotion_rules.js +794 -6
  77. package/lib/resources/customer_addresses.cjs +794 -6
  78. package/lib/resources/customer_addresses.js +794 -6
  79. package/lib/resources/customer_groups.cjs +794 -6
  80. package/lib/resources/customer_groups.js +794 -6
  81. package/lib/resources/customer_password_resets.cjs +794 -6
  82. package/lib/resources/customer_password_resets.js +794 -6
  83. package/lib/resources/customer_payment_sources.cjs +794 -6
  84. package/lib/resources/customer_payment_sources.js +794 -6
  85. package/lib/resources/customer_subscriptions.cjs +794 -6
  86. package/lib/resources/customer_subscriptions.js +794 -6
  87. package/lib/resources/customers.cjs +794 -6
  88. package/lib/resources/customers.js +794 -6
  89. package/lib/resources/delivery_lead_times.cjs +794 -6
  90. package/lib/resources/delivery_lead_times.js +794 -6
  91. package/lib/resources/discount_engine_items.cjs +794 -6
  92. package/lib/resources/discount_engine_items.js +794 -6
  93. package/lib/resources/discount_engines.cjs +794 -6
  94. package/lib/resources/discount_engines.js +794 -6
  95. package/lib/resources/easypost_pickups.cjs +794 -6
  96. package/lib/resources/easypost_pickups.js +794 -6
  97. package/lib/resources/event_callbacks.cjs +794 -6
  98. package/lib/resources/event_callbacks.js +794 -6
  99. package/lib/resources/events.cjs +794 -6
  100. package/lib/resources/events.js +794 -6
  101. package/lib/resources/exports.cjs +794 -6
  102. package/lib/resources/exports.js +794 -6
  103. package/lib/resources/external_gateways.cjs +794 -6
  104. package/lib/resources/external_gateways.js +794 -6
  105. package/lib/resources/external_payments.cjs +794 -6
  106. package/lib/resources/external_payments.js +794 -6
  107. package/lib/resources/external_promotions.cjs +794 -6
  108. package/lib/resources/external_promotions.js +794 -6
  109. package/lib/resources/external_tax_calculators.cjs +794 -6
  110. package/lib/resources/external_tax_calculators.js +794 -6
  111. package/lib/resources/fixed_amount_promotions.cjs +794 -6
  112. package/lib/resources/fixed_amount_promotions.js +794 -6
  113. package/lib/resources/fixed_price_promotions.cjs +794 -6
  114. package/lib/resources/fixed_price_promotions.js +794 -6
  115. package/lib/resources/flex_promotions.cjs +794 -6
  116. package/lib/resources/flex_promotions.js +794 -6
  117. package/lib/resources/free_gift_promotions.cjs +794 -6
  118. package/lib/resources/free_gift_promotions.js +794 -6
  119. package/lib/resources/free_shipping_promotions.cjs +794 -6
  120. package/lib/resources/free_shipping_promotions.js +794 -6
  121. package/lib/resources/geocoders.cjs +794 -6
  122. package/lib/resources/geocoders.js +794 -6
  123. package/lib/resources/gift_card_recipients.cjs +794 -6
  124. package/lib/resources/gift_card_recipients.js +794 -6
  125. package/lib/resources/gift_cards.cjs +794 -6
  126. package/lib/resources/gift_cards.js +794 -6
  127. package/lib/resources/google_geocoders.cjs +794 -6
  128. package/lib/resources/google_geocoders.js +794 -6
  129. package/lib/resources/imports.cjs +794 -6
  130. package/lib/resources/imports.js +794 -6
  131. package/lib/resources/in_stock_subscriptions.cjs +794 -6
  132. package/lib/resources/in_stock_subscriptions.js +794 -6
  133. package/lib/resources/inventory_models.cjs +794 -6
  134. package/lib/resources/inventory_models.js +794 -6
  135. package/lib/resources/inventory_return_locations.cjs +794 -6
  136. package/lib/resources/inventory_return_locations.js +794 -6
  137. package/lib/resources/inventory_stock_locations.cjs +794 -6
  138. package/lib/resources/inventory_stock_locations.js +794 -6
  139. package/lib/resources/klarna_gateways.cjs +794 -6
  140. package/lib/resources/klarna_gateways.js +794 -6
  141. package/lib/resources/klarna_payments.cjs +794 -6
  142. package/lib/resources/klarna_payments.js +794 -6
  143. package/lib/resources/line_item_options.cjs +794 -6
  144. package/lib/resources/line_item_options.js +794 -6
  145. package/lib/resources/line_items.cjs +794 -6
  146. package/lib/resources/line_items.js +794 -6
  147. package/lib/resources/links.cjs +794 -6
  148. package/lib/resources/links.js +794 -6
  149. package/lib/resources/manual_gateways.cjs +794 -6
  150. package/lib/resources/manual_gateways.js +794 -6
  151. package/lib/resources/manual_tax_calculators.cjs +794 -6
  152. package/lib/resources/manual_tax_calculators.js +794 -6
  153. package/lib/resources/markets.cjs +794 -6
  154. package/lib/resources/markets.js +794 -6
  155. package/lib/resources/merchants.cjs +794 -6
  156. package/lib/resources/merchants.js +794 -6
  157. package/lib/resources/notifications.cjs +794 -6
  158. package/lib/resources/notifications.js +794 -6
  159. package/lib/resources/order_amount_promotion_rules.cjs +794 -6
  160. package/lib/resources/order_amount_promotion_rules.js +794 -6
  161. package/lib/resources/order_copies.cjs +794 -6
  162. package/lib/resources/order_copies.js +794 -6
  163. package/lib/resources/order_factories.cjs +794 -6
  164. package/lib/resources/order_factories.js +794 -6
  165. package/lib/resources/order_subscription_items.cjs +794 -6
  166. package/lib/resources/order_subscription_items.js +794 -6
  167. package/lib/resources/order_subscriptions.cjs +794 -6
  168. package/lib/resources/order_subscriptions.js +794 -6
  169. package/lib/resources/orders.cjs +794 -6
  170. package/lib/resources/orders.js +794 -6
  171. package/lib/resources/organizations.cjs +786 -6
  172. package/lib/resources/organizations.js +786 -6
  173. package/lib/resources/packages.cjs +794 -6
  174. package/lib/resources/packages.js +794 -6
  175. package/lib/resources/parcel_line_items.cjs +794 -6
  176. package/lib/resources/parcel_line_items.js +794 -6
  177. package/lib/resources/parcels.cjs +794 -6
  178. package/lib/resources/parcels.js +794 -6
  179. package/lib/resources/payment_gateways.cjs +794 -6
  180. package/lib/resources/payment_gateways.js +794 -6
  181. package/lib/resources/payment_methods.cjs +794 -6
  182. package/lib/resources/payment_methods.js +794 -6
  183. package/lib/resources/payment_options.cjs +794 -6
  184. package/lib/resources/payment_options.js +794 -6
  185. package/lib/resources/paypal_gateways.cjs +794 -6
  186. package/lib/resources/paypal_gateways.js +794 -6
  187. package/lib/resources/paypal_payments.cjs +794 -6
  188. package/lib/resources/paypal_payments.js +794 -6
  189. package/lib/resources/percentage_discount_promotions.cjs +794 -6
  190. package/lib/resources/percentage_discount_promotions.js +794 -6
  191. package/lib/resources/pickups.cjs +794 -6
  192. package/lib/resources/pickups.js +794 -6
  193. package/lib/resources/price_frequency_tiers.cjs +794 -6
  194. package/lib/resources/price_frequency_tiers.js +794 -6
  195. package/lib/resources/price_list_schedulers.cjs +794 -6
  196. package/lib/resources/price_list_schedulers.js +794 -6
  197. package/lib/resources/price_lists.cjs +794 -6
  198. package/lib/resources/price_lists.js +794 -6
  199. package/lib/resources/price_tiers.cjs +794 -6
  200. package/lib/resources/price_tiers.js +794 -6
  201. package/lib/resources/price_volume_tiers.cjs +794 -6
  202. package/lib/resources/price_volume_tiers.js +794 -6
  203. package/lib/resources/prices.cjs +794 -6
  204. package/lib/resources/prices.js +794 -6
  205. package/lib/resources/promotion_rules.cjs +794 -6
  206. package/lib/resources/promotion_rules.js +794 -6
  207. package/lib/resources/promotions.cjs +794 -6
  208. package/lib/resources/promotions.js +794 -6
  209. package/lib/resources/recurring_order_copies.cjs +794 -6
  210. package/lib/resources/recurring_order_copies.js +794 -6
  211. package/lib/resources/refunds.cjs +794 -6
  212. package/lib/resources/refunds.js +794 -6
  213. package/lib/resources/reserved_stocks.cjs +794 -6
  214. package/lib/resources/reserved_stocks.js +794 -6
  215. package/lib/resources/resource_errors.cjs +794 -6
  216. package/lib/resources/resource_errors.js +794 -6
  217. package/lib/resources/return_line_items.cjs +794 -6
  218. package/lib/resources/return_line_items.js +794 -6
  219. package/lib/resources/returns.cjs +794 -6
  220. package/lib/resources/returns.js +794 -6
  221. package/lib/resources/satispay_gateways.cjs +794 -6
  222. package/lib/resources/satispay_gateways.js +794 -6
  223. package/lib/resources/satispay_payments.cjs +794 -6
  224. package/lib/resources/satispay_payments.js +794 -6
  225. package/lib/resources/shipments.cjs +794 -6
  226. package/lib/resources/shipments.js +794 -6
  227. package/lib/resources/shipping_categories.cjs +794 -6
  228. package/lib/resources/shipping_categories.js +794 -6
  229. package/lib/resources/shipping_method_tiers.cjs +794 -6
  230. package/lib/resources/shipping_method_tiers.js +794 -6
  231. package/lib/resources/shipping_methods.cjs +794 -6
  232. package/lib/resources/shipping_methods.js +794 -6
  233. package/lib/resources/shipping_weight_tiers.cjs +794 -6
  234. package/lib/resources/shipping_weight_tiers.js +794 -6
  235. package/lib/resources/shipping_zones.cjs +794 -6
  236. package/lib/resources/shipping_zones.js +794 -6
  237. package/lib/resources/sku_list_items.cjs +794 -6
  238. package/lib/resources/sku_list_items.js +794 -6
  239. package/lib/resources/sku_list_promotion_rules.cjs +794 -6
  240. package/lib/resources/sku_list_promotion_rules.js +794 -6
  241. package/lib/resources/sku_lists.cjs +794 -6
  242. package/lib/resources/sku_lists.js +794 -6
  243. package/lib/resources/sku_options.cjs +794 -6
  244. package/lib/resources/sku_options.js +794 -6
  245. package/lib/resources/skus.cjs +794 -6
  246. package/lib/resources/skus.js +794 -6
  247. package/lib/resources/stock_items.cjs +794 -6
  248. package/lib/resources/stock_items.js +794 -6
  249. package/lib/resources/stock_line_items.cjs +794 -6
  250. package/lib/resources/stock_line_items.js +794 -6
  251. package/lib/resources/stock_locations.cjs +794 -6
  252. package/lib/resources/stock_locations.js +794 -6
  253. package/lib/resources/stock_reservations.cjs +794 -6
  254. package/lib/resources/stock_reservations.js +794 -6
  255. package/lib/resources/stock_transfers.cjs +794 -6
  256. package/lib/resources/stock_transfers.js +794 -6
  257. package/lib/resources/stores.cjs +794 -6
  258. package/lib/resources/stores.js +794 -6
  259. package/lib/resources/stripe_gateways.cjs +794 -6
  260. package/lib/resources/stripe_gateways.js +794 -6
  261. package/lib/resources/stripe_payments.cjs +794 -6
  262. package/lib/resources/stripe_payments.js +794 -6
  263. package/lib/resources/stripe_tax_accounts.cjs +794 -6
  264. package/lib/resources/stripe_tax_accounts.js +794 -6
  265. package/lib/resources/subscription_models.cjs +794 -6
  266. package/lib/resources/subscription_models.js +794 -6
  267. package/lib/resources/tags.cjs +794 -6
  268. package/lib/resources/tags.js +794 -6
  269. package/lib/resources/talon_one_accounts.cjs +794 -6
  270. package/lib/resources/talon_one_accounts.js +794 -6
  271. package/lib/resources/tax_calculators.cjs +794 -6
  272. package/lib/resources/tax_calculators.js +794 -6
  273. package/lib/resources/tax_categories.cjs +794 -6
  274. package/lib/resources/tax_categories.js +794 -6
  275. package/lib/resources/tax_rules.cjs +794 -6
  276. package/lib/resources/tax_rules.js +794 -6
  277. package/lib/resources/taxjar_accounts.cjs +794 -6
  278. package/lib/resources/taxjar_accounts.js +794 -6
  279. package/lib/resources/transactions.cjs +794 -6
  280. package/lib/resources/transactions.js +794 -6
  281. package/lib/resources/versions.cjs +794 -6
  282. package/lib/resources/versions.js +794 -6
  283. package/lib/resources/vertex_accounts.cjs +794 -6
  284. package/lib/resources/vertex_accounts.js +794 -6
  285. package/lib/resources/voids.cjs +794 -6
  286. package/lib/resources/voids.js +794 -6
  287. package/lib/resources/webhooks.cjs +794 -6
  288. package/lib/resources/webhooks.js +794 -6
  289. package/lib/resources/wire_transfers.cjs +794 -6
  290. package/lib/resources/wire_transfers.js +794 -6
  291. package/lib/static.cjs +753 -20
  292. package/lib/static.js +739 -6
  293. package/lib/util.cjs +5 -6
  294. package/lib/util.js +5 -6
  295. package/package.json +1 -1
  296. package/lib/chunk-AQ5VUG5P.js +0 -12
  297. package/lib/chunk-JE77HYXB.cjs +0 -17
package/lib/static.js CHANGED
@@ -1,10 +1,743 @@
1
- import './chunk-AQ5VUG5P.js';
2
- import { isVersionable, isTaggable, isDeletable, isUpdatable, isCreatable, isSingleton, getSingletons, getResources } from './enum';
3
- import { OPEN_API_SCHEMA_VERSION } from './commercelayer';
4
- import { isApiError, isSdkError } from './error';
5
- import { isTokenExpired } from './util';
1
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
2
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
3
+ }) : x)(function(x) {
4
+ if (typeof require !== "undefined") return require.apply(this, arguments);
5
+ throw Error('Dynamic require of "' + x + '" is not supported');
6
+ });
6
7
 
7
- const CommerceLayerStatic = {
8
+ // src/enum.ts
9
+ var apiResources = [
10
+ // ##__API_RESOURCE_LIST_START__##
11
+ "addresses",
12
+ "adjustments",
13
+ "adyen_gateways",
14
+ "adyen_payments",
15
+ "applications",
16
+ "attachments",
17
+ "authorizations",
18
+ "avalara_accounts",
19
+ "axerve_gateways",
20
+ "axerve_payments",
21
+ "bing_geocoders",
22
+ "braintree_gateways",
23
+ "braintree_payments",
24
+ "bundles",
25
+ "buy_x_pay_y_promotions",
26
+ "captures",
27
+ "carrier_accounts",
28
+ "checkout_com_gateways",
29
+ "checkout_com_payments",
30
+ "cleanups",
31
+ "coupon_codes_promotion_rules",
32
+ "coupon_recipients",
33
+ "coupons",
34
+ "custom_promotion_rules",
35
+ "customer_addresses",
36
+ "customer_groups",
37
+ "customer_password_resets",
38
+ "customer_payment_sources",
39
+ "customer_subscriptions",
40
+ "customers",
41
+ "delivery_lead_times",
42
+ "discount_engine_items",
43
+ "discount_engines",
44
+ "easypost_pickups",
45
+ "event_callbacks",
46
+ "events",
47
+ "exports",
48
+ "external_gateways",
49
+ "external_payments",
50
+ "external_promotions",
51
+ "external_tax_calculators",
52
+ "fixed_amount_promotions",
53
+ "fixed_price_promotions",
54
+ "flex_promotions",
55
+ "free_gift_promotions",
56
+ "free_shipping_promotions",
57
+ "geocoders",
58
+ "gift_card_recipients",
59
+ "gift_cards",
60
+ "google_geocoders",
61
+ "imports",
62
+ "in_stock_subscriptions",
63
+ "inventory_models",
64
+ "inventory_return_locations",
65
+ "inventory_stock_locations",
66
+ "klarna_gateways",
67
+ "klarna_payments",
68
+ "line_item_options",
69
+ "line_items",
70
+ "links",
71
+ "manual_gateways",
72
+ "manual_tax_calculators",
73
+ "markets",
74
+ "merchants",
75
+ "notifications",
76
+ "order_amount_promotion_rules",
77
+ "order_copies",
78
+ "order_factories",
79
+ "order_subscription_items",
80
+ "order_subscriptions",
81
+ "orders",
82
+ "organizations",
83
+ "packages",
84
+ "parcel_line_items",
85
+ "parcels",
86
+ "payment_gateways",
87
+ "payment_methods",
88
+ "payment_options",
89
+ "paypal_gateways",
90
+ "paypal_payments",
91
+ "percentage_discount_promotions",
92
+ "pickups",
93
+ "price_frequency_tiers",
94
+ "price_list_schedulers",
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
+ "stores",
126
+ "stripe_gateways",
127
+ "stripe_payments",
128
+ "stripe_tax_accounts",
129
+ "subscription_models",
130
+ "tags",
131
+ "talon_one_accounts",
132
+ "tax_calculators",
133
+ "tax_categories",
134
+ "tax_rules",
135
+ "taxjar_accounts",
136
+ "transactions",
137
+ "versions",
138
+ "vertex_accounts",
139
+ "voids",
140
+ "webhooks",
141
+ "wire_transfers"
142
+ // ##__API_RESOURCE_LIST_STOP__##
143
+ ];
144
+ var resourceList = apiResources;
145
+ var singletonList = [
146
+ // ##__API_RESOURCE_SINGLETON_START__##
147
+ "applications",
148
+ "organizations"
149
+ // ##__API_RESOURCE_SINGLETON_STOP__##
150
+ ];
151
+ var creatableResources = [
152
+ // ##__API_RESOURCE_CREATABLE_START__##
153
+ "addresses",
154
+ "adjustments",
155
+ "adyen_gateways",
156
+ "adyen_payments",
157
+ "attachments",
158
+ "avalara_accounts",
159
+ "axerve_gateways",
160
+ "axerve_payments",
161
+ "bing_geocoders",
162
+ "braintree_gateways",
163
+ "braintree_payments",
164
+ "bundles",
165
+ "buy_x_pay_y_promotions",
166
+ "carrier_accounts",
167
+ "checkout_com_gateways",
168
+ "checkout_com_payments",
169
+ "cleanups",
170
+ "coupon_codes_promotion_rules",
171
+ "coupon_recipients",
172
+ "coupons",
173
+ "custom_promotion_rules",
174
+ "customer_addresses",
175
+ "customer_groups",
176
+ "customer_password_resets",
177
+ "customer_payment_sources",
178
+ "customer_subscriptions",
179
+ "customers",
180
+ "delivery_lead_times",
181
+ "easypost_pickups",
182
+ "exports",
183
+ "external_gateways",
184
+ "external_payments",
185
+ "external_promotions",
186
+ "external_tax_calculators",
187
+ "fixed_amount_promotions",
188
+ "fixed_price_promotions",
189
+ "flex_promotions",
190
+ "free_gift_promotions",
191
+ "free_shipping_promotions",
192
+ "gift_card_recipients",
193
+ "gift_cards",
194
+ "google_geocoders",
195
+ "imports",
196
+ "in_stock_subscriptions",
197
+ "inventory_models",
198
+ "inventory_return_locations",
199
+ "inventory_stock_locations",
200
+ "klarna_gateways",
201
+ "klarna_payments",
202
+ "line_item_options",
203
+ "line_items",
204
+ "links",
205
+ "manual_gateways",
206
+ "manual_tax_calculators",
207
+ "markets",
208
+ "merchants",
209
+ "notifications",
210
+ "order_amount_promotion_rules",
211
+ "order_copies",
212
+ "order_subscription_items",
213
+ "order_subscriptions",
214
+ "orders",
215
+ "packages",
216
+ "parcel_line_items",
217
+ "parcels",
218
+ "payment_methods",
219
+ "payment_options",
220
+ "paypal_gateways",
221
+ "paypal_payments",
222
+ "percentage_discount_promotions",
223
+ "price_frequency_tiers",
224
+ "price_list_schedulers",
225
+ "price_lists",
226
+ "price_volume_tiers",
227
+ "prices",
228
+ "recurring_order_copies",
229
+ "return_line_items",
230
+ "returns",
231
+ "satispay_gateways",
232
+ "satispay_payments",
233
+ "shipments",
234
+ "shipping_categories",
235
+ "shipping_methods",
236
+ "shipping_weight_tiers",
237
+ "shipping_zones",
238
+ "sku_list_items",
239
+ "sku_list_promotion_rules",
240
+ "sku_lists",
241
+ "sku_options",
242
+ "skus",
243
+ "stock_items",
244
+ "stock_line_items",
245
+ "stock_locations",
246
+ "stock_reservations",
247
+ "stock_transfers",
248
+ "stores",
249
+ "stripe_gateways",
250
+ "stripe_payments",
251
+ "stripe_tax_accounts",
252
+ "subscription_models",
253
+ "tags",
254
+ "talon_one_accounts",
255
+ "tax_categories",
256
+ "tax_rules",
257
+ "taxjar_accounts",
258
+ "vertex_accounts",
259
+ "webhooks",
260
+ "wire_transfers"
261
+ // ##__API_RESOURCE_CREATABLE_STOP__##
262
+ ];
263
+ var updatableResources = [
264
+ // ##__API_RESOURCE_UPDATABLE_START__##
265
+ "addresses",
266
+ "adjustments",
267
+ "adyen_gateways",
268
+ "adyen_payments",
269
+ "attachments",
270
+ "authorizations",
271
+ "avalara_accounts",
272
+ "axerve_gateways",
273
+ "axerve_payments",
274
+ "bing_geocoders",
275
+ "braintree_gateways",
276
+ "braintree_payments",
277
+ "bundles",
278
+ "buy_x_pay_y_promotions",
279
+ "captures",
280
+ "carrier_accounts",
281
+ "checkout_com_gateways",
282
+ "checkout_com_payments",
283
+ "cleanups",
284
+ "coupon_codes_promotion_rules",
285
+ "coupon_recipients",
286
+ "coupons",
287
+ "custom_promotion_rules",
288
+ "customer_addresses",
289
+ "customer_groups",
290
+ "customer_password_resets",
291
+ "customer_payment_sources",
292
+ "customer_subscriptions",
293
+ "customers",
294
+ "delivery_lead_times",
295
+ "easypost_pickups",
296
+ "events",
297
+ "exports",
298
+ "external_gateways",
299
+ "external_payments",
300
+ "external_promotions",
301
+ "external_tax_calculators",
302
+ "fixed_amount_promotions",
303
+ "fixed_price_promotions",
304
+ "flex_promotions",
305
+ "free_gift_promotions",
306
+ "free_shipping_promotions",
307
+ "gift_card_recipients",
308
+ "gift_cards",
309
+ "google_geocoders",
310
+ "imports",
311
+ "in_stock_subscriptions",
312
+ "inventory_models",
313
+ "inventory_return_locations",
314
+ "inventory_stock_locations",
315
+ "klarna_gateways",
316
+ "klarna_payments",
317
+ "line_item_options",
318
+ "line_items",
319
+ "links",
320
+ "manual_gateways",
321
+ "manual_tax_calculators",
322
+ "markets",
323
+ "merchants",
324
+ "notifications",
325
+ "order_amount_promotion_rules",
326
+ "order_copies",
327
+ "order_subscription_items",
328
+ "order_subscriptions",
329
+ "orders",
330
+ "packages",
331
+ "parcel_line_items",
332
+ "parcels",
333
+ "payment_methods",
334
+ "payment_options",
335
+ "paypal_gateways",
336
+ "paypal_payments",
337
+ "percentage_discount_promotions",
338
+ "price_frequency_tiers",
339
+ "price_list_schedulers",
340
+ "price_lists",
341
+ "price_volume_tiers",
342
+ "prices",
343
+ "recurring_order_copies",
344
+ "refunds",
345
+ "return_line_items",
346
+ "returns",
347
+ "satispay_gateways",
348
+ "satispay_payments",
349
+ "shipments",
350
+ "shipping_categories",
351
+ "shipping_methods",
352
+ "shipping_weight_tiers",
353
+ "shipping_zones",
354
+ "sku_list_items",
355
+ "sku_list_promotion_rules",
356
+ "sku_lists",
357
+ "sku_options",
358
+ "skus",
359
+ "stock_items",
360
+ "stock_line_items",
361
+ "stock_locations",
362
+ "stock_reservations",
363
+ "stock_transfers",
364
+ "stores",
365
+ "stripe_gateways",
366
+ "stripe_payments",
367
+ "stripe_tax_accounts",
368
+ "subscription_models",
369
+ "tags",
370
+ "talon_one_accounts",
371
+ "tax_categories",
372
+ "tax_rules",
373
+ "taxjar_accounts",
374
+ "vertex_accounts",
375
+ "voids",
376
+ "webhooks",
377
+ "wire_transfers"
378
+ // ##__API_RESOURCE_UPDATABLE_STOP__##
379
+ ];
380
+ var deletableResources = [
381
+ // ##__API_RESOURCE_DELETABLE_START__##
382
+ "addresses",
383
+ "adjustments",
384
+ "adyen_gateways",
385
+ "adyen_payments",
386
+ "attachments",
387
+ "avalara_accounts",
388
+ "axerve_gateways",
389
+ "axerve_payments",
390
+ "bing_geocoders",
391
+ "braintree_gateways",
392
+ "braintree_payments",
393
+ "bundles",
394
+ "buy_x_pay_y_promotions",
395
+ "carrier_accounts",
396
+ "checkout_com_gateways",
397
+ "checkout_com_payments",
398
+ "cleanups",
399
+ "coupon_codes_promotion_rules",
400
+ "coupon_recipients",
401
+ "coupons",
402
+ "custom_promotion_rules",
403
+ "customer_addresses",
404
+ "customer_groups",
405
+ "customer_password_resets",
406
+ "customer_payment_sources",
407
+ "customer_subscriptions",
408
+ "customers",
409
+ "delivery_lead_times",
410
+ "easypost_pickups",
411
+ "exports",
412
+ "external_gateways",
413
+ "external_payments",
414
+ "external_promotions",
415
+ "external_tax_calculators",
416
+ "fixed_amount_promotions",
417
+ "fixed_price_promotions",
418
+ "flex_promotions",
419
+ "free_gift_promotions",
420
+ "free_shipping_promotions",
421
+ "gift_card_recipients",
422
+ "gift_cards",
423
+ "google_geocoders",
424
+ "imports",
425
+ "in_stock_subscriptions",
426
+ "inventory_models",
427
+ "inventory_return_locations",
428
+ "inventory_stock_locations",
429
+ "klarna_gateways",
430
+ "klarna_payments",
431
+ "line_item_options",
432
+ "line_items",
433
+ "links",
434
+ "manual_gateways",
435
+ "manual_tax_calculators",
436
+ "markets",
437
+ "merchants",
438
+ "notifications",
439
+ "order_amount_promotion_rules",
440
+ "order_copies",
441
+ "order_subscription_items",
442
+ "order_subscriptions",
443
+ "orders",
444
+ "packages",
445
+ "parcel_line_items",
446
+ "parcels",
447
+ "payment_methods",
448
+ "payment_options",
449
+ "paypal_gateways",
450
+ "paypal_payments",
451
+ "percentage_discount_promotions",
452
+ "price_frequency_tiers",
453
+ "price_list_schedulers",
454
+ "price_lists",
455
+ "price_volume_tiers",
456
+ "prices",
457
+ "recurring_order_copies",
458
+ "return_line_items",
459
+ "returns",
460
+ "satispay_gateways",
461
+ "satispay_payments",
462
+ "shipments",
463
+ "shipping_categories",
464
+ "shipping_methods",
465
+ "shipping_weight_tiers",
466
+ "shipping_zones",
467
+ "sku_list_items",
468
+ "sku_list_promotion_rules",
469
+ "sku_lists",
470
+ "sku_options",
471
+ "skus",
472
+ "stock_items",
473
+ "stock_line_items",
474
+ "stock_locations",
475
+ "stock_reservations",
476
+ "stock_transfers",
477
+ "stores",
478
+ "stripe_gateways",
479
+ "stripe_payments",
480
+ "stripe_tax_accounts",
481
+ "subscription_models",
482
+ "tags",
483
+ "talon_one_accounts",
484
+ "tax_categories",
485
+ "tax_rules",
486
+ "taxjar_accounts",
487
+ "vertex_accounts",
488
+ "webhooks",
489
+ "wire_transfers"
490
+ // ##__API_RESOURCE_DELETABLE_STOP__##
491
+ ];
492
+ var taggableResources = [
493
+ // ##__API_RESOURCE_TAGGABLE_START__##
494
+ "addresses",
495
+ "bundles",
496
+ "buy_x_pay_y_promotions",
497
+ "coupons",
498
+ "customers",
499
+ "external_promotions",
500
+ "fixed_amount_promotions",
501
+ "fixed_price_promotions",
502
+ "flex_promotions",
503
+ "free_gift_promotions",
504
+ "free_shipping_promotions",
505
+ "gift_cards",
506
+ "line_item_options",
507
+ "line_items",
508
+ "order_subscriptions",
509
+ "orders",
510
+ "percentage_discount_promotions",
511
+ "promotions",
512
+ "returns",
513
+ "shipments",
514
+ "sku_options",
515
+ "skus"
516
+ // ##__API_RESOURCE_TAGGABLE_STOP__##
517
+ ];
518
+ var versionableResources = [
519
+ // ##__API_RESOURCE_VERSIONABLE_START__##
520
+ "addresses",
521
+ "adjustments",
522
+ "adyen_gateways",
523
+ "adyen_payments",
524
+ "authorizations",
525
+ "avalara_accounts",
526
+ "axerve_gateways",
527
+ "axerve_payments",
528
+ "braintree_gateways",
529
+ "braintree_payments",
530
+ "bundles",
531
+ "buy_x_pay_y_promotions",
532
+ "captures",
533
+ "carrier_accounts",
534
+ "checkout_com_gateways",
535
+ "checkout_com_payments",
536
+ "cleanups",
537
+ "coupon_codes_promotion_rules",
538
+ "coupon_recipients",
539
+ "coupons",
540
+ "custom_promotion_rules",
541
+ "customer_addresses",
542
+ "customer_groups",
543
+ "customer_payment_sources",
544
+ "customer_subscriptions",
545
+ "delivery_lead_times",
546
+ "discount_engines",
547
+ "exports",
548
+ "external_gateways",
549
+ "external_payments",
550
+ "external_promotions",
551
+ "external_tax_calculators",
552
+ "fixed_amount_promotions",
553
+ "fixed_price_promotions",
554
+ "flex_promotions",
555
+ "free_gift_promotions",
556
+ "free_shipping_promotions",
557
+ "gift_card_recipients",
558
+ "gift_cards",
559
+ "in_stock_subscriptions",
560
+ "inventory_models",
561
+ "inventory_return_locations",
562
+ "inventory_stock_locations",
563
+ "klarna_gateways",
564
+ "klarna_payments",
565
+ "manual_gateways",
566
+ "manual_tax_calculators",
567
+ "markets",
568
+ "merchants",
569
+ "order_amount_promotion_rules",
570
+ "order_subscriptions",
571
+ "orders",
572
+ "packages",
573
+ "parcel_line_items",
574
+ "parcels",
575
+ "payment_gateways",
576
+ "payment_methods",
577
+ "paypal_gateways",
578
+ "paypal_payments",
579
+ "percentage_discount_promotions",
580
+ "price_frequency_tiers",
581
+ "price_list_schedulers",
582
+ "price_lists",
583
+ "price_tiers",
584
+ "price_volume_tiers",
585
+ "prices",
586
+ "promotion_rules",
587
+ "promotions",
588
+ "refunds",
589
+ "reserved_stocks",
590
+ "returns",
591
+ "satispay_gateways",
592
+ "satispay_payments",
593
+ "shipments",
594
+ "shipping_categories",
595
+ "shipping_method_tiers",
596
+ "shipping_methods",
597
+ "shipping_weight_tiers",
598
+ "shipping_zones",
599
+ "sku_list_items",
600
+ "sku_list_promotion_rules",
601
+ "sku_lists",
602
+ "sku_options",
603
+ "skus",
604
+ "stock_items",
605
+ "stock_line_items",
606
+ "stock_locations",
607
+ "stock_transfers",
608
+ "stores",
609
+ "stripe_gateways",
610
+ "stripe_payments",
611
+ "stripe_tax_accounts",
612
+ "talon_one_accounts",
613
+ "tax_calculators",
614
+ "tax_categories",
615
+ "tax_rules",
616
+ "taxjar_accounts",
617
+ "transactions",
618
+ "vertex_accounts",
619
+ "voids",
620
+ "webhooks",
621
+ "wire_transfers"
622
+ // ##__API_RESOURCE_VERSIONABLE_STOP__##
623
+ ];
624
+ function getResources(sort) {
625
+ return sort ? [...resourceList].sort() : resourceList;
626
+ }
627
+ function getSingletons(sort) {
628
+ return sort ? [...singletonList].sort() : singletonList;
629
+ }
630
+ function isSingleton(resource) {
631
+ return singletonList.includes(resource);
632
+ }
633
+ function isCreatable(resource) {
634
+ return creatableResources.includes(resource);
635
+ }
636
+ function isUpdatable(resource) {
637
+ return updatableResources.includes(resource);
638
+ }
639
+ function isDeletable(resource) {
640
+ return deletableResources.includes(resource);
641
+ }
642
+ function isTaggable(resource) {
643
+ return taggableResources.includes(resource);
644
+ }
645
+ function isVersionable(resource) {
646
+ return versionableResources.includes(resource);
647
+ }
648
+
649
+ // src/debug.ts
650
+ var debuggerFunction = (_pattern, ..._args) => {
651
+ };
652
+ var debuggerFactory = (_namespace) => debuggerFunction;
653
+ try {
654
+ const debugModule = __require("debug");
655
+ if (debugModule && typeof debugModule === "function") debuggerFactory = debugModule;
656
+ } catch (error) {
657
+ }
658
+ var debugPrefix = "clsdk";
659
+ var debug = (namespace) => {
660
+ return debuggerFactory(`${debugPrefix}:${namespace}`);
661
+ };
662
+ var debug_default = debug;
663
+
664
+ // src/error.ts
665
+ var ErrorType = /* @__PURE__ */ ((ErrorType2) => {
666
+ ErrorType2["CLIENT"] = "client";
667
+ ErrorType2["REQUEST"] = "request";
668
+ ErrorType2["RESPONSE"] = "response";
669
+ ErrorType2["CANCEL"] = "cancel";
670
+ ErrorType2["PARSE"] = "parse";
671
+ ErrorType2["TIMEOUT"] = "timeout";
672
+ ErrorType2["TOKEN_REFRESH"] = "token-refresh";
673
+ return ErrorType2;
674
+ })(ErrorType || {});
675
+ var SdkError = class _SdkError extends Error {
676
+ static NAME = "SdkError";
677
+ static isSdkError(error) {
678
+ return error && [_SdkError.NAME, ApiError.NAME].includes(error.name) && Object.values(ErrorType).includes(error.type);
679
+ }
680
+ type;
681
+ code;
682
+ source;
683
+ constructor(error) {
684
+ super(error.message);
685
+ this.name = _SdkError.NAME;
686
+ this.type = error.type || "client" /* CLIENT */;
687
+ }
688
+ };
689
+ var ApiError = class _ApiError extends SdkError {
690
+ static NAME = "ApiError";
691
+ static isApiError(error) {
692
+ return SdkError.isSdkError(error) && error.name === _ApiError.NAME && error.type === "response" /* RESPONSE */;
693
+ }
694
+ errors = [];
695
+ status;
696
+ statusText;
697
+ // constructor(error: SdkError)
698
+ constructor(error) {
699
+ super({ ...error, type: "response" /* RESPONSE */ });
700
+ this.name = _ApiError.NAME;
701
+ }
702
+ first() {
703
+ return this.errors?.length > 0 ? this.errors[0] : void 0;
704
+ }
705
+ };
706
+ function isSdkError(error) {
707
+ return SdkError.isSdkError(error);
708
+ }
709
+ function isApiError(error) {
710
+ return ApiError.isApiError(error);
711
+ }
712
+
713
+ // src/util.ts
714
+ var extractTokenData = (token) => {
715
+ try {
716
+ const data = JSON.parse(atob(token.split(".")[1]));
717
+ return {
718
+ organization: data.organization.slug,
719
+ domain: data.iss ? String(data.iss).replace("https://auth.", "") : void 0,
720
+ expiration: data.exp
721
+ };
722
+ } catch (err) {
723
+ return void 0;
724
+ }
725
+ };
726
+ var isTokenExpired = (token) => {
727
+ try {
728
+ const tokenData = extractTokenData(token);
729
+ return tokenData?.expiration ? tokenData.expiration * 1e3 - Date.now() < 0 : false;
730
+ } catch (err) {
731
+ return false;
732
+ }
733
+ };
734
+
735
+ // src/commercelayer.ts
736
+ debug_default("commercelayer");
737
+ var OPEN_API_SCHEMA_VERSION = "7.8.3";
738
+
739
+ // src/static.ts
740
+ var CommerceLayerStatic = {
8
741
  resources: (sort) => {
9
742
  return getResources(sort);
10
743
  },