@commercelayer/sdk 6.1.0 → 6.2.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 +3 -3
- package/lib/index.d.mts +12 -1
- package/lib/index.d.ts +12 -1
- package/lib/index.js +1 -1
- package/lib/index.mjs +1 -1
- package/package.json +3 -3
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[];
|
@@ -14989,7 +15000,7 @@ type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
|
|
14989
15000
|
type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
|
14990
15001
|
declare class CommerceLayerClient {
|
14991
15002
|
#private;
|
14992
|
-
readonly openApiSchemaVersion = "5.3.
|
15003
|
+
readonly openApiSchemaVersion = "5.3.1";
|
14993
15004
|
constructor(config: CommerceLayerInitConfig);
|
14994
15005
|
get addresses(): Addresses;
|
14995
15006
|
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[];
|
@@ -14989,7 +15000,7 @@ type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
|
|
14989
15000
|
type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
|
14990
15001
|
declare class CommerceLayerClient {
|
14991
15002
|
#private;
|
14992
|
-
readonly openApiSchemaVersion = "5.3.
|
15003
|
+
readonly openApiSchemaVersion = "5.3.1";
|
14993
15004
|
constructor(config: CommerceLayerInitConfig);
|
14994
15005
|
get addresses(): Addresses;
|
14995
15006
|
get adjustments(): Adjustments;
|