@commercelayer/sdk 5.0.0-beta.4 → 5.0.0-beta.6

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 (235) hide show
  1. package/lib/cjs/client.js +8 -3
  2. package/lib/cjs/commercelayer.d.ts +2 -2
  3. package/lib/cjs/commercelayer.js +1 -1
  4. package/lib/cjs/error.js +1 -1
  5. package/lib/cjs/jsonapi.js +5 -1
  6. package/lib/cjs/resource.js +7 -7
  7. package/lib/cjs/resources/addresses.js +2 -3
  8. package/lib/cjs/resources/adjustments.js +2 -3
  9. package/lib/cjs/resources/adyen_gateways.js +2 -3
  10. package/lib/cjs/resources/adyen_payments.js +2 -3
  11. package/lib/cjs/resources/application.js +0 -1
  12. package/lib/cjs/resources/attachments.js +2 -3
  13. package/lib/cjs/resources/authorizations.js +1 -2
  14. package/lib/cjs/resources/avalara_accounts.js +2 -3
  15. package/lib/cjs/resources/axerve_gateways.js +2 -3
  16. package/lib/cjs/resources/axerve_payments.js +2 -3
  17. package/lib/cjs/resources/billing_info_validation_rules.js +2 -3
  18. package/lib/cjs/resources/bing_geocoders.js +2 -3
  19. package/lib/cjs/resources/braintree_gateways.js +2 -3
  20. package/lib/cjs/resources/braintree_payments.js +2 -3
  21. package/lib/cjs/resources/bundles.js +2 -3
  22. package/lib/cjs/resources/captures.js +1 -2
  23. package/lib/cjs/resources/carrier_accounts.js +0 -1
  24. package/lib/cjs/resources/checkout_com_gateways.js +2 -3
  25. package/lib/cjs/resources/checkout_com_payments.js +2 -3
  26. package/lib/cjs/resources/cleanups.js +1 -2
  27. package/lib/cjs/resources/coupon_codes_promotion_rules.js +2 -3
  28. package/lib/cjs/resources/coupon_recipients.js +2 -3
  29. package/lib/cjs/resources/coupons.js +2 -3
  30. package/lib/cjs/resources/customer_addresses.js +2 -3
  31. package/lib/cjs/resources/customer_groups.js +2 -3
  32. package/lib/cjs/resources/customer_password_resets.js +2 -3
  33. package/lib/cjs/resources/customer_payment_sources.js +2 -3
  34. package/lib/cjs/resources/customer_subscriptions.js +2 -3
  35. package/lib/cjs/resources/customers.js +2 -3
  36. package/lib/cjs/resources/delivery_lead_times.js +2 -3
  37. package/lib/cjs/resources/event_callbacks.js +0 -1
  38. package/lib/cjs/resources/events.js +0 -1
  39. package/lib/cjs/resources/exports.js +1 -2
  40. package/lib/cjs/resources/external_gateways.js +2 -3
  41. package/lib/cjs/resources/external_payments.js +2 -3
  42. package/lib/cjs/resources/external_promotions.js +2 -3
  43. package/lib/cjs/resources/external_tax_calculators.js +2 -3
  44. package/lib/cjs/resources/fixed_amount_promotions.js +2 -3
  45. package/lib/cjs/resources/fixed_price_promotions.js +2 -3
  46. package/lib/cjs/resources/free_gift_promotions.js +2 -3
  47. package/lib/cjs/resources/free_shipping_promotions.js +2 -3
  48. package/lib/cjs/resources/geocoders.js +0 -1
  49. package/lib/cjs/resources/gift_card_recipients.js +2 -3
  50. package/lib/cjs/resources/gift_cards.js +2 -3
  51. package/lib/cjs/resources/google_geocoders.js +2 -3
  52. package/lib/cjs/resources/imports.js +1 -2
  53. package/lib/cjs/resources/in_stock_subscriptions.js +2 -3
  54. package/lib/cjs/resources/inventory_models.js +2 -3
  55. package/lib/cjs/resources/inventory_return_locations.js +2 -3
  56. package/lib/cjs/resources/inventory_stock_locations.js +2 -3
  57. package/lib/cjs/resources/klarna_gateways.js +2 -3
  58. package/lib/cjs/resources/klarna_payments.js +2 -3
  59. package/lib/cjs/resources/line_item_options.js +2 -3
  60. package/lib/cjs/resources/line_items.d.ts +2 -2
  61. package/lib/cjs/resources/line_items.js +2 -3
  62. package/lib/cjs/resources/manual_gateways.js +2 -3
  63. package/lib/cjs/resources/manual_tax_calculators.js +2 -3
  64. package/lib/cjs/resources/markets.js +2 -3
  65. package/lib/cjs/resources/merchants.js +2 -3
  66. package/lib/cjs/resources/order_amount_promotion_rules.js +2 -3
  67. package/lib/cjs/resources/order_copies.js +1 -2
  68. package/lib/cjs/resources/order_subscriptions.js +2 -3
  69. package/lib/cjs/resources/order_validation_rules.js +0 -1
  70. package/lib/cjs/resources/orders.d.ts +2 -2
  71. package/lib/cjs/resources/orders.js +2 -3
  72. package/lib/cjs/resources/organization.js +0 -1
  73. package/lib/cjs/resources/packages.js +2 -3
  74. package/lib/cjs/resources/parcel_line_items.js +2 -3
  75. package/lib/cjs/resources/parcels.js +2 -3
  76. package/lib/cjs/resources/payment_gateways.js +0 -1
  77. package/lib/cjs/resources/payment_methods.js +2 -3
  78. package/lib/cjs/resources/paypal_gateways.js +2 -3
  79. package/lib/cjs/resources/paypal_payments.js +2 -3
  80. package/lib/cjs/resources/percentage_discount_promotions.js +2 -3
  81. package/lib/cjs/resources/price_lists.js +2 -3
  82. package/lib/cjs/resources/price_tiers.js +0 -1
  83. package/lib/cjs/resources/price_volume_tiers.js +2 -3
  84. package/lib/cjs/resources/prices.js +2 -3
  85. package/lib/cjs/resources/promotion_rules.js +0 -1
  86. package/lib/cjs/resources/promotions.js +0 -1
  87. package/lib/cjs/resources/refunds.js +0 -1
  88. package/lib/cjs/resources/return_line_items.js +2 -3
  89. package/lib/cjs/resources/returns.js +2 -3
  90. package/lib/cjs/resources/satispay_gateways.js +2 -3
  91. package/lib/cjs/resources/satispay_payments.js +2 -3
  92. package/lib/cjs/resources/shipments.js +1 -2
  93. package/lib/cjs/resources/shipping_categories.js +2 -3
  94. package/lib/cjs/resources/shipping_method_tiers.js +0 -1
  95. package/lib/cjs/resources/shipping_methods.js +2 -3
  96. package/lib/cjs/resources/shipping_weight_tiers.js +2 -3
  97. package/lib/cjs/resources/shipping_zones.js +2 -3
  98. package/lib/cjs/resources/sku_list_items.js +2 -3
  99. package/lib/cjs/resources/sku_list_promotion_rules.js +2 -3
  100. package/lib/cjs/resources/sku_lists.js +2 -3
  101. package/lib/cjs/resources/sku_options.js +2 -3
  102. package/lib/cjs/resources/skus.js +2 -3
  103. package/lib/cjs/resources/stock_items.js +2 -3
  104. package/lib/cjs/resources/stock_line_items.js +0 -1
  105. package/lib/cjs/resources/stock_locations.js +2 -3
  106. package/lib/cjs/resources/stock_transfers.js +2 -3
  107. package/lib/cjs/resources/stripe_gateways.js +2 -3
  108. package/lib/cjs/resources/stripe_payments.js +2 -3
  109. package/lib/cjs/resources/tax_calculators.js +0 -1
  110. package/lib/cjs/resources/tax_categories.js +2 -3
  111. package/lib/cjs/resources/tax_rules.js +2 -3
  112. package/lib/cjs/resources/taxjar_accounts.js +2 -3
  113. package/lib/cjs/resources/transactions.js +0 -1
  114. package/lib/cjs/resources/voids.js +0 -1
  115. package/lib/cjs/resources/webhooks.js +2 -3
  116. package/lib/cjs/resources/wire_transfers.js +2 -3
  117. package/lib/esm/client.js +8 -3
  118. package/lib/esm/commercelayer.d.ts +2 -2
  119. package/lib/esm/commercelayer.js +1 -1
  120. package/lib/esm/error.js +1 -1
  121. package/lib/esm/jsonapi.js +5 -1
  122. package/lib/esm/resource.js +7 -7
  123. package/lib/esm/resources/addresses.js +2 -3
  124. package/lib/esm/resources/adjustments.js +2 -3
  125. package/lib/esm/resources/adyen_gateways.js +2 -3
  126. package/lib/esm/resources/adyen_payments.js +2 -3
  127. package/lib/esm/resources/application.js +0 -1
  128. package/lib/esm/resources/attachments.js +2 -3
  129. package/lib/esm/resources/authorizations.js +1 -2
  130. package/lib/esm/resources/avalara_accounts.js +2 -3
  131. package/lib/esm/resources/axerve_gateways.js +2 -3
  132. package/lib/esm/resources/axerve_payments.js +2 -3
  133. package/lib/esm/resources/billing_info_validation_rules.js +2 -3
  134. package/lib/esm/resources/bing_geocoders.js +2 -3
  135. package/lib/esm/resources/braintree_gateways.js +2 -3
  136. package/lib/esm/resources/braintree_payments.js +2 -3
  137. package/lib/esm/resources/bundles.js +2 -3
  138. package/lib/esm/resources/captures.js +1 -2
  139. package/lib/esm/resources/carrier_accounts.js +0 -1
  140. package/lib/esm/resources/checkout_com_gateways.js +2 -3
  141. package/lib/esm/resources/checkout_com_payments.js +2 -3
  142. package/lib/esm/resources/cleanups.js +1 -2
  143. package/lib/esm/resources/coupon_codes_promotion_rules.js +2 -3
  144. package/lib/esm/resources/coupon_recipients.js +2 -3
  145. package/lib/esm/resources/coupons.js +2 -3
  146. package/lib/esm/resources/customer_addresses.js +2 -3
  147. package/lib/esm/resources/customer_groups.js +2 -3
  148. package/lib/esm/resources/customer_password_resets.js +2 -3
  149. package/lib/esm/resources/customer_payment_sources.js +2 -3
  150. package/lib/esm/resources/customer_subscriptions.js +2 -3
  151. package/lib/esm/resources/customers.js +2 -3
  152. package/lib/esm/resources/delivery_lead_times.js +2 -3
  153. package/lib/esm/resources/event_callbacks.js +0 -1
  154. package/lib/esm/resources/events.js +0 -1
  155. package/lib/esm/resources/exports.js +1 -2
  156. package/lib/esm/resources/external_gateways.js +2 -3
  157. package/lib/esm/resources/external_payments.js +2 -3
  158. package/lib/esm/resources/external_promotions.js +2 -3
  159. package/lib/esm/resources/external_tax_calculators.js +2 -3
  160. package/lib/esm/resources/fixed_amount_promotions.js +2 -3
  161. package/lib/esm/resources/fixed_price_promotions.js +2 -3
  162. package/lib/esm/resources/free_gift_promotions.js +2 -3
  163. package/lib/esm/resources/free_shipping_promotions.js +2 -3
  164. package/lib/esm/resources/geocoders.js +0 -1
  165. package/lib/esm/resources/gift_card_recipients.js +2 -3
  166. package/lib/esm/resources/gift_cards.js +2 -3
  167. package/lib/esm/resources/google_geocoders.js +2 -3
  168. package/lib/esm/resources/imports.js +1 -2
  169. package/lib/esm/resources/in_stock_subscriptions.js +2 -3
  170. package/lib/esm/resources/inventory_models.js +2 -3
  171. package/lib/esm/resources/inventory_return_locations.js +2 -3
  172. package/lib/esm/resources/inventory_stock_locations.js +2 -3
  173. package/lib/esm/resources/klarna_gateways.js +2 -3
  174. package/lib/esm/resources/klarna_payments.js +2 -3
  175. package/lib/esm/resources/line_item_options.js +2 -3
  176. package/lib/esm/resources/line_items.d.ts +2 -2
  177. package/lib/esm/resources/line_items.js +2 -3
  178. package/lib/esm/resources/manual_gateways.js +2 -3
  179. package/lib/esm/resources/manual_tax_calculators.js +2 -3
  180. package/lib/esm/resources/markets.js +2 -3
  181. package/lib/esm/resources/merchants.js +2 -3
  182. package/lib/esm/resources/order_amount_promotion_rules.js +2 -3
  183. package/lib/esm/resources/order_copies.js +1 -2
  184. package/lib/esm/resources/order_subscriptions.js +2 -3
  185. package/lib/esm/resources/order_validation_rules.js +0 -1
  186. package/lib/esm/resources/orders.d.ts +2 -2
  187. package/lib/esm/resources/orders.js +2 -3
  188. package/lib/esm/resources/organization.js +0 -1
  189. package/lib/esm/resources/packages.js +2 -3
  190. package/lib/esm/resources/parcel_line_items.js +2 -3
  191. package/lib/esm/resources/parcels.js +2 -3
  192. package/lib/esm/resources/payment_gateways.js +0 -1
  193. package/lib/esm/resources/payment_methods.js +2 -3
  194. package/lib/esm/resources/paypal_gateways.js +2 -3
  195. package/lib/esm/resources/paypal_payments.js +2 -3
  196. package/lib/esm/resources/percentage_discount_promotions.js +2 -3
  197. package/lib/esm/resources/price_lists.js +2 -3
  198. package/lib/esm/resources/price_tiers.js +0 -1
  199. package/lib/esm/resources/price_volume_tiers.js +2 -3
  200. package/lib/esm/resources/prices.js +2 -3
  201. package/lib/esm/resources/promotion_rules.js +0 -1
  202. package/lib/esm/resources/promotions.js +0 -1
  203. package/lib/esm/resources/refunds.js +0 -1
  204. package/lib/esm/resources/return_line_items.js +2 -3
  205. package/lib/esm/resources/returns.js +2 -3
  206. package/lib/esm/resources/satispay_gateways.js +2 -3
  207. package/lib/esm/resources/satispay_payments.js +2 -3
  208. package/lib/esm/resources/shipments.js +1 -2
  209. package/lib/esm/resources/shipping_categories.js +2 -3
  210. package/lib/esm/resources/shipping_method_tiers.js +0 -1
  211. package/lib/esm/resources/shipping_methods.js +2 -3
  212. package/lib/esm/resources/shipping_weight_tiers.js +2 -3
  213. package/lib/esm/resources/shipping_zones.js +2 -3
  214. package/lib/esm/resources/sku_list_items.js +2 -3
  215. package/lib/esm/resources/sku_list_promotion_rules.js +2 -3
  216. package/lib/esm/resources/sku_lists.js +2 -3
  217. package/lib/esm/resources/sku_options.js +2 -3
  218. package/lib/esm/resources/skus.js +2 -3
  219. package/lib/esm/resources/stock_items.js +2 -3
  220. package/lib/esm/resources/stock_line_items.js +0 -1
  221. package/lib/esm/resources/stock_locations.js +2 -3
  222. package/lib/esm/resources/stock_transfers.js +2 -3
  223. package/lib/esm/resources/stripe_gateways.js +2 -3
  224. package/lib/esm/resources/stripe_payments.js +2 -3
  225. package/lib/esm/resources/tax_calculators.js +0 -1
  226. package/lib/esm/resources/tax_categories.js +2 -3
  227. package/lib/esm/resources/tax_rules.js +2 -3
  228. package/lib/esm/resources/taxjar_accounts.js +2 -3
  229. package/lib/esm/resources/transactions.js +0 -1
  230. package/lib/esm/resources/voids.js +0 -1
  231. package/lib/esm/resources/webhooks.js +2 -3
  232. package/lib/esm/resources/wire_transfers.js +2 -3
  233. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  234. package/lib/tsconfig.tsbuildinfo +1 -1
  235. package/package.json +3 -3
