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