@betterstore/sdk 0.3.66 → 0.3.68

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @betterstore/sdk
2
2
 
3
+ ## 0.3.68
4
+
5
+ ### Patch Changes
6
+
7
+ - bug fix
8
+
9
+ ## 0.3.67
10
+
11
+ ### Patch Changes
12
+
13
+ - bug fixes
14
+
3
15
  ## 0.3.66
4
16
 
5
17
  ### Patch Changes
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;
@@ -131,7 +135,6 @@ interface LineItem {
131
135
  name: string;
132
136
  value: string;
133
137
  }[];
134
- discountId?: string;
135
138
  productData: ProductData;
136
139
  metadata?: string;
137
140
  }
@@ -146,7 +149,7 @@ interface CheckoutCreateParams {
146
149
  customerId?: string;
147
150
  lineItems: LineItemCreate[];
148
151
  currency?: Currency;
149
- discountCode?: string;
152
+ discountCodes?: string[];
150
153
  }
151
154
  interface CheckoutUpdateParams {
152
155
  customerId?: string;
@@ -338,6 +341,10 @@ declare class Customer {
338
341
  * Delete a customer
339
342
  */
340
343
  delete(customerId: string): Promise<void>;
344
+ /**
345
+ * Delete a customer
346
+ */
347
+ updateCustomerSubscription(stripeSubscriptionId: string, params: CustomerSubscriptionUpdateParams): Promise<CustomerSubscription>;
341
348
  }
342
349
 
343
350
  declare class Helpers {
@@ -373,4 +380,4 @@ declare function createStoreHelpers(config?: {
373
380
  proxy?: string;
374
381
  }): Helpers;
375
382
 
376
- 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 };
383
+ 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;
@@ -131,7 +135,6 @@ interface LineItem {
131
135
  name: string;
132
136
  value: string;
133
137
  }[];
134
- discountId?: string;
135
138
  productData: ProductData;
136
139
  metadata?: string;
137
140
  }
@@ -146,7 +149,7 @@ interface CheckoutCreateParams {
146
149
  customerId?: string;
147
150
  lineItems: LineItemCreate[];
148
151
  currency?: Currency;
149
- discountCode?: string;
152
+ discountCodes?: string[];
150
153
  }
151
154
  interface CheckoutUpdateParams {
152
155
  customerId?: string;
@@ -338,6 +341,10 @@ declare class Customer {
338
341
  * Delete a customer
339
342
  */
340
343
  delete(customerId: string): Promise<void>;
344
+ /**
345
+ * Delete a customer
346
+ */
347
+ updateCustomerSubscription(stripeSubscriptionId: string, params: CustomerSubscriptionUpdateParams): Promise<CustomerSubscription>;
341
348
  }
342
349
 
343
350
  declare class Helpers {
@@ -373,4 +380,4 @@ declare function createStoreHelpers(config?: {
373
380
  proxy?: string;
374
381
  }): Helpers;
375
382
 
376
- 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 };
383
+ 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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betterstore/sdk",
3
- "version": "0.3.66",
3
+ "version": "0.3.68",
4
4
  "description": "E-commerce for Developers",
5
5
  "private": false,
6
6
  "publishConfig": {