@commercelayer/sdk 4.30.0 → 4.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/lib/cjs/api.d.ts +4 -2
  2. package/lib/cjs/api.js +8 -2
  3. package/lib/cjs/client.d.ts +5 -1
  4. package/lib/cjs/client.js +22 -3
  5. package/lib/cjs/commercelayer.d.ts +4 -2
  6. package/lib/cjs/commercelayer.js +3 -1
  7. package/lib/cjs/error.d.ts +1 -0
  8. package/lib/cjs/error.js +1 -2
  9. package/lib/cjs/interceptor.d.ts +1 -1
  10. package/lib/cjs/jsonapi.js +4 -1
  11. package/lib/cjs/model.d.ts +2 -0
  12. package/lib/cjs/resources/authorizations.d.ts +3 -0
  13. package/lib/cjs/resources/authorizations.js +4 -0
  14. package/lib/cjs/resources/captures.d.ts +3 -0
  15. package/lib/cjs/resources/captures.js +4 -0
  16. package/lib/cjs/resources/coupons.d.ts +8 -0
  17. package/lib/cjs/resources/coupons.js +4 -0
  18. package/lib/cjs/resources/customer_addresses.d.ts +2 -0
  19. package/lib/cjs/resources/customers.d.ts +1 -0
  20. package/lib/cjs/resources/external_promotions.d.ts +3 -0
  21. package/lib/cjs/resources/external_promotions.js +4 -0
  22. package/lib/cjs/resources/fixed_amount_promotions.d.ts +3 -0
  23. package/lib/cjs/resources/fixed_amount_promotions.js +4 -0
  24. package/lib/cjs/resources/fixed_price_promotions.d.ts +8 -8
  25. package/lib/cjs/resources/fixed_price_promotions.js +4 -4
  26. package/lib/cjs/resources/free_gift_promotions.d.ts +8 -8
  27. package/lib/cjs/resources/free_gift_promotions.js +4 -4
  28. package/lib/cjs/resources/free_shipping_promotions.d.ts +3 -0
  29. package/lib/cjs/resources/free_shipping_promotions.js +4 -0
  30. package/lib/cjs/resources/imports.d.ts +0 -3
  31. package/lib/cjs/resources/inventory_models.d.ts +3 -0
  32. package/lib/cjs/resources/line_items.d.ts +5 -0
  33. package/lib/cjs/resources/line_items.js +4 -0
  34. package/lib/cjs/resources/order_amount_promotion_rules.d.ts +3 -0
  35. package/lib/cjs/resources/orders.d.ts +4 -4
  36. package/lib/cjs/resources/parcel_line_items.d.ts +1 -1
  37. package/lib/cjs/resources/parcels.d.ts +3 -3
  38. package/lib/cjs/resources/percentage_discount_promotions.d.ts +8 -8
  39. package/lib/cjs/resources/percentage_discount_promotions.js +4 -4
  40. package/lib/cjs/resources/promotions.d.ts +3 -0
  41. package/lib/cjs/resources/promotions.js +4 -0
  42. package/lib/cjs/resources/refunds.d.ts +3 -0
  43. package/lib/cjs/resources/refunds.js +4 -0
  44. package/lib/cjs/resources/reserved_stocks.d.ts +28 -0
  45. package/lib/cjs/resources/reserved_stocks.js +28 -0
  46. package/lib/cjs/resources/return_line_items.d.ts +2 -1
  47. package/lib/cjs/resources/satispay_payments.d.ts +7 -0
  48. package/lib/cjs/resources/shipping_methods.d.ts +6 -0
  49. package/lib/cjs/resources/skus.d.ts +3 -0
  50. package/lib/cjs/resources/skus.js +4 -0
  51. package/lib/cjs/resources/stock_items.d.ts +6 -0
  52. package/lib/cjs/resources/stock_items.js +8 -0
  53. package/lib/cjs/resources/stock_line_items.d.ts +3 -0
  54. package/lib/cjs/resources/stock_line_items.js +4 -0
  55. package/lib/cjs/resources/stock_reservations.d.ts +36 -0
  56. package/lib/cjs/resources/stock_reservations.js +36 -0
  57. package/lib/cjs/resources/stripe_payments.d.ts +1 -0
  58. package/lib/cjs/resources/transactions.d.ts +5 -2
  59. package/lib/cjs/resources/transactions.js +4 -0
  60. package/lib/cjs/resources/voids.d.ts +3 -0
  61. package/lib/cjs/resources/voids.js +4 -0
  62. package/lib/cjs/util.d.ts +0 -4
  63. package/lib/esm/api.d.ts +4 -2
  64. package/lib/esm/api.js +4 -0
  65. package/lib/esm/client.d.ts +5 -1
  66. package/lib/esm/client.js +22 -3
  67. package/lib/esm/commercelayer.d.ts +4 -2
  68. package/lib/esm/commercelayer.js +3 -1
  69. package/lib/esm/error.d.ts +1 -0
  70. package/lib/esm/interceptor.d.ts +1 -1
  71. package/lib/esm/jsonapi.js +4 -1
  72. package/lib/esm/model.d.ts +2 -0
  73. package/lib/esm/resources/authorizations.d.ts +3 -0
  74. package/lib/esm/resources/authorizations.js +4 -0
  75. package/lib/esm/resources/captures.d.ts +3 -0
  76. package/lib/esm/resources/captures.js +4 -0
  77. package/lib/esm/resources/coupons.d.ts +8 -0
  78. package/lib/esm/resources/coupons.js +4 -0
  79. package/lib/esm/resources/customer_addresses.d.ts +2 -0
  80. package/lib/esm/resources/customers.d.ts +1 -0
  81. package/lib/esm/resources/external_promotions.d.ts +3 -0
  82. package/lib/esm/resources/external_promotions.js +4 -0
  83. package/lib/esm/resources/fixed_amount_promotions.d.ts +3 -0
  84. package/lib/esm/resources/fixed_amount_promotions.js +4 -0
  85. package/lib/esm/resources/fixed_price_promotions.d.ts +8 -8
  86. package/lib/esm/resources/fixed_price_promotions.js +4 -4
  87. package/lib/esm/resources/free_gift_promotions.d.ts +8 -8
  88. package/lib/esm/resources/free_gift_promotions.js +4 -4
  89. package/lib/esm/resources/free_shipping_promotions.d.ts +3 -0
  90. package/lib/esm/resources/free_shipping_promotions.js +4 -0
  91. package/lib/esm/resources/imports.d.ts +0 -3
  92. package/lib/esm/resources/inventory_models.d.ts +3 -0
  93. package/lib/esm/resources/line_items.d.ts +5 -0
  94. package/lib/esm/resources/line_items.js +4 -0
  95. package/lib/esm/resources/order_amount_promotion_rules.d.ts +3 -0
  96. package/lib/esm/resources/orders.d.ts +4 -4
  97. package/lib/esm/resources/parcel_line_items.d.ts +1 -1
  98. package/lib/esm/resources/parcels.d.ts +3 -3
  99. package/lib/esm/resources/percentage_discount_promotions.d.ts +8 -8
  100. package/lib/esm/resources/percentage_discount_promotions.js +4 -4
  101. package/lib/esm/resources/promotions.d.ts +3 -0
  102. package/lib/esm/resources/promotions.js +4 -0
  103. package/lib/esm/resources/refunds.d.ts +3 -0
  104. package/lib/esm/resources/refunds.js +4 -0
  105. package/lib/esm/resources/reserved_stocks.d.ts +28 -0
  106. package/lib/esm/resources/reserved_stocks.js +26 -0
  107. package/lib/esm/resources/return_line_items.d.ts +2 -1
  108. package/lib/esm/resources/satispay_payments.d.ts +7 -0
  109. package/lib/esm/resources/shipping_methods.d.ts +6 -0
  110. package/lib/esm/resources/skus.d.ts +3 -0
  111. package/lib/esm/resources/skus.js +4 -0
  112. package/lib/esm/resources/stock_items.d.ts +6 -0
  113. package/lib/esm/resources/stock_items.js +8 -0
  114. package/lib/esm/resources/stock_line_items.d.ts +3 -0
  115. package/lib/esm/resources/stock_line_items.js +4 -0
  116. package/lib/esm/resources/stock_reservations.d.ts +36 -0
  117. package/lib/esm/resources/stock_reservations.js +34 -0
  118. package/lib/esm/resources/stripe_payments.d.ts +1 -0
  119. package/lib/esm/resources/transactions.d.ts +5 -2
  120. package/lib/esm/resources/transactions.js +4 -0
  121. package/lib/esm/resources/voids.d.ts +3 -0
  122. package/lib/esm/resources/voids.js +4 -0
  123. package/lib/esm/util.d.ts +0 -4
  124. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  125. package/lib/tsconfig.tsbuildinfo +1 -1
  126. package/package.json +8 -8
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const resource_1 = require("../resource");
4
+ class ReservedStocks extends resource_1.ApiResource {
5
+ async stock_item(reservedStockId, params, options) {
6
+ const _reservedStockId = reservedStockId.id || reservedStockId;
7
+ return this.resources.fetch({ type: 'stock_items' }, `reserved_stocks/${_reservedStockId}/stock_item`, params, options);
8
+ }
9
+ async sku(reservedStockId, params, options) {
10
+ const _reservedStockId = reservedStockId.id || reservedStockId;
11
+ return this.resources.fetch({ type: 'skus' }, `reserved_stocks/${_reservedStockId}/sku`, params, options);
12
+ }
13
+ async stock_reservations(reservedStockId, params, options) {
14
+ const _reservedStockId = reservedStockId.id || reservedStockId;
15
+ return this.resources.fetch({ type: 'stock_reservations' }, `reserved_stocks/${_reservedStockId}/stock_reservations`, params, options);
16
+ }
17
+ isReservedStock(resource) {
18
+ return resource.type && (resource.type === ReservedStocks.TYPE);
19
+ }
20
+ relationship(id) {
21
+ return ((id === null) || (typeof id === 'string')) ? { id, type: ReservedStocks.TYPE } : { id: id.id, type: ReservedStocks.TYPE };
22
+ }
23
+ type() {
24
+ return ReservedStocks.TYPE;
25
+ }
26
+ }
27
+ ReservedStocks.TYPE = 'reserved_stocks';
28
+ exports.default = ReservedStocks;
@@ -17,8 +17,9 @@ interface ReturnLineItem extends Resource {
17
17
  readonly type: ReturnLineItemType;
18
18
  sku_code?: string | null;
19
19
  bundle_code?: string | null;
20
- name?: string | null;
21
20
  quantity: number;
21
+ name?: string | null;
22
+ image_url?: string | null;
22
23
  return_reason?: Record<string, any> | null;
23
24
  restocked_at?: string | null;
24
25
  return?: Return | null;
@@ -13,11 +13,18 @@ type OrderRel = ResourceRel & {
13
13
  interface SatispayPayment extends Resource {
14
14
  readonly type: SatispayPaymentType;
15
15
  payment_id?: string | null;
16
+ flow?: string | null;
16
17
  redirect_url?: string | null;
18
+ payment_url?: string | null;
19
+ intent_amount_cents: number;
20
+ intent_amount_float?: number | null;
21
+ formatted_intent_amount?: string | null;
22
+ payment_response?: Record<string, any> | null;
17
23
  order?: Order | null;
18
24
  payment_gateway?: PaymentGateway | null;
19
25
  }
20
26
  interface SatispayPaymentCreate extends ResourceCreate {
27
+ flow?: string | null;
21
28
  redirect_url?: string | null;
22
29
  order: OrderRel;
23
30
  }
@@ -33,6 +33,7 @@ interface ShippingMethod extends Resource {
33
33
  name: string;
34
34
  scheme?: string | null;
35
35
  currency_code?: string | null;
36
+ external_prices_url?: string | null;
36
37
  disabled_at?: string | null;
37
38
  price_amount_cents: number;
38
39
  price_amount_float?: number | null;
@@ -40,6 +41,7 @@ interface ShippingMethod extends Resource {
40
41
  free_over_amount_cents?: number | null;
41
42
  free_over_amount_float?: number | null;
42
43
  formatted_free_over_amount?: string | null;
44
+ use_subtotal?: boolean | null;
43
45
  price_amount_for_shipment_cents?: number | null;
44
46
  price_amount_for_shipment_float?: number | null;
45
47
  formatted_price_amount_for_shipment?: string | null;
@@ -59,8 +61,10 @@ interface ShippingMethodCreate extends ResourceCreate {
59
61
  name: string;
60
62
  scheme?: string | null;
61
63
  currency_code?: string | null;
64
+ external_prices_url?: string | null;
62
65
  price_amount_cents: number;
63
66
  free_over_amount_cents?: number | null;
67
+ use_subtotal?: boolean | null;
64
68
  min_weight?: number | null;
65
69
  max_weight?: number | null;
66
70
  unit_of_weight?: string | null;
@@ -74,10 +78,12 @@ interface ShippingMethodUpdate extends ResourceUpdate {
74
78
  name?: string | null;
75
79
  scheme?: string | null;
76
80
  currency_code?: string | null;
81
+ external_prices_url?: string | null;
77
82
  _disable?: boolean | null;
78
83
  _enable?: boolean | null;
79
84
  price_amount_cents?: number | null;
80
85
  free_over_amount_cents?: number | null;
86
+ use_subtotal?: boolean | null;
81
87
  min_weight?: number | null;
82
88
  max_weight?: number | null;
83
89
  unit_of_weight?: string | null;
@@ -4,6 +4,7 @@ import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
4
  import type { ShippingCategory, ShippingCategoryType } from './shipping_categories';
5
5
  import type { Price } from './prices';
6
6
  import type { StockItem } from './stock_items';
7
+ import type { StockReservation } from './stock_reservations';
7
8
  import type { DeliveryLeadTime } from './delivery_lead_times';
8
9
  import type { SkuOption } from './sku_options';
9
10
  import type { Attachment } from './attachments';
@@ -35,6 +36,7 @@ interface Sku extends Resource {
35
36
  shipping_category?: ShippingCategory | null;
36
37
  prices?: Price[] | null;
37
38
  stock_items?: StockItem[] | null;
39
+ stock_reservations?: StockReservation[] | null;
38
40
  delivery_lead_times?: DeliveryLeadTime[] | null;
39
41
  sku_options?: SkuOption[] | null;
40
42
  attachments?: Attachment[] | null;
@@ -77,6 +79,7 @@ declare class Skus extends ApiResource<Sku> {
77
79
  shipping_category(skuId: string | Sku, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingCategory>;
78
80
  prices(skuId: string | Sku, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Price>>;
79
81
  stock_items(skuId: string | Sku, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockItem>>;
82
+ stock_reservations(skuId: string | Sku, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockReservation>>;
80
83
  delivery_lead_times(skuId: string | Sku, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<DeliveryLeadTime>>;
81
84
  sku_options(skuId: string | Sku, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<SkuOption>>;
82
85
  attachments(skuId: string | Sku, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
@@ -23,6 +23,10 @@ class Skus extends resource_1.ApiResource {
23
23
  const _skuId = skuId.id || skuId;
24
24
  return this.resources.fetch({ type: 'stock_items' }, `skus/${_skuId}/stock_items`, params, options);
25
25
  }
26
+ async stock_reservations(skuId, params, options) {
27
+ const _skuId = skuId.id || skuId;
28
+ return this.resources.fetch({ type: 'stock_reservations' }, `skus/${_skuId}/stock_reservations`, params, options);
29
+ }
26
30
  async delivery_lead_times(skuId, params, options) {
27
31
  const _skuId = skuId.id || skuId;
28
32
  return this.resources.fetch({ type: 'delivery_lead_times' }, `skus/${_skuId}/delivery_lead_times`, params, options);
@@ -3,6 +3,8 @@ import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesCon
3
3
  import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
4
  import type { StockLocation, StockLocationType } from './stock_locations';
5
5
  import type { Sku, SkuType } from './skus';
6
+ import type { ReservedStock } from './reserved_stocks';
7
+ import type { StockReservation } from './stock_reservations';
6
8
  import type { Attachment } from './attachments';
7
9
  type StockItemType = 'stock_items';
8
10
  type StockItemRel = ResourceRel & {
@@ -20,6 +22,8 @@ interface StockItem extends Resource {
20
22
  quantity: number;
21
23
  stock_location?: StockLocation | null;
22
24
  sku?: Sku | null;
25
+ reserved_stock?: ReservedStock | null;
26
+ stock_reservations?: StockReservation[] | null;
23
27
  attachments?: Attachment[] | null;
24
28
  }
25
29
  interface StockItemCreate extends ResourceCreate {
@@ -41,6 +45,8 @@ declare class StockItems extends ApiResource<StockItem> {
41
45
  delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
42
46
  stock_location(stockItemId: string | StockItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
43
47
  sku(stockItemId: string | StockItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
48
+ reserved_stock(stockItemId: string | StockItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReservedStock>;
49
+ stock_reservations(stockItemId: string | StockItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockReservation>>;
44
50
  attachments(stockItemId: string | StockItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
45
51
  isStockItem(resource: any): resource is StockItem;
46
52
  relationship(id: string | ResourceId | null): StockItemRel;
@@ -19,6 +19,14 @@ class StockItems extends resource_1.ApiResource {
19
19
  const _stockItemId = stockItemId.id || stockItemId;
20
20
  return this.resources.fetch({ type: 'skus' }, `stock_items/${_stockItemId}/sku`, params, options);
21
21
  }
22
+ async reserved_stock(stockItemId, params, options) {
23
+ const _stockItemId = stockItemId.id || stockItemId;
24
+ return this.resources.fetch({ type: 'reserved_stocks' }, `stock_items/${_stockItemId}/reserved_stock`, params, options);
25
+ }
26
+ async stock_reservations(stockItemId, params, options) {
27
+ const _stockItemId = stockItemId.id || stockItemId;
28
+ return this.resources.fetch({ type: 'stock_reservations' }, `stock_items/${_stockItemId}/stock_reservations`, params, options);
29
+ }
22
30
  async attachments(stockItemId, params, options) {
23
31
  const _stockItemId = stockItemId.id || stockItemId;
24
32
  return this.resources.fetch({ type: 'attachments' }, `stock_items/${_stockItemId}/attachments`, params, options);
@@ -4,6 +4,7 @@ import type { QueryParamsRetrieve } from '../query';
4
4
  import type { Shipment } from './shipments';
5
5
  import type { LineItem } from './line_items';
6
6
  import type { StockItem } from './stock_items';
7
+ import type { Sku } from './skus';
7
8
  type StockLineItemType = 'stock_line_items';
8
9
  type StockLineItemRel = ResourceRel & {
9
10
  type: StockLineItemType;
@@ -16,12 +17,14 @@ interface StockLineItem extends Resource {
16
17
  shipment?: Shipment | null;
17
18
  line_item?: LineItem | null;
18
19
  stock_item?: StockItem | null;
20
+ sku?: Sku | null;
19
21
  }
20
22
  declare class StockLineItems extends ApiResource<StockLineItem> {
21
23
  static readonly TYPE: StockLineItemType;
22
24
  shipment(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
23
25
  line_item(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
24
26
  stock_item(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockItem>;
27
+ sku(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
25
28
  isStockLineItem(resource: any): resource is StockLineItem;
26
29
  relationship(id: string | ResourceId | null): StockLineItemRel;
27
30
  type(): StockLineItemType;
@@ -14,6 +14,10 @@ class StockLineItems extends resource_1.ApiResource {
14
14
  const _stockLineItemId = stockLineItemId.id || stockLineItemId;
15
15
  return this.resources.fetch({ type: 'stock_items' }, `stock_line_items/${_stockLineItemId}/stock_item`, params, options);
16
16
  }
17
+ async sku(stockLineItemId, params, options) {
18
+ const _stockLineItemId = stockLineItemId.id || stockLineItemId;
19
+ return this.resources.fetch({ type: 'skus' }, `stock_line_items/${_stockLineItemId}/sku`, params, options);
20
+ }
17
21
  isStockLineItem(resource) {
18
22
  return resource.type && (resource.type === StockLineItems.TYPE);
19
23
  }
@@ -0,0 +1,36 @@
1
+ import { ApiResource } from '../resource';
2
+ import type { Resource, ResourceId, ResourcesConfig, ResourceRel } from '../resource';
3
+ import type { QueryParamsRetrieve } from '../query';
4
+ import type { LineItem } from './line_items';
5
+ import type { Order } from './orders';
6
+ import type { StockItem } from './stock_items';
7
+ import type { ReservedStock } from './reserved_stocks';
8
+ import type { Sku } from './skus';
9
+ type StockReservationType = 'stock_reservations';
10
+ type StockReservationRel = ResourceRel & {
11
+ type: StockReservationType;
12
+ };
13
+ interface StockReservation extends Resource {
14
+ readonly type: StockReservationType;
15
+ status: 'draft' | 'pending';
16
+ quantity: number;
17
+ expires_at: string;
18
+ line_item?: LineItem | null;
19
+ order?: Order | null;
20
+ stock_item?: StockItem | null;
21
+ reserved_stock?: ReservedStock | null;
22
+ sku?: Sku | null;
23
+ }
24
+ declare class StockReservations extends ApiResource<StockReservation> {
25
+ static readonly TYPE: StockReservationType;
26
+ line_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
27
+ order(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
28
+ stock_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockItem>;
29
+ reserved_stock(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReservedStock>;
30
+ sku(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
31
+ isStockReservation(resource: any): resource is StockReservation;
32
+ relationship(id: string | ResourceId | null): StockReservationRel;
33
+ type(): StockReservationType;
34
+ }
35
+ export default StockReservations;
36
+ export type { StockReservation, StockReservationType };
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const resource_1 = require("../resource");
4
+ class StockReservations extends resource_1.ApiResource {
5
+ async line_item(stockReservationId, params, options) {
6
+ const _stockReservationId = stockReservationId.id || stockReservationId;
7
+ return this.resources.fetch({ type: 'line_items' }, `stock_reservations/${_stockReservationId}/line_item`, params, options);
8
+ }
9
+ async order(stockReservationId, params, options) {
10
+ const _stockReservationId = stockReservationId.id || stockReservationId;
11
+ return this.resources.fetch({ type: 'orders' }, `stock_reservations/${_stockReservationId}/order`, params, options);
12
+ }
13
+ async stock_item(stockReservationId, params, options) {
14
+ const _stockReservationId = stockReservationId.id || stockReservationId;
15
+ return this.resources.fetch({ type: 'stock_items' }, `stock_reservations/${_stockReservationId}/stock_item`, params, options);
16
+ }
17
+ async reserved_stock(stockReservationId, params, options) {
18
+ const _stockReservationId = stockReservationId.id || stockReservationId;
19
+ return this.resources.fetch({ type: 'reserved_stocks' }, `stock_reservations/${_stockReservationId}/reserved_stock`, params, options);
20
+ }
21
+ async sku(stockReservationId, params, options) {
22
+ const _stockReservationId = stockReservationId.id || stockReservationId;
23
+ return this.resources.fetch({ type: 'skus' }, `stock_reservations/${_stockReservationId}/sku`, params, options);
24
+ }
25
+ isStockReservation(resource) {
26
+ return resource.type && (resource.type === StockReservations.TYPE);
27
+ }
28
+ relationship(id) {
29
+ return ((id === null) || (typeof id === 'string')) ? { id, type: StockReservations.TYPE } : { id: id.id, type: StockReservations.TYPE };
30
+ }
31
+ type() {
32
+ return StockReservations.TYPE;
33
+ }
34
+ }
35
+ StockReservations.TYPE = 'stock_reservations';
36
+ exports.default = StockReservations;
@@ -30,6 +30,7 @@ interface StripePaymentCreate extends ResourceCreate {
30
30
  }
31
31
  interface StripePaymentUpdate extends ResourceUpdate {
32
32
  options?: Record<string, any> | null;
33
+ _update?: boolean | null;
33
34
  _refresh?: boolean | null;
34
35
  order?: OrderRel | null;
35
36
  }
@@ -1,7 +1,8 @@
1
1
  import { ApiResource } from '../resource';
2
- import type { Resource, ResourceId, ResourcesConfig, ResourceRel } from '../resource';
3
- import type { QueryParamsRetrieve } from '../query';
2
+ import type { Resource, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
3
+ import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
4
  import type { Order } from './orders';
5
+ import type { Attachment } from './attachments';
5
6
  type TransactionType = 'transactions';
6
7
  type TransactionRel = ResourceRel & {
7
8
  type: TransactionType;
@@ -20,10 +21,12 @@ interface Transaction extends Resource {
20
21
  token?: string | null;
21
22
  gateway_transaction_id?: string | null;
22
23
  order?: Order | null;
24
+ attachments?: Attachment[] | null;
23
25
  }
24
26
  declare class Transactions extends ApiResource<Transaction> {
25
27
  static readonly TYPE: TransactionType;
26
28
  order(transactionId: string | Transaction, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
29
+ attachments(transactionId: string | Transaction, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
27
30
  isTransaction(resource: any): resource is Transaction;
28
31
  relationship(id: string | ResourceId | null): TransactionRel;
29
32
  type(): TransactionType;
@@ -6,6 +6,10 @@ class Transactions extends resource_1.ApiResource {
6
6
  const _transactionId = transactionId.id || transactionId;
7
7
  return this.resources.fetch({ type: 'orders' }, `transactions/${_transactionId}/order`, params, options);
8
8
  }
9
+ async attachments(transactionId, params, options) {
10
+ const _transactionId = transactionId.id || transactionId;
11
+ return this.resources.fetch({ type: 'attachments' }, `transactions/${_transactionId}/attachments`, params, options);
12
+ }
9
13
  isTransaction(resource) {
10
14
  return resource.type && (resource.type === Transactions.TYPE);
11
15
  }
@@ -2,6 +2,7 @@ import { ApiResource } from '../resource';
2
2
  import type { Resource, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
3
3
  import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
4
  import type { Order } from './orders';
5
+ import type { Attachment } from './attachments';
5
6
  import type { Authorization } from './authorizations';
6
7
  import type { Event } from './events';
7
8
  type VoidType = 'voids';
@@ -22,12 +23,14 @@ interface Void extends Resource {
22
23
  token?: string | null;
23
24
  gateway_transaction_id?: string | null;
24
25
  order?: Order | null;
26
+ attachments?: Attachment[] | null;
25
27
  reference_authorization?: Authorization | null;
26
28
  events?: Event[] | null;
27
29
  }
28
30
  declare class Voids extends ApiResource<Void> {
29
31
  static readonly TYPE: VoidType;
30
32
  order(voidId: string | Void, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
33
+ attachments(voidId: string | Void, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
31
34
  reference_authorization(voidId: string | Void, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Authorization>;
32
35
  events(voidId: string | Void, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
33
36
  isVoid(resource: any): resource is Void;
@@ -6,6 +6,10 @@ class Voids extends resource_1.ApiResource {
6
6
  const _voidId = voidId.id || voidId;
7
7
  return this.resources.fetch({ type: 'orders' }, `voids/${_voidId}/order`, params, options);
8
8
  }
9
+ async attachments(voidId, params, options) {
10
+ const _voidId = voidId.id || voidId;
11
+ return this.resources.fetch({ type: 'attachments' }, `voids/${_voidId}/attachments`, params, options);
12
+ }
9
13
  async reference_authorization(voidId, params, options) {
10
14
  const _voidId = voidId.id || voidId;
11
15
  return this.resources.fetch({ type: 'authorizations' }, `voids/${_voidId}/reference_authorization`, params, options);
package/lib/cjs/util.d.ts CHANGED
@@ -1,7 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- /// <reference types="node" />
4
- /// <reference types="node" />
5
1
  import type { ObjectType } from "./common";
6
2
  declare const sleep: (ms: number) => Promise<NodeJS.Timeout>;
7
3
  declare const sortObjectFields: (obj: ObjectType) => ObjectType;
package/lib/esm/api.d.ts CHANGED
@@ -84,6 +84,7 @@ export { default as PromotionRules } from './resources/promotion_rules';
84
84
  export { default as Promotions } from './resources/promotions';
85
85
  export { default as RecurringOrderCopies } from './resources/recurring_order_copies';
86
86
  export { default as Refunds } from './resources/refunds';
87
+ export { default as ReservedStocks } from './resources/reserved_stocks';
87
88
  export { default as ReturnLineItems } from './resources/return_line_items';
88
89
  export { default as Returns } from './resources/returns';
89
90
  export { default as SatispayGateways } from './resources/satispay_gateways';
@@ -102,6 +103,7 @@ export { default as Skus } from './resources/skus';
102
103
  export { default as StockItems } from './resources/stock_items';
103
104
  export { default as StockLineItems } from './resources/stock_line_items';
104
105
  export { default as StockLocations } from './resources/stock_locations';
106
+ export { default as StockReservations } from './resources/stock_reservations';
105
107
  export { default as StockTransfers } from './resources/stock_transfers';
106
108
  export { default as StripeGateways } from './resources/stripe_gateways';
107
109
  export { default as StripePayments } from './resources/stripe_payments';
@@ -115,8 +117,8 @@ export { default as Transactions } from './resources/transactions';
115
117
  export { default as Voids } from './resources/voids';
116
118
  export { default as Webhooks } from './resources/webhooks';
117
119
  export { default as WireTransfers } from './resources/wire_transfers';
118
- export type ResourceTypeLock = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'application' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | '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' | 'events' | 'exports' | '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_factories' | 'order_subscription_items' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'organization' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'recurring_order_copies' | 'refunds' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | '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' | 'subscription_models' | 'tags' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'voids' | 'webhooks' | 'wire_transfers';
119
- export declare const resourceList: readonly ["addresses", "adjustments", "adyen_gateways", "adyen_payments", "application", "attachments", "authorizations", "avalara_accounts", "axerve_gateways", "axerve_payments", "billing_info_validation_rules", "bing_geocoders", "braintree_gateways", "braintree_payments", "bundles", "captures", "carrier_accounts", "checkout_com_gateways", "checkout_com_payments", "cleanups", "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", "events", "exports", "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_factories", "order_subscription_items", "order_subscriptions", "order_validation_rules", "orders", "organization", "packages", "parcel_line_items", "parcels", "payment_gateways", "payment_methods", "paypal_gateways", "paypal_payments", "percentage_discount_promotions", "price_frequency_tiers", "price_lists", "price_tiers", "price_volume_tiers", "prices", "promotion_rules", "promotions", "recurring_order_copies", "refunds", "return_line_items", "returns", "satispay_gateways", "satispay_payments", "shipments", "shipping_categories", "shipping_method_tiers", "shipping_methods", "shipping_weight_tiers", "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", "subscription_models", "tags", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "voids", "webhooks", "wire_transfers"];
120
+ export type ResourceTypeLock = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'application' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | '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' | 'events' | 'exports' | '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_factories' | 'order_subscription_items' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'organization' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'recurring_order_copies' | 'refunds' | 'reserved_stocks' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_reservations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'voids' | 'webhooks' | 'wire_transfers';
121
+ export declare const resourceList: readonly ["addresses", "adjustments", "adyen_gateways", "adyen_payments", "application", "attachments", "authorizations", "avalara_accounts", "axerve_gateways", "axerve_payments", "billing_info_validation_rules", "bing_geocoders", "braintree_gateways", "braintree_payments", "bundles", "captures", "carrier_accounts", "checkout_com_gateways", "checkout_com_payments", "cleanups", "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", "events", "exports", "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_factories", "order_subscription_items", "order_subscriptions", "order_validation_rules", "orders", "organization", "packages", "parcel_line_items", "parcels", "payment_gateways", "payment_methods", "paypal_gateways", "paypal_payments", "percentage_discount_promotions", "price_frequency_tiers", "price_lists", "price_tiers", "price_volume_tiers", "prices", "promotion_rules", "promotions", "recurring_order_copies", "refunds", "reserved_stocks", "return_line_items", "returns", "satispay_gateways", "satispay_payments", "shipments", "shipping_categories", "shipping_method_tiers", "shipping_methods", "shipping_weight_tiers", "shipping_zones", "sku_list_items", "sku_list_promotion_rules", "sku_lists", "sku_options", "skus", "stock_items", "stock_line_items", "stock_locations", "stock_reservations", "stock_transfers", "stripe_gateways", "stripe_payments", "subscription_models", "tags", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "voids", "webhooks", "wire_transfers"];
120
122
  export type RetrievableResourceType = ResourceTypeLock;
121
123
  export type RetrievableResource = {
122
124
  type: RetrievableResourceType;
package/lib/esm/api.js CHANGED
@@ -86,6 +86,7 @@ export { default as PromotionRules } from './resources/promotion_rules';
86
86
  export { default as Promotions } from './resources/promotions';
87
87
  export { default as RecurringOrderCopies } from './resources/recurring_order_copies';
88
88
  export { default as Refunds } from './resources/refunds';
89
+ export { default as ReservedStocks } from './resources/reserved_stocks';
89
90
  export { default as ReturnLineItems } from './resources/return_line_items';
90
91
  export { default as Returns } from './resources/returns';
91
92
  export { default as SatispayGateways } from './resources/satispay_gateways';
@@ -104,6 +105,7 @@ export { default as Skus } from './resources/skus';
104
105
  export { default as StockItems } from './resources/stock_items';
105
106
  export { default as StockLineItems } from './resources/stock_line_items';
106
107
  export { default as StockLocations } from './resources/stock_locations';
108
+ export { default as StockReservations } from './resources/stock_reservations';
107
109
  export { default as StockTransfers } from './resources/stock_transfers';
108
110
  export { default as StripeGateways } from './resources/stripe_gateways';
109
111
  export { default as StripePayments } from './resources/stripe_payments';
@@ -203,6 +205,7 @@ export const resourceList = [
203
205
  'promotions',
204
206
  'recurring_order_copies',
205
207
  'refunds',
208
+ 'reserved_stocks',
206
209
  'return_line_items',
207
210
  'returns',
208
211
  'satispay_gateways',
@@ -221,6 +224,7 @@ export const resourceList = [
221
224
  'stock_items',
222
225
  'stock_line_items',
223
226
  'stock_locations',
227
+ 'stock_reservations',
224
228
  'stock_transfers',
225
229
  'stripe_gateways',
226
230
  'stripe_payments',
@@ -5,12 +5,15 @@ import type { InterceptorManager } from './interceptor';
5
5
  import type { Agent as HttpAgent } from 'http';
6
6
  import type { Agent as HttpsAgent } from 'https';
7
7
  type ProxyConfig = AxiosProxyConfig | false;
8
+ type RequestParams = Record<string, string | number | boolean>;
9
+ type RequestHeaders = Record<string, string>;
8
10
  type RequestConfig = {
9
11
  timeout?: number;
10
- params?: Record<string, string | number | boolean>;
12
+ params?: RequestParams;
11
13
  httpAgent?: HttpAgent;
12
14
  httpsAgent?: HttpsAgent;
13
15
  proxy?: ProxyConfig;
16
+ headers?: RequestHeaders;
14
17
  };
15
18
  type ApiClientInitConfig = {
16
19
  organization: string;
@@ -26,6 +29,7 @@ declare class ApiClient {
26
29
  private constructor();
27
30
  config(config: ApiClientConfig): void;
28
31
  request(method: Method, path: string, body?: any, options?: ApiClientConfig): Promise<any>;
32
+ private customHeaders;
29
33
  }
30
34
  export default ApiClient;
31
35
  export type { ApiClientInitConfig, ApiClientConfig, RequestConfig };
package/lib/esm/client.js CHANGED
@@ -26,8 +26,11 @@ const handleError = (error) => {
26
26
  const apiError = new ApiError(sdkError);
27
27
  apiError.type = ErrorType.RESPONSE;
28
28
  apiError.status = error.response.status;
29
+ apiError.statusText = error.response.statusText;
29
30
  apiError.code = String(apiError.status);
30
31
  apiError.errors = error.response.data.errors;
32
+ if (!apiError.message && apiError.statusText)
33
+ apiError.message = apiError.statusText;
31
34
  sdkError = apiError;
32
35
  }
33
36
  else if (error.request) {
@@ -66,13 +69,16 @@ class ApiClient {
66
69
  httpAgent: options.httpAgent,
67
70
  httpsAgent: options.httpsAgent,
68
71
  };
72
+ // Set custom headers
73
+ const customHeaders = this.customHeaders(options.headers);
69
74
  const axiosOptions = {
70
75
  baseURL: this.baseUrl,
71
76
  timeout: config.client.timeout,
72
77
  headers: {
78
+ ...customHeaders,
73
79
  'Accept': 'application/vnd.api+json',
74
80
  'Content-Type': 'application/vnd.api+json',
75
- 'Authorization': 'Bearer ' + __classPrivateFieldGet(this, _ApiClient_accessToken, "f"),
81
+ 'Authorization': 'Bearer ' + __classPrivateFieldGet(this, _ApiClient_accessToken, "f")
76
82
  },
77
83
  ...axiosConfig
78
84
  };
@@ -99,6 +105,8 @@ class ApiClient {
99
105
  __classPrivateFieldSet(this, _ApiClient_accessToken, config.accessToken, "f");
100
106
  def.headers.common.Authorization = 'Bearer ' + __classPrivateFieldGet(this, _ApiClient_accessToken, "f");
101
107
  }
108
+ if (config.headers)
109
+ def.headers.common = this.customHeaders(config.headers);
102
110
  }
103
111
  async request(method, path, body, options) {
104
112
  debug('request %s %s, %O, %O', method, path, body || {}, options || {});
@@ -107,8 +115,10 @@ class ApiClient {
107
115
  // Runtime request parameters
108
116
  const baseUrl = (options === null || options === void 0 ? void 0 : options.organization) ? baseURL(options.organization, options.domain) : undefined;
109
117
  const accessToken = (options === null || options === void 0 ? void 0 : options.accessToken) || __classPrivateFieldGet(this, _ApiClient_accessToken, "f");
110
- const headers = accessToken ? { 'Authorization': 'Bearer ' + accessToken } : undefined;
111
- const requestParams = { method, baseURL: baseUrl, url, data, headers, ...options };
118
+ const headers = this.customHeaders(options === null || options === void 0 ? void 0 : options.headers);
119
+ if (accessToken)
120
+ headers.Authorization = 'Bearer ' + accessToken;
121
+ const requestParams = { method, baseURL: baseUrl, url, data, ...options, headers };
112
122
  debug('request params: %O', requestParams);
113
123
  // const start = Date.now()
114
124
  return __classPrivateFieldGet(this, _ApiClient_client, "f").request(requestParams)
@@ -116,6 +126,15 @@ class ApiClient {
116
126
  .catch(error => handleError(error));
117
127
  // .finally(() => console.log(`<<-- ${method} ${path} ${Date.now() - start}`))
118
128
  }
129
+ customHeaders(headers) {
130
+ const customHeaders = {};
131
+ if (headers) {
132
+ for (const [name, value] of Object.entries(headers))
133
+ if (!['accept', 'content-type', 'authorization'].includes(name.toLowerCase()))
134
+ customHeaders[name] = value;
135
+ }
136
+ return customHeaders;
137
+ }
119
138
  }
120
139
  _ApiClient_accessToken = new WeakMap(), _ApiClient_client = new WeakMap();
121
140
  export default ApiClient;
@@ -2,7 +2,7 @@ import * as api from './api';
2
2
  import type { ApiError } from './error';
3
3
  import type { ErrorInterceptor, InterceptorType, RawResponseReader, RequestInterceptor, ResponseInterceptor } from './interceptor';
4
4
  import { type ResourcesInitConfig } from './resource';
5
- declare const OPEN_API_SCHEMA_VERSION = "4.2.4";
5
+ declare const OPEN_API_SCHEMA_VERSION = "4.10.0";
6
6
  export { OPEN_API_SCHEMA_VERSION };
7
7
  type SdkConfig = Record<string, unknown>;
8
8
  type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
@@ -10,7 +10,7 @@ type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
10
10
  declare class CommerceLayerClient {
11
11
  #private;
12
12
  static get openApiSchemaVersion(): string;
13
- readonly openApiSchemaVersion = "4.2.4";
13
+ readonly openApiSchemaVersion = "4.10.0";
14
14
  addresses: api.Addresses;
15
15
  adjustments: api.Adjustments;
16
16
  adyen_gateways: api.AdyenGateways;
@@ -94,6 +94,7 @@ declare class CommerceLayerClient {
94
94
  promotions: api.Promotions;
95
95
  recurring_order_copies: api.RecurringOrderCopies;
96
96
  refunds: api.Refunds;
97
+ reserved_stocks: api.ReservedStocks;
97
98
  return_line_items: api.ReturnLineItems;
98
99
  returns: api.Returns;
99
100
  satispay_gateways: api.SatispayGateways;
@@ -112,6 +113,7 @@ declare class CommerceLayerClient {
112
113
  stock_items: api.StockItems;
113
114
  stock_line_items: api.StockLineItems;
114
115
  stock_locations: api.StockLocations;
116
+ stock_reservations: api.StockReservations;
115
117
  stock_transfers: api.StockTransfers;
116
118
  stripe_gateways: api.StripeGateways;
117
119
  stripe_payments: api.StripePayments;
@@ -16,7 +16,7 @@ import ResourceAdapter from './resource';
16
16
  import Debug from './debug';
17
17
  const debug = Debug('commercelayer');
18
18
  // Autogenerated schema version number, do not remove this line
19
- const OPEN_API_SCHEMA_VERSION = '4.2.4';
19
+ const OPEN_API_SCHEMA_VERSION = '4.10.0';
20
20
  export { OPEN_API_SCHEMA_VERSION };
21
21
  class CommerceLayerClient {
22
22
  static get openApiSchemaVersion() { return OPEN_API_SCHEMA_VERSION; }
@@ -113,6 +113,7 @@ class CommerceLayerClient {
113
113
  this.promotions = new api.Promotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
114
114
  this.recurring_order_copies = new api.RecurringOrderCopies(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
115
115
  this.refunds = new api.Refunds(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
116
+ this.reserved_stocks = new api.ReservedStocks(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
116
117
  this.return_line_items = new api.ReturnLineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
117
118
  this.returns = new api.Returns(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
118
119
  this.satispay_gateways = new api.SatispayGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
@@ -131,6 +132,7 @@ class CommerceLayerClient {
131
132
  this.stock_items = new api.StockItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
132
133
  this.stock_line_items = new api.StockLineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
133
134
  this.stock_locations = new api.StockLocations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
135
+ this.stock_reservations = new api.StockReservations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
134
136
  this.stock_transfers = new api.StockTransfers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
135
137
  this.stripe_gateways = new api.StripeGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
136
138
  this.stripe_payments = new api.StripePayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
@@ -22,6 +22,7 @@ declare class ApiError extends SdkError {
22
22
  static isApiError(error: any): error is ApiError;
23
23
  errors: any[];
24
24
  status?: number;
25
+ statusText?: string;
25
26
  constructor(error: SdkError);
26
27
  first(): any;
27
28
  }