@commercelayer/sdk 6.19.1 → 6.20.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.
package/lib/index.d.mts CHANGED
@@ -2507,7 +2507,7 @@ interface LineItemOption extends Resource {
2507
2507
  */
2508
2508
  currency_code?: string | null;
2509
2509
  /**
2510
- * The unit amount of the line item option, in cents. When you add a line item option to an order, this is automatically populated from associated SKU option's price.
2510
+ * The unit amount of the line item option, in cents. When you add a line item option to an order, this is automatically populated from associated SKU option's price. Cannot be passed by sales channels.
2511
2511
  * @example ```"990"```
2512
2512
  */
2513
2513
  unit_amount_cents?: number | null;
@@ -2567,6 +2567,11 @@ interface LineItemOptionCreate extends ResourceCreate {
2567
2567
  * @example ```"2"```
2568
2568
  */
2569
2569
  quantity: number;
2570
+ /**
2571
+ * The unit amount of the line item option, in cents. When you add a line item option to an order, this is automatically populated from associated SKU option's price. Cannot be passed by sales channels.
2572
+ * @example ```"990"```
2573
+ */
2574
+ unit_amount_cents?: number | null;
2570
2575
  /**
2571
2576
  * Set of key-value pairs that represent the selected options.
2572
2577
  * @example ```"[object Object]"```
@@ -2587,6 +2592,11 @@ interface LineItemOptionUpdate extends ResourceUpdate {
2587
2592
  * @example ```"2"```
2588
2593
  */
2589
2594
  quantity?: number | null;
2595
+ /**
2596
+ * The unit amount of the line item option, in cents. When you add a line item option to an order, this is automatically populated from associated SKU option's price. Cannot be passed by sales channels.
2597
+ * @example ```"990"```
2598
+ */
2599
+ unit_amount_cents?: number | null;
2590
2600
  /**
2591
2601
  * Set of key-value pairs that represent the selected options.
2592
2602
  * @example ```"[object Object]"```
@@ -3441,103 +3451,6 @@ declare class ReturnLineItems extends ApiResource<ReturnLineItem> {
3441
3451
  type(): ReturnLineItemType;
3442
3452
  }
3443
3453
 
3444
- type ReservedStockType = 'reserved_stocks';
3445
- type ReservedStockRel = ResourceRel & {
3446
- type: ReservedStockType;
3447
- };
3448
- type ReservedStockSort = Pick<ReservedStock, 'id' | 'quantity'> & ResourceSort;
3449
- interface ReservedStock extends Resource {
3450
- readonly type: ReservedStockType;
3451
- /**
3452
- * The stock item reserved quantity.
3453
- * @example ```"100"```
3454
- */
3455
- quantity: number;
3456
- stock_item?: StockItem | null;
3457
- sku?: Sku | null;
3458
- stock_reservations?: StockReservation[] | null;
3459
- versions?: Version[] | null;
3460
- }
3461
- declare class ReservedStocks extends ApiResource<ReservedStock> {
3462
- static readonly TYPE: ReservedStockType;
3463
- stock_item(reservedStockId: string | ReservedStock, params?: QueryParamsRetrieve<StockItem>, options?: ResourcesConfig): Promise<StockItem>;
3464
- sku(reservedStockId: string | ReservedStock, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku>;
3465
- stock_reservations(reservedStockId: string | ReservedStock, params?: QueryParamsList<StockReservation>, options?: ResourcesConfig): Promise<ListResponse<StockReservation>>;
3466
- versions(reservedStockId: string | ReservedStock, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>>;
3467
- isReservedStock(resource: any): resource is ReservedStock;
3468
- relationship(id: string | ResourceId | null): ReservedStockRel;
3469
- relationshipToMany(...ids: string[]): ReservedStockRel[];
3470
- type(): ReservedStockType;
3471
- }
3472
-
3473
- type StockReservationType = 'stock_reservations';
3474
- type StockReservationRel = ResourceRel & {
3475
- type: StockReservationType;
3476
- };
3477
- type StockItemRel$3 = ResourceRel & {
3478
- type: StockItemType;
3479
- };
3480
- type StockReservationSort = Pick<StockReservation, 'id' | 'status' | 'quantity' | 'expires_at'> & ResourceSort;
3481
- interface StockReservation extends Resource {
3482
- readonly type: StockReservationType;
3483
- /**
3484
- * The stock reservation status. One of 'draft' (default), or 'pending'.
3485
- * @example ```"draft"```
3486
- */
3487
- status: 'draft' | 'pending';
3488
- /**
3489
- * The stock reservation quantity.
3490
- * @example ```"4"```
3491
- */
3492
- quantity: number;
3493
- /**
3494
- * The expiration date/time of this stock reservation.
3495
- * @example ```"2018-01-02T12:00:00.000Z"```
3496
- */
3497
- expires_at: string;
3498
- line_item?: LineItem | null;
3499
- order?: Order | null;
3500
- stock_item?: StockItem | null;
3501
- reserved_stock?: ReservedStock | null;
3502
- sku?: Sku | null;
3503
- }
3504
- interface StockReservationCreate extends ResourceCreate {
3505
- /**
3506
- * The stock reservation quantity.
3507
- * @example ```"4"```
3508
- */
3509
- quantity: number;
3510
- stock_item: StockItemRel$3;
3511
- }
3512
- interface StockReservationUpdate extends ResourceUpdate {
3513
- /**
3514
- * The stock reservation quantity.
3515
- * @example ```"4"```
3516
- */
3517
- quantity?: number | null;
3518
- /**
3519
- * Send this attribute if you want to mark this stock reservation as pending.
3520
- * @example ```"true"```
3521
- */
3522
- _pending?: boolean | null;
3523
- }
3524
- declare class StockReservations extends ApiResource<StockReservation> {
3525
- static readonly TYPE: StockReservationType;
3526
- create(resource: StockReservationCreate, params?: QueryParamsRetrieve<StockReservation>, options?: ResourcesConfig): Promise<StockReservation>;
3527
- update(resource: StockReservationUpdate, params?: QueryParamsRetrieve<StockReservation>, options?: ResourcesConfig): Promise<StockReservation>;
3528
- delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
3529
- line_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem>;
3530
- order(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order>;
3531
- stock_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<StockItem>, options?: ResourcesConfig): Promise<StockItem>;
3532
- reserved_stock(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<ReservedStock>, options?: ResourcesConfig): Promise<ReservedStock>;
3533
- sku(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku>;
3534
- _pending(id: string | StockReservation, params?: QueryParamsRetrieve<StockReservation>, options?: ResourcesConfig): Promise<StockReservation>;
3535
- isStockReservation(resource: any): resource is StockReservation;
3536
- relationship(id: string | ResourceId | null): StockReservationRel;
3537
- relationshipToMany(...ids: string[]): StockReservationRel[];
3538
- type(): StockReservationType;
3539
- }
3540
-
3541
3454
  type StockLineItemType = 'stock_line_items';
3542
3455
  type StockLineItemRel$1 = ResourceRel & {
3543
3456
  type: StockLineItemType;
@@ -3548,7 +3461,7 @@ type ShipmentRel$5 = ResourceRel & {
3548
3461
  type LineItemRel$2 = ResourceRel & {
3549
3462
  type: LineItemType;
3550
3463
  };
3551
- type StockItemRel$2 = ResourceRel & {
3464
+ type StockItemRel$3 = ResourceRel & {
3552
3465
  type: StockItemType;
3553
3466
  };
3554
3467
  type SkuRel$b = ResourceRel & {
@@ -3576,6 +3489,7 @@ interface StockLineItem extends Resource {
3576
3489
  line_item?: LineItem | null;
3577
3490
  stock_item?: StockItem | null;
3578
3491
  sku?: Sku | null;
3492
+ stock_reservation?: StockReservation | null;
3579
3493
  versions?: Version[] | null;
3580
3494
  }
3581
3495
  interface StockLineItemCreate extends ResourceCreate {
@@ -3591,7 +3505,7 @@ interface StockLineItemCreate extends ResourceCreate {
3591
3505
  quantity: number;
3592
3506
  shipment?: ShipmentRel$5 | null;
3593
3507
  line_item?: LineItemRel$2 | null;
3594
- stock_item?: StockItemRel$2 | null;
3508
+ stock_item?: StockItemRel$3 | null;
3595
3509
  sku?: SkuRel$b | null;
3596
3510
  }
3597
3511
  interface StockLineItemUpdate extends ResourceUpdate {
@@ -3622,7 +3536,7 @@ interface StockLineItemUpdate extends ResourceUpdate {
3622
3536
  _decrement_stock?: boolean | null;
3623
3537
  shipment?: ShipmentRel$5 | null;
3624
3538
  line_item?: LineItemRel$2 | null;
3625
- stock_item?: StockItemRel$2 | null;
3539
+ stock_item?: StockItemRel$3 | null;
3626
3540
  sku?: SkuRel$b | null;
3627
3541
  }
3628
3542
  declare class StockLineItems extends ApiResource<StockLineItem> {
@@ -3634,6 +3548,7 @@ declare class StockLineItems extends ApiResource<StockLineItem> {
3634
3548
  line_item(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem>;
3635
3549
  stock_item(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve<StockItem>, options?: ResourcesConfig): Promise<StockItem>;
3636
3550
  sku(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku>;
3551
+ stock_reservation(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve<StockReservation>, options?: ResourcesConfig): Promise<StockReservation>;
3637
3552
  versions(stockLineItemId: string | StockLineItem, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>>;
3638
3553
  _reserve_stock(id: string | StockLineItem, params?: QueryParamsRetrieve<StockLineItem>, options?: ResourcesConfig): Promise<StockLineItem>;
3639
3554
  _release_stock(id: string | StockLineItem, params?: QueryParamsRetrieve<StockLineItem>, options?: ResourcesConfig): Promise<StockLineItem>;
@@ -3644,6 +3559,107 @@ declare class StockLineItems extends ApiResource<StockLineItem> {
3644
3559
  type(): StockLineItemType;
3645
3560
  }
3646
3561
 
3562
+ type ReservedStockType = 'reserved_stocks';
3563
+ type ReservedStockRel = ResourceRel & {
3564
+ type: ReservedStockType;
3565
+ };
3566
+ type ReservedStockSort = Pick<ReservedStock, 'id' | 'quantity'> & ResourceSort;
3567
+ interface ReservedStock extends Resource {
3568
+ readonly type: ReservedStockType;
3569
+ /**
3570
+ * The stock item reserved quantity.
3571
+ * @example ```"100"```
3572
+ */
3573
+ quantity: number;
3574
+ stock_item?: StockItem | null;
3575
+ sku?: Sku | null;
3576
+ stock_reservations?: StockReservation[] | null;
3577
+ versions?: Version[] | null;
3578
+ }
3579
+ declare class ReservedStocks extends ApiResource<ReservedStock> {
3580
+ static readonly TYPE: ReservedStockType;
3581
+ stock_item(reservedStockId: string | ReservedStock, params?: QueryParamsRetrieve<StockItem>, options?: ResourcesConfig): Promise<StockItem>;
3582
+ sku(reservedStockId: string | ReservedStock, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku>;
3583
+ stock_reservations(reservedStockId: string | ReservedStock, params?: QueryParamsList<StockReservation>, options?: ResourcesConfig): Promise<ListResponse<StockReservation>>;
3584
+ versions(reservedStockId: string | ReservedStock, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>>;
3585
+ isReservedStock(resource: any): resource is ReservedStock;
3586
+ relationship(id: string | ResourceId | null): ReservedStockRel;
3587
+ relationshipToMany(...ids: string[]): ReservedStockRel[];
3588
+ type(): ReservedStockType;
3589
+ }
3590
+
3591
+ type StockReservationType = 'stock_reservations';
3592
+ type StockReservationRel = ResourceRel & {
3593
+ type: StockReservationType;
3594
+ };
3595
+ type StockItemRel$2 = ResourceRel & {
3596
+ type: StockItemType;
3597
+ };
3598
+ type StockReservationSort = Pick<StockReservation, 'id' | 'status' | 'quantity' | 'expires_at'> & ResourceSort;
3599
+ interface StockReservation extends Resource {
3600
+ readonly type: StockReservationType;
3601
+ /**
3602
+ * The stock reservation status. One of 'draft' (default), or 'pending'.
3603
+ * @example ```"draft"```
3604
+ */
3605
+ status: 'draft' | 'pending';
3606
+ /**
3607
+ * The stock reservation quantity.
3608
+ * @example ```"4"```
3609
+ */
3610
+ quantity: number;
3611
+ /**
3612
+ * The expiration date/time of this stock reservation.
3613
+ * @example ```"2018-01-02T12:00:00.000Z"```
3614
+ */
3615
+ expires_at: string;
3616
+ line_item?: LineItem | null;
3617
+ order?: Order | null;
3618
+ stock_line_item?: StockLineItem | null;
3619
+ stock_transfer?: StockTransfer | null;
3620
+ stock_item?: StockItem | null;
3621
+ reserved_stock?: ReservedStock | null;
3622
+ sku?: Sku | null;
3623
+ }
3624
+ interface StockReservationCreate extends ResourceCreate {
3625
+ /**
3626
+ * The stock reservation quantity.
3627
+ * @example ```"4"```
3628
+ */
3629
+ quantity: number;
3630
+ stock_item: StockItemRel$2;
3631
+ }
3632
+ interface StockReservationUpdate extends ResourceUpdate {
3633
+ /**
3634
+ * The stock reservation quantity.
3635
+ * @example ```"4"```
3636
+ */
3637
+ quantity?: number | null;
3638
+ /**
3639
+ * Send this attribute if you want to mark this stock reservation as pending.
3640
+ * @example ```"true"```
3641
+ */
3642
+ _pending?: boolean | null;
3643
+ }
3644
+ declare class StockReservations extends ApiResource<StockReservation> {
3645
+ static readonly TYPE: StockReservationType;
3646
+ create(resource: StockReservationCreate, params?: QueryParamsRetrieve<StockReservation>, options?: ResourcesConfig): Promise<StockReservation>;
3647
+ update(resource: StockReservationUpdate, params?: QueryParamsRetrieve<StockReservation>, options?: ResourcesConfig): Promise<StockReservation>;
3648
+ delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
3649
+ line_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem>;
3650
+ order(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order>;
3651
+ stock_line_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<StockLineItem>, options?: ResourcesConfig): Promise<StockLineItem>;
3652
+ stock_transfer(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer>;
3653
+ stock_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<StockItem>, options?: ResourcesConfig): Promise<StockItem>;
3654
+ reserved_stock(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<ReservedStock>, options?: ResourcesConfig): Promise<ReservedStock>;
3655
+ sku(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku>;
3656
+ _pending(id: string | StockReservation, params?: QueryParamsRetrieve<StockReservation>, options?: ResourcesConfig): Promise<StockReservation>;
3657
+ isStockReservation(resource: any): resource is StockReservation;
3658
+ relationship(id: string | ResourceId | null): StockReservationRel;
3659
+ relationshipToMany(...ids: string[]): StockReservationRel[];
3660
+ type(): StockReservationType;
3661
+ }
3662
+
3647
3663
  type SkuListItemType = 'sku_list_items';
3648
3664
  type SkuListItemRel = ResourceRel & {
3649
3665
  type: SkuListItemType;
@@ -3792,6 +3808,11 @@ interface Link extends Resource {
3792
3808
  * @example ```"orders"```
3793
3809
  */
3794
3810
  item_type?: 'orders' | 'skus' | 'sku_lists' | null;
3811
+ /**
3812
+ * The link params to be passed in URL the query string.
3813
+ * @example ```"[object Object]"```
3814
+ */
3815
+ params?: Record<string, any> | null;
3795
3816
  /**
3796
3817
  * Time at which this resource was disabled.
3797
3818
  * @example ```"2018-01-01T12:00:00.000Z"```
@@ -3836,6 +3857,11 @@ interface LinkCreate extends ResourceCreate {
3836
3857
  * @example ```"orders"```
3837
3858
  */
3838
3859
  item_type?: 'orders' | 'skus' | 'sku_lists' | null;
3860
+ /**
3861
+ * The link params to be passed in URL the query string.
3862
+ * @example ```"[object Object]"```
3863
+ */
3864
+ params?: Record<string, any> | null;
3839
3865
  /**
3840
3866
  * Send this attribute if you want to mark this resource as disabled.
3841
3867
  * @example ```"true"```
@@ -3879,6 +3905,11 @@ interface LinkUpdate extends ResourceUpdate {
3879
3905
  * @example ```"commercelayer.link"```
3880
3906
  */
3881
3907
  domain?: string | null;
3908
+ /**
3909
+ * The link params to be passed in URL the query string.
3910
+ * @example ```"[object Object]"```
3911
+ */
3912
+ params?: Record<string, any> | null;
3882
3913
  /**
3883
3914
  * Send this attribute if you want to mark this resource as disabled.
3884
3915
  * @example ```"true"```
@@ -11055,6 +11086,7 @@ interface StockTransfer extends Resource {
11055
11086
  destination_stock_location?: StockLocation | null;
11056
11087
  shipment?: Shipment | null;
11057
11088
  line_item?: LineItem | null;
11089
+ stock_reservation?: StockReservation | null;
11058
11090
  attachments?: Attachment[] | null;
11059
11091
  events?: Event[] | null;
11060
11092
  versions?: Version[] | null;
@@ -11138,6 +11170,7 @@ declare class StockTransfers extends ApiResource<StockTransfer> {
11138
11170
  destination_stock_location(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve<StockLocation>, options?: ResourcesConfig): Promise<StockLocation>;
11139
11171
  shipment(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve<Shipment>, options?: ResourcesConfig): Promise<Shipment>;
11140
11172
  line_item(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem>;
11173
+ stock_reservation(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve<StockReservation>, options?: ResourcesConfig): Promise<StockReservation>;
11141
11174
  attachments(stockTransferId: string | StockTransfer, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
11142
11175
  events(stockTransferId: string | StockTransfer, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>>;
11143
11176
  versions(stockTransferId: string | StockTransfer, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>>;
@@ -11410,6 +11443,8 @@ interface Sku extends Resource {
11410
11443
  stock_reservations?: StockReservation[] | null;
11411
11444
  delivery_lead_times?: DeliveryLeadTime[] | null;
11412
11445
  sku_options?: SkuOption[] | null;
11446
+ sku_list_items?: SkuListItem[] | null;
11447
+ sku_lists?: SkuList[] | null;
11413
11448
  attachments?: Attachment[] | null;
11414
11449
  links?: Link[] | null;
11415
11450
  events?: Event[] | null;
@@ -11534,6 +11569,8 @@ declare class Skus extends ApiResource<Sku> {
11534
11569
  stock_reservations(skuId: string | Sku, params?: QueryParamsList<StockReservation>, options?: ResourcesConfig): Promise<ListResponse<StockReservation>>;
11535
11570
  delivery_lead_times(skuId: string | Sku, params?: QueryParamsList<DeliveryLeadTime>, options?: ResourcesConfig): Promise<ListResponse<DeliveryLeadTime>>;
11536
11571
  sku_options(skuId: string | Sku, params?: QueryParamsList<SkuOption>, options?: ResourcesConfig): Promise<ListResponse<SkuOption>>;
11572
+ sku_list_items(skuId: string | Sku, params?: QueryParamsList<SkuListItem>, options?: ResourcesConfig): Promise<ListResponse<SkuListItem>>;
11573
+ sku_lists(skuId: string | Sku, params?: QueryParamsList<SkuList>, options?: ResourcesConfig): Promise<ListResponse<SkuList>>;
11537
11574
  attachments(skuId: string | Sku, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
11538
11575
  links(skuId: string | Sku, params?: QueryParamsList<Link>, options?: ResourcesConfig): Promise<ListResponse<Link>>;
11539
11576
  events(skuId: string | Sku, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>>;
@@ -15818,7 +15855,7 @@ type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
15818
15855
  type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
15819
15856
  declare class CommerceLayerClient {
15820
15857
  #private;
15821
- readonly openApiSchemaVersion = "7.1.2";
15858
+ readonly openApiSchemaVersion = "7.2.0";
15822
15859
  constructor(config: CommerceLayerInitConfig);
15823
15860
  get addresses(): Addresses;
15824
15861
  get adjustments(): Adjustments;