@commercelayer/sdk 5.7.0 → 5.8.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 (55) hide show
  1. package/lib/cjs/api.d.ts +3 -2
  2. package/lib/cjs/api.js +5 -2
  3. package/lib/cjs/commercelayer.d.ts +3 -2
  4. package/lib/cjs/commercelayer.js +2 -1
  5. package/lib/cjs/model.d.ts +1 -0
  6. package/lib/cjs/resources/authorizations.d.ts +3 -0
  7. package/lib/cjs/resources/authorizations.js +4 -0
  8. package/lib/cjs/resources/captures.d.ts +3 -0
  9. package/lib/cjs/resources/captures.js +4 -0
  10. package/lib/cjs/resources/customer_addresses.d.ts +2 -0
  11. package/lib/cjs/resources/parcel_line_items.d.ts +1 -1
  12. package/lib/cjs/resources/refunds.d.ts +3 -0
  13. package/lib/cjs/resources/refunds.js +4 -0
  14. package/lib/cjs/resources/reserved_stocks.d.ts +28 -0
  15. package/lib/cjs/resources/reserved_stocks.js +28 -0
  16. package/lib/cjs/resources/return_line_items.d.ts +2 -1
  17. package/lib/cjs/resources/stock_items.d.ts +3 -0
  18. package/lib/cjs/resources/stock_items.js +4 -0
  19. package/lib/cjs/resources/stock_line_items.d.ts +3 -0
  20. package/lib/cjs/resources/stock_line_items.js +4 -0
  21. package/lib/cjs/resources/stock_reservations.d.ts +3 -0
  22. package/lib/cjs/resources/stock_reservations.js +4 -0
  23. package/lib/cjs/resources/transactions.d.ts +5 -2
  24. package/lib/cjs/resources/transactions.js +4 -0
  25. package/lib/cjs/resources/voids.d.ts +3 -0
  26. package/lib/cjs/resources/voids.js +4 -0
  27. package/lib/esm/api.d.ts +3 -2
  28. package/lib/esm/api.js +2 -0
  29. package/lib/esm/commercelayer.d.ts +3 -2
  30. package/lib/esm/commercelayer.js +2 -1
  31. package/lib/esm/model.d.ts +1 -0
  32. package/lib/esm/resources/authorizations.d.ts +3 -0
  33. package/lib/esm/resources/authorizations.js +4 -0
  34. package/lib/esm/resources/captures.d.ts +3 -0
  35. package/lib/esm/resources/captures.js +4 -0
  36. package/lib/esm/resources/customer_addresses.d.ts +2 -0
  37. package/lib/esm/resources/parcel_line_items.d.ts +1 -1
  38. package/lib/esm/resources/refunds.d.ts +3 -0
  39. package/lib/esm/resources/refunds.js +4 -0
  40. package/lib/esm/resources/reserved_stocks.d.ts +28 -0
  41. package/lib/esm/resources/reserved_stocks.js +26 -0
  42. package/lib/esm/resources/return_line_items.d.ts +2 -1
  43. package/lib/esm/resources/stock_items.d.ts +3 -0
  44. package/lib/esm/resources/stock_items.js +4 -0
  45. package/lib/esm/resources/stock_line_items.d.ts +3 -0
  46. package/lib/esm/resources/stock_line_items.js +4 -0
  47. package/lib/esm/resources/stock_reservations.d.ts +3 -0
  48. package/lib/esm/resources/stock_reservations.js +4 -0
  49. package/lib/esm/resources/transactions.d.ts +5 -2
  50. package/lib/esm/resources/transactions.js +4 -0
  51. package/lib/esm/resources/voids.d.ts +3 -0
  52. package/lib/esm/resources/voids.js +4 -0
  53. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  54. package/lib/tsconfig.tsbuildinfo +1 -1
  55. package/package.json +7 -7
@@ -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.9.0";
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.9.0";
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;
@@ -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.9.0';
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"));
@@ -84,6 +84,7 @@ export type { PromotionRule } from './resources/promotion_rules';
84
84
  export type { Promotion } from './resources/promotions';
