@commercelayer/sdk 6.1.0 → 6.3.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/README.md CHANGED
@@ -265,10 +265,10 @@ Many resources have relationships with other resources and instead of including
265
265
 
266
266
  ```javascript
267
267
  // Fetch 1-to-1 related resource: billing address of an order
268
- const billingAddress = cl.orders.billing_address('xYZkjABcde')
268
+ const billingAddress = await cl.orders.billing_address('xYZkjABcde')
269
269
 
270
270
  // Fetch 1-to-N related resources: orders associated to a customer
271
- const orders = cl.customers.orders('XyzKjAbCDe', { fields: ['status', 'number'] })
271
+ const orders = await cl.customers.orders('XyzKjAbCDe', { fields: ['status', 'number'] })
272
272
  ```
273
273
 
274
274
  In general:
@@ -291,7 +291,7 @@ resources.
291
291
 
292
292
  ```javascript
293
293
  // Get the total number of placed orders
294
- const placedOrders = cl.orders.count({ filters: { status_eq: 'placed' } })
294
+ const placedOrders = await cl.orders.count({ filters: { status_eq: 'placed' } })
295
295
 
296
296
  ```
297
297
 
package/lib/index.d.mts CHANGED
@@ -1853,6 +1853,11 @@ interface StripePayment extends Resource {
1853
1853
  * @example ```"pi_1234XXX_secret_5678YYY"```
1854
1854
  */
1855
1855
  client_secret?: string | null;
1856
+ /**
1857
+ * The Stripe charge ID. Identifies money movement upon the payment intent confirmation..
1858
+ * @example ```"ch_1234XXX"```
1859
+ */
1860
+ charge_id?: string | null;
1856
1861
  /**
1857
1862
  * The Stripe publishable API key..
1858
1863
  * @example ```"pk_live_xxxx-yyyy-zzzz"```
@@ -6692,6 +6697,11 @@ interface OrderSubscriptionUpdate extends ResourceUpdate {
6692
6697
  * @example ```"true"```
6693
6698
  */
6694
6699
  _cancel?: boolean | null;
6700
+ /**
6701
+ * Send this attribute if you want to convert a manual subscription to an automatic one. A subscription model is required before conversion..
6702
+ * @example ```"true"```
6703
+ */
6704
+ _convert?: boolean | null;
6695
6705
  customer_payment_source?: CustomerPaymentSourceRel | null;
6696
6706
  }
6697
6707
  declare class OrderSubscriptions extends ApiResource<OrderSubscription> {
@@ -6713,6 +6723,7 @@ declare class OrderSubscriptions extends ApiResource<OrderSubscription> {
6713
6723
  _activate(id: string | OrderSubscription, params?: QueryParamsRetrieve<OrderSubscription>, options?: ResourcesConfig): Promise<OrderSubscription>;
6714
6724
  _deactivate(id: string | OrderSubscription, params?: QueryParamsRetrieve<OrderSubscription>, options?: ResourcesConfig): Promise<OrderSubscription>;
6715
6725
  _cancel(id: string | OrderSubscription, params?: QueryParamsRetrieve<OrderSubscription>, options?: ResourcesConfig): Promise<OrderSubscription>;
6726
+ _convert(id: string | OrderSubscription, params?: QueryParamsRetrieve<OrderSubscription>, options?: ResourcesConfig): Promise<OrderSubscription>;
6716
6727
  isOrderSubscription(resource: any): resource is OrderSubscription;
6717
6728
  relationship(id: string | ResourceId | null): OrderSubscriptionRel;
6718
6729
  relationshipToMany(...ids: string[]): OrderSubscriptionRel[];
@@ -10234,6 +10245,11 @@ interface StockTransfer extends Resource {
10234
10245
  versions?: Version[] | null;
10235
10246
  }
10236
10247
  interface StockTransferCreate extends ResourceCreate {
10248
+ /**
10249
+ * Unique identifier for the stock transfer (numeric)..
10250
+ * @example ```"1234"```
10251
+ */
10252
+ number?: string | null;
10237
10253
  /**
10238
10254
  * The code of the associated SKU..
10239
10255
  * @example ```"TSHIRTMM000000FFFFFFXLXX"```
@@ -10251,6 +10267,11 @@ interface StockTransferCreate extends ResourceCreate {
10251
10267
  line_item?: LineItemRel | null;
10252
10268
  }
10253
10269
  interface StockTransferUpdate extends ResourceUpdate {
10270
+ /**
10271
+ * Unique identifier for the stock transfer (numeric)..
10272
+ * @example ```"1234"```
10273
+ */
10274
+ number?: string | null;
10254
10275
  /**
10255
10276
  * The code of the associated SKU..
10256
10277
  * @example ```"TSHIRTMM000000FFFFFFXLXX"```
@@ -14989,7 +15010,7 @@ type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
14989
15010
  type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
14990
15011
  declare class CommerceLayerClient {
14991
15012
  #private;
14992
- readonly openApiSchemaVersion = "5.3.0";
15013
+ readonly openApiSchemaVersion = "5.3.2";
14993
15014
  constructor(config: CommerceLayerInitConfig);
14994
15015
  get addresses(): Addresses;
14995
15016
  get adjustments(): Adjustments;
package/lib/index.d.ts CHANGED
@@ -1853,6 +1853,11 @@ interface StripePayment extends Resource {
1853
1853
  * @example ```"pi_1234XXX_secret_5678YYY"```
1854
1854
  */
1855
1855
  client_secret?: string | null;
1856
+ /**
1857
+ * The Stripe charge ID. Identifies money movement upon the payment intent confirmation..
1858
+ * @example ```"ch_1234XXX"```
1859
+ */
1860
+ charge_id?: string | null;
1856
1861
  /**
1857
1862
  * The Stripe publishable API key..
1858
1863
  * @example ```"pk_live_xxxx-yyyy-zzzz"```
@@ -6692,6 +6697,11 @@ interface OrderSubscriptionUpdate extends ResourceUpdate {
6692
6697
  * @example ```"true"```
6693
6698
  */
6694
6699
  _cancel?: boolean | null;
6700
+ /**
6701
+ * Send this attribute if you want to convert a manual subscription to an automatic one. A subscription model is required before conversion..
6702
+ * @example ```"true"```
6703
+ */
6704
+ _convert?: boolean | null;
6695
6705
  customer_payment_source?: CustomerPaymentSourceRel | null;
6696
6706
  }
6697
6707
  declare class OrderSubscriptions extends ApiResource<OrderSubscription> {
@@ -6713,6 +6723,7 @@ declare class OrderSubscriptions extends ApiResource<OrderSubscription> {
6713
6723
  _activate(id: string | OrderSubscription, params?: QueryParamsRetrieve<OrderSubscription>, options?: ResourcesConfig): Promise<OrderSubscription>;
6714
6724
  _deactivate(id: string | OrderSubscription, params?: QueryParamsRetrieve<OrderSubscription>, options?: ResourcesConfig): Promise<OrderSubscription>;
6715
6725
  _cancel(id: string | OrderSubscription, params?: QueryParamsRetrieve<OrderSubscription>, options?: ResourcesConfig): Promise<OrderSubscription>;
6726
+ _convert(id: string | OrderSubscription, params?: QueryParamsRetrieve<OrderSubscription>, options?: ResourcesConfig): Promise<OrderSubscription>;
6716
6727
  isOrderSubscription(resource: any): resource is OrderSubscription;
6717
6728
  relationship(id: string | ResourceId | null): OrderSubscriptionRel;
6718
6729
  relationshipToMany(...ids: string[]): OrderSubscriptionRel[];
@@ -10234,6 +10245,11 @@ interface StockTransfer extends Resource {
10234
10245
  versions?: Version[] | null;
10235
10246
  }
10236
10247
  interface StockTransferCreate extends ResourceCreate {
10248
+ /**
10249
+ * Unique identifier for the stock transfer (numeric)..
10250
+ * @example ```"1234"```
10251
+ */
10252
+ number?: string | null;
10237
10253
  /**
10238
10254
  * The code of the associated SKU..
10239
10255
  * @example ```"TSHIRTMM000000FFFFFFXLXX"```
@@ -10251,6 +10267,11 @@ interface StockTransferCreate extends ResourceCreate {
10251
10267
  line_item?: LineItemRel | null;
10252
10268
  }
10253
10269
  interface StockTransferUpdate extends ResourceUpdate {
10270
+ /**
10271
+ * Unique identifier for the stock transfer (numeric)..
10272
+ * @example ```"1234"```
10273
+ */
10274
+ number?: string | null;
10254
10275
  /**
10255
10276
  * The code of the associated SKU..
10256
10277
  * @example ```"TSHIRTMM000000FFFFFFXLXX"```
@@ -14989,7 +15010,7 @@ type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
14989
15010
  type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
14990
15011
  declare class CommerceLayerClient {
14991
15012
  #private;
14992
- readonly openApiSchemaVersion = "5.3.0";
15013
+ readonly openApiSchemaVersion = "5.3.2";
14993
15014
  constructor(config: CommerceLayerInitConfig);
14994
15015
  get addresses(): Addresses;
14995
15016
  get adjustments(): Adjustments;