@@ -2,12 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class OrderCopies extends resource_1.ApiResource {
5
- // static readonly PATH = 'order_copies'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: OrderCopies.TYPE }, params, options);
8
7
  }
9
8
  async create(resource, params, options) {
10
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: OrderCopies.TYPE }), params, options);
9
+ return this.resources.create({ ...resource, type: OrderCopies.TYPE }, params, options);
11
10
  }
12
11
  async delete(id, options) {
13
12
  await this.resources.delete((typeof id === 'string') ? { id, type: OrderCopies.TYPE } : id, options);
@@ -2,15 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class OrderSubscriptions extends resource_1.ApiResource {
5
- // static readonly PATH = 'order_subscriptions'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: OrderSubscriptions.TYPE }, params, options);
8
7
  }
9
8
  async create(resource, params, options) {
10
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: OrderSubscriptions.TYPE }), params, options);
9
+ return this.resources.create({ ...resource, type: OrderSubscriptions.TYPE }, params, options);
11
10
  }
12
11
  async update(resource, params, options) {
13
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: OrderSubscriptions.TYPE }), params, options);
12
+ return this.resources.update({ ...resource, type: OrderSubscriptions.TYPE }, params, options);
14
13
  }
15
14
  async delete(id, options) {
16
15
  await this.resources.delete((typeof id === 'string') ? { id, type: OrderSubscriptions.TYPE } : id, options);
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class OrderValidationRules extends resource_1.ApiResource {
5
- // static readonly PATH = 'order_validation_rules'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: OrderValidationRules.TYPE }, params, options);
8
7
  }
@@ -79,8 +79,8 @@ interface Order extends Resource {
79
79
  number?: number;
80
80
  autorefresh?: boolean;
81
81
  status?: 'draft' | 'pending' | 'placed' | 'approved' | 'cancelled';
82
- payment_status?: 'unpaid' | 'authorized' | 'paid' | 'voided' | 'refunded';
83
- fulfillment_status?: 'unfulfilled' | 'in_progress' | 'fulfilled';
82
+ payment_status?: 'unpaid' | 'authorized' | 'paid' | 'voided' | 'refunded' | 'free';
83
+ fulfillment_status?: 'unfulfilled' | 'in_progress' | 'fulfilled' | 'not_required';
84
84
  guest?: boolean;
85
85
  editable?: boolean;
86
86
  customer_email?: string;
@@ -2,15 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class Orders extends resource_1.ApiResource {
5
- // static readonly PATH = 'orders'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: Orders.TYPE }, params, options);
8
7
  }
9
8
  async create(resource, params, options) {
10
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: Orders.TYPE }), params, options);
9
+ return this.resources.create({ ...resource, type: Orders.TYPE }, params, options);
11
10
  }
12
11
  async update(resource, params, options) {
13
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: Orders.TYPE }), params, options);
12
+ return this.resources.update({ ...resource, type: Orders.TYPE }, params, options);
14
13
  }
15
14
  async delete(id, options) {
16
15
  await this.resources.delete((typeof id === 'string') ? { id, type: Orders.TYPE } : id, options);
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class Organizations extends resource_1.ApiSingleton {
5
- // static readonly PATH = 'organization'
6
5
  isOrganization(resource) {
7
6
  return resource.type && (resource.type === Organizations.TYPE);
8
7
  }
@@ -2,15 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class Packages extends resource_1.ApiResource {
5
- // static readonly PATH = 'packages'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: Packages.TYPE }, params, options);
8
7
  }
9
8
  async create(resource, params, options) {
10
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: Packages.TYPE }), params, options);
9
+ return this.resources.create({ ...resource, type: Packages.TYPE }, params, options);
11
10
  }
12
11
  async update(resource, params, options) {
13
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: Packages.TYPE }), params, options);
12
+ return this.resources.update({ ...resource, type: Packages.TYPE }, params, options);
14
13
  }
15
14
  async delete(id, options) {
16
15
  await this.resources.delete((typeof id === 'string') ? { id, type: Packages.TYPE } : id, options);
@@ -2,15 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class ParcelLineItems extends resource_1.ApiResource {
5
- // static readonly PATH = 'parcel_line_items'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: ParcelLineItems.TYPE }, params, options);
8
7
  }
9
8
  async create(resource, params, options) {
10
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: ParcelLineItems.TYPE }), params, options);
9
+ return this.resources.create({ ...resource, type: ParcelLineItems.TYPE }, params, options);
11
10
  }
12
11
  async update(resource, params, options) {
13
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: ParcelLineItems.TYPE }), params, options);
12
+ return this.resources.update({ ...resource, type: ParcelLineItems.TYPE }, params, options);
14
13
  }
15
14
  async delete(id, options) {
16
15
  await this.resources.delete((typeof id === 'string') ? { id, type: ParcelLineItems.TYPE } : id, options);
@@ -2,15 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class Parcels extends resource_1.ApiResource {
5
- // static readonly PATH = 'parcels'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: Parcels.TYPE }, params, options);
8
7
  }
9
8
  async create(resource, params, options) {
10
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: Parcels.TYPE }), params, options);
9
+ return this.resources.create({ ...resource, type: Parcels.TYPE }, params, options);
11
10
  }
12
11
  async update(resource, params, options) {
13
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: Parcels.TYPE }), params, options);
12
+ return this.resources.update({ ...resource, type: Parcels.TYPE }, params, options);
14
13
  }
15
14
  async delete(id, options) {
16
15
  await this.resources.delete((typeof id === 'string') ? { id, type: Parcels.TYPE } : id, options);
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class PaymentGateways extends resource_1.ApiResource {
5
- // static readonly PATH = 'payment_gateways'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: PaymentGateways.TYPE }, params, options);
8
7
  }
@@ -2,15 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class PaymentMethods extends resource_1.ApiResource {
5
- // static readonly PATH = 'payment_methods'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: PaymentMethods.TYPE }, params, options);
8
7
  }
9
8
  async create(resource, params, options) {
10
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: PaymentMethods.TYPE }), params, options);
9
+ return this.resources.create({ ...resource, type: PaymentMethods.TYPE }, params, options);
11
10
  }
12
11
  async update(resource, params, options) {
13
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: PaymentMethods.TYPE }), params, options);
12
+ return this.resources.update({ ...resource, type: PaymentMethods.TYPE }, params, options);
14
13
  }
15
14
  async delete(id, options) {
16
15
  await this.resources.delete((typeof id === 'string') ? { id, type: PaymentMethods.TYPE } : id, options);
@@ -2,15 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class PaypalGateways extends resource_1.ApiResource {
5
- // static readonly PATH = 'paypal_gateways'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: PaypalGateways.TYPE }, params, options);
8
7
  }
9
8
  async create(resource, params, options) {
10
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: PaypalGateways.TYPE }), params, options);
9
+ return this.resources.create({ ...resource, type: PaypalGateways.TYPE }, params, options);
11
10
  }
12
11
  async update(resource, params, options) {
13
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: PaypalGateways.TYPE }), params, options);
12
+ return this.resources.update({ ...resource, type: PaypalGateways.TYPE }, params, options);
14
13
  }
15
14
  async delete(id, options) {
16
15
  await this.resources.delete((typeof id === 'string') ? { id, type: PaypalGateways.TYPE } : id, options);
@@ -2,15 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class PaypalPayments extends resource_1.ApiResource {
5
- // static readonly PATH = 'paypal_payments'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: PaypalPayments.TYPE }, params, options);
8
7
  }
9
8
  async create(resource, params, options) {
10
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: PaypalPayments.TYPE }), params, options);
9
+ return this.resources.create({ ...resource, type: PaypalPayments.TYPE }, params, options);
11
10
  }
12
11
  async update(resource, params, options) {
13
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: PaypalPayments.TYPE }), params, options);
12
+ return this.resources.update({ ...resource, type: PaypalPayments.TYPE }, params, options);
14
13
  }
15
14
  async delete(id, options) {
16
15
  await this.resources.delete((typeof id === 'string') ? { id, type: PaypalPayments.TYPE } : id, options);
@@ -2,15 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class PercentageDiscountPromotions extends resource_1.ApiResource {
5
- // static readonly PATH = 'percentage_discount_promotions'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: PercentageDiscountPromotions.TYPE }, params, options);
8
7
  }
9
8
  async create(resource, params, options) {
10
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: PercentageDiscountPromotions.TYPE }), params, options);
9
+ return this.resources.create({ ...resource, type: PercentageDiscountPromotions.TYPE }, params, options);
11
10
  }
12
11
  async update(resource, params, options) {
13
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: PercentageDiscountPromotions.TYPE }), params, options);
12
+ return this.resources.update({ ...resource, type: PercentageDiscountPromotions.TYPE }, params, options);
14
13
  }
15
14
  async delete(id, options) {
16
15
  await this.resources.delete((typeof id === 'string') ? { id, type: PercentageDiscountPromotions.TYPE } : id, options);
@@ -2,15 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class PriceLists extends resource_1.ApiResource {
5
- // static readonly PATH = 'price_lists'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: PriceLists.TYPE }, params, options);
8
7
  }
9
8
  async create(resource, params, options) {
10
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: PriceLists.TYPE }), params, options);
9
+ return this.resources.create({ ...resource, type: PriceLists.TYPE }, params, options);
11
10
  }
12
11
  async update(resource, params, options) {
13
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: PriceLists.TYPE }), params, options);
12
+ return this.resources.update({ ...resource, type: PriceLists.TYPE }, params, options);
14
13
  }
15
14
  async delete(id, options) {
16
15
  await this.resources.delete((typeof id === 'string') ? { id, type: PriceLists.TYPE } : id, options);
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class PriceTiers extends resource_1.ApiResource {
5
- // static readonly PATH = 'price_tiers'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: PriceTiers.TYPE }, params, options);
8
7
  }
@@ -2,15 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class PriceVolumeTiers extends resource_1.ApiResource {
5
- // static readonly PATH = 'price_volume_tiers'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: PriceVolumeTiers.TYPE }, params, options);
8
7
  }
9
8
  async create(resource, params, options) {
10
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: PriceVolumeTiers.TYPE }), params, options);
9
+ return this.resources.create({ ...resource, type: PriceVolumeTiers.TYPE }, params, options);
11
10
  }
12
11
  async update(resource, params, options) {
13
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: PriceVolumeTiers.TYPE }), params, options);
12
+ return this.resources.update({ ...resource, type: PriceVolumeTiers.TYPE }, params, options);
14
13
  }
15
14
  async delete(id, options) {
16
15
  await this.resources.delete((typeof id === 'string') ? { id, type: PriceVolumeTiers.TYPE } : id, options);
@@ -2,15 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class Prices extends resource_1.ApiResource {
5
- // static readonly PATH = 'prices'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: Prices.TYPE }, params, options);
8
7
  }
9
8
  async create(resource, params, options) {
10
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: Prices.TYPE }), params, options);
9
+ return this.resources.create({ ...resource, type: Prices.TYPE }, params, options);
11
10
  }
12
11
  async update(resource, params, options) {
13
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: Prices.TYPE }), params, options);
12
+ return this.resources.update({ ...resource, type: Prices.TYPE }, params, options);
14
13
  }
15
14
  async delete(id, options) {
16
15
  await this.resources.delete((typeof id === 'string') ? { id, type: Prices.TYPE } : id, options);
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class PromotionRules extends resource_1.ApiResource {
5
- // static readonly PATH = 'promotion_rules'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: PromotionRules.TYPE }, params, options);
8
7
  }
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class Promotions extends resource_1.ApiResource {
5
- // static readonly PATH = 'promotions'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: Promotions.TYPE }, params, options);
8
7
  }
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class Refunds extends resource_1.ApiResource {
5
- // static readonly PATH = 'refunds'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: Refunds.TYPE }, params, options);
8
7
  }
@@ -2,15 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class ReturnLineItems extends resource_1.ApiResource {
5
- // static readonly PATH = 'return_line_items'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: ReturnLineItems.TYPE }, params, options);
8
7
  }
9
8
  async create(resource, params, options) {
10
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: ReturnLineItems.TYPE }), params, options);
9
+ return this.resources.create({ ...resource, type: ReturnLineItems.TYPE }, params, options);
11
10
  }
12
11
  async update(resource, params, options) {
13
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: ReturnLineItems.TYPE }), params, options);
12
+ return this.resources.update({ ...resource, type: ReturnLineItems.TYPE }, params, options);
14
13
  }
15
14
  async delete(id, options) {
16
15
  await this.resources.delete((typeof id === 'string') ? { id, type: ReturnLineItems.TYPE } : id, options);
@@ -2,15 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class Returns extends resource_1.ApiResource {
5
- // static readonly PATH = 'returns'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: Returns.TYPE }, params, options);
8
7
  }
9
8
  async create(resource, params, options) {
10
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: Returns.TYPE }), params, options);
9
+ return this.resources.create({ ...resource, type: Returns.TYPE }, params, options);
11
10
  }
12
11
  async update(resource, params, options) {
13
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: Returns.TYPE }), params, options);
12
+ return this.resources.update({ ...resource, type: Returns.TYPE }, params, options);
14
13
  }
15
14
  async delete(id, options) {
16
15
  await this.resources.delete((typeof id === 'string') ? { id, type: Returns.TYPE } : id, options);
@@ -2,15 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class SatispayGateways extends resource_1.ApiResource {
5
- // static readonly PATH = 'satispay_gateways'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: SatispayGateways.TYPE }, params, options);
8
7
  }
9
8
  async create(resource, params, options) {
10
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: SatispayGateways.TYPE }), params, options);
9
+ return this.resources.create({ ...resource, type: SatispayGateways.TYPE }, params, options);
11
10
  }
12
11
  async update(resource, params, options) {
13
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: SatispayGateways.TYPE }), params, options);
12
+ return this.resources.update({ ...resource, type: SatispayGateways.TYPE }, params, options);
14
13
  }
15
14
  async delete(id, options) {
16
15
  await this.resources.delete((typeof id === 'string') ? { id, type: SatispayGateways.TYPE } : id, options);
@@ -2,15 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class SatispayPayments extends resource_1.ApiResource {
5
- // static readonly PATH = 'satispay_payments'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: SatispayPayments.TYPE }, params, options);
8
7
  }
9
8
  async create(resource, params, options) {
10
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: SatispayPayments.TYPE }), params, options);
9
+ return this.resources.create({ ...resource, type: SatispayPayments.TYPE }, params, options);
11
10
  }
12
11
  async update(resource, params, options) {
13
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: SatispayPayments.TYPE }), params, options);
12
+ return this.resources.update({ ...resource, type: SatispayPayments.TYPE }, params, options);
14
13
  }
15
14
  async delete(id, options) {
16
15
  await this.resources.delete((typeof id === 'string') ? { id, type: SatispayPayments.TYPE } : id, options);
@@ -2,12 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class Shipments extends resource_1.ApiResource {
5
- // static readonly PATH = 'shipments'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: Shipments.TYPE }, params, options);
8
7
  }
9
8
  async update(resource, params, options) {
10
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: Shipments.TYPE }), params, options);
9
+ return this.resources.update({ ...resource, type: Shipments.TYPE }, params, options);
11
10
  }
12
11
  async order(shipmentId, params, options) {
13
12
  const _shipmentId = shipmentId.id || shipmentId;
@@ -2,15 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class ShippingCategories extends resource_1.ApiResource {
5
- // static readonly PATH = 'shipping_categories'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: ShippingCategories.TYPE }, params, options);
8
7
  }
9
8
  async create(resource, params, options) {
10
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: ShippingCategories.TYPE }), params, options);
9
+ return this.resources.create({ ...resource, type: ShippingCategories.TYPE }, params, options);
11
10
  }
12
11
  async update(resource, params, options) {
13
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: ShippingCategories.TYPE }), params, options);
12
+ return this.resources.update({ ...resource, type: ShippingCategories.TYPE }, params, options);
14
13
  }
15
14
  async delete(id, options) {
16
15
  await this.resources.delete((typeof id === 'string') ? { id, type: ShippingCategories.TYPE } : id, options);
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class ShippingMethodTiers extends resource_1.ApiResource {
5
- // static readonly PATH = 'shipping_method_tiers'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: ShippingMethodTiers.TYPE }, params, options);
8
7
  }
@@ -2,15 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class ShippingMethods extends resource_1.ApiResource {
5
- // static readonly PATH = 'shipping_methods'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: ShippingMethods.TYPE }, params, options);
8
7
  }
9
8
  async create(resource, params, options) {
10
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: ShippingMethods.TYPE }), params, options);
9
+ return this.resources.create({ ...resource, type: ShippingMethods.TYPE }, params, options);
11
10
  }
12
11
  async update(resource, params, options) {
13
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: ShippingMethods.TYPE }), params, options);
12
+ return this.resources.update({ ...resource, type: ShippingMethods.TYPE }, params, options);
14
13
  }
15
14
  async delete(id, options) {
16
15
  await this.resources.delete((typeof id === 'string') ? { id, type: ShippingMethods.TYPE } : id, options);
@@ -2,15 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class ShippingWeightTiers extends resource_1.ApiResource {
5
- // static readonly PATH = 'shipping_weight_tiers'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: ShippingWeightTiers.TYPE }, params, options);
8
7
  }
9
8
  async create(resource, params, options) {
10
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: ShippingWeightTiers.TYPE }), params, options);
9
+ return this.resources.create({ ...resource, type: ShippingWeightTiers.TYPE }, params, options);
11
10
  }
12
11
  async update(resource, params, options) {
13
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: ShippingWeightTiers.TYPE }), params, options);
12
+ return this.resources.update({ ...resource, type: ShippingWeightTiers.TYPE }, params, options);
14
13
  }
15
14
  async delete(id, options) {
16
15
  await this.resources.delete((typeof id === 'string') ? { id, type: ShippingWeightTiers.TYPE } : id, options);
@@ -2,15 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class ShippingZones extends resource_1.ApiResource {
5
- // static readonly PATH = 'shipping_zones'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: ShippingZones.TYPE }, params, options);
8
7
  }
9
8
  async create(resource, params, options) {
10
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: ShippingZones.TYPE }), params, options);
9
+ return this.resources.create({ ...resource, type: ShippingZones.TYPE }, params, options);
11
10
  }
12
11
  async update(resource, params, options) {
13
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: ShippingZones.TYPE }), params, options);
12
+ return this.resources.update({ ...resource, type: ShippingZones.TYPE }, params, options);
14
13
  }
15
14
  async delete(id, options) {
16
15
  await this.resources.delete((typeof id === 'string') ? { id, type: ShippingZones.TYPE } : id, options);
@@ -2,15 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class SkuListItems extends resource_1.ApiResource {
5
- // static readonly PATH = 'sku_list_items'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: SkuListItems.TYPE }, params, options);
8
7
  }
9
8
  async create(resource, params, options) {
10
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: SkuListItems.TYPE }), params, options);
9
+ return this.resources.create({ ...resource, type: SkuListItems.TYPE }, params, options);
11
10
  }
12
11
  async update(resource, params, options) {
13
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: SkuListItems.TYPE }), params, options);
12
+ return this.resources.update({ ...resource, type: SkuListItems.TYPE }, params, options);
14
13
  }
15
14
  async delete(id, options) {
16
15
  await this.resources.delete((typeof id === 'string') ? { id, type: SkuListItems.TYPE } : id, options);
@@ -2,15 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class SkuListPromotionRules extends resource_1.ApiResource {
5
- // static readonly PATH = 'sku_list_promotion_rules'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: SkuListPromotionRules.TYPE }, params, options);
8
7
  }
9
8
  async create(resource, params, options) {
10
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: SkuListPromotionRules.TYPE }), params, options);
9
+ return this.resources.create({ ...resource, type: SkuListPromotionRules.TYPE }, params, options);
11
10
  }
12
11
  async update(resource, params, options) {
13
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: SkuListPromotionRules.TYPE }), params, options);
12
+ return this.resources.update({ ...resource, type: SkuListPromotionRules.TYPE }, params, options);
14
13
  }
15
14
  async delete(id, options) {
16
15
  await this.resources.delete((typeof id === 'string') ? { id, type: SkuListPromotionRules.TYPE } : id, options);
@@ -2,15 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class SkuLists extends resource_1.ApiResource {
5
- // static readonly PATH = 'sku_lists'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: SkuLists.TYPE }, params, options);
8
7
  }
9
8
  async create(resource, params, options) {
10
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: SkuLists.TYPE }), params, options);
9
+ return this.resources.create({ ...resource, type: SkuLists.TYPE }, params, options);
11
10
  }
12
11
  async update(resource, params, options) {
13
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: SkuLists.TYPE }), params, options);
12
+ return this.resources.update({ ...resource, type: SkuLists.TYPE }, params, options);
14
13
  }
15
14
  async delete(id, options) {
16
15
  await this.resources.delete((typeof id === 'string') ? { id, type: SkuLists.TYPE } : id, options);
@@ -2,15 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class SkuOptions extends resource_1.ApiResource {
5
- // static readonly PATH = 'sku_options'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: SkuOptions.TYPE }, params, options);
8
7
  }
9
8
  async create(resource, params, options) {
10
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: SkuOptions.TYPE }), params, options);
9
+ return this.resources.create({ ...resource, type: SkuOptions.TYPE }, params, options);
11
10
  }
12
11
  async update(resource, params, options) {
13
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: SkuOptions.TYPE }), params, options);
12
+ return this.resources.update({ ...resource, type: SkuOptions.TYPE }, params, options);
14
13
  }
15
14
  async delete(id, options) {
16
15
  await this.resources.delete((typeof id === 'string') ? { id, type: SkuOptions.TYPE } : id, options);
@@ -2,15 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class Skus extends resource_1.ApiResource {
5
- // static readonly PATH = 'skus'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: Skus.TYPE }, params, options);
8
7
  }
9
8
  async create(resource, params, options) {
10
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: Skus.TYPE }), params, options);
9
+ return this.resources.create({ ...resource, type: Skus.TYPE }, params, options);
11
10
  }
12
11
  async update(resource, params, options) {
13
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: Skus.TYPE }), params, options);
12
+ return this.resources.update({ ...resource, type: Skus.TYPE }, params, options);
14
13
  }
15
14
  async delete(id, options) {
16
15
  await this.resources.delete((typeof id === 'string') ? { id, type: Skus.TYPE } : id, options);
@@ -2,15 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  class StockItems extends resource_1.ApiResource {
5
- // static readonly PATH = 'stock_items'
6
5
  async list(params, options) {
7
6
  return this.resources.list({ type: StockItems.TYPE }, params, options);
8
7
  }
9
8
  async create(resource, params, options) {
10
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: StockItems.TYPE }), params, options);
9
+ return this.resources.create({ ...resource, type: StockItems.TYPE }, params, options);
11
10
  }
12
11
  async update(resource, params, options) {
13
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: StockItems.TYPE }), params, options);
12
+ return this.resources.update({ ...resource, type: StockItems.TYPE }, params, options);
14
13
  }
15
14
  async delete(id, options) {
16
15
  await this.resources.delete((typeof id === 'string') ? { id, type: StockItems.TYPE } : id, options);