85
85
  export type { RecurringOrderCopy, RecurringOrderCopyCreate, RecurringOrderCopyUpdate } from './resources/recurring_order_copies';
86
86
  export type { Refund } from './resources/refunds';
87
+ export type { ReservedStock } from './resources/reserved_stocks';
87
88
  export type { ReturnLineItem, ReturnLineItemCreate, ReturnLineItemUpdate } from './resources/return_line_items';
88
89
  export type { Return, ReturnCreate, ReturnUpdate } from './resources/returns';
89
90
  export type { SatispayGateway, SatispayGatewayCreate, SatispayGatewayUpdate } from './resources/satispay_gateways';
@@ -2,6 +2,7 @@ import { ApiResource } from '../resource';
2
2
  import type { Resource, ResourceUpdate, 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 { Capture } from './captures';
6
7
  import type { Void } from './voids';
7
8
  import type { Event } from './events';
@@ -37,6 +38,7 @@ interface Authorization extends Resource {
37
38
  void_balance_float?: number | null;
38
39
  formatted_void_balance?: string | null;
39
40
  order?: Order | null;
41
+ attachments?: Attachment[] | null;
40
42
  captures?: Capture[] | null;
41
43
  voids?: Void[] | null;
42
44
  events?: Event[] | null;
@@ -50,6 +52,7 @@ declare class Authorizations extends ApiResource<Authorization> {
50
52
  static readonly TYPE: AuthorizationType;
51
53
  update(resource: AuthorizationUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Authorization>;
52
54
  order(authorizationId: string | Authorization, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
55
+ attachments(authorizationId: string | Authorization, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
53
56
  captures(authorizationId: string | Authorization, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Capture>>;
54
57
  voids(authorizationId: string | Authorization, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Void>>;
55
58
  events(authorizationId: string | Authorization, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
@@ -7,6 +7,10 @@ class Authorizations extends ApiResource {
7
7
  const _authorizationId = authorizationId.id || authorizationId;
8
8
  return this.resources.fetch({ type: 'orders' }, `authorizations/${_authorizationId}/order`, params, options);
9
9
  }
10
+ async attachments(authorizationId, params, options) {
11
+ const _authorizationId = authorizationId.id || authorizationId;
12
+ return this.resources.fetch({ type: 'attachments' }, `authorizations/${_authorizationId}/attachments`, params, options);
13
+ }
10
14
  async captures(authorizationId, params, options) {
11
15
  const _authorizationId = authorizationId.id || authorizationId;
12
16
  return this.resources.fetch({ type: 'captures' }, `authorizations/${_authorizationId}/captures`, params, options);
@@ -2,6 +2,7 @@ import { ApiResource } from '../resource';
2
2
  import type { Resource, ResourceUpdate, 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 { Refund } from './refunds';
7
8
  import type { Event } from './events';
@@ -29,6 +30,7 @@ interface Capture extends Resource {
29
30
  refund_balance_float?: number | null;
30
31
  formatted_refund_balance?: string | null;
31
32
  order?: Order | null;
33
+ attachments?: Attachment[] | null;
32
34
  reference_authorization?: Authorization | null;
33
35
  refunds?: Refund[] | null;
34
36
  events?: Event[] | null;
@@ -41,6 +43,7 @@ declare class Captures extends ApiResource<Capture> {
41
43
  static readonly TYPE: CaptureType;
42
44
  update(resource: CaptureUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Capture>;
43
45
  order(captureId: string | Capture, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
46
+ attachments(captureId: string | Capture, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
44
47
  reference_authorization(captureId: string | Capture, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Authorization>;
45
48
  refunds(captureId: string | Capture, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Refund>>;
46
49
  events(captureId: string | Capture, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
@@ -7,6 +7,10 @@ class Captures extends ApiResource {
7
7
  const _captureId = captureId.id || captureId;
8
8
  return this.resources.fetch({ type: 'orders' }, `captures/${_captureId}/order`, params, options);
9
9
  }
10
+ async attachments(captureId, params, options) {
11
+ const _captureId = captureId.id || captureId;
12
+ return this.resources.fetch({ type: 'attachments' }, `captures/${_captureId}/attachments`, params, options);
13
+ }
10
14
  async reference_authorization(captureId, params, options) {
11
15
  const _captureId = captureId.id || captureId;
12
16
  return this.resources.fetch({ type: 'authorizations' }, `captures/${_captureId}/reference_authorization`, params, options);
@@ -17,11 +17,13 @@ type AddressRel = ResourceRel & {
17
17
  interface CustomerAddress extends Resource {
18
18
  readonly type: CustomerAddressType;
19
19
  name?: string | null;
20
+ customer_email: string;
20
21
  customer?: Customer | null;
21
22
  address?: Address | null;
22
23
  events?: Event[] | null;
23
24
  }
24
25
  interface CustomerAddressCreate extends ResourceCreate {
26
+ customer_email: string;
25
27
  customer: CustomerRel;
26
28
  address: AddressRel;
27
29
  }
@@ -16,6 +16,7 @@ type StockLineItemRel = ResourceRel & {
16
16
  interface ParcelLineItem extends Resource {
17
17
  readonly type: ParcelLineItemType;
18
18
  sku_code?: string | null;
19
+ bundle_code?: string | null;
19
20
  quantity: number;
20
21
  name: string;
21
22
  image_url?: string | null;
@@ -27,7 +28,6 @@ interface ParcelLineItem extends Resource {
27
28
  shipment_line_item?: object;
28
29
  }
29
30
  interface ParcelLineItemCreate extends ResourceCreate {
30
- sku_code?: string | null;
31
31
  quantity: number;
32
32
  parcel: ParcelRel;
33
33
  stock_line_item: StockLineItemRel;
@@ -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 { Capture } from './captures';
6
7
  import type { Event } from './events';
7
8
  type RefundType = 'refunds';
@@ -22,12 +23,14 @@ interface Refund 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_capture?: Capture | null;
26
28
  events?: Event[] | null;
27
29
  }
28
30
  declare class Refunds extends ApiResource<Refund> {
29
31
  static readonly TYPE: RefundType;
30
32
  order(refundId: string | Refund, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
33
+ attachments(refundId: string | Refund, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
31
34
  reference_capture(refundId: string | Refund, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Capture>;
32
35
  events(refundId: string | Refund, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
33
36
  isRefund(resource: any): resource is Refund;
@@ -4,6 +4,10 @@ class Refunds extends ApiResource {
4
4
  const _refundId = refundId.id || refundId;
5
5
  return this.resources.fetch({ type: 'orders' }, `refunds/${_refundId}/order`, params, options);
6
6
  }
7
+ async attachments(refundId, params, options) {
8
+ const _refundId = refundId.id || refundId;
9
+ return this.resources.fetch({ type: 'attachments' }, `refunds/${_refundId}/attachments`, params, options);
10
+ }
7
11
  async reference_capture(refundId, params, options) {
8
12
  const _refundId = refundId.id || refundId;
9
13
  return this.resources.fetch({ type: 'captures' }, `refunds/${_refundId}/reference_capture`, params, options);
@@ -0,0 +1,28 @@
1
+ import { ApiResource } from '../resource';
2
+ import type { Resource, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
3
+ import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
+ import type { StockItem } from './stock_items';
5
+ import type { Sku } from './skus';
6
+ import type { StockReservation } from './stock_reservations';
7
+ type ReservedStockType = 'reserved_stocks';
8
+ type ReservedStockRel = ResourceRel & {
9
+ type: ReservedStockType;
10
+ };
11
+ interface ReservedStock extends Resource {
12
+ readonly type: ReservedStockType;
13
+ quantity: number;
14
+ stock_item?: StockItem | null;
15
+ sku?: Sku | null;
16
+ stock_reservations?: StockReservation[] | null;
17
+ }
18
+ declare class ReservedStocks extends ApiResource<ReservedStock> {
19
+ static readonly TYPE: ReservedStockType;
20
+ stock_item(reservedStockId: string | ReservedStock, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockItem>;
21
+ sku(reservedStockId: string | ReservedStock, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
22
+ stock_reservations(reservedStockId: string | ReservedStock, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockReservation>>;
23
+ isReservedStock(resource: any): resource is ReservedStock;
24
+ relationship(id: string | ResourceId | null): ReservedStockRel;
25
+ type(): ReservedStockType;
26
+ }
27
+ export default ReservedStocks;
28
+ export type { ReservedStock, ReservedStockType };
@@ -0,0 +1,26 @@
1
+ import { ApiResource } from '../resource';
2
+ class ReservedStocks extends ApiResource {
3
+ async stock_item(reservedStockId, params, options) {
4
+ const _reservedStockId = reservedStockId.id || reservedStockId;
5
+ return this.resources.fetch({ type: 'stock_items' }, `reserved_stocks/${_reservedStockId}/stock_item`, params, options);
6
+ }
7
+ async sku(reservedStockId, params, options) {
8
+ const _reservedStockId = reservedStockId.id || reservedStockId;
9
+ return this.resources.fetch({ type: 'skus' }, `reserved_stocks/${_reservedStockId}/sku`, params, options);
10
+ }
11
+ async stock_reservations(reservedStockId, params, options) {
12
+ const _reservedStockId = reservedStockId.id || reservedStockId;
13
+ return this.resources.fetch({ type: 'stock_reservations' }, `reserved_stocks/${_reservedStockId}/stock_reservations`, params, options);
14
+ }
15
+ isReservedStock(resource) {
16
+ return resource.type && (resource.type === ReservedStocks.TYPE);
17
+ }
18
+ relationship(id) {
19
+ return ((id === null) || (typeof id === 'string')) ? { id, type: ReservedStocks.TYPE } : { id: id.id, type: ReservedStocks.TYPE };
20
+ }
21
+ type() {
22
+ return ReservedStocks.TYPE;
23
+ }
24
+ }
25
+ ReservedStocks.TYPE = 'reserved_stocks';
26
+ export 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;
@@ -3,6 +3,7 @@ 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';
6
7
  import type { StockReservation } from './stock_reservations';
7
8
  import type { Attachment } from './attachments';
8
9
  type StockItemType = 'stock_items';
@@ -21,6 +22,7 @@ interface StockItem extends Resource {
21
22
  quantity: number;
22
23
  stock_location?: StockLocation | null;
23
24
  sku?: Sku | null;
25
+ reserved_stock?: ReservedStock | null;
24
26
  stock_reservations?: StockReservation[] | null;
25
27
  attachments?: Attachment[] | null;
26
28
  }
@@ -43,6 +45,7 @@ declare class StockItems extends ApiResource<StockItem> {
43
45
  delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
44
46
  stock_location(stockItemId: string | StockItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
45
47
  sku(stockItemId: string | StockItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
48
+ reserved_stock(stockItemId: string | StockItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReservedStock>;
46
49
  stock_reservations(stockItemId: string | StockItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockReservation>>;
47
50
  attachments(stockItemId: string | StockItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
48
51
  isStockItem(resource: any): resource is StockItem;
@@ -17,6 +17,10 @@ class StockItems extends ApiResource {
17
17
  const _stockItemId = stockItemId.id || stockItemId;
18
18
  return this.resources.fetch({ type: 'skus' }, `stock_items/${_stockItemId}/sku`, params, options);
19
19
  }
20
+ async reserved_stock(stockItemId, params, options) {
21
+ const _stockItemId = stockItemId.id || stockItemId;
22
+ return this.resources.fetch({ type: 'reserved_stocks' }, `stock_items/${_stockItemId}/reserved_stock`, params, options);
23
+ }
20
24
  async stock_reservations(stockItemId, params, options) {
21
25
  const _stockItemId = stockItemId.id || stockItemId;
22
26
  return this.resources.fetch({ type: 'stock_reservations' }, `stock_items/${_stockItemId}/stock_reservations`, 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;
@@ -12,6 +12,10 @@ class StockLineItems extends ApiResource {
12
12
  const _stockLineItemId = stockLineItemId.id || stockLineItemId;
13
13
  return this.resources.fetch({ type: 'stock_items' }, `stock_line_items/${_stockLineItemId}/stock_item`, params, options);
14
14
  }
15
+ async sku(stockLineItemId, params, options) {
16
+ const _stockLineItemId = stockLineItemId.id || stockLineItemId;
17
+ return this.resources.fetch({ type: 'skus' }, `stock_line_items/${_stockLineItemId}/sku`, params, options);
18
+ }
15
19
  isStockLineItem(resource) {
16
20
  return resource.type && (resource.type === StockLineItems.TYPE);
17
21
  }
@@ -4,6 +4,7 @@ import type { QueryParamsRetrieve } from '../query';
4
4
  import type { LineItem } from './line_items';
5
5
  import type { Order } from './orders';
6
6
  import type { StockItem } from './stock_items';
7
+ import type { ReservedStock } from './reserved_stocks';
7
8
  import type { Sku } from './skus';
8
9
  type StockReservationType = 'stock_reservations';
9
10
  type StockReservationRel = ResourceRel & {
@@ -17,6 +18,7 @@ interface StockReservation extends Resource {
17
18
  line_item?: LineItem | null;
18
19
  order?: Order | null;
19
20
  stock_item?: StockItem | null;
21
+ reserved_stock?: ReservedStock | null;
20
22
  sku?: Sku | null;
21
23
  }
22
24
  declare class StockReservations extends ApiResource<StockReservation> {
@@ -24,6 +26,7 @@ declare class StockReservations extends ApiResource<StockReservation> {
24
26
  line_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
25
27
  order(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
26
28
  stock_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockItem>;
29
+ reserved_stock(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReservedStock>;
27
30
  sku(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
28
31
  isStockReservation(resource: any): resource is StockReservation;
29
32
  relationship(id: string | ResourceId | null): StockReservationRel;
@@ -12,6 +12,10 @@ class StockReservations extends ApiResource {
12
12
  const _stockReservationId = stockReservationId.id || stockReservationId;
13
13
  return this.resources.fetch({ type: 'stock_items' }, `stock_reservations/${_stockReservationId}/stock_item`, params, options);
14
14
  }
15
+ async reserved_stock(stockReservationId, params, options) {
16
+ const _stockReservationId = stockReservationId.id || stockReservationId;
17
+ return this.resources.fetch({ type: 'reserved_stocks' }, `stock_reservations/${_stockReservationId}/reserved_stock`, params, options);
18
+ }
15
19
  async sku(stockReservationId, params, options) {
16
20
  const _stockReservationId = stockReservationId.id || stockReservationId;
17
21
  return this.resources.fetch({ type: 'skus' }, `stock_reservations/${_stockReservationId}/sku`, params, options);
@@ -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;
@@ -4,6 +4,10 @@ class Transactions extends ApiResource {
4
4
  const _transactionId = transactionId.id || transactionId;
5
5
  return this.resources.fetch({ type: 'orders' }, `transactions/${_transactionId}/order`, params, options);
6
6
  }
7
+ async attachments(transactionId, params, options) {
8
+ const _transactionId = transactionId.id || transactionId;
9
+ return this.resources.fetch({ type: 'attachments' }, `transactions/${_transactionId}/attachments`, params, options);
10
+ }
7
11
  isTransaction(resource) {
8
12
  return resource.type && (resource.type === Transactions.TYPE);
9
13
  }
@@ -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;
@@ -4,6 +4,10 @@ class Voids extends ApiResource {
4
4
  const _voidId = voidId.id || voidId;
5
5
  return this.resources.fetch({ type: 'orders' }, `voids/${_voidId}/order`, params, options);
6
6
  }
7
+ async attachments(voidId, params, options) {
8
+ const _voidId = voidId.id || voidId;
9
+ return this.resources.fetch({ type: 'attachments' }, `voids/${_voidId}/attachments`, params, options);
10
+ }
7
11
  async reference_authorization(voidId, params, options) {
8
12
  const _voidId = voidId.id || voidId;
9
13
  return this.resources.fetch({ type: 'authorizations' }, `voids/${_voidId}/reference_authorization`, params, options);