@commercelayer/sdk 3.0.1 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. package/lib/cjs/api.d.ts +6 -4
  2. package/lib/cjs/api.js +1 -1
  3. package/lib/cjs/client.js +1 -1
  4. package/lib/cjs/commercelayer.d.ts +2 -0
  5. package/lib/cjs/commercelayer.js +1 -1
  6. package/lib/cjs/debug.d.ts +3 -0
  7. package/lib/cjs/debug.js +1 -0
  8. package/lib/cjs/index.js +1 -1
  9. package/lib/cjs/jsonapi.js +1 -1
  10. package/lib/cjs/model.d.ts +4 -2
  11. package/lib/cjs/resource.js +1 -1
  12. package/lib/cjs/resources/adyen_payments.d.ts +1 -1
  13. package/lib/cjs/resources/attachments.d.ts +1 -1
  14. package/lib/cjs/resources/billing_info_validation_rules.d.ts +1 -1
  15. package/lib/cjs/resources/braintree_payments.d.ts +1 -1
  16. package/lib/cjs/resources/bundles.d.ts +1 -1
  17. package/lib/cjs/resources/checkout_com_payments.d.ts +1 -1
  18. package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +1 -1
  19. package/lib/cjs/resources/coupons.d.ts +1 -1
  20. package/lib/cjs/resources/customer_addresses.d.ts +2 -2
  21. package/lib/cjs/resources/customer_payment_sources.d.ts +8 -4
  22. package/lib/cjs/resources/delivery_lead_times.d.ts +2 -2
  23. package/lib/cjs/resources/delivery_lead_times.js +1 -1
  24. package/lib/cjs/resources/external_gateways.d.ts +3 -0
  25. package/lib/cjs/resources/external_payments.d.ts +3 -1
  26. package/lib/cjs/resources/fixed_price_promotions.d.ts +1 -1
  27. package/lib/cjs/resources/free_gift_promotions.d.ts +1 -1
  28. package/lib/cjs/resources/in_stock_subscriptions.d.ts +3 -3
  29. package/lib/cjs/resources/inventory_return_locations.d.ts +2 -2
  30. package/lib/cjs/resources/inventory_stock_locations.d.ts +2 -2
  31. package/lib/cjs/resources/klarna_gateways.d.ts +42 -0
  32. package/lib/cjs/resources/klarna_gateways.js +1 -0
  33. package/lib/cjs/resources/klarna_payments.d.ts +39 -0
  34. package/lib/cjs/resources/klarna_payments.js +1 -0
  35. package/lib/cjs/resources/line_item_options.d.ts +2 -2
  36. package/lib/cjs/resources/line_items.d.ts +1 -1
  37. package/lib/cjs/resources/markets.d.ts +3 -3
  38. package/lib/cjs/resources/merchants.d.ts +1 -1
  39. package/lib/cjs/resources/order_amount_promotion_rules.d.ts +1 -1
  40. package/lib/cjs/resources/order_copies.d.ts +1 -1
  41. package/lib/cjs/resources/order_subscriptions.d.ts +1 -1
  42. package/lib/cjs/resources/orders.d.ts +7 -3
  43. package/lib/cjs/resources/packages.d.ts +1 -1
  44. package/lib/cjs/resources/parcel_line_items.d.ts +2 -2
  45. package/lib/cjs/resources/parcels.d.ts +2 -2
  46. package/lib/cjs/resources/payment_methods.d.ts +2 -2
  47. package/lib/cjs/resources/paypal_payments.d.ts +1 -1
  48. package/lib/cjs/resources/prices.d.ts +1 -1
  49. package/lib/cjs/resources/return_line_items.d.ts +2 -2
  50. package/lib/cjs/resources/returns.d.ts +1 -1
  51. package/lib/cjs/resources/shipping_methods.d.ts +3 -3
  52. package/lib/cjs/resources/sku_list_items.d.ts +2 -2
  53. package/lib/cjs/resources/sku_list_promotion_rules.d.ts +1 -1
  54. package/lib/cjs/resources/sku_options.d.ts +1 -1
  55. package/lib/cjs/resources/skus.d.ts +1 -1
  56. package/lib/cjs/resources/stock_items.d.ts +1 -1
  57. package/lib/cjs/resources/stock_locations.d.ts +1 -1
  58. package/lib/cjs/resources/stock_transfers.d.ts +3 -3
  59. package/lib/cjs/resources/stripe_payments.d.ts +1 -1
  60. package/lib/cjs/resources/tax_categories.d.ts +2 -2
  61. package/lib/cjs/resources/tax_rules.d.ts +1 -1
  62. package/lib/cjs/resources/wire_transfers.d.ts +1 -1
  63. package/lib/cjs/static.js +1 -1
  64. package/lib/esm/api.d.ts +6 -4
  65. package/lib/esm/api.js +1 -1
  66. package/lib/esm/client.js +1 -1
  67. package/lib/esm/commercelayer.d.ts +2 -0
  68. package/lib/esm/commercelayer.js +1 -1
  69. package/lib/esm/common.js +1 -1
  70. package/lib/esm/debug.d.ts +3 -0
  71. package/lib/esm/debug.js +1 -0
  72. package/lib/esm/jsonapi.js +1 -1
  73. package/lib/esm/model.d.ts +4 -2
  74. package/lib/esm/resource.js +1 -1
  75. package/lib/esm/resources/addresses.js +1 -1
  76. package/lib/esm/resources/adjustments.js +1 -1
  77. package/lib/esm/resources/adyen_gateways.js +1 -1
  78. package/lib/esm/resources/adyen_payments.d.ts +1 -1
  79. package/lib/esm/resources/adyen_payments.js +1 -1
  80. package/lib/esm/resources/application.js +1 -1
  81. package/lib/esm/resources/attachments.d.ts +1 -1
  82. package/lib/esm/resources/authorizations.js +1 -1
  83. package/lib/esm/resources/avalara_accounts.js +1 -1
  84. package/lib/esm/resources/billing_info_validation_rules.d.ts +1 -1
  85. package/lib/esm/resources/billing_info_validation_rules.js +1 -1
  86. package/lib/esm/resources/bing_geocoders.js +1 -1
  87. package/lib/esm/resources/braintree_gateways.js +1 -1
  88. package/lib/esm/resources/braintree_payments.d.ts +1 -1
  89. package/lib/esm/resources/braintree_payments.js +1 -1
  90. package/lib/esm/resources/bundles.d.ts +1 -1
  91. package/lib/esm/resources/bundles.js +1 -1
  92. package/lib/esm/resources/captures.js +1 -1
  93. package/lib/esm/resources/carrier_accounts.js +1 -1
  94. package/lib/esm/resources/checkout_com_payments.d.ts +1 -1
  95. package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +1 -1
  96. package/lib/esm/resources/coupon_codes_promotion_rules.js +1 -1
  97. package/lib/esm/resources/coupon_recipients.js +1 -1
  98. package/lib/esm/resources/coupons.d.ts +1 -1
  99. package/lib/esm/resources/coupons.js +1 -1
  100. package/lib/esm/resources/customer_addresses.d.ts +2 -2
  101. package/lib/esm/resources/customer_addresses.js +1 -1
  102. package/lib/esm/resources/customer_groups.js +1 -1
  103. package/lib/esm/resources/customer_password_resets.js +1 -1
  104. package/lib/esm/resources/customer_payment_sources.d.ts +8 -4
  105. package/lib/esm/resources/customer_payment_sources.js +1 -1
  106. package/lib/esm/resources/customer_subscriptions.js +1 -1
  107. package/lib/esm/resources/customers.js +1 -1
  108. package/lib/esm/resources/delivery_lead_times.d.ts +2 -2
  109. package/lib/esm/resources/delivery_lead_times.js +1 -1
  110. package/lib/esm/resources/event_callbacks.js +1 -1
  111. package/lib/esm/resources/external_gateways.d.ts +3 -0
  112. package/lib/esm/resources/external_payments.d.ts +3 -1
  113. package/lib/esm/resources/external_promotions.js +1 -1
  114. package/lib/esm/resources/fixed_price_promotions.d.ts +1 -1
  115. package/lib/esm/resources/fixed_price_promotions.js +1 -1
  116. package/lib/esm/resources/free_gift_promotions.d.ts +1 -1
  117. package/lib/esm/resources/free_gift_promotions.js +1 -1
  118. package/lib/esm/resources/free_shipping_promotions.js +1 -1
  119. package/lib/esm/resources/geocoders.js +1 -1
  120. package/lib/esm/resources/gift_cards.js +1 -1
  121. package/lib/esm/resources/google_geocoders.js +1 -1
  122. package/lib/esm/resources/imports.js +1 -1
  123. package/lib/esm/resources/in_stock_subscriptions.d.ts +3 -3
  124. package/lib/esm/resources/in_stock_subscriptions.js +1 -1
  125. package/lib/esm/resources/inventory_models.js +1 -1
  126. package/lib/esm/resources/inventory_return_locations.d.ts +2 -2
  127. package/lib/esm/resources/inventory_stock_locations.d.ts +2 -2
  128. package/lib/esm/resources/inventory_stock_locations.js +1 -1
  129. package/lib/esm/resources/klarna_gateways.d.ts +42 -0
  130. package/lib/esm/resources/klarna_gateways.js +1 -0
  131. package/lib/esm/resources/klarna_payments.d.ts +39 -0
  132. package/lib/esm/resources/klarna_payments.js +1 -0
  133. package/lib/esm/resources/line_item_options.d.ts +2 -2
  134. package/lib/esm/resources/line_item_options.js +1 -1
  135. package/lib/esm/resources/line_items.d.ts +1 -1
  136. package/lib/esm/resources/line_items.js +1 -1
  137. package/lib/esm/resources/manual_gateways.js +1 -1
  138. package/lib/esm/resources/manual_tax_calculators.js +1 -1
  139. package/lib/esm/resources/markets.d.ts +3 -3
  140. package/lib/esm/resources/markets.js +1 -1
  141. package/lib/esm/resources/merchants.d.ts +1 -1
  142. package/lib/esm/resources/merchants.js +1 -1
  143. package/lib/esm/resources/order_amount_promotion_rules.d.ts +1 -1
  144. package/lib/esm/resources/order_amount_promotion_rules.js +1 -1
  145. package/lib/esm/resources/order_copies.d.ts +1 -1
  146. package/lib/esm/resources/order_copies.js +1 -1
  147. package/lib/esm/resources/order_subscriptions.d.ts +1 -1
  148. package/lib/esm/resources/order_subscriptions.js +1 -1
  149. package/lib/esm/resources/order_validation_rules.js +1 -1
  150. package/lib/esm/resources/orders.d.ts +7 -3
  151. package/lib/esm/resources/orders.js +1 -1
  152. package/lib/esm/resources/organization.js +1 -1
  153. package/lib/esm/resources/packages.d.ts +1 -1
  154. package/lib/esm/resources/packages.js +1 -1
  155. package/lib/esm/resources/parcel_line_items.d.ts +2 -2
  156. package/lib/esm/resources/parcel_line_items.js +1 -1
  157. package/lib/esm/resources/parcels.d.ts +2 -2
  158. package/lib/esm/resources/parcels.js +1 -1
  159. package/lib/esm/resources/payment_gateways.js +1 -1
  160. package/lib/esm/resources/payment_methods.d.ts +2 -2
  161. package/lib/esm/resources/paypal_gateways.js +1 -1
  162. package/lib/esm/resources/paypal_payments.d.ts +1 -1
  163. package/lib/esm/resources/paypal_payments.js +1 -1
  164. package/lib/esm/resources/price_lists.js +1 -1
  165. package/lib/esm/resources/prices.d.ts +1 -1
  166. package/lib/esm/resources/prices.js +1 -1
  167. package/lib/esm/resources/promotion_rules.js +1 -1
  168. package/lib/esm/resources/promotions.js +1 -1
  169. package/lib/esm/resources/refunds.js +1 -1
  170. package/lib/esm/resources/return_line_items.d.ts +2 -2
  171. package/lib/esm/resources/returns.d.ts +1 -1
  172. package/lib/esm/resources/returns.js +1 -1
  173. package/lib/esm/resources/shipments.js +1 -1
  174. package/lib/esm/resources/shipping_categories.js +1 -1
  175. package/lib/esm/resources/shipping_methods.d.ts +3 -3
  176. package/lib/esm/resources/shipping_methods.js +1 -1
  177. package/lib/esm/resources/shipping_zones.js +1 -1
  178. package/lib/esm/resources/sku_list_items.d.ts +2 -2
  179. package/lib/esm/resources/sku_list_items.js +1 -1
  180. package/lib/esm/resources/sku_list_promotion_rules.d.ts +1 -1
  181. package/lib/esm/resources/sku_list_promotion_rules.js +1 -1
  182. package/lib/esm/resources/sku_lists.js +1 -1
  183. package/lib/esm/resources/sku_options.d.ts +1 -1
  184. package/lib/esm/resources/sku_options.js +1 -1
  185. package/lib/esm/resources/skus.d.ts +1 -1
  186. package/lib/esm/resources/skus.js +1 -1
  187. package/lib/esm/resources/stock_items.d.ts +1 -1
  188. package/lib/esm/resources/stock_items.js +1 -1
  189. package/lib/esm/resources/stock_line_items.js +1 -1
  190. package/lib/esm/resources/stock_locations.d.ts +1 -1
  191. package/lib/esm/resources/stock_locations.js +1 -1
  192. package/lib/esm/resources/stock_transfers.d.ts +3 -3
  193. package/lib/esm/resources/stock_transfers.js +1 -1
  194. package/lib/esm/resources/stripe_gateways.js +1 -1
  195. package/lib/esm/resources/stripe_payments.d.ts +1 -1
  196. package/lib/esm/resources/stripe_payments.js +1 -1
  197. package/lib/esm/resources/tax_calculators.js +1 -1
  198. package/lib/esm/resources/tax_categories.d.ts +2 -2
  199. package/lib/esm/resources/tax_categories.js +1 -1
  200. package/lib/esm/resources/tax_rules.d.ts +1 -1
  201. package/lib/esm/resources/tax_rules.js +1 -1
  202. package/lib/esm/resources/taxjar_accounts.js +1 -1
  203. package/lib/esm/resources/transactions.js +1 -1
  204. package/lib/esm/resources/voids.js +1 -1
  205. package/lib/esm/resources/webhooks.js +1 -1
  206. package/lib/esm/resources/wire_transfers.d.ts +1 -1
  207. package/lib/esm/resources/wire_transfers.js +1 -1
  208. package/lib/esm/static.js +1 -1
  209. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  210. package/lib/tsconfig.tsbuildinfo +1 -1
  211. package/package.json +1 -1
@@ -20,8 +20,8 @@ interface InventoryStockLocation extends Resource {
20
20
  interface InventoryStockLocationCreate extends ResourceCreate {
21
21
  priority: number;
22
22
  on_hold?: boolean;
23
- stock_location?: StockLocationRel;
24
- inventory_model?: InventoryModelRel;
23
+ stock_location: StockLocationRel;
24
+ inventory_model: InventoryModelRel;
25
25
  }
26
26
  interface InventoryStockLocationUpdate extends ResourceUpdate {
27
27
  priority?: number;
@@ -0,0 +1,42 @@
1
+ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
2
+ import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
3
+ import { PaymentMethod } from './payment_methods';
4
+ import { KlarnaPayment } from './klarna_payments';
5
+ declare type KlarnaGatewayRel = ResourceId & {
6
+ type: typeof KlarnaGateways.TYPE;
7
+ };
8
+ declare type KlarnaPaymentRel = ResourceId & {
9
+ type: 'klarna_payments';
10
+ };
11
+ interface KlarnaGateway extends Resource {
12
+ name?: string;
13
+ payment_methods?: PaymentMethod[];
14
+ klarna_payments?: KlarnaPayment[];
15
+ }
16
+ interface KlarnaGatewayCreate extends ResourceCreate {
17
+ name: string;
18
+ country_code: string;
19
+ api_key: string;
20
+ api_secret: string;
21
+ klarna_payments?: KlarnaPaymentRel[];
22
+ }
23
+ interface KlarnaGatewayUpdate extends ResourceUpdate {
24
+ name?: string;
25
+ country_code?: string;
26
+ api_key?: string;
27
+ api_secret?: string;
28
+ klarna_payments?: KlarnaPaymentRel[];
29
+ }
30
+ declare class KlarnaGateways extends ApiResource {
31
+ static readonly TYPE: 'klarna_gateways';
32
+ list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<KlarnaGateway>>;
33
+ create(resource: KlarnaGatewayCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<KlarnaGateway>;
34
+ retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<KlarnaGateway>;
35
+ update(resource: KlarnaGatewayUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<KlarnaGateway>;
36
+ delete(id: string, options?: ResourcesConfig): Promise<void>;
37
+ isKlarnaGateway(resource: any): resource is KlarnaGateway;
38
+ relationship(id: string | ResourceId): KlarnaGatewayRel;
39
+ type(): string;
40
+ }
41
+ export default KlarnaGateways;
42
+ export { KlarnaGateway, KlarnaGatewayCreate, KlarnaGatewayUpdate };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class KlarnaGateways extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:KlarnaGateways.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:KlarnaGateways.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:KlarnaGateways.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:KlarnaGateways.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:KlarnaGateways.TYPE,id:e},t)}isKlarnaGateway(e){return e.type&&e.type===KlarnaGateways.TYPE}relationship(e){return typeof e=="string"?{id:e,type:KlarnaGateways.TYPE}:{id:e.id,type:KlarnaGateways.TYPE}}type(){return KlarnaGateways.TYPE}}KlarnaGateways.TYPE="klarna_gateways",exports.default=KlarnaGateways;
@@ -0,0 +1,39 @@
1
+ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
2
+ import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
3
+ import { Order } from './orders';
4
+ import { PaymentGateway } from './payment_gateways';
5
+ declare type KlarnaPaymentRel = ResourceId & {
6
+ type: typeof KlarnaPayments.TYPE;
7
+ };
8
+ declare type OrderRel = ResourceId & {
9
+ type: 'orders';
10
+ };
11
+ interface KlarnaPayment extends Resource {
12
+ session_id?: string;
13
+ client_token?: string;
14
+ payment_methods?: object[];
15
+ auth_token?: string;
16
+ order?: Order;
17
+ payment_gateway?: PaymentGateway;
18
+ }
19
+ interface KlarnaPaymentCreate extends ResourceCreate {
20
+ order: OrderRel;
21
+ }
22
+ interface KlarnaPaymentUpdate extends ResourceUpdate {
23
+ auth_token?: string;
24
+ _update?: boolean;
25
+ order?: OrderRel;
26
+ }
27
+ declare class KlarnaPayments extends ApiResource {
28
+ static readonly TYPE: 'klarna_payments';
29
+ list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<KlarnaPayment>>;
30
+ create(resource: KlarnaPaymentCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<KlarnaPayment>;
31
+ retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<KlarnaPayment>;
32
+ update(resource: KlarnaPaymentUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<KlarnaPayment>;
33
+ delete(id: string, options?: ResourcesConfig): Promise<void>;
34
+ isKlarnaPayment(resource: any): resource is KlarnaPayment;
35
+ relationship(id: string | ResourceId): KlarnaPaymentRel;
36
+ type(): string;
37
+ }
38
+ export default KlarnaPayments;
39
+ export { KlarnaPayment, KlarnaPaymentCreate, KlarnaPaymentUpdate };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class KlarnaPayments extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:KlarnaPayments.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:KlarnaPayments.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:KlarnaPayments.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:KlarnaPayments.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:KlarnaPayments.TYPE,id:e},t)}isKlarnaPayment(e){return e.type&&e.type===KlarnaPayments.TYPE}relationship(e){return typeof e=="string"?{id:e,type:KlarnaPayments.TYPE}:{id:e.id,type:KlarnaPayments.TYPE}}type(){return KlarnaPayments.TYPE}}KlarnaPayments.TYPE="klarna_payments",exports.default=KlarnaPayments;
@@ -31,8 +31,8 @@ interface LineItemOptionCreate extends ResourceCreate {
31
31
  name?: string;
32
32
  quantity: number;
33
33
  options: object;
34
- line_item?: LineItemRel;
35
- sku_option?: SkuOptionRel;
34
+ line_item: LineItemRel;
35
+ sku_option: SkuOptionRel;
36
36
  }
37
37
  interface LineItemOptionUpdate extends ResourceUpdate {
38
38
  name?: string;
@@ -96,7 +96,7 @@ interface LineItemCreate extends ResourceCreate {
96
96
  name?: string;
97
97
  image_url?: string;
98
98
  item_type?: string;
99
- order?: OrderRel;
99
+ order: OrderRel;
100
100
  item?: AdjustmentRel | BundleRel | ExternalPromotionRel | FixedAmountPromotionRel | FreeShippingPromotionRel | GiftCardRel | PaymentMethodRel | PercentageDiscountPromotionRel | ShipmentRel | SkuRel;
101
101
  }
102
102
  interface LineItemUpdate extends ResourceUpdate {
@@ -43,9 +43,9 @@ interface MarketCreate extends ResourceCreate {
43
43
  facebook_pixel_id?: string;
44
44
  checkout_url?: string;
45
45
  external_prices_url?: string;
46
- merchant?: MerchantRel;
47
- price_list?: PriceListRel;
48
- inventory_model?: InventoryModelRel;
46
+ merchant: MerchantRel;
47
+ price_list: PriceListRel;
48
+ inventory_model: InventoryModelRel;
49
49
  tax_calculator?: TaxCalculatorRel;
50
50
  customer_group?: CustomerGroupRel;
51
51
  }
@@ -15,7 +15,7 @@ interface Merchant extends Resource {
15
15
  }
16
16
  interface MerchantCreate extends ResourceCreate {
17
17
  name: string;
18
- address?: AddressRel;
18
+ address: AddressRel;
19
19
  }
20
20
  interface MerchantUpdate extends ResourceUpdate {
21
21
  name?: string;
@@ -35,7 +35,7 @@ interface OrderAmountPromotionRule extends Resource {
35
35
  }
36
36
  interface OrderAmountPromotionRuleCreate extends ResourceCreate {
37
37
  order_amount_cents?: number;
38
- promotion?: PercentageDiscountPromotionRel | FreeShippingPromotionRel | FixedAmountPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel;
38
+ promotion: PercentageDiscountPromotionRel | FreeShippingPromotionRel | FixedAmountPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel;
39
39
  }
40
40
  interface OrderAmountPromotionRuleUpdate extends ResourceUpdate {
41
41
  order_amount_cents?: number;
@@ -26,7 +26,7 @@ interface OrderCopyCreate extends ResourceCreate {
26
26
  place_target_order?: boolean;
27
27
  cancel_source_order?: boolean;
28
28
  reuse_wallet?: boolean;
29
- source_order?: OrderRel;
29
+ source_order: OrderRel;
30
30
  }
31
31
  declare class OrderCopies extends ApiResource {
32
32
  static readonly TYPE: 'order_copies';
@@ -39,7 +39,7 @@ interface OrderSubscriptionCreate extends ResourceCreate {
39
39
  expires_at?: string;
40
40
  options?: object;
41
41
  market?: MarketRel;
42
- source_order?: OrderRel;
42
+ source_order: OrderRel;
43
43
  }
44
44
  interface OrderSubscriptionUpdate extends ResourceUpdate {
45
45
  expires_at?: string;
@@ -9,6 +9,7 @@ import { AdyenPayment } from './adyen_payments';
9
9
  import { BraintreePayment } from './braintree_payments';
10
10
  import { CheckoutComPayment } from './checkout_com_payments';
11
11
  import { ExternalPayment } from './external_payments';
12
+ import { KlarnaPayment } from './klarna_payments';
12
13
  import { PaypalPayment } from './paypal_payments';
13
14
  import { StripePayment } from './stripe_payments';
14
15
  import { WireTransfer } from './wire_transfers';
@@ -48,6 +49,9 @@ declare type CheckoutComPaymentRel = ResourceId & {
48
49
  declare type ExternalPaymentRel = ResourceId & {
49
50
  type: 'external_payments';
50
51
  };
52
+ declare type KlarnaPaymentRel = ResourceId & {
53
+ type: 'klarna_payments';
54
+ };
51
55
  declare type PaypalPaymentRel = ResourceId & {
52
56
  type: 'paypal_payments';
53
57
  };
@@ -162,7 +166,7 @@ interface Order extends Resource {
162
166
  available_payment_methods?: PaymentMethod[];
163
167
  available_customer_payment_sources?: CustomerPaymentSource[];
164
168
  payment_method?: PaymentMethod;
165
- payment_source?: AdyenPayment | BraintreePayment | CheckoutComPayment | ExternalPayment | PaypalPayment | StripePayment | WireTransfer;
169
+ payment_source?: AdyenPayment | BraintreePayment | CheckoutComPayment | ExternalPayment | KlarnaPayment | PaypalPayment | StripePayment | WireTransfer;
166
170
  line_items?: LineItem[];
167
171
  shipments?: Shipment[];
168
172
  transactions?: (Authorization | Void | Capture | Refund)[];
@@ -193,7 +197,7 @@ interface OrderCreate extends ResourceCreate {
193
197
  shipping_address?: AddressRel;
194
198
  billing_address?: AddressRel;
195
199
  payment_method?: PaymentMethodRel;
196
- payment_source?: AdyenPaymentRel | BraintreePaymentRel | CheckoutComPaymentRel | ExternalPaymentRel | PaypalPaymentRel | StripePaymentRel | WireTransferRel;
200
+ payment_source?: AdyenPaymentRel | BraintreePaymentRel | CheckoutComPaymentRel | ExternalPaymentRel | KlarnaPaymentRel | PaypalPaymentRel | StripePaymentRel | WireTransferRel;
197
201
  }
198
202
  interface OrderUpdate extends ResourceUpdate {
199
203
  autorefresh?: boolean;
@@ -234,7 +238,7 @@ interface OrderUpdate extends ResourceUpdate {
234
238
  shipping_address?: AddressRel;
235
239
  billing_address?: AddressRel;
236
240
  payment_method?: PaymentMethodRel;
237
- payment_source?: AdyenPaymentRel | BraintreePaymentRel | CheckoutComPaymentRel | ExternalPaymentRel | PaypalPaymentRel | StripePaymentRel | WireTransferRel;
241
+ payment_source?: AdyenPaymentRel | BraintreePaymentRel | CheckoutComPaymentRel | ExternalPaymentRel | KlarnaPaymentRel | PaypalPaymentRel | StripePaymentRel | WireTransferRel;
238
242
  }
239
243
  declare class Orders extends ApiResource {
240
244
  static readonly TYPE: 'orders';
@@ -27,7 +27,7 @@ interface PackageCreate extends ResourceCreate {
27
27
  width: number;
28
28
  height: number;
29
29
  unit_of_length: string;
30
- stock_location?: StockLocationRel;
30
+ stock_location: StockLocationRel;
31
31
  }
32
32
  interface PackageUpdate extends ResourceUpdate {
33
33
  name?: string;
@@ -24,8 +24,8 @@ interface ParcelLineItem extends Resource {
24
24
  interface ParcelLineItemCreate extends ResourceCreate {
25
25
  sku_code?: string;
26
26
  quantity: number;
27
- parcel?: ParcelRel;
28
- stock_line_item?: StockLineItemRel;
27
+ parcel: ParcelRel;
28
+ stock_line_item: StockLineItemRel;
29
29
  /**
30
30
  * @deprecated This field should not be used as it may be removed in the future without notice
31
31
  */
@@ -63,8 +63,8 @@ interface ParcelCreate extends ResourceCreate {
63
63
  carrier_weight_oz?: string;
64
64
  signed_by?: string;
65
65
  incoterm?: string;
66
- shipment?: ShipmentRel;
67
- package?: PackageRel;
66
+ shipment: ShipmentRel;
67
+ package: PackageRel;
68
68
  }
69
69
  interface ParcelUpdate extends ResourceUpdate {
70
70
  weight?: number;
@@ -28,8 +28,8 @@ interface PaymentMethodCreate extends ResourceCreate {
28
28
  payment_source_type: string;
29
29
  moto?: boolean;
30
30
  price_amount_cents: number;
31
- market?: MarketRel;
32
- payment_gateway?: PaymentGatewayRel;
31
+ market: MarketRel;
32
+ payment_gateway: PaymentGatewayRel;
33
33
  }
34
34
  interface PaymentMethodUpdate extends ResourceUpdate {
35
35
  payment_source_type?: string;
@@ -24,7 +24,7 @@ interface PaypalPaymentCreate extends ResourceCreate {
24
24
  return_url: string;
25
25
  cancel_url: string;
26
26
  note_to_payer?: string;
27
- order?: OrderRel;
27
+ order: OrderRel;
28
28
  }
29
29
  interface PaypalPaymentUpdate extends ResourceUpdate {
30
30
  paypal_payer_id?: string;
@@ -29,7 +29,7 @@ interface PriceCreate extends ResourceCreate {
29
29
  sku_code?: string;
30
30
  amount_cents: number;
31
31
  compare_at_amount_cents: number;
32
- price_list?: PriceListRel;
32
+ price_list: PriceListRel;
33
33
  sku?: SkuRel;
34
34
  }
35
35
  interface PriceUpdate extends ResourceUpdate {
@@ -24,8 +24,8 @@ interface ReturnLineItem extends Resource {
24
24
  interface ReturnLineItemCreate extends ResourceCreate {
25
25
  quantity: number;
26
26
  return_reason?: object;
27
- return?: ReturnRel;
28
- line_item?: LineItemRel;
27
+ return: ReturnRel;
28
+ line_item: LineItemRel;
29
29
  }
30
30
  interface ReturnLineItemUpdate extends ResourceUpdate {
31
31
  quantity?: number;
@@ -35,7 +35,7 @@ interface Return extends Resource {
35
35
  attachments?: Attachment[];
36
36
  }
37
37
  interface ReturnCreate extends ResourceCreate {
38
- order?: OrderRel;
38
+ order: OrderRel;
39
39
  stock_location?: StockLocationRel;
40
40
  }
41
41
  interface ReturnUpdate extends ResourceUpdate {
@@ -40,9 +40,9 @@ interface ShippingMethodCreate extends ResourceCreate {
40
40
  name: string;
41
41
  price_amount_cents: number;
42
42
  free_over_amount_cents?: number;
43
- market?: MarketRel;
44
- shipping_zone?: ShippingZoneRel;
45
- shipping_category?: ShippingCategoryRel;
43
+ market: MarketRel;
44
+ shipping_zone: ShippingZoneRel;
45
+ shipping_category: ShippingCategoryRel;
46
46
  }
47
47
  interface ShippingMethodUpdate extends ResourceUpdate {
48
48
  name?: string;
@@ -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(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)};
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)};
package/lib/esm/api.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * ©2021 Commerce Layer Inc.
3
- * OpenAPI schema, version 2.7.6
2
+ * ©2022 Commerce Layer Inc.
3
+ * OpenAPI schema, version 2.8.0
4
4
  **/
5
5
  export { default as Addresses } from './resources/addresses';
6
6
  export { default as Adjustments } from './resources/adjustments';
@@ -47,6 +47,8 @@ export { default as InStockSubscriptions } from './resources/in_stock_subscripti
47
47
  export { default as InventoryModels } from './resources/inventory_models';
48
48
  export { default as InventoryReturnLocations } from './resources/inventory_return_locations';
49
49
  export { default as InventoryStockLocations } from './resources/inventory_stock_locations';
50
+ export { default as KlarnaGateways } from './resources/klarna_gateways';
51
+ export { default as KlarnaPayments } from './resources/klarna_payments';
50
52
  export { default as LineItemOptions } from './resources/line_item_options';
51
53
  export { default as LineItems } from './resources/line_items';
52
54
  export { default as ManualGateways } from './resources/manual_gateways';
@@ -97,5 +99,5 @@ export { default as Transactions } from './resources/transactions';
97
99
  export { default as Voids } from './resources/voids';
98
100
  export { default as Webhooks } from './resources/webhooks';
99
101
  export { default as WireTransfers } from './resources/wire_transfers';
100
- export declare type ResourceTypeLock = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'application' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'event_callbacks' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'geocoders' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'organization' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_lists' | 'prices' | 'promotion_rules' | 'promotions' | 'refunds' | 'return_line_items' | 'returns' | 'shipments' | 'shipping_categories' | 'shipping_methods' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'voids' | 'webhooks' | 'wire_transfers';
101
- export declare const resourceList: readonly ["addresses", "adjustments", "adyen_gateways", "adyen_payments", "application", "attachments", "authorizations", "avalara_accounts", "billing_info_validation_rules", "bing_geocoders", "braintree_gateways", "braintree_payments", "bundles", "captures", "carrier_accounts", "checkout_com_gateways", "checkout_com_payments", "coupon_codes_promotion_rules", "coupon_recipients", "coupons", "customer_addresses", "customer_groups", "customer_password_resets", "customer_payment_sources", "customer_subscriptions", "customers", "delivery_lead_times", "event_callbacks", "external_gateways", "external_payments", "external_promotions", "external_tax_calculators", "fixed_amount_promotions", "fixed_price_promotions", "free_gift_promotions", "free_shipping_promotions", "geocoders", "gift_card_recipients", "gift_cards", "google_geocoders", "imports", "in_stock_subscriptions", "inventory_models", "inventory_return_locations", "inventory_stock_locations", "line_item_options", "line_items", "manual_gateways", "manual_tax_calculators", "markets", "merchants", "order_amount_promotion_rules", "order_copies", "order_subscriptions", "order_validation_rules", "orders", "organization", "packages", "parcel_line_items", "parcels", "payment_gateways", "payment_methods", "paypal_gateways", "paypal_payments", "percentage_discount_promotions", "price_lists", "prices", "promotion_rules", "promotions", "refunds", "return_line_items", "returns", "shipments", "shipping_categories", "shipping_methods", "shipping_zones", "sku_list_items", "sku_list_promotion_rules", "sku_lists", "sku_options", "skus", "stock_items", "stock_line_items", "stock_locations", "stock_transfers", "stripe_gateways", "stripe_payments", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "voids", "webhooks", "wire_transfers"];
102
+ export declare type ResourceTypeLock = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'application' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'event_callbacks' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'geocoders' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'organization' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_lists' | 'prices' | 'promotion_rules' | 'promotions' | 'refunds' | 'return_line_items' | 'returns' | 'shipments' | 'shipping_categories' | 'shipping_methods' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'voids' | 'webhooks' | 'wire_transfers';
103
+ export declare const resourceList: readonly ["addresses", "adjustments", "adyen_gateways", "adyen_payments", "application", "attachments", "authorizations", "avalara_accounts", "billing_info_validation_rules", "bing_geocoders", "braintree_gateways", "braintree_payments", "bundles", "captures", "carrier_accounts", "checkout_com_gateways", "checkout_com_payments", "coupon_codes_promotion_rules", "coupon_recipients", "coupons", "customer_addresses", "customer_groups", "customer_password_resets", "customer_payment_sources", "customer_subscriptions", "customers", "delivery_lead_times", "event_callbacks", "external_gateways", "external_payments", "external_promotions", "external_tax_calculators", "fixed_amount_promotions", "fixed_price_promotions", "free_gift_promotions", "free_shipping_promotions", "geocoders", "gift_card_recipients", "gift_cards", "google_geocoders", "imports", "in_stock_subscriptions", "inventory_models", "inventory_return_locations", "inventory_stock_locations", "klarna_gateways", "klarna_payments", "line_item_options", "line_items", "manual_gateways", "manual_tax_calculators", "markets", "merchants", "order_amount_promotion_rules", "order_copies", "order_subscriptions", "order_validation_rules", "orders", "organization", "packages", "parcel_line_items", "parcels", "payment_gateways", "payment_methods", "paypal_gateways", "paypal_payments", "percentage_discount_promotions", "price_lists", "prices", "promotion_rules", "promotions", "refunds", "return_line_items", "returns", "shipments", "shipping_categories", "shipping_methods", "shipping_zones", "sku_list_items", "sku_list_promotion_rules", "sku_lists", "sku_options", "skus", "stock_items", "stock_line_items", "stock_locations", "stock_transfers", "stripe_gateways", "stripe_payments", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "voids", "webhooks", "wire_transfers"];
package/lib/esm/api.js CHANGED
@@ -1 +1 @@
1
- export{default as Addresses}from"./resources/addresses";export{default as Adjustments}from"./resources/adjustments";export{default as AdyenGateways}from"./resources/adyen_gateways";export{default as AdyenPayments}from"./resources/adyen_payments";export{default as Applications}from"./resources/application";export{default as Attachments}from"./resources/attachments";export{default as Authorizations}from"./resources/authorizations";export{default as AvalaraAccounts}from"./resources/avalara_accounts";export{default as BillingInfoValidationRules}from"./resources/billing_info_validation_rules";export{default as BingGeocoders}from"./resources/bing_geocoders";export{default as BraintreeGateways}from"./resources/braintree_gateways";export{default as BraintreePayments}from"./resources/braintree_payments";export{default as Bundles}from"./resources/bundles";export{default as Captures}from"./resources/captures";export{default as CarrierAccounts}from"./resources/carrier_accounts";export{default as CheckoutComGateways}from"./resources/checkout_com_gateways";export{default as CheckoutComPayments}from"./resources/checkout_com_payments";export{default as CouponCodesPromotionRules}from"./resources/coupon_codes_promotion_rules";export{default as CouponRecipients}from"./resources/coupon_recipients";export{default as Coupons}from"./resources/coupons";export{default as CustomerAddresses}from"./resources/customer_addresses";export{default as CustomerGroups}from"./resources/customer_groups";export{default as CustomerPasswordResets}from"./resources/customer_password_resets";export{default as CustomerPaymentSources}from"./resources/customer_payment_sources";export{default as CustomerSubscriptions}from"./resources/customer_subscriptions";export{default as Customers}from"./resources/customers";export{default as DeliveryLeadTimes}from"./resources/delivery_lead_times";export{default as EventCallbacks}from"./resources/event_callbacks";export{default as ExternalGateways}from"./resources/external_gateways";export{default as ExternalPayments}from"./resources/external_payments";export{default as ExternalPromotions}from"./resources/external_promotions";export{default as ExternalTaxCalculators}from"./resources/external_tax_calculators";export{default as FixedAmountPromotions}from"./resources/fixed_amount_promotions";export{default as FixedPricePromotions}from"./resources/fixed_price_promotions";export{default as FreeGiftPromotions}from"./resources/free_gift_promotions";export{default as FreeShippingPromotions}from"./resources/free_shipping_promotions";export{default as Geocoders}from"./resources/geocoders";export{default as GiftCardRecipients}from"./resources/gift_card_recipients";export{default as GiftCards}from"./resources/gift_cards";export{default as GoogleGeocoders}from"./resources/google_geocoders";export{default as Imports}from"./resources/imports";export{default as InStockSubscriptions}from"./resources/in_stock_subscriptions";export{default as InventoryModels}from"./resources/inventory_models";export{default as InventoryReturnLocations}from"./resources/inventory_return_locations";export{default as InventoryStockLocations}from"./resources/inventory_stock_locations";export{default as LineItemOptions}from"./resources/line_item_options";export{default as LineItems}from"./resources/line_items";export{default as ManualGateways}from"./resources/manual_gateways";export{default as ManualTaxCalculators}from"./resources/manual_tax_calculators";export{default as Markets}from"./resources/markets";export{default as Merchants}from"./resources/merchants";export{default as OrderAmountPromotionRules}from"./resources/order_amount_promotion_rules";export{default as OrderCopies}from"./resources/order_copies";export{default as OrderSubscriptions}from"./resources/order_subscriptions";export{default as OrderValidationRules}from"./resources/order_validation_rules";export{default as Orders}from"./resources/orders";export{default as Organizations}from"./resources/organization";export{default as Packages}from"./resources/packages";export{default as ParcelLineItems}from"./resources/parcel_line_items";export{default as Parcels}from"./resources/parcels";export{default as PaymentGateways}from"./resources/payment_gateways";export{default as PaymentMethods}from"./resources/payment_methods";export{default as PaypalGateways}from"./resources/paypal_gateways";export{default as PaypalPayments}from"./resources/paypal_payments";export{default as PercentageDiscountPromotions}from"./resources/percentage_discount_promotions";export{default as PriceLists}from"./resources/price_lists";export{default as Prices}from"./resources/prices";export{default as PromotionRules}from"./resources/promotion_rules";export{default as Promotions}from"./resources/promotions";export{default as Refunds}from"./resources/refunds";export{default as ReturnLineItems}from"./resources/return_line_items";export{default as Returns}from"./resources/returns";export{default as Shipments}from"./resources/shipments";export{default as ShippingCategories}from"./resources/shipping_categories";export{default as ShippingMethods}from"./resources/shipping_methods";export{default as ShippingZones}from"./resources/shipping_zones";export{default as SkuListItems}from"./resources/sku_list_items";export{default as SkuListPromotionRules}from"./resources/sku_list_promotion_rules";export{default as SkuLists}from"./resources/sku_lists";export{default as SkuOptions}from"./resources/sku_options";export{default as Skus}from"./resources/skus";export{default as StockItems}from"./resources/stock_items";export{default as StockLineItems}from"./resources/stock_line_items";export{default as StockLocations}from"./resources/stock_locations";export{default as StockTransfers}from"./resources/stock_transfers";export{default as StripeGateways}from"./resources/stripe_gateways";export{default as StripePayments}from"./resources/stripe_payments";export{default as TaxCalculators}from"./resources/tax_calculators";export{default as TaxCategories}from"./resources/tax_categories";export{default as TaxRules}from"./resources/tax_rules";export{default as TaxjarAccounts}from"./resources/taxjar_accounts";export{default as Transactions}from"./resources/transactions";export{default as Voids}from"./resources/voids";export{default as Webhooks}from"./resources/webhooks";export{default as WireTransfers}from"./resources/wire_transfers";export const resourceList=["addresses","adjustments","adyen_gateways","adyen_payments","application","attachments","authorizations","avalara_accounts","billing_info_validation_rules","bing_geocoders","braintree_gateways","braintree_payments","bundles","captures","carrier_accounts","checkout_com_gateways","checkout_com_payments","coupon_codes_promotion_rules","coupon_recipients","coupons","customer_addresses","customer_groups","customer_password_resets","customer_payment_sources","customer_subscriptions","customers","delivery_lead_times","event_callbacks","external_gateways","external_payments","external_promotions","external_tax_calculators","fixed_amount_promotions","fixed_price_promotions","free_gift_promotions","free_shipping_promotions","geocoders","gift_card_recipients","gift_cards","google_geocoders","imports","in_stock_subscriptions","inventory_models","inventory_return_locations","inventory_stock_locations","line_item_options","line_items","manual_gateways","manual_tax_calculators","markets","merchants","order_amount_promotion_rules","order_copies","order_subscriptions","order_validation_rules","orders","organization","packages","parcel_line_items","parcels","payment_gateways","payment_methods","paypal_gateways","paypal_payments","percentage_discount_promotions","price_lists","prices","promotion_rules","promotions","refunds","return_line_items","returns","shipments","shipping_categories","shipping_methods","shipping_zones","sku_list_items","sku_list_promotion_rules","sku_lists","sku_options","skus","stock_items","stock_line_items","stock_locations","stock_transfers","stripe_gateways","stripe_payments","tax_calculators","tax_categories","tax_rules","taxjar_accounts","transactions","voids","webhooks","wire_transfers"];
1
+ export{default as Addresses}from"./resources/addresses";export{default as Adjustments}from"./resources/adjustments";export{default as AdyenGateways}from"./resources/adyen_gateways";export{default as AdyenPayments}from"./resources/adyen_payments";export{default as Applications}from"./resources/application";export{default as Attachments}from"./resources/attachments";export{default as Authorizations}from"./resources/authorizations";export{default as AvalaraAccounts}from"./resources/avalara_accounts";export{default as BillingInfoValidationRules}from"./resources/billing_info_validation_rules";export{default as BingGeocoders}from"./resources/bing_geocoders";export{default as BraintreeGateways}from"./resources/braintree_gateways";export{default as BraintreePayments}from"./resources/braintree_payments";export{default as Bundles}from"./resources/bundles";export{default as Captures}from"./resources/captures";export{default as CarrierAccounts}from"./resources/carrier_accounts";export{default as CheckoutComGateways}from"./resources/checkout_com_gateways";export{default as CheckoutComPayments}from"./resources/checkout_com_payments";export{default as CouponCodesPromotionRules}from"./resources/coupon_codes_promotion_rules";export{default as CouponRecipients}from"./resources/coupon_recipients";export{default as Coupons}from"./resources/coupons";export{default as CustomerAddresses}from"./resources/customer_addresses";export{default as CustomerGroups}from"./resources/customer_groups";export{default as CustomerPasswordResets}from"./resources/customer_password_resets";export{default as CustomerPaymentSources}from"./resources/customer_payment_sources";export{default as CustomerSubscriptions}from"./resources/customer_subscriptions";export{default as Customers}from"./resources/customers";export{default as DeliveryLeadTimes}from"./resources/delivery_lead_times";export{default as EventCallbacks}from"./resources/event_callbacks";export{default as ExternalGateways}from"./resources/external_gateways";export{default as ExternalPayments}from"./resources/external_payments";export{default as ExternalPromotions}from"./resources/external_promotions";export{default as ExternalTaxCalculators}from"./resources/external_tax_calculators";export{default as FixedAmountPromotions}from"./resources/fixed_amount_promotions";export{default as FixedPricePromotions}from"./resources/fixed_price_promotions";export{default as FreeGiftPromotions}from"./resources/free_gift_promotions";export{default as FreeShippingPromotions}from"./resources/free_shipping_promotions";export{default as Geocoders}from"./resources/geocoders";export{default as GiftCardRecipients}from"./resources/gift_card_recipients";export{default as GiftCards}from"./resources/gift_cards";export{default as GoogleGeocoders}from"./resources/google_geocoders";export{default as Imports}from"./resources/imports";export{default as InStockSubscriptions}from"./resources/in_stock_subscriptions";export{default as InventoryModels}from"./resources/inventory_models";export{default as InventoryReturnLocations}from"./resources/inventory_return_locations";export{default as InventoryStockLocations}from"./resources/inventory_stock_locations";export{default as KlarnaGateways}from"./resources/klarna_gateways";export{default as KlarnaPayments}from"./resources/klarna_payments";export{default as LineItemOptions}from"./resources/line_item_options";export{default as LineItems}from"./resources/line_items";export{default as ManualGateways}from"./resources/manual_gateways";export{default as ManualTaxCalculators}from"./resources/manual_tax_calculators";export{default as Markets}from"./resources/markets";export{default as Merchants}from"./resources/merchants";export{default as OrderAmountPromotionRules}from"./resources/order_amount_promotion_rules";export{default as OrderCopies}from"./resources/order_copies";export{default as OrderSubscriptions}from"./resources/order_subscriptions";export{default as OrderValidationRules}from"./resources/order_validation_rules";export{default as Orders}from"./resources/orders";export{default as Organizations}from"./resources/organization";export{default as Packages}from"./resources/packages";export{default as ParcelLineItems}from"./resources/parcel_line_items";export{default as Parcels}from"./resources/parcels";export{default as PaymentGateways}from"./resources/payment_gateways";export{default as PaymentMethods}from"./resources/payment_methods";export{default as PaypalGateways}from"./resources/paypal_gateways";export{default as PaypalPayments}from"./resources/paypal_payments";export{default as PercentageDiscountPromotions}from"./resources/percentage_discount_promotions";export{default as PriceLists}from"./resources/price_lists";export{default as Prices}from"./resources/prices";export{default as PromotionRules}from"./resources/promotion_rules";export{default as Promotions}from"./resources/promotions";export{default as Refunds}from"./resources/refunds";export{default as ReturnLineItems}from"./resources/return_line_items";export{default as Returns}from"./resources/returns";export{default as Shipments}from"./resources/shipments";export{default as ShippingCategories}from"./resources/shipping_categories";export{default as ShippingMethods}from"./resources/shipping_methods";export{default as ShippingZones}from"./resources/shipping_zones";export{default as SkuListItems}from"./resources/sku_list_items";export{default as SkuListPromotionRules}from"./resources/sku_list_promotion_rules";export{default as SkuLists}from"./resources/sku_lists";export{default as SkuOptions}from"./resources/sku_options";export{default as Skus}from"./resources/skus";export{default as StockItems}from"./resources/stock_items";export{default as StockLineItems}from"./resources/stock_line_items";export{default as StockLocations}from"./resources/stock_locations";export{default as StockTransfers}from"./resources/stock_transfers";export{default as StripeGateways}from"./resources/stripe_gateways";export{default as StripePayments}from"./resources/stripe_payments";export{default as TaxCalculators}from"./resources/tax_calculators";export{default as TaxCategories}from"./resources/tax_categories";export{default as TaxRules}from"./resources/tax_rules";export{default as TaxjarAccounts}from"./resources/taxjar_accounts";export{default as Transactions}from"./resources/transactions";export{default as Voids}from"./resources/voids";export{default as Webhooks}from"./resources/webhooks";export{default as WireTransfers}from"./resources/wire_transfers";export const resourceList=["addresses","adjustments","adyen_gateways","adyen_payments","application","attachments","authorizations","avalara_accounts","billing_info_validation_rules","bing_geocoders","braintree_gateways","braintree_payments","bundles","captures","carrier_accounts","checkout_com_gateways","checkout_com_payments","coupon_codes_promotion_rules","coupon_recipients","coupons","customer_addresses","customer_groups","customer_password_resets","customer_payment_sources","customer_subscriptions","customers","delivery_lead_times","event_callbacks","external_gateways","external_payments","external_promotions","external_tax_calculators","fixed_amount_promotions","fixed_price_promotions","free_gift_promotions","free_shipping_promotions","geocoders","gift_card_recipients","gift_cards","google_geocoders","imports","in_stock_subscriptions","inventory_models","inventory_return_locations","inventory_stock_locations","klarna_gateways","klarna_payments","line_item_options","line_items","manual_gateways","manual_tax_calculators","markets","merchants","order_amount_promotion_rules","order_copies","order_subscriptions","order_validation_rules","orders","organization","packages","parcel_line_items","parcels","payment_gateways","payment_methods","paypal_gateways","paypal_payments","percentage_discount_promotions","price_lists","prices","promotion_rules","promotions","refunds","return_line_items","returns","shipments","shipping_categories","shipping_methods","shipping_zones","sku_list_items","sku_list_promotion_rules","sku_lists","sku_options","skus","stock_items","stock_line_items","stock_locations","stock_transfers","stripe_gateways","stripe_payments","tax_calculators","tax_categories","tax_rules","taxjar_accounts","transactions","voids","webhooks","wire_transfers"];
package/lib/esm/client.js CHANGED
@@ -1 +1 @@
1
- var h=this&&this.__classPrivateFieldSet||function(t,e,r,s,o){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r},c=this&&this.__classPrivateFieldGet||function(t,e,r,s){if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?s:r==="a"?s.call(t):s?s.value:e.get(t)},a,i;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){a.set(this,void 0),i.set(this,void 0),this.baseUrl=p(e.organization,e.domain),h(this,a,e.accessToken,"f");const r={timeout:e.timeout||l.client.timeout};h(this,i,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,a,"f")}},r)),"f"),this.interceptors=c(this,i,"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,i,"f").defaults;e.timeout&&(r.timeout=e.timeout),e.organization&&(this.baseUrl=p(e.organization,e.domain)),e.accessToken&&h(this,a,e.accessToken,"f")}async request(e,r,s,o){const m=s?{data:s}:void 0,w=r,v=(o==null?void 0:o.organization)?p(o.organization,o.domain):void 0,E=(o==null?void 0:o.accessToken)?{Authorization:"Bearer "+o.accessToken}:void 0;return c(this,i,"f").request(Object.assign({method:e,baseURL:v,url:w,data:m,headers:E},o)).then(d=>d.data).catch(d=>y(d))}}a=new WeakMap,i=new WeakMap;export default f;
1
+ var h=this&&this.__classPrivateFieldSet||function(o,t,e,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?o!==t||!i:!t.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(o,e):i?i.value=e:t.set(o,e),e},a=this&&this.__classPrivateFieldGet||function(o,t,e,r){if(e==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?o!==t||!r:!t.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?r:e==="a"?r.call(o):r?r.value:t.get(o)},s,n;import u from"axios";import{SdkError as T,ApiError as g,ErrorType as c}from"./error";import l from"./config";const p=(o,t)=>`https://${o.toLowerCase()}.${t||l.default.domain}/api`,b=o=>{let t=new T({message:o.message,type:c.GENERIC});if(u.isAxiosError(o))if(o.response){const e=new g(t);e.type=c.RESPONSE,e.status=o.response.status,e.code=String(e.status),e.errors=o.response.data.errors,t=e}else o.request?(t.type=c.REQUEST,t.request=o.request):t.type=c.CLIENT;else u.isCancel(o)?t.type=c.CANCEL:t.source=o;throw t};class f{constructor(t){s.set(this,void 0),n.set(this,void 0),this.baseUrl=p(t.organization,t.domain),h(this,s,t.accessToken,"f");const e={timeout:t.timeout||l.client.timeout};h(this,n,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 "+a(this,s,"f")}},e)),"f"),this.interceptors=a(this,n,"f").interceptors}static create(t){if(!(t==null?void 0:t.organization))throw new Error("Undefined 'organization' parameter");if(!(t==null?void 0:t.accessToken))throw new Error("Undefined 'accessToken' parameter");return new f(t)}config(t){const e=a(this,n,"f").defaults;t.timeout&&(e.timeout=t.timeout),t.organization&&(this.baseUrl=p(t.organization,t.domain)),t.accessToken&&(h(this,s,t.accessToken,"f"),e.headers.common.Authorization="Bearer "+a(this,s,"f"))}async request(t,e,r,i){const w=r?{data:r}:void 0,v=e,E=(i==null?void 0:i.organization)?p(i.organization,i.domain):void 0,m=(i==null?void 0:i.accessToken)||a(this,s,"f"),y=m?{Authorization:"Bearer "+m}:void 0;return a(this,n,"f").request(Object.assign({method:t,baseURL:E,url:v,data:w,headers:y},i)).then(d=>d.data).catch(d=>b(d))}}s=new WeakMap,n=new WeakMap;export default f;
@@ -53,6 +53,8 @@ declare class CommerceLayerClient {
53
53
  inventory_models: api.InventoryModels;
54
54
  inventory_return_locations: api.InventoryReturnLocations;
55
55
  inventory_stock_locations: api.InventoryStockLocations;
56
+ klarna_gateways: api.KlarnaGateways;
57
+ klarna_payments: api.KlarnaPayments;
56
58
  line_item_options: api.LineItemOptions;
57
59
  line_items: api.LineItems;
58
60
  manual_gateways: api.ManualGateways;