@betterstore/sdk 0.3.67 → 0.3.69
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/CHANGELOG.md +12 -0
- package/dist/index.d.mts +14 -2
- package/dist/index.d.ts +14 -2
- package/dist/index.js +12 -0
- package/dist/index.mjs +12 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -33,6 +33,10 @@ interface Customer$1 extends CustomerCreateParams {
|
|
|
33
33
|
createdAt: string;
|
|
34
34
|
updatedAt: string;
|
|
35
35
|
}
|
|
36
|
+
interface CustomerSubscription {
|
|
37
|
+
cancelAtPeriodEnd: boolean;
|
|
38
|
+
}
|
|
39
|
+
type CustomerSubscriptionUpdateParams = Partial<Pick<CustomerSubscription, "cancelAtPeriodEnd">>;
|
|
36
40
|
|
|
37
41
|
interface VariantOption {
|
|
38
42
|
name: string;
|
|
@@ -134,7 +138,11 @@ interface LineItem {
|
|
|
134
138
|
productData: ProductData;
|
|
135
139
|
metadata?: string;
|
|
136
140
|
}
|
|
137
|
-
interface LineItemCreate extends Omit<LineItem, "productData" | "product" | "metadata"> {
|
|
141
|
+
interface LineItemCreate extends Omit<LineItem, "productData" | "product" | "metadata" | "variantOptions"> {
|
|
142
|
+
variantOptions?: {
|
|
143
|
+
name: string;
|
|
144
|
+
value: string;
|
|
145
|
+
}[];
|
|
138
146
|
productId: string;
|
|
139
147
|
product?: Pick<Product, "title" | "priceInCents" | "images">;
|
|
140
148
|
metadata?: RecursiveRecord;
|
|
@@ -337,6 +345,10 @@ declare class Customer {
|
|
|
337
345
|
* Delete a customer
|
|
338
346
|
*/
|
|
339
347
|
delete(customerId: string): Promise<void>;
|
|
348
|
+
/**
|
|
349
|
+
* Delete a customer
|
|
350
|
+
*/
|
|
351
|
+
updateCustomerSubscription(stripeSubscriptionId: string, params: CustomerSubscriptionUpdateParams): Promise<CustomerSubscription>;
|
|
340
352
|
}
|
|
341
353
|
|
|
342
354
|
declare class Helpers {
|
|
@@ -372,4 +384,4 @@ declare function createStoreHelpers(config?: {
|
|
|
372
384
|
proxy?: string;
|
|
373
385
|
}): Helpers;
|
|
374
386
|
|
|
375
|
-
export { type Address, type CheckoutCreateParams, type CheckoutSession, type CheckoutUpdateParams, type Collection, type CollectionWithProducts, type Currency, type Customer$1 as Customer, type CustomerCreateParams, type CustomerUpdateParams, type LineItem, type LineItemCreate, type Product, type ProductBillingInterval, type ProductBillingType, type ProductOption, type ProductStatus, type ProductVariant, type ProductWithoutVariants, type ShippingRate, type VariantOption, createStoreClient, createStoreHelpers, createBetterStore as default };
|
|
387
|
+
export { type Address, type CheckoutCreateParams, type CheckoutSession, type CheckoutUpdateParams, type Collection, type CollectionWithProducts, type Currency, type Customer$1 as Customer, type CustomerCreateParams, type CustomerSubscription, type CustomerSubscriptionUpdateParams, type CustomerUpdateParams, type LineItem, type LineItemCreate, type Product, type ProductBillingInterval, type ProductBillingType, type ProductOption, type ProductStatus, type ProductVariant, type ProductWithoutVariants, type ShippingRate, type VariantOption, createStoreClient, createStoreHelpers, createBetterStore as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -33,6 +33,10 @@ interface Customer$1 extends CustomerCreateParams {
|
|
|
33
33
|
createdAt: string;
|
|
34
34
|
updatedAt: string;
|
|
35
35
|
}
|
|
36
|
+
interface CustomerSubscription {
|
|
37
|
+
cancelAtPeriodEnd: boolean;
|
|
38
|
+
}
|
|
39
|
+
type CustomerSubscriptionUpdateParams = Partial<Pick<CustomerSubscription, "cancelAtPeriodEnd">>;
|
|
36
40
|
|
|
37
41
|
interface VariantOption {
|
|
38
42
|
name: string;
|
|
@@ -134,7 +138,11 @@ interface LineItem {
|
|
|
134
138
|
productData: ProductData;
|
|
135
139
|
metadata?: string;
|
|
136
140
|
}
|
|
137
|
-
interface LineItemCreate extends Omit<LineItem, "productData" | "product" | "metadata"> {
|
|
141
|
+
interface LineItemCreate extends Omit<LineItem, "productData" | "product" | "metadata" | "variantOptions"> {
|
|
142
|
+
variantOptions?: {
|
|
143
|
+
name: string;
|
|
144
|
+
value: string;
|
|
145
|
+
}[];
|
|
138
146
|
productId: string;
|
|
139
147
|
product?: Pick<Product, "title" | "priceInCents" | "images">;
|
|
140
148
|
metadata?: RecursiveRecord;
|
|
@@ -337,6 +345,10 @@ declare class Customer {
|
|
|
337
345
|
* Delete a customer
|
|
338
346
|
*/
|
|
339
347
|
delete(customerId: string): Promise<void>;
|
|
348
|
+
/**
|
|
349
|
+
* Delete a customer
|
|
350
|
+
*/
|
|
351
|
+
updateCustomerSubscription(stripeSubscriptionId: string, params: CustomerSubscriptionUpdateParams): Promise<CustomerSubscription>;
|
|
340
352
|
}
|
|
341
353
|
|
|
342
354
|
declare class Helpers {
|
|
@@ -372,4 +384,4 @@ declare function createStoreHelpers(config?: {
|
|
|
372
384
|
proxy?: string;
|
|
373
385
|
}): Helpers;
|
|
374
386
|
|
|
375
|
-
export { type Address, type CheckoutCreateParams, type CheckoutSession, type CheckoutUpdateParams, type Collection, type CollectionWithProducts, type Currency, type Customer$1 as Customer, type CustomerCreateParams, type CustomerUpdateParams, type LineItem, type LineItemCreate, type Product, type ProductBillingInterval, type ProductBillingType, type ProductOption, type ProductStatus, type ProductVariant, type ProductWithoutVariants, type ShippingRate, type VariantOption, createStoreClient, createStoreHelpers, createBetterStore as default };
|
|
387
|
+
export { type Address, type CheckoutCreateParams, type CheckoutSession, type CheckoutUpdateParams, type Collection, type CollectionWithProducts, type Currency, type Customer$1 as Customer, type CustomerCreateParams, type CustomerSubscription, type CustomerSubscriptionUpdateParams, type CustomerUpdateParams, type LineItem, type LineItemCreate, type Product, type ProductBillingInterval, type ProductBillingType, type ProductOption, type ProductStatus, type ProductVariant, type ProductWithoutVariants, type ShippingRate, type VariantOption, createStoreClient, createStoreHelpers, createBetterStore as default };
|
package/dist/index.js
CHANGED
|
@@ -382,6 +382,18 @@ var Customer = class {
|
|
|
382
382
|
yield this.apiClient.delete(`/customer/${customerId}`);
|
|
383
383
|
});
|
|
384
384
|
}
|
|
385
|
+
/**
|
|
386
|
+
* Delete a customer
|
|
387
|
+
*/
|
|
388
|
+
updateCustomerSubscription(stripeSubscriptionId, params) {
|
|
389
|
+
return __async(this, null, function* () {
|
|
390
|
+
const data = yield this.apiClient.put(
|
|
391
|
+
`/customer/subscription/${stripeSubscriptionId}`,
|
|
392
|
+
params
|
|
393
|
+
);
|
|
394
|
+
return data;
|
|
395
|
+
});
|
|
396
|
+
}
|
|
385
397
|
};
|
|
386
398
|
var customer_default = Customer;
|
|
387
399
|
|
package/dist/index.mjs
CHANGED
|
@@ -345,6 +345,18 @@ var Customer = class {
|
|
|
345
345
|
yield this.apiClient.delete(`/customer/${customerId}`);
|
|
346
346
|
});
|
|
347
347
|
}
|
|
348
|
+
/**
|
|
349
|
+
* Delete a customer
|
|
350
|
+
*/
|
|
351
|
+
updateCustomerSubscription(stripeSubscriptionId, params) {
|
|
352
|
+
return __async(this, null, function* () {
|
|
353
|
+
const data = yield this.apiClient.put(
|
|
354
|
+
`/customer/subscription/${stripeSubscriptionId}`,
|
|
355
|
+
params
|
|
356
|
+
);
|
|
357
|
+
return data;
|
|
358
|
+
});
|
|
359
|
+
}
|
|
348
360
|
};
|
|
349
361
|
var customer_default = Customer;
|
|
350
362
|
|