@commercelayer/sdk 3.0.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/lib/cjs/client.d.ts +1 -5
  2. package/lib/cjs/client.js +1 -1
  3. package/lib/cjs/commercelayer.d.ts +1 -0
  4. package/lib/cjs/commercelayer.js +1 -1
  5. package/lib/cjs/config.d.ts +1 -1
  6. package/lib/cjs/config.js +1 -1
  7. package/lib/cjs/debug.d.ts +3 -0
  8. package/lib/cjs/debug.js +1 -0
  9. package/lib/cjs/index.js +1 -1
  10. package/lib/cjs/jsonapi.js +1 -1
  11. package/lib/cjs/query.js +1 -1
  12. package/lib/cjs/resource.d.ts +4 -2
  13. package/lib/cjs/resource.js +1 -1
  14. package/lib/cjs/resources/adyen_payments.d.ts +1 -1
  15. package/lib/cjs/resources/attachments.d.ts +1 -1
  16. package/lib/cjs/resources/billing_info_validation_rules.d.ts +1 -1
  17. package/lib/cjs/resources/braintree_payments.d.ts +1 -1
  18. package/lib/cjs/resources/bundles.d.ts +1 -1
  19. package/lib/cjs/resources/checkout_com_payments.d.ts +1 -1
  20. package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +1 -1
  21. package/lib/cjs/resources/coupons.d.ts +1 -1
  22. package/lib/cjs/resources/customer_addresses.d.ts +2 -2
  23. package/lib/cjs/resources/customer_payment_sources.d.ts +2 -2
  24. package/lib/cjs/resources/delivery_lead_times.d.ts +2 -2
  25. package/lib/cjs/resources/delivery_lead_times.js +1 -1
  26. package/lib/cjs/resources/external_payments.d.ts +1 -1
  27. package/lib/cjs/resources/fixed_price_promotions.d.ts +1 -1
  28. package/lib/cjs/resources/free_gift_promotions.d.ts +1 -1
  29. package/lib/cjs/resources/in_stock_subscriptions.d.ts +3 -3
  30. package/lib/cjs/resources/inventory_return_locations.d.ts +2 -2
  31. package/lib/cjs/resources/inventory_stock_locations.d.ts +2 -2
  32. package/lib/cjs/resources/line_item_options.d.ts +2 -2
  33. package/lib/cjs/resources/line_items.d.ts +1 -1
  34. package/lib/cjs/resources/markets.d.ts +3 -3
  35. package/lib/cjs/resources/merchants.d.ts +1 -1
  36. package/lib/cjs/resources/order_amount_promotion_rules.d.ts +1 -1
  37. package/lib/cjs/resources/order_copies.d.ts +1 -1
  38. package/lib/cjs/resources/order_subscriptions.d.ts +1 -1
  39. package/lib/cjs/resources/packages.d.ts +1 -1
  40. package/lib/cjs/resources/parcel_line_items.d.ts +2 -2
  41. package/lib/cjs/resources/parcels.d.ts +2 -2
  42. package/lib/cjs/resources/payment_methods.d.ts +2 -2
  43. package/lib/cjs/resources/paypal_payments.d.ts +1 -1
  44. package/lib/cjs/resources/prices.d.ts +1 -1
  45. package/lib/cjs/resources/return_line_items.d.ts +2 -2
  46. package/lib/cjs/resources/returns.d.ts +1 -1
  47. package/lib/cjs/resources/shipping_methods.d.ts +3 -3
  48. package/lib/cjs/resources/sku_list_items.d.ts +2 -2
  49. package/lib/cjs/resources/sku_list_promotion_rules.d.ts +1 -1
  50. package/lib/cjs/resources/sku_options.d.ts +1 -1
  51. package/lib/cjs/resources/skus.d.ts +1 -1
  52. package/lib/cjs/resources/stock_items.d.ts +1 -1
  53. package/lib/cjs/resources/stock_locations.d.ts +1 -1
  54. package/lib/cjs/resources/stock_transfers.d.ts +3 -3
  55. package/lib/cjs/resources/stripe_payments.d.ts +1 -1
  56. package/lib/cjs/resources/tax_categories.d.ts +2 -2
  57. package/lib/cjs/resources/tax_rules.d.ts +1 -1
  58. package/lib/cjs/resources/wire_transfers.d.ts +1 -1
  59. package/lib/cjs/static.js +1 -1
  60. package/lib/esm/client.d.ts +1 -5
  61. package/lib/esm/client.js +1 -1
  62. package/lib/esm/commercelayer.d.ts +1 -0
  63. package/lib/esm/commercelayer.js +1 -1
  64. package/lib/esm/common.js +1 -1
  65. package/lib/esm/config.d.ts +1 -1
  66. package/lib/esm/config.js +1 -1
  67. package/lib/esm/debug.d.ts +3 -0
  68. package/lib/esm/debug.js +1 -0
  69. package/lib/esm/error.js +1 -1
  70. package/lib/esm/jsonapi.js +1 -1
  71. package/lib/esm/query.js +1 -1
  72. package/lib/esm/resource.d.ts +4 -2
  73. package/lib/esm/resource.js +1 -1
  74. package/lib/esm/resources/addresses.js +1 -1
  75. package/lib/esm/resources/adjustments.js +1 -1
  76. package/lib/esm/resources/adyen_gateways.js +1 -1
  77. package/lib/esm/resources/adyen_payments.d.ts +1 -1
  78. package/lib/esm/resources/adyen_payments.js +1 -1
  79. package/lib/esm/resources/application.js +1 -1
  80. package/lib/esm/resources/attachments.d.ts +1 -1
  81. package/lib/esm/resources/authorizations.js +1 -1
  82. package/lib/esm/resources/avalara_accounts.js +1 -1
  83. package/lib/esm/resources/billing_info_validation_rules.d.ts +1 -1
  84. package/lib/esm/resources/billing_info_validation_rules.js +1 -1
  85. package/lib/esm/resources/bing_geocoders.js +1 -1
  86. package/lib/esm/resources/braintree_gateways.js +1 -1
  87. package/lib/esm/resources/braintree_payments.d.ts +1 -1
  88. package/lib/esm/resources/braintree_payments.js +1 -1
  89. package/lib/esm/resources/bundles.d.ts +1 -1
  90. package/lib/esm/resources/bundles.js +1 -1
  91. package/lib/esm/resources/captures.js +1 -1
  92. package/lib/esm/resources/carrier_accounts.js +1 -1
  93. package/lib/esm/resources/checkout_com_payments.d.ts +1 -1
  94. package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +1 -1
  95. package/lib/esm/resources/coupon_codes_promotion_rules.js +1 -1
  96. package/lib/esm/resources/coupon_recipients.js +1 -1
  97. package/lib/esm/resources/coupons.d.ts +1 -1
  98. package/lib/esm/resources/coupons.js +1 -1
  99. package/lib/esm/resources/customer_addresses.d.ts +2 -2
  100. package/lib/esm/resources/customer_addresses.js +1 -1
  101. package/lib/esm/resources/customer_groups.js +1 -1
  102. package/lib/esm/resources/customer_password_resets.js +1 -1
  103. package/lib/esm/resources/customer_payment_sources.d.ts +2 -2
  104. package/lib/esm/resources/customer_payment_sources.js +1 -1
  105. package/lib/esm/resources/customer_subscriptions.js +1 -1
  106. package/lib/esm/resources/customers.js +1 -1
  107. package/lib/esm/resources/delivery_lead_times.d.ts +2 -2
  108. package/lib/esm/resources/delivery_lead_times.js +1 -1
  109. package/lib/esm/resources/event_callbacks.js +1 -1
  110. package/lib/esm/resources/external_payments.d.ts +1 -1
  111. package/lib/esm/resources/external_promotions.js +1 -1
  112. package/lib/esm/resources/fixed_price_promotions.d.ts +1 -1
  113. package/lib/esm/resources/fixed_price_promotions.js +1 -1
  114. package/lib/esm/resources/free_gift_promotions.d.ts +1 -1
  115. package/lib/esm/resources/free_gift_promotions.js +1 -1
  116. package/lib/esm/resources/free_shipping_promotions.js +1 -1
  117. package/lib/esm/resources/geocoders.js +1 -1
  118. package/lib/esm/resources/gift_cards.js +1 -1
  119. package/lib/esm/resources/google_geocoders.js +1 -1
  120. package/lib/esm/resources/imports.js +1 -1
  121. package/lib/esm/resources/in_stock_subscriptions.d.ts +3 -3
  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.d.ts +2 -2
  125. package/lib/esm/resources/inventory_stock_locations.d.ts +2 -2
  126. package/lib/esm/resources/inventory_stock_locations.js +1 -1
  127. package/lib/esm/resources/line_item_options.d.ts +2 -2
  128. package/lib/esm/resources/line_item_options.js +1 -1
  129. package/lib/esm/resources/line_items.d.ts +1 -1
  130. package/lib/esm/resources/line_items.js +1 -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 +3 -3
  134. package/lib/esm/resources/markets.js +1 -1
  135. package/lib/esm/resources/merchants.d.ts +1 -1
  136. package/lib/esm/resources/merchants.js +1 -1
  137. package/lib/esm/resources/order_amount_promotion_rules.d.ts +1 -1
  138. package/lib/esm/resources/order_amount_promotion_rules.js +1 -1
  139. package/lib/esm/resources/order_copies.d.ts +1 -1
  140. package/lib/esm/resources/order_copies.js +1 -1
  141. package/lib/esm/resources/order_subscriptions.d.ts +1 -1
  142. package/lib/esm/resources/order_subscriptions.js +1 -1
  143. package/lib/esm/resources/order_validation_rules.js +1 -1
  144. package/lib/esm/resources/orders.js +1 -1
  145. package/lib/esm/resources/organization.js +1 -1
  146. package/lib/esm/resources/packages.d.ts +1 -1
  147. package/lib/esm/resources/packages.js +1 -1
  148. package/lib/esm/resources/parcel_line_items.d.ts +2 -2
  149. package/lib/esm/resources/parcel_line_items.js +1 -1
  150. package/lib/esm/resources/parcels.d.ts +2 -2
  151. package/lib/esm/resources/parcels.js +1 -1
  152. package/lib/esm/resources/payment_gateways.js +1 -1
  153. package/lib/esm/resources/payment_methods.d.ts +2 -2
  154. package/lib/esm/resources/paypal_gateways.js +1 -1
  155. package/lib/esm/resources/paypal_payments.d.ts +1 -1
  156. package/lib/esm/resources/paypal_payments.js +1 -1
  157. package/lib/esm/resources/price_lists.js +1 -1
  158. package/lib/esm/resources/prices.d.ts +1 -1
  159. package/lib/esm/resources/prices.js +1 -1
  160. package/lib/esm/resources/promotion_rules.js +1 -1
  161. package/lib/esm/resources/promotions.js +1 -1
  162. package/lib/esm/resources/refunds.js +1 -1
  163. package/lib/esm/resources/return_line_items.d.ts +2 -2
  164. package/lib/esm/resources/returns.d.ts +1 -1
  165. package/lib/esm/resources/returns.js +1 -1
  166. package/lib/esm/resources/shipments.js +1 -1
  167. package/lib/esm/resources/shipping_categories.js +1 -1
  168. package/lib/esm/resources/shipping_methods.d.ts +3 -3
  169. package/lib/esm/resources/shipping_methods.js +1 -1
  170. package/lib/esm/resources/shipping_zones.js +1 -1
  171. package/lib/esm/resources/sku_list_items.d.ts +2 -2
  172. package/lib/esm/resources/sku_list_items.js +1 -1
  173. package/lib/esm/resources/sku_list_promotion_rules.d.ts +1 -1
  174. package/lib/esm/resources/sku_list_promotion_rules.js +1 -1
  175. package/lib/esm/resources/sku_lists.js +1 -1
  176. package/lib/esm/resources/sku_options.d.ts +1 -1
  177. package/lib/esm/resources/sku_options.js +1 -1
  178. package/lib/esm/resources/skus.d.ts +1 -1
  179. package/lib/esm/resources/skus.js +1 -1
  180. package/lib/esm/resources/stock_items.d.ts +1 -1
  181. package/lib/esm/resources/stock_items.js +1 -1
  182. package/lib/esm/resources/stock_line_items.js +1 -1
  183. package/lib/esm/resources/stock_locations.d.ts +1 -1
  184. package/lib/esm/resources/stock_locations.js +1 -1
  185. package/lib/esm/resources/stock_transfers.d.ts +3 -3
  186. package/lib/esm/resources/stock_transfers.js +1 -1
  187. package/lib/esm/resources/stripe_gateways.js +1 -1
  188. package/lib/esm/resources/stripe_payments.d.ts +1 -1
  189. package/lib/esm/resources/stripe_payments.js +1 -1
  190. package/lib/esm/resources/tax_calculators.js +1 -1
  191. package/lib/esm/resources/tax_categories.d.ts +2 -2
  192. package/lib/esm/resources/tax_categories.js +1 -1
  193. package/lib/esm/resources/tax_rules.d.ts +1 -1
  194. package/lib/esm/resources/tax_rules.js +1 -1
  195. package/lib/esm/resources/taxjar_accounts.js +1 -1
  196. package/lib/esm/resources/transactions.js +1 -1
  197. package/lib/esm/resources/voids.js +1 -1
  198. package/lib/esm/resources/webhooks.js +1 -1
  199. package/lib/esm/resources/wire_transfers.d.ts +1 -1
  200. package/lib/esm/resources/wire_transfers.js +1 -1
  201. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  202. package/lib/tsconfig.tsbuildinfo +1 -1
  203. package/package.json +2 -1
@@ -22,8 +22,8 @@ interface SkuListItemCreate extends ResourceCreate {
22
22
  position?: number;
23
23
  sku_code?: string;
24
24
  quantity?: number;
25
- sku_list?: SkuListRel;
26
- sku?: SkuRel;
25
+ sku_list: SkuListRel;
26
+ sku: SkuRel;
27
27
  }
28
28
  interface SkuListItemUpdate extends ResourceUpdate {
29
29
  position?: number;
@@ -42,7 +42,7 @@ interface SkuListPromotionRule extends Resource {
42
42
  interface SkuListPromotionRuleCreate extends ResourceCreate {
43
43
  all_skus?: boolean;
44
44
  min_quantity?: number;
45
- promotion?: PercentageDiscountPromotionRel | FreeShippingPromotionRel | FixedAmountPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel;
45
+ promotion: PercentageDiscountPromotionRel | FreeShippingPromotionRel | FixedAmountPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel;
46
46
  sku_list?: SkuListRel;
47
47
  }
48
48
  interface SkuListPromotionRuleUpdate extends ResourceUpdate {
@@ -26,7 +26,7 @@ interface SkuOptionCreate extends ResourceCreate {
26
26
  price_amount_cents?: number;
27
27
  delay_hours?: number;
28
28
  sku_code_regex?: string;
29
- market?: MarketRel;
29
+ market: MarketRel;
30
30
  }
31
31
  interface SkuOptionUpdate extends ResourceUpdate {
32
32
  name?: string;
@@ -42,7 +42,7 @@ interface SkuCreate extends ResourceCreate {
42
42
  hs_tariff_number?: string;
43
43
  do_not_ship?: boolean;
44
44
  do_not_track?: boolean;
45
- shipping_category?: ShippingCategoryRel;
45
+ shipping_category: ShippingCategoryRel;
46
46
  }
47
47
  interface SkuUpdate extends ResourceUpdate {
48
48
  code?: string;
@@ -22,7 +22,7 @@ interface StockItem extends Resource {
22
22
  interface StockItemCreate extends ResourceCreate {
23
23
  sku_code?: string;
24
24
  quantity: number;
25
- stock_location?: StockLocationRel;
25
+ stock_location: StockLocationRel;
26
26
  sku?: SkuRel;
27
27
  }
28
28
  interface StockItemUpdate extends ResourceUpdate {
@@ -28,7 +28,7 @@ interface StockLocationCreate extends ResourceCreate {
28
28
  name: string;
29
29
  label_format?: string;
30
30
  suppress_etd?: boolean;
31
- address?: AddressRel;
31
+ address: AddressRel;
32
32
  }
33
33
  interface StockLocationUpdate extends ResourceUpdate {
34
34
  name?: string;
@@ -34,9 +34,9 @@ interface StockTransfer extends Resource {
34
34
  interface StockTransferCreate extends ResourceCreate {
35
35
  sku_code?: string;
36
36
  quantity: number;
37
- sku?: SkuRel;
38
- origin_stock_location?: StockLocationRel;
39
- destination_stock_location?: StockLocationRel;
37
+ sku: SkuRel;
38
+ origin_stock_location: StockLocationRel;
39
+ destination_stock_location: StockLocationRel;
40
40
  shipment?: ShipmentRel;
41
41
  line_item?: LineItemRel;
42
42
  }
@@ -18,7 +18,7 @@ interface StripePayment extends Resource {
18
18
  }
19
19
  interface StripePaymentCreate extends ResourceCreate {
20
20
  options?: object;
21
- order?: OrderRel;
21
+ order: OrderRel;
22
22
  }
23
23
  interface StripePaymentUpdate extends ResourceUpdate {
24
24
  options?: object;
@@ -34,8 +34,8 @@ interface TaxCategory extends Resource {
34
34
  interface TaxCategoryCreate extends ResourceCreate {
35
35
  code: string;
36
36
  sku_code?: string;
37
- sku?: SkuRel;
38
- tax_calculator?: AvalaraAccountRel | TaxjarAccountRel | ManualTaxCalculatorRel | ExternalTaxCalculatorRel;
37
+ sku: SkuRel;
38
+ tax_calculator: AvalaraAccountRel | TaxjarAccountRel | ManualTaxCalculatorRel | ExternalTaxCalculatorRel;
39
39
  }
40
40
  interface TaxCategoryUpdate extends ResourceUpdate {
41
41
  code?: string;
@@ -36,7 +36,7 @@ interface TaxRuleCreate extends ResourceCreate {
36
36
  payment_method_taxable?: boolean;
37
37
  gift_card_taxable?: boolean;
38
38
  adjustment_taxable?: boolean;
39
- manual_tax_calculator?: ManualTaxCalculatorRel;
39
+ manual_tax_calculator: ManualTaxCalculatorRel;
40
40
  }
41
41
  interface TaxRuleUpdate extends ResourceUpdate {
42
42
  name?: string;
@@ -11,7 +11,7 @@ interface WireTransfer extends Resource {
11
11
  order?: Order;
12
12
  }
13
13
  interface WireTransferCreate extends ResourceCreate {
14
- order?: OrderRel;
14
+ order: OrderRel;
15
15
  }
16
16
  interface WireTransferUpdate extends ResourceUpdate {
17
17
  order?: OrderRel;
package/lib/cjs/static.js CHANGED
@@ -1 +1 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(r,e,t,i){i===void 0&&(i=t),Object.defineProperty(r,i,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),__importStar=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&__createBinding(e,r,t);return __setModuleDefault(e,r),e};Object.defineProperty(exports,"__esModule",{value:!0}),exports.CommerceLayerStatic=void 0;const api=__importStar(require("./api")),error_1=require("./error");exports.CommerceLayerStatic={resources:()=>api.resourceList,isSdkError:r=>error_1.SdkError.isSdkError(r),isApiError:r=>error_1.ApiError.isApiError(r)};
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,i){i===void 0&&(i=t),Object.defineProperty(e,i,{enumerable:!0,get:function(){return r[t]}})}:function(e,r,t,i){i===void 0&&(i=t),e[i]=r[t]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&__createBinding(r,e,t);return __setModuleDefault(r,e),r};Object.defineProperty(exports,"__esModule",{value:!0}),exports.CommerceLayerStatic=void 0;const api=__importStar(require("./api")),error_1=require("./error");exports.CommerceLayerStatic={resources:()=>api.resourceList,isSdkError:e=>error_1.SdkError.isSdkError(e),isApiError:e=>error_1.ApiError.isApiError(e)};
@@ -12,11 +12,7 @@ declare type ApiClientInitConfig = {
12
12
  domain?: string;
13
13
  accessToken: string;
14
14
  } & RequestConfig;
15
- declare type ApiClientConfig = {
16
- organization?: string;
17
- domain?: string;
18
- accessToken?: string;
19
- } & RequestConfig;
15
+ declare type ApiClientConfig = Partial<ApiClientInitConfig>;
20
16
  declare class ApiClient {
21
17
  #private;
22
18
  static create(options: ApiClientInitConfig): ApiClient;
package/lib/esm/client.js CHANGED
@@ -1 +1 @@
1
- var h=this&&this.__classPrivateFieldSet||function(t,e,r,i,a){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?a.call(t,r):a?a.value=r:e.set(t,r),r},c=this&&this.__classPrivateFieldGet||function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},s,o;import u from"axios";import{SdkError as T,ApiError as g,ErrorType as n}from"./error";import l from"./config";const p=(t,e)=>`https://${t.toLowerCase()}.${e||l.default.domain}/api`,y=t=>{let e=new T({message:t.message,type:n.GENERIC});if(u.isAxiosError(t))if(t.response){const r=new g(e);r.type=n.RESPONSE,r.status=t.response.status,r.code=String(r.status),r.errors=t.response.data.errors,e=r}else t.request?(e.type=n.REQUEST,e.request=t.request):e.type=n.CLIENT;else u.isCancel(t)?e.type=n.CANCEL:e.source=t;throw e};class f{constructor(e){s.set(this,void 0),o.set(this,void 0),this.baseUrl=p(e.organization,e.domain),h(this,s,e.accessToken,"f");const r={timeout:e.timeout||l.client.timeout};h(this,o,u.create(Object.assign({baseURL:this.baseUrl,timeout:l.client.timeout,headers:{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json",Authorization:"Bearer "+c(this,s,"f")}},r)),"f"),this.interceptors=c(this,o,"f").interceptors}static create(e){if(!(e==null?void 0:e.organization))throw new Error("Undefined 'organization' parameter");if(!(e==null?void 0:e.accessToken))throw new Error("Undefined 'accessToken' parameter");return new f(e)}config(e){const r=c(this,o,"f").defaults;e.timeout&&(r.timeout=e.timeout),e.organization&&(this.baseUrl=p(e.organization,e.domain)),e.accessToken&&h(this,s,e.accessToken,"f")}async request(e,r,i,a){const m=i?{data:i}:void 0,w=r,v=(a==null?void 0:a.organization)?p(a.organization,a.domain):void 0,E=(a==null?void 0:a.accessToken)?{Authorization:"Bearer "+a.accessToken}:void 0;return c(this,o,"f").request(Object.assign({method:e,baseURL:v,url:w,data:m,headers:E},a)).then(d=>d.data).catch(d=>y(d))}}s=new WeakMap,o=new WeakMap;export default f;
1
+ var u=this&&this.__classPrivateFieldSet||function(a,e,t,s,r){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?a!==e||!r:!e.has(a))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?r.call(a,t):r?r.value=t:e.set(a,t),t},n=this&&this.__classPrivateFieldGet||function(a,e,t,s){if(t==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?a!==e||!s:!e.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?s:t==="a"?s.call(a):s?s.value:e.get(a)},i,o;import h from"axios";import{SdkError as y,ApiError as C,ErrorType as c}from"./error";import m from"./config";import _ from"./debug";const d=_(),f=(a,e)=>`https://${a.toLowerCase()}.${e||m.default.domain}/api`,z=a=>{let e=new y({message:a.message,type:c.GENERIC});if(h.isAxiosError(a))if(a.response){const t=new C(e);t.type=c.RESPONSE,t.status=a.response.status,t.code=String(t.status),t.errors=a.response.data.errors,e=t}else a.request?(e.type=c.REQUEST,e.request=a.request):e.type=c.CLIENT;else h.isCancel(a)?e.type=c.CANCEL:e.source=a;throw e};class w{constructor(e){i.set(this,void 0),o.set(this,void 0),d("new client instance %O",e),this.baseUrl=f(e.organization,e.domain),u(this,i,e.accessToken,"f");const t={timeout:e.timeout||m.client.timeout},s=Object.assign({baseURL:this.baseUrl,timeout:m.client.timeout,headers:{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json",Authorization:"Bearer "+n(this,i,"f")}},t);d("axios options: %O",s),u(this,o,h.create(s),"f"),this.interceptors=n(this,o,"f").interceptors}static create(e){if(!(e==null?void 0:e.organization))throw new Error("Undefined 'organization' parameter");if(!(e==null?void 0:e.accessToken))throw new Error("Undefined 'accessToken' parameter");return new w(e)}config(e){d("config %o",e);const t=n(this,o,"f").defaults;e.timeout&&(t.timeout=e.timeout),e.organization&&(this.baseUrl=f(e.organization,e.domain)),e.accessToken&&(u(this,i,e.accessToken,"f"),t.headers.common.Authorization="Bearer "+n(this,i,"f"))}async request(e,t,s,r){d("request %s %s, %O, %O",e,t,s||{},r||{});const v=s?{data:s}:void 0,T=t,b=(r==null?void 0:r.organization)?f(r.organization,r.domain):void 0,p=(r==null?void 0:r.accessToken)||n(this,i,"f"),g=p?{Authorization:"Bearer "+p}:void 0,E=Object.assign({method:e,baseURL:b,url:T,data:v,headers:g},r);return d("request params: %O",E),n(this,o,"f").request(E).then(l=>l.data).catch(l=>z(l))}}i=new WeakMap,o=new WeakMap;export default w;
@@ -105,6 +105,7 @@ declare class CommerceLayerClient {
105
105
  wire_transfers: api.WireTransfers;
106
106
  constructor(config: CommerceLayerInitConfig);
107
107
  get currentOrganization(): string;
108
+ private localConfig;
108
109
  config(config: CommerceLayerConfig): void;
109
110
  resources(): readonly string[];
110
111
  isApiError(error: any): error is ApiError;
@@ -1 +1 @@
1
- var c=this&&this.__classPrivateFieldSet||function(o,i,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?o!==i||!a:!i.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(o,n):a?a.value=n:i.set(o,n),n},s=this&&this.__classPrivateFieldGet||function(o,i,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?o!==i||!r:!i.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(o):r?r.value:i.get(o)},t,h;import*as e from"./api";import{CommerceLayerStatic as f}from"./static";import w from"./resource";const u="2.7.6";class p{constructor(i){t.set(this,void 0),h.set(this,void 0),c(this,t,new w(i),"f"),c(this,h,i.organization,"f"),this.addresses=new e.Addresses(s(this,t,"f")),this.adjustments=new e.Adjustments(s(this,t,"f")),this.adyen_gateways=new e.AdyenGateways(s(this,t,"f")),this.adyen_payments=new e.AdyenPayments(s(this,t,"f")),this.application=new e.Applications(s(this,t,"f")),this.attachments=new e.Attachments(s(this,t,"f")),this.authorizations=new e.Authorizations(s(this,t,"f")),this.avalara_accounts=new e.AvalaraAccounts(s(this,t,"f")),this.billing_info_validation_rules=new e.BillingInfoValidationRules(s(this,t,"f")),this.bing_geocoders=new e.BingGeocoders(s(this,t,"f")),this.braintree_gateways=new e.BraintreeGateways(s(this,t,"f")),this.braintree_payments=new e.BraintreePayments(s(this,t,"f")),this.bundles=new e.Bundles(s(this,t,"f")),this.captures=new e.Captures(s(this,t,"f")),this.carrier_accounts=new e.CarrierAccounts(s(this,t,"f")),this.checkout_com_gateways=new e.CheckoutComGateways(s(this,t,"f")),this.checkout_com_payments=new e.CheckoutComPayments(s(this,t,"f")),this.coupon_codes_promotion_rules=new e.CouponCodesPromotionRules(s(this,t,"f")),this.coupon_recipients=new e.CouponRecipients(s(this,t,"f")),this.coupons=new e.Coupons(s(this,t,"f")),this.customer_addresses=new e.CustomerAddresses(s(this,t,"f")),this.customer_groups=new e.CustomerGroups(s(this,t,"f")),this.customer_password_resets=new e.CustomerPasswordResets(s(this,t,"f")),this.customer_payment_sources=new e.CustomerPaymentSources(s(this,t,"f")),this.customer_subscriptions=new e.CustomerSubscriptions(s(this,t,"f")),this.customers=new e.Customers(s(this,t,"f")),this.delivery_lead_times=new e.DeliveryLeadTimes(s(this,t,"f")),this.event_callbacks=new e.EventCallbacks(s(this,t,"f")),this.external_gateways=new e.ExternalGateways(s(this,t,"f")),this.external_payments=new e.ExternalPayments(s(this,t,"f")),this.external_promotions=new e.ExternalPromotions(s(this,t,"f")),this.external_tax_calculators=new e.ExternalTaxCalculators(s(this,t,"f")),this.fixed_amount_promotions=new e.FixedAmountPromotions(s(this,t,"f")),this.fixed_price_promotions=new e.FixedPricePromotions(s(this,t,"f")),this.free_gift_promotions=new e.FreeGiftPromotions(s(this,t,"f")),this.free_shipping_promotions=new e.FreeShippingPromotions(s(this,t,"f")),this.geocoders=new e.Geocoders(s(this,t,"f")),this.gift_card_recipients=new e.GiftCardRecipients(s(this,t,"f")),this.gift_cards=new e.GiftCards(s(this,t,"f")),this.google_geocoders=new e.GoogleGeocoders(s(this,t,"f")),this.imports=new e.Imports(s(this,t,"f")),this.in_stock_subscriptions=new e.InStockSubscriptions(s(this,t,"f")),this.inventory_models=new e.InventoryModels(s(this,t,"f")),this.inventory_return_locations=new e.InventoryReturnLocations(s(this,t,"f")),this.inventory_stock_locations=new e.InventoryStockLocations(s(this,t,"f")),this.line_item_options=new e.LineItemOptions(s(this,t,"f")),this.line_items=new e.LineItems(s(this,t,"f")),this.manual_gateways=new e.ManualGateways(s(this,t,"f")),this.manual_tax_calculators=new e.ManualTaxCalculators(s(this,t,"f")),this.markets=new e.Markets(s(this,t,"f")),this.merchants=new e.Merchants(s(this,t,"f")),this.order_amount_promotion_rules=new e.OrderAmountPromotionRules(s(this,t,"f")),this.order_copies=new e.OrderCopies(s(this,t,"f")),this.order_subscriptions=new e.OrderSubscriptions(s(this,t,"f")),this.order_validation_rules=new e.OrderValidationRules(s(this,t,"f")),this.orders=new e.Orders(s(this,t,"f")),this.organization=new e.Organizations(s(this,t,"f")),this.packages=new e.Packages(s(this,t,"f")),this.parcel_line_items=new e.ParcelLineItems(s(this,t,"f")),this.parcels=new e.Parcels(s(this,t,"f")),this.payment_gateways=new e.PaymentGateways(s(this,t,"f")),this.payment_methods=new e.PaymentMethods(s(this,t,"f")),this.paypal_gateways=new e.PaypalGateways(s(this,t,"f")),this.paypal_payments=new e.PaypalPayments(s(this,t,"f")),this.percentage_discount_promotions=new e.PercentageDiscountPromotions(s(this,t,"f")),this.price_lists=new e.PriceLists(s(this,t,"f")),this.prices=new e.Prices(s(this,t,"f")),this.promotion_rules=new e.PromotionRules(s(this,t,"f")),this.promotions=new e.Promotions(s(this,t,"f")),this.refunds=new e.Refunds(s(this,t,"f")),this.return_line_items=new e.ReturnLineItems(s(this,t,"f")),this.returns=new e.Returns(s(this,t,"f")),this.shipments=new e.Shipments(s(this,t,"f")),this.shipping_categories=new e.ShippingCategories(s(this,t,"f")),this.shipping_methods=new e.ShippingMethods(s(this,t,"f")),this.shipping_zones=new e.ShippingZones(s(this,t,"f")),this.sku_list_items=new e.SkuListItems(s(this,t,"f")),this.sku_list_promotion_rules=new e.SkuListPromotionRules(s(this,t,"f")),this.sku_lists=new e.SkuLists(s(this,t,"f")),this.sku_options=new e.SkuOptions(s(this,t,"f")),this.skus=new e.Skus(s(this,t,"f")),this.stock_items=new e.StockItems(s(this,t,"f")),this.stock_line_items=new e.StockLineItems(s(this,t,"f")),this.stock_locations=new e.StockLocations(s(this,t,"f")),this.stock_transfers=new e.StockTransfers(s(this,t,"f")),this.stripe_gateways=new e.StripeGateways(s(this,t,"f")),this.stripe_payments=new e.StripePayments(s(this,t,"f")),this.tax_calculators=new e.TaxCalculators(s(this,t,"f")),this.tax_categories=new e.TaxCategories(s(this,t,"f")),this.tax_rules=new e.TaxRules(s(this,t,"f")),this.taxjar_accounts=new e.TaxjarAccounts(s(this,t,"f")),this.transactions=new e.Transactions(s(this,t,"f")),this.voids=new e.Voids(s(this,t,"f")),this.webhooks=new e.Webhooks(s(this,t,"f")),this.wire_transfers=new e.WireTransfers(s(this,t,"f"))}static get openApiSchemaVersion(){return u}get currentOrganization(){return s(this,h,"f")}config(i){!i||(i.organization&&c(this,h,i.organization,"f"),s(this,t,"f").config(i))}resources(){return f.resources()}isApiError(i){return f.isApiError(i)}addRequestInterceptor(i,n){return s(this,t,"f").interceptors.request.use(i,n)}addResponseInterceptor(i,n){return s(this,t,"f").interceptors.response.use(i,n)}removeInterceptor(i,n){return s(this,t,"f").interceptors[i].eject(n)}addRawResponseReader(){const i={id:void 0,rawResponse:void 0};function n(a){return i.rawResponse=a==null?void 0:a.data,a}const r=this.addResponseInterceptor(n);return i.id=r,i}removeRawResponseReader(i){const n=typeof i=="number"?i:i.id;if(n)return this.removeInterceptor("response",n)}}t=new WeakMap,h=new WeakMap;const m=o=>new p(o);export default m;
1
+ var c=this&&this.__classPrivateFieldSet||function(o,i,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?o!==i||!a:!i.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(o,n):a?a.value=n:i.set(o,n),n},s=this&&this.__classPrivateFieldGet||function(o,i,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?o!==i||!r:!i.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(o):r?r.value:i.get(o)},t,h;import*as e from"./api";import{CommerceLayerStatic as f}from"./static";import u from"./resource";import p from"./debug";const w=p(),m="2.7.6";class l{constructor(i){t.set(this,void 0),h.set(this,void 0),w("new commercelayer instance %O",i),c(this,t,new u(i),"f"),c(this,h,i.organization,"f"),this.addresses=new e.Addresses(s(this,t,"f")),this.adjustments=new e.Adjustments(s(this,t,"f")),this.adyen_gateways=new e.AdyenGateways(s(this,t,"f")),this.adyen_payments=new e.AdyenPayments(s(this,t,"f")),this.application=new e.Applications(s(this,t,"f")),this.attachments=new e.Attachments(s(this,t,"f")),this.authorizations=new e.Authorizations(s(this,t,"f")),this.avalara_accounts=new e.AvalaraAccounts(s(this,t,"f")),this.billing_info_validation_rules=new e.BillingInfoValidationRules(s(this,t,"f")),this.bing_geocoders=new e.BingGeocoders(s(this,t,"f")),this.braintree_gateways=new e.BraintreeGateways(s(this,t,"f")),this.braintree_payments=new e.BraintreePayments(s(this,t,"f")),this.bundles=new e.Bundles(s(this,t,"f")),this.captures=new e.Captures(s(this,t,"f")),this.carrier_accounts=new e.CarrierAccounts(s(this,t,"f")),this.checkout_com_gateways=new e.CheckoutComGateways(s(this,t,"f")),this.checkout_com_payments=new e.CheckoutComPayments(s(this,t,"f")),this.coupon_codes_promotion_rules=new e.CouponCodesPromotionRules(s(this,t,"f")),this.coupon_recipients=new e.CouponRecipients(s(this,t,"f")),this.coupons=new e.Coupons(s(this,t,"f")),this.customer_addresses=new e.CustomerAddresses(s(this,t,"f")),this.customer_groups=new e.CustomerGroups(s(this,t,"f")),this.customer_password_resets=new e.CustomerPasswordResets(s(this,t,"f")),this.customer_payment_sources=new e.CustomerPaymentSources(s(this,t,"f")),this.customer_subscriptions=new e.CustomerSubscriptions(s(this,t,"f")),this.customers=new e.Customers(s(this,t,"f")),this.delivery_lead_times=new e.DeliveryLeadTimes(s(this,t,"f")),this.event_callbacks=new e.EventCallbacks(s(this,t,"f")),this.external_gateways=new e.ExternalGateways(s(this,t,"f")),this.external_payments=new e.ExternalPayments(s(this,t,"f")),this.external_promotions=new e.ExternalPromotions(s(this,t,"f")),this.external_tax_calculators=new e.ExternalTaxCalculators(s(this,t,"f")),this.fixed_amount_promotions=new e.FixedAmountPromotions(s(this,t,"f")),this.fixed_price_promotions=new e.FixedPricePromotions(s(this,t,"f")),this.free_gift_promotions=new e.FreeGiftPromotions(s(this,t,"f")),this.free_shipping_promotions=new e.FreeShippingPromotions(s(this,t,"f")),this.geocoders=new e.Geocoders(s(this,t,"f")),this.gift_card_recipients=new e.GiftCardRecipients(s(this,t,"f")),this.gift_cards=new e.GiftCards(s(this,t,"f")),this.google_geocoders=new e.GoogleGeocoders(s(this,t,"f")),this.imports=new e.Imports(s(this,t,"f")),this.in_stock_subscriptions=new e.InStockSubscriptions(s(this,t,"f")),this.inventory_models=new e.InventoryModels(s(this,t,"f")),this.inventory_return_locations=new e.InventoryReturnLocations(s(this,t,"f")),this.inventory_stock_locations=new e.InventoryStockLocations(s(this,t,"f")),this.line_item_options=new e.LineItemOptions(s(this,t,"f")),this.line_items=new e.LineItems(s(this,t,"f")),this.manual_gateways=new e.ManualGateways(s(this,t,"f")),this.manual_tax_calculators=new e.ManualTaxCalculators(s(this,t,"f")),this.markets=new e.Markets(s(this,t,"f")),this.merchants=new e.Merchants(s(this,t,"f")),this.order_amount_promotion_rules=new e.OrderAmountPromotionRules(s(this,t,"f")),this.order_copies=new e.OrderCopies(s(this,t,"f")),this.order_subscriptions=new e.OrderSubscriptions(s(this,t,"f")),this.order_validation_rules=new e.OrderValidationRules(s(this,t,"f")),this.orders=new e.Orders(s(this,t,"f")),this.organization=new e.Organizations(s(this,t,"f")),this.packages=new e.Packages(s(this,t,"f")),this.parcel_line_items=new e.ParcelLineItems(s(this,t,"f")),this.parcels=new e.Parcels(s(this,t,"f")),this.payment_gateways=new e.PaymentGateways(s(this,t,"f")),this.payment_methods=new e.PaymentMethods(s(this,t,"f")),this.paypal_gateways=new e.PaypalGateways(s(this,t,"f")),this.paypal_payments=new e.PaypalPayments(s(this,t,"f")),this.percentage_discount_promotions=new e.PercentageDiscountPromotions(s(this,t,"f")),this.price_lists=new e.PriceLists(s(this,t,"f")),this.prices=new e.Prices(s(this,t,"f")),this.promotion_rules=new e.PromotionRules(s(this,t,"f")),this.promotions=new e.Promotions(s(this,t,"f")),this.refunds=new e.Refunds(s(this,t,"f")),this.return_line_items=new e.ReturnLineItems(s(this,t,"f")),this.returns=new e.Returns(s(this,t,"f")),this.shipments=new e.Shipments(s(this,t,"f")),this.shipping_categories=new e.ShippingCategories(s(this,t,"f")),this.shipping_methods=new e.ShippingMethods(s(this,t,"f")),this.shipping_zones=new e.ShippingZones(s(this,t,"f")),this.sku_list_items=new e.SkuListItems(s(this,t,"f")),this.sku_list_promotion_rules=new e.SkuListPromotionRules(s(this,t,"f")),this.sku_lists=new e.SkuLists(s(this,t,"f")),this.sku_options=new e.SkuOptions(s(this,t,"f")),this.skus=new e.Skus(s(this,t,"f")),this.stock_items=new e.StockItems(s(this,t,"f")),this.stock_line_items=new e.StockLineItems(s(this,t,"f")),this.stock_locations=new e.StockLocations(s(this,t,"f")),this.stock_transfers=new e.StockTransfers(s(this,t,"f")),this.stripe_gateways=new e.StripeGateways(s(this,t,"f")),this.stripe_payments=new e.StripePayments(s(this,t,"f")),this.tax_calculators=new e.TaxCalculators(s(this,t,"f")),this.tax_categories=new e.TaxCategories(s(this,t,"f")),this.tax_rules=new e.TaxRules(s(this,t,"f")),this.taxjar_accounts=new e.TaxjarAccounts(s(this,t,"f")),this.transactions=new e.Transactions(s(this,t,"f")),this.voids=new e.Voids(s(this,t,"f")),this.webhooks=new e.Webhooks(s(this,t,"f")),this.wire_transfers=new e.WireTransfers(s(this,t,"f"))}static get openApiSchemaVersion(){return m}get currentOrganization(){return s(this,h,"f")}localConfig(i){i.organization&&c(this,h,i.organization,"f")}config(i){w("config %o",i),this.localConfig(i),s(this,t,"f").config(i)}resources(){return f.resources()}isApiError(i){return f.isApiError(i)}addRequestInterceptor(i,n){return s(this,t,"f").interceptors.request.use(i,n)}addResponseInterceptor(i,n){return s(this,t,"f").interceptors.response.use(i,n)}removeInterceptor(i,n){return s(this,t,"f").interceptors[i].eject(n)}addRawResponseReader(){const i={id:void 0,rawResponse:void 0};function n(a){return i.rawResponse=a==null?void 0:a.data,a}const r=this.addResponseInterceptor(n);return i.id=r,i}removeRawResponseReader(i){const n=typeof i=="number"?i:i.id;if(n)return this.removeInterceptor("response",n)}}t=new WeakMap,h=new WeakMap;const _=o=>new l(o);export default _;
package/lib/esm/common.js CHANGED
@@ -1 +1 @@
1
- import{resourceList as t}from"./api";const p=e=>e&&e.type&&e.id&&t.includes(e.type),i=e=>e&&typeof e.type!="undefined"&&e.type&&t.includes(e.type);export{p as isResourceId,i as isResourceType};
1
+ import{resourceList as e}from"./api";const p=s=>s&&s.type&&s.id&&e.includes(s.type),t=s=>s&&typeof s.type!="undefined"&&s.type&&e.includes(s.type);export{p as isResourceId,t as isResourceType};
@@ -5,7 +5,7 @@ declare const config: {
5
5
  readonly pageSize: 10;
6
6
  };
7
7
  readonly client: {
8
- readonly timeout: 3000;
8
+ readonly timeout: 15000;
9
9
  };
10
10
  };
11
11
  export default config;
package/lib/esm/config.js CHANGED
@@ -1 +1 @@
1
- const e={default:{domain:"commercelayer.io",pageNumber:1,pageSize:10},client:{timeout:3e3}};export default e;
1
+ const e={default:{domain:"commercelayer.io",pageNumber:1,pageSize:10},client:{timeout:15e3}};export default e;
@@ -0,0 +1,3 @@
1
+ declare type Debugger = (pattern: string, ...args: any[]) => void;
2
+ declare const debug: (namespace?: string | undefined) => Debugger;
3
+ export default debug;
@@ -0,0 +1 @@
1
+ const a=(e,...r)=>{};let t=e=>a;try{const e=require("debug");e&&typeof e=="function"&&(t=e)}catch{}const n="clsdk",o=()=>{const e=new Error;Error.prepareStackTrace=(d,c)=>c;const r=e.stack;return Error.prepareStackTrace=void 0,(r[2].getFileName()||"/").replace(/^.*[\\/]/,"").replace(".ts","")},s=e=>t(`${n}:${e||o()}`);export default s;
package/lib/esm/error.js CHANGED
@@ -1 +1 @@
1
- var t;(function(s){s.CLIENT="client",s.REQUEST="request",s.RESPONSE="response",s.GENERIC="generic",s.CANCEL="cancel"})(t||(t={}));class e extends Error{constructor(r){super(r.message);this.name=this.constructor.name,this.type=r.type||t.GENERIC}static isSdkError(r){return r&&["SdkError","ApiError"].includes(r.name)&&Object.values(t).includes(r.type)}}class i extends e{constructor(r){super(Object.assign(Object.assign({},r),{type:t.RESPONSE}));this.errors=[],this.name=this.constructor.name}static isApiError(r){return e.isSdkError(r)&&r.name==="ApiError"&&r.type===t.RESPONSE}first(){var r;return((r=this.errors)===null||r===void 0?void 0:r.length)>0?this.errors[0]:void 0}}export{e as SdkError,i as ApiError,t as ErrorType};
1
+ var s;(function(e){e.CLIENT="client",e.REQUEST="request",e.RESPONSE="response",e.GENERIC="generic",e.CANCEL="cancel"})(s||(s={}));class t extends Error{constructor(r){super(r.message);this.name=this.constructor.name,this.type=r.type||s.GENERIC}static isSdkError(r){return r&&["SdkError","ApiError"].includes(r.name)&&Object.values(s).includes(r.type)}}class i extends t{constructor(r){super(Object.assign(Object.assign({},r),{type:s.RESPONSE}));this.errors=[],this.name=this.constructor.name}static isApiError(r){return t.isSdkError(r)&&r.name==="ApiError"&&r.type===s.RESPONSE}first(){var r;return((r=this.errors)===null||r===void 0?void 0:r.length)>0?this.errors[0]:void 0}}export{t as SdkError,i as ApiError,s as ErrorType};
@@ -1 +1 @@
1
- import{isResourceId as o}from"./common";const l=i=>{let e;i.links&&delete i.links;const s=i.data,a=i.included;return Array.isArray(s)?e=s.map(r=>t(r,a)):e=t(s,a),e},d=(i,e=[])=>e.find(s=>i.id===s.id&&i.type===s.type)||i,t=(i,e)=>{const s=Object.assign({id:i.id,type:i.type},i.attributes);return i.relationships&&Object.keys(i.relationships).forEach(a=>{const r=i.relationships[a].data;r?Array.isArray(r)?s[a]=r.map(n=>t(d(n,e),e)):s[a]=t(d(r,e),e):r===null&&(s[a]=null)}),s},c=i=>{const e={},s={};for(const r in i){if(["type","id"].includes(r))continue;const n=i[r];n&&(o(n)||Array.isArray(n)&&o(n[0]))?s[r]={data:n}:e[r]=n}const a={type:i.type,attributes:e,relationships:s};return o(i)&&(a.id=i.id),a};export{l as denormalize,c as normalize};
1
+ import{isResourceId as i}from"./common";import c from"./debug";const a=c(),p=r=>{let s;r.links&&delete r.links;const e=r.data,n=r.included;return Array.isArray(e)?s=e.map(t=>d(t,n)):s=d(e,n),s},l=(r,s=[])=>s.find(e=>r.id===e.id&&r.type===e.type)||r,d=(r,s)=>{a("denormalize resource: %O, %o",r,s||{});const e=Object.assign({id:r.id,type:r.type},r.attributes);return r.relationships&&Object.keys(r.relationships).forEach(n=>{const t=r.relationships[n].data;t?Array.isArray(t)?e[n]=t.map(o=>d(l(o,s),s)):e[n]=d(l(t,s),s):t===null&&(e[n]=null)}),a("denormalized resource: %O",e),e},u=r=>{a("normalize resource: %O",r);const s={},e={};for(const t in r){if(["type","id"].includes(t))continue;const o=r[t];o&&(i(o)||Array.isArray(o)&&i(o[0]))?e[t]={data:o}:s[t]=o}const n={type:r.type,attributes:s,relationships:e};return i(r)&&(n.id=r.id),a("normalized resource: %O",n),n};export{p as denormalize,u as normalize};
package/lib/esm/query.js CHANGED
@@ -1 +1 @@
1
- const r=e=>e.filters||e.pageNumber||e.pageSize||e.sort,o=(e,n)=>{const i={};return e&&(e.include&&(i.include=e.include.join(",")),e.fields&&(Array.isArray(e.fields)&&(e.fields={[n.type]:e.fields}),Object.entries(e.fields).forEach(([t,f])=>{i[`fields[${t}]`]=f.join(",")})),r(e)&&(e.sort&&(Array.isArray(e.sort)?i.sort=e.sort.join(","):i.sort=Object.entries(e.sort).map(([t,f])=>`${f==="desc"?"-":""}${t}`).join(",")),e.pageNumber&&(i["page[number]"]=String(e.pageNumber)),e.pageSize&&(i["page[size]"]=String(e.pageSize)),e.filters&&Object.entries(e.filters).forEach(([t,f])=>{i[`filter[q][${t}]`]=String(f)}))),i};export{o as generateQueryStringParams};
1
+ import n from"./debug";const a=n(),o=r=>r.filters||r.pageNumber||r.pageSize||r.sort,g=(r,e)=>{a("generate query string params: %O, %O",r,e);const i={};return r&&(r.include&&(i.include=r.include.join(",")),r.fields&&(Array.isArray(r.fields)&&(r.fields={[e.type]:r.fields}),Object.entries(r.fields).forEach(([s,t])=>{i[`fields[${s}]`]=t.join(",")})),o(r)&&(r.sort&&(Array.isArray(r.sort)?i.sort=r.sort.join(","):i.sort=Object.entries(r.sort).map(([s,t])=>`${t==="desc"?"-":""}${s}`).join(",")),r.pageNumber&&(i["page[number]"]=String(r.pageNumber)),r.pageSize&&(i["page[size]"]=String(r.pageSize)),r.filters&&Object.entries(r.filters).forEach(([s,t])=>{i[`filter[q][${s}]`]=String(t)})),a("query string params: %O",i)),i};export{g as generateQueryStringParams};
@@ -1,4 +1,4 @@
1
- import { ApiClientConfig, ApiClientInitConfig } from './client';
1
+ import { ApiClientInitConfig } from './client';
2
2
  import { QueryParamsRetrieve, QueryParamsList } from './query';
3
3
  import { ResourceTypeLock } from './api';
4
4
  import { InterceptorManager } from './interceptor';
@@ -46,11 +46,12 @@ declare class ListResponse<R> extends Array<R> {
46
46
  export type { Metadata, ResourceType, ResourceId, Resource, ResourceCreate, ResourceUpdate, ListResponse };
47
47
  declare type ResourceAdapterConfig = {};
48
48
  declare type ResourcesInitConfig = ResourceAdapterConfig & ApiClientInitConfig;
49
- declare type ResourcesConfig = ResourceAdapterConfig & ApiClientConfig;
49
+ declare type ResourcesConfig = Partial<ResourcesInitConfig>;
50
50
  declare class ResourceAdapter {
51
51
  #private;
52
52
  constructor(config: ResourcesInitConfig);
53
53
  get interceptors(): InterceptorManager;
54
+ private localConfig;
54
55
  config(config: ResourcesConfig): void;
55
56
  singleton<R extends Resource>(resource: ResourceType, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<R>;
56
57
  retrieve<R extends Resource>(resource: ResourceId, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<R>;
@@ -64,6 +65,7 @@ declare abstract class ApiResource {
64
65
  protected resources: ResourceAdapter;
65
66
  constructor(adapter: ResourceAdapter);
66
67
  abstract relationship(id: string | ResourceId): ResourceId;
68
+ abstract type(): string;
67
69
  }
68
70
  export default ResourceAdapter;
69
71
  export { ApiResource, ResourcesConfig, ResourcesInitConfig };
@@ -1 +1 @@
1
- var f=this&&this.__classPrivateFieldSet||function(a,t,s,e,r){if(e==="m")throw new TypeError("Private method is not writable");if(e==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?a!==t||!r:!t.has(a))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e==="a"?r.call(a,s):r?r.value=s:t.set(a,s),s},o=this&&this.__classPrivateFieldGet||function(a,t,s,e){if(s==="a"&&!e)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?a!==t||!e:!t.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?e:s==="a"?e.call(a):e?e.value:t.get(a)},n,p;import w from"./client";import{denormalize as l,normalize as h}from"./jsonapi";import{generateQueryStringParams as u}from"./query";import m from"./config";class b extends Array{constructor(t,s){super(...s||[]);this.meta=t}first(){return this.length?this[0]:void 0}last(){return this.length?this[this.length-1]:void 0}get(t){return this.length&&t>=0?this[t]:void 0}}class y{constructor(t){n.set(this,void 0),p.set(this,{}),f(this,n,w.create(t),"f"),this.config(t)}get interceptors(){return o(this,n,"f").interceptors}config(t){!t||o(this,n,"f").config(t)}async singleton(t,s,e){const r=u(s,t);(e==null?void 0:e.params)&&Object.assign(r,e==null?void 0:e.params);const i=await o(this,n,"f").request("get",`${t.type}`,void 0,Object.assign(Object.assign({},e),{params:r}));return l(i)}async retrieve(t,s,e){const r=u(s,t);(e==null?void 0:e.params)&&Object.assign(r,e==null?void 0:e.params);const i=await o(this,n,"f").request("get",`${t.type}/${t.id}`,void 0,Object.assign(Object.assign({},e),{params:r}));return l(i)}async list(t,s,e){var r,i;const c=u(s,t);(e==null?void 0:e.params)&&Object.assign(c,e==null?void 0:e.params);const d=await o(this,n,"f").request("get",`${t.type}`,void 0,Object.assign(Object.assign({},e),{params:c})),g=l(d),v={pageCount:Number((r=d.meta)===null||r===void 0?void 0:r.page_count),recordCount:Number((i=d.meta)===null||i===void 0?void 0:i.record_count),currentPage:(s==null?void 0:s.pageNumber)||m.default.pageNumber,recordsPerPage:(s==null?void 0:s.pageSize)||m.default.pageSize};return new b(v,g)}async create(t,s,e){const r=u(s,t);(e==null?void 0:e.params)&&Object.assign(r,e==null?void 0:e.params);const i=h(t),c=await o(this,n,"f").request("post",t.type,i,Object.assign(Object.assign({},e),{params:r}));return l(c)}async update(t,s,e){const r=u(s,t);(e==null?void 0:e.params)&&Object.assign(r,e==null?void 0:e.params);const i=h(t),c=await o(this,n,"f").request("patch",`${t.type}/${t.id}`,i,Object.assign(Object.assign({},e),{params:r}));return l(c)}async delete(t,s){await o(this,n,"f").request("delete",`${t.type}/${t.id}`,void 0,s)}}n=new WeakMap,p=new WeakMap;class j{constructor(t){this.resources=t}}export default y;export{j as ApiResource};
1
+ var w=this&&this.__classPrivateFieldSet||function(a,t,s,e,r){if(e==="m")throw new TypeError("Private method is not writable");if(e==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?a!==t||!r:!t.has(a))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e==="a"?r.call(a,s):r?r.value=s:t.set(a,s),s},n=this&&this.__classPrivateFieldGet||function(a,t,s,e){if(s==="a"&&!e)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?a!==t||!e:!t.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?e:s==="a"?e.call(a):e?e.value:t.get(a)},o,g;import O from"./client";import{denormalize as u,normalize as h}from"./jsonapi";import{generateQueryStringParams as d}from"./query";import m from"./config";import b from"./debug";const c=b();class y extends Array{constructor(t,s){super(...s||[]);this.meta=t}first(){return this.length?this[0]:void 0}last(){return this.length?this[this.length-1]:void 0}get(t){return this.length&&t>=0?this[t]:void 0}}class j{constructor(t){o.set(this,void 0),g.set(this,{}),w(this,o,O.create(t),"f"),this.localConfig(t)}get interceptors(){return n(this,o,"f").interceptors}localConfig(t){}config(t){c("config %o",t),this.localConfig(t),n(this,o,"f").config(t)}async singleton(t,s,e){c("singleton: %o, %O, %O",t,s||{},e||{});const r=d(s,t);(e==null?void 0:e.params)&&Object.assign(r,e==null?void 0:e.params);const i=await n(this,o,"f").request("get",`${t.type}`,void 0,Object.assign(Object.assign({},e),{params:r}));return u(i)}async retrieve(t,s,e){c("retrieve: %o, %O, %O",t,s||{},e||{});const r=d(s,t);(e==null?void 0:e.params)&&Object.assign(r,e==null?void 0:e.params);const i=await n(this,o,"f").request("get",`${t.type}/${t.id}`,void 0,Object.assign(Object.assign({},e),{params:r}));return u(i)}async list(t,s,e){var r,i;c("list: %o, %O, %O",t,s||{},e||{});const l=d(s,t);(e==null?void 0:e.params)&&Object.assign(l,e==null?void 0:e.params);const p=await n(this,o,"f").request("get",`${t.type}`,void 0,Object.assign(Object.assign({},e),{params:l})),f=u(p),v={pageCount:Number((r=p.meta)===null||r===void 0?void 0:r.page_count),recordCount:Number((i=p.meta)===null||i===void 0?void 0:i.record_count),currentPage:(s==null?void 0:s.pageNumber)||m.default.pageNumber,recordsPerPage:(s==null?void 0:s.pageSize)||m.default.pageSize};return new y(v,f)}async create(t,s,e){c("create: %o, %O, %O",t,s||{},e||{});const r=d(s,t);(e==null?void 0:e.params)&&Object.assign(r,e==null?void 0:e.params);const i=h(t),l=await n(this,o,"f").request("post",t.type,i,Object.assign(Object.assign({},e),{params:r}));return u(l)}async update(t,s,e){c("update: %o, %O, %O",t,s||{},e||{});const r=d(s,t);(e==null?void 0:e.params)&&Object.assign(r,e==null?void 0:e.params);const i=h(t),l=await n(this,o,"f").request("patch",`${t.type}/${t.id}`,i,Object.assign(Object.assign({},e),{params:r}));return u(l)}async delete(t,s){c("delete: %o, %O",t,s||{}),await n(this,o,"f").request("delete",`${t.type}/${t.id}`,void 0,s)}}o=new WeakMap,g=new WeakMap;class P{constructor(t){c("new resource instance: %s",this.type()),this.resources=t}}export default j;export{P as ApiResource};
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class s extends i{async list(e,t){return this.resources.list({type:s.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:s.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:s.TYPE,id:e},t)}isAddress(e){return e.type&&e.type===s.TYPE}relationship(e){return typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="addresses";export default s;
1
+ import{ApiResource as i}from"../resource";class t extends i{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async create(e,r,s){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}isAddress(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="addresses";export default t;
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class t extends i{async list(e,s){return this.resources.list({type:t.TYPE},e,s)}async create(e,s,r){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),s,r)}async retrieve(e,s,r){return this.resources.retrieve({type:t.TYPE,id:e},s,r)}async update(e,s,r){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),s,r)}async delete(e,s){await this.resources.delete({type:t.TYPE,id:e},s)}isAdjustment(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="adjustments";export default t;
1
+ import{ApiResource as i}from"../resource";class s extends i{async list(e,t){return this.resources.list({type:s.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:s.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:s.TYPE,id:e},t)}isAdjustment(e){return e.type&&e.type===s.TYPE}relationship(e){return typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="adjustments";export default s;
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class s extends i{async list(e,t){return this.resources.list({type:s.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:s.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:s.TYPE,id:e},t)}isAdyenGateway(e){return e.type&&e.type===s.TYPE}relationship(e){return typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="adyen_gateways";export default s;
1
+ import{ApiResource as i}from"../resource";class t extends i{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async create(e,r,s){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}isAdyenGateway(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="adyen_gateways";export default t;
@@ -18,7 +18,7 @@ interface AdyenPayment extends Resource {
18
18
  payment_gateway?: PaymentGateway;
19
19
  }
20
20
  interface AdyenPaymentCreate extends ResourceCreate {
21
- order?: OrderRel;
21
+ order: OrderRel;
22
22
  }
23
23
  interface AdyenPaymentUpdate extends ResourceUpdate {
24
24
  payment_request_data?: object;
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class s extends i{async list(e,t){return this.resources.list({type:s.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:s.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:s.TYPE,id:e},t)}isAdyenPayment(e){return e.type&&e.type===s.TYPE}relationship(e){return typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="adyen_payments";export default s;
1
+ import{ApiResource as i}from"../resource";class t extends i{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async create(e,r,s){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}isAdyenPayment(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="adyen_payments";export default t;
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class r extends i{async retrieve(e,t){return this.resources.singleton({type:r.TYPE},e,t)}isApplication(e){return e.type&&e.type===r.TYPE}relationship(e){return typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}r.TYPE="application";export default r;
1
+ import{ApiResource as p}from"../resource";class e extends p{async retrieve(t,i){return this.resources.singleton({type:e.TYPE},t,i)}isApplication(t){return t.type&&t.type===e.TYPE}relationship(t){return typeof t=="string"?{id:t,type:e.TYPE}:{id:t.id,type:e.TYPE}}type(){return e.TYPE}}e.TYPE="application";export default e;
@@ -133,7 +133,7 @@ interface AttachmentCreate extends ResourceCreate {
133
133
  name: string;
134
134
  description?: string;
135
135
  url?: string;
136
- attachable?: BundleRel | CarrierAccountRel | CustomerGroupRel | CustomerRel | DeliveryLeadTimeRel | GeocoderRel | GiftCardRecipientRel | GiftCardRel | InventoryModelRel | MarketRel | MerchantRel | BillingInfoValidationRuleRel | OrderRel | PackageRel | ParcelRel | PaymentMethodRel | PriceListRel | PriceRel | PromotionRel | ReturnRel | ShipmentRel | ShippingCategoryRel | ShippingMethodRel | ShippingZoneRel | SkuOptionRel | SkuRel | StockItemRel | StockLocationRel | TaxCalculatorRel | TaxCategoryRel;
136
+ attachable: BundleRel | CarrierAccountRel | CustomerGroupRel | CustomerRel | DeliveryLeadTimeRel | GeocoderRel | GiftCardRecipientRel | GiftCardRel | InventoryModelRel | MarketRel | MerchantRel | BillingInfoValidationRuleRel | OrderRel | PackageRel | ParcelRel | PaymentMethodRel | PriceListRel | PriceRel | PromotionRel | ReturnRel | ShipmentRel | ShippingCategoryRel | ShippingMethodRel | ShippingZoneRel | SkuOptionRel | SkuRel | StockItemRel | StockLocationRel | TaxCalculatorRel | TaxCategoryRel;
137
137
  }
138
138
  interface AttachmentUpdate extends ResourceUpdate {
139
139
  name?: string;
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class r extends i{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async retrieve(e,t,s){return this.resources.retrieve({type:r.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:r.TYPE}),t,s)}isAuthorization(e){return e.type&&e.type===r.TYPE}relationship(e){return typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}r.TYPE="authorizations";export default r;
1
+ import{ApiResource as r}from"../resource";class e extends r{async list(t,s){return this.resources.list({type:e.TYPE},t,s)}async retrieve(t,s,i){return this.resources.retrieve({type:e.TYPE,id:t},s,i)}async update(t,s,i){return this.resources.update(Object.assign(Object.assign({},t),{type:e.TYPE}),s,i)}isAuthorization(t){return t.type&&t.type===e.TYPE}relationship(t){return typeof t=="string"?{id:t,type:e.TYPE}:{id:t.id,type:e.TYPE}}type(){return e.TYPE}}e.TYPE="authorizations";export default e;
@@ -1 +1 @@
1
- import{ApiResource as a}from"../resource";class s extends a{async list(e,r){return this.resources.list({type:s.TYPE},e,r)}async create(e,r,t){return this.resources.create(Object.assign(Object.assign({},e),{type:s.TYPE}),r,t)}async retrieve(e,r,t){return this.resources.retrieve({type:s.TYPE,id:e},r,t)}async update(e,r,t){return this.resources.update(Object.assign(Object.assign({},e),{type:s.TYPE}),r,t)}async delete(e,r){await this.resources.delete({type:s.TYPE,id:e},r)}isAvalaraAccount(e){return e.type&&e.type===s.TYPE}relationship(e){return typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="avalara_accounts";export default s;
1
+ import{ApiResource as a}from"../resource";class t extends a{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async create(e,r,s){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}isAvalaraAccount(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="avalara_accounts";export default t;
@@ -11,7 +11,7 @@ interface BillingInfoValidationRule extends Resource {
11
11
  market?: Market;
12
12
  }
13
13
  interface BillingInfoValidationRuleCreate extends ResourceCreate {
14
- market?: MarketRel;
14
+ market: MarketRel;
15
15
  }
16
16
  interface BillingInfoValidationRuleUpdate extends ResourceUpdate {
17
17
  market?: MarketRel;
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class s extends i{async list(e,t){return this.resources.list({type:s.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:s.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:s.TYPE,id:e},t)}isBillingInfoValidationRule(e){return e.type&&e.type===s.TYPE}relationship(e){return typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="billing_info_validation_rules";export default s;
1
+ import{ApiResource as s}from"../resource";class t extends s{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async create(e,r,i){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),r,i)}async retrieve(e,r,i){return this.resources.retrieve({type:t.TYPE,id:e},r,i)}async update(e,r,i){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),r,i)}async delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}isBillingInfoValidationRule(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="billing_info_validation_rules";export default t;
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class t extends i{async list(e,s){return this.resources.list({type:t.TYPE},e,s)}async create(e,s,r){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),s,r)}async retrieve(e,s,r){return this.resources.retrieve({type:t.TYPE,id:e},s,r)}async update(e,s,r){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),s,r)}async delete(e,s){await this.resources.delete({type:t.TYPE,id:e},s)}isBingGeocoder(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="bing_geocoders";export default t;
1
+ import{ApiResource as i}from"../resource";class s extends i{async list(e,r){return this.resources.list({type:s.TYPE},e,r)}async create(e,r,t){return this.resources.create(Object.assign(Object.assign({},e),{type:s.TYPE}),r,t)}async retrieve(e,r,t){return this.resources.retrieve({type:s.TYPE,id:e},r,t)}async update(e,r,t){return this.resources.update(Object.assign(Object.assign({},e),{type:s.TYPE}),r,t)}async delete(e,r){await this.resources.delete({type:s.TYPE,id:e},r)}isBingGeocoder(e){return e.type&&e.type===s.TYPE}relationship(e){return typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="bing_geocoders";export default s;
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class r extends i{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,s){return this.resources.create(Object.assign(Object.assign({},e),{type:r.TYPE}),t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:r.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:r.TYPE}),t,s)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}isBraintreeGateway(e){return e.type&&e.type===r.TYPE}relationship(e){return typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}r.TYPE="braintree_gateways";export default r;
1
+ import{ApiResource as i}from"../resource";class t extends i{async list(e,s){return this.resources.list({type:t.TYPE},e,s)}async create(e,s,r){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),s,r)}async retrieve(e,s,r){return this.resources.retrieve({type:t.TYPE,id:e},s,r)}async update(e,s,r){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),s,r)}async delete(e,s){await this.resources.delete({type:t.TYPE,id:e},s)}isBraintreeGateway(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="braintree_gateways";export default t;
@@ -21,7 +21,7 @@ interface BraintreePaymentCreate extends ResourceCreate {
21
21
  payment_id?: string;
22
22
  local?: boolean;
23
23
  options?: object;
24
- order?: OrderRel;
24
+ order: OrderRel;
25
25
  }
26
26
  interface BraintreePaymentUpdate extends ResourceUpdate {
27
27
  payment_method_nonce?: string;
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class r extends i{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,s){return this.resources.create(Object.assign(Object.assign({},e),{type:r.TYPE}),t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:r.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:r.TYPE}),t,s)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}isBraintreePayment(e){return e.type&&e.type===r.TYPE}relationship(e){return typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}r.TYPE="braintree_payments";export default r;
1
+ import{ApiResource as i}from"../resource";class t extends i{async list(e,s){return this.resources.list({type:t.TYPE},e,s)}async create(e,s,r){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),s,r)}async retrieve(e,s,r){return this.resources.retrieve({type:t.TYPE,id:e},s,r)}async update(e,s,r){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),s,r)}async delete(e,s){await this.resources.delete({type:t.TYPE,id:e},s)}isBraintreePayment(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="braintree_payments";export default t;
@@ -39,7 +39,7 @@ interface BundleCreate extends ResourceCreate {
39
39
  compare_at_amount_cents: number;
40
40
  _compute_compare_at_amount?: boolean;
41
41
  market?: MarketRel;
42
- sku_list?: SkuListRel;
42
+ sku_list: SkuListRel;
43
43
  }
44
44
  interface BundleUpdate extends ResourceUpdate {
45
45
  code?: string;
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class s extends i{async list(e,r){return this.resources.list({type:s.TYPE},e,r)}async create(e,r,t){return this.resources.create(Object.assign(Object.assign({},e),{type:s.TYPE}),r,t)}async retrieve(e,r,t){return this.resources.retrieve({type:s.TYPE,id:e},r,t)}async update(e,r,t){return this.resources.update(Object.assign(Object.assign({},e),{type:s.TYPE}),r,t)}async delete(e,r){await this.resources.delete({type:s.TYPE,id:e},r)}isBundle(e){return e.type&&e.type===s.TYPE}relationship(e){return typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="bundles";export default s;
1
+ import{ApiResource as i}from"../resource";class t extends i{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async create(e,r,s){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}isBundle(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="bundles";export default t;
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class r extends i{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async retrieve(e,t,s){return this.resources.retrieve({type:r.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:r.TYPE}),t,s)}isCapture(e){return e.type&&e.type===r.TYPE}relationship(e){return typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}r.TYPE="captures";export default r;
1
+ import{ApiResource as i}from"../resource";class t extends i{async list(e,s){return this.resources.list({type:t.TYPE},e,s)}async retrieve(e,s,r){return this.resources.retrieve({type:t.TYPE,id:e},s,r)}async update(e,s,r){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),s,r)}isCapture(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="captures";export default t;
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class e extends i{async list(r,t){return this.resources.list({type:e.TYPE},r,t)}async retrieve(r,t,s){return this.resources.retrieve({type:e.TYPE,id:r},t,s)}isCarrierAccount(r){return r.type&&r.type===e.TYPE}relationship(r){return typeof r=="string"?{id:r,type:e.TYPE}:{id:r.id,type:e.TYPE}}type(){return e.TYPE}}e.TYPE="carrier_accounts";export default e;
1
+ import{ApiResource as s}from"../resource";class r extends s{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async retrieve(e,t,i){return this.resources.retrieve({type:r.TYPE,id:e},t,i)}isCarrierAccount(e){return e.type&&e.type===r.TYPE}relationship(e){return typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}r.TYPE="carrier_accounts";export default r;
@@ -23,7 +23,7 @@ interface CheckoutComPaymentCreate extends ResourceCreate {
23
23
  payment_type: string;
24
24
  token: string;
25
25
  session_id?: string;
26
- order?: OrderRel;
26
+ order: OrderRel;
27
27
  }
28
28
  interface CheckoutComPaymentUpdate extends ResourceUpdate {
29
29
  payment_type?: string;
@@ -36,7 +36,7 @@ interface CouponCodesPromotionRule extends Resource {
36
36
  coupons?: Coupon[];
37
37
  }
38
38
  interface CouponCodesPromotionRuleCreate extends ResourceCreate {
39
- promotion?: PercentageDiscountPromotionRel | FreeShippingPromotionRel | FixedAmountPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel;
39
+ promotion: PercentageDiscountPromotionRel | FreeShippingPromotionRel | FixedAmountPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel;
40
40
  coupons?: CouponRel[];
41
41
  }
42
42
  interface CouponCodesPromotionRuleUpdate extends ResourceUpdate {
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class s extends i{async list(e,r){return this.resources.list({type:s.TYPE},e,r)}async create(e,r,t){return this.resources.create(Object.assign(Object.assign({},e),{type:s.TYPE}),r,t)}async retrieve(e,r,t){return this.resources.retrieve({type:s.TYPE,id:e},r,t)}async update(e,r,t){return this.resources.update(Object.assign(Object.assign({},e),{type:s.TYPE}),r,t)}async delete(e,r){await this.resources.delete({type:s.TYPE,id:e},r)}isCouponCodesPromotionRule(e){return e.type&&e.type===s.TYPE}relationship(e){return typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="coupon_codes_promotion_rules";export default s;
1
+ import{ApiResource as i}from"../resource";class t extends i{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async create(e,r,s){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}isCouponCodesPromotionRule(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="coupon_codes_promotion_rules";export default t;
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class s extends i{async list(e,t){return this.resources.list({type:s.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:s.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:s.TYPE,id:e},t)}isCouponRecipient(e){return e.type&&e.type===s.TYPE}relationship(e){return typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="coupon_recipients";export default s;
1
+ import{ApiResource as i}from"../resource";class t extends i{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async create(e,r,s){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}isCouponRecipient(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="coupon_recipients";export default t;
@@ -20,7 +20,7 @@ interface CouponCreate extends ResourceCreate {
20
20
  customer_single_use?: boolean;
21
21
  usage_limit: number;
22
22
  recipient_email?: string;
23
- promotion_rule?: CouponCodesPromotionRuleRel;
23
+ promotion_rule: CouponCodesPromotionRuleRel;
24
24
  }
25
25
  interface CouponUpdate extends ResourceUpdate {
26
26
  code?: string;
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class s extends i{async list(e,r){return this.resources.list({type:s.TYPE},e,r)}async create(e,r,t){return this.resources.create(Object.assign(Object.assign({},e),{type:s.TYPE}),r,t)}async retrieve(e,r,t){return this.resources.retrieve({type:s.TYPE,id:e},r,t)}async update(e,r,t){return this.resources.update(Object.assign(Object.assign({},e),{type:s.TYPE}),r,t)}async delete(e,r){await this.resources.delete({type:s.TYPE,id:e},r)}isCoupon(e){return e.type&&e.type===s.TYPE}relationship(e){return typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="coupons";export default s;
1
+ import{ApiResource as i}from"../resource";class t extends i{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async create(e,r,s){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}isCoupon(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="coupons";export default t;
@@ -17,8 +17,8 @@ interface CustomerAddress extends Resource {
17
17
  address?: Address;
18
18
  }
19
19
  interface CustomerAddressCreate extends ResourceCreate {
20
- customer?: CustomerRel;
21
- address?: AddressRel;
20
+ customer: CustomerRel;
21
+ address: AddressRel;
22
22
  }
23
23
  interface CustomerAddressUpdate extends ResourceUpdate {
24
24
  customer?: CustomerRel;
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class s extends i{async list(e,t){return this.resources.list({type:s.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:s.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:s.TYPE,id:e},t)}isCustomerAddress(e){return e.type&&e.type===s.TYPE}relationship(e){return typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="customer_addresses";export default s;
1
+ import{ApiResource as i}from"../resource";class t extends i{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async create(e,r,s){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}isCustomerAddress(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="customer_addresses";export default t;
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class s extends i{async list(e,r){return this.resources.list({type:s.TYPE},e,r)}async create(e,r,t){return this.resources.create(Object.assign(Object.assign({},e),{type:s.TYPE}),r,t)}async retrieve(e,r,t){return this.resources.retrieve({type:s.TYPE,id:e},r,t)}async update(e,r,t){return this.resources.update(Object.assign(Object.assign({},e),{type:s.TYPE}),r,t)}async delete(e,r){await this.resources.delete({type:s.TYPE,id:e},r)}isCustomerGroup(e){return e.type&&e.type===s.TYPE}relationship(e){return typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="customer_groups";export default s;
1
+ import{ApiResource as i}from"../resource";class t extends i{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async create(e,r,s){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}isCustomerGroup(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="customer_groups";export default t;
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class s extends i{async list(e,r){return this.resources.list({type:s.TYPE},e,r)}async create(e,r,t){return this.resources.create(Object.assign(Object.assign({},e),{type:s.TYPE}),r,t)}async retrieve(e,r,t){return this.resources.retrieve({type:s.TYPE,id:e},r,t)}async update(e,r,t){return this.resources.update(Object.assign(Object.assign({},e),{type:s.TYPE}),r,t)}async delete(e,r){await this.resources.delete({type:s.TYPE,id:e},r)}isCustomerPasswordReset(e){return e.type&&e.type===s.TYPE}relationship(e){return typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="customer_password_resets";export default s;
1
+ import{ApiResource as i}from"../resource";class t extends i{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async create(e,r,s){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}isCustomerPasswordReset(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="customer_password_resets";export default t;
@@ -43,8 +43,8 @@ interface CustomerPaymentSource extends Resource {
43
43
  payment_source?: AdyenPayment | BraintreePayment | CheckoutComPayment | ExternalPayment | PaypalPayment | StripePayment | WireTransfer;
44
44
  }
45
45
  interface CustomerPaymentSourceCreate extends ResourceCreate {
46
- customer?: CustomerRel;
47
- payment_source?: AdyenPaymentRel | BraintreePaymentRel | CheckoutComPaymentRel | ExternalPaymentRel | PaypalPaymentRel | StripePaymentRel | WireTransferRel;
46
+ customer: CustomerRel;
47
+ payment_source: AdyenPaymentRel | BraintreePaymentRel | CheckoutComPaymentRel | ExternalPaymentRel | PaypalPaymentRel | StripePaymentRel | WireTransferRel;
48
48
  }
49
49
  interface CustomerPaymentSourceUpdate extends ResourceUpdate {
50
50
  customer?: CustomerRel;