@betterstore/sdk 0.3.64 → 0.3.66

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.66
4
+
5
+ ### Patch Changes
6
+
7
+ - bug fixes
8
+
9
+ ## 0.3.65
10
+
11
+ ### Patch Changes
12
+
13
+ - bug fix
14
+
3
15
  ## 0.3.64
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -54,8 +54,8 @@ interface ProductVariant {
54
54
  lengthInCm?: number;
55
55
  priceInCents: number;
56
56
  billingType: ProductBillingType;
57
- billingInterval?: string | null;
58
- stripeProductId?: string | null;
57
+ billingInterval: ProductBillingInterval;
58
+ billingIntervalCount: number;
59
59
  variantOptions: VariantOption[];
60
60
  }
61
61
  interface ProductOption {
@@ -63,6 +63,7 @@ interface ProductOption {
63
63
  values: string[];
64
64
  }
65
65
  type ProductStatus = "DRAFT" | "ACTIVE" | "ARCHIVED";
66
+ type ProductBillingInterval = "DAY" | "WEEK" | "MONTH" | "YEAR";
66
67
  type ProductBillingType = "ONE_TIME" | "SUBSCRIPTION";
67
68
  interface Product {
68
69
  id: string;
@@ -78,8 +79,8 @@ interface Product {
78
79
  lengthInCm?: number;
79
80
  priceInCents: number;
80
81
  billingType: ProductBillingType;
81
- billingInterval?: string | null;
82
- stripeProductId?: string | null;
82
+ billingInterval: ProductBillingInterval;
83
+ billingIntervalCount: number;
83
84
  trackInventory: boolean;
84
85
  sku?: string;
85
86
  barcode?: string;
@@ -120,9 +121,9 @@ interface ZasilkovnaRate extends BaseRate {
120
121
  clientSecret: string;
121
122
  }
122
123
 
123
- type ProductData = Pick<Product, "title" | "description" | "images" | "category" | "tags" | "sku" | "barcode" | "vendor" | "isPhysical" | "weightInGrams" | "heightInCm" | "widthInCm" | "lengthInCm" | "priceInCents" | "billingType" | "billingInterval" | "stripeProductId"> & {
124
+ type ProductData = Pick<Product, "title" | "description" | "images" | "category" | "tags" | "sku" | "barcode" | "vendor" | "isPhysical" | "weightInGrams" | "heightInCm" | "widthInCm" | "lengthInCm" | "priceInCents" | "billingType" | "billingInterval" | "billingIntervalCount"> & {
124
125
  productId: string;
125
- selectedVariant: Pick<ProductVariant, "title" | "sku" | "barcode" | "images" | "isPhysical" | "weightInGrams" | "heightInCm" | "widthInCm" | "lengthInCm" | "priceInCents" | "billingType" | "billingInterval" | "stripeProductId" | "variantOptions">;
126
+ selectedVariant: Pick<ProductVariant, "title" | "sku" | "barcode" | "images" | "isPhysical" | "weightInGrams" | "heightInCm" | "widthInCm" | "lengthInCm" | "priceInCents" | "billingType" | "billingInterval" | "billingIntervalCount" | "variantOptions">;
126
127
  };
127
128
  interface LineItem {
128
129
  quantity: number;
@@ -189,6 +190,9 @@ type Discount = {
189
190
  maxUsesPerCustomer?: number | null;
190
191
  maxAllowedProductQuantity?: number | null;
191
192
  uses: number;
193
+ subscriptionDiscountDurationType: "ONE_TIME" | "RECURRING" | "FOREVER";
194
+ subscriptionDiscountDurationValue: number;
195
+ stripeDiscountId?: string | null;
192
196
  startsAt: Date;
193
197
  expiresAt?: Date | null;
194
198
  status: "ACTIVE" | "EXPIRED" | "SCHEDULED";
@@ -210,7 +214,10 @@ interface CheckoutSession {
210
214
  appliedDiscounts: {
211
215
  id: string;
212
216
  amount: number;
213
- allowedProductIDs: string[];
217
+ allowedLineItems: {
218
+ productId: string;
219
+ quantity: number;
220
+ }[];
214
221
  discount: Discount;
215
222
  }[];
216
223
  currency: string;
@@ -366,4 +373,4 @@ declare function createStoreHelpers(config?: {
366
373
  proxy?: string;
367
374
  }): Helpers;
368
375
 
369
- 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 ProductBillingType, type ProductOption, type ProductStatus, type ProductVariant, type ProductWithoutVariants, type ShippingRate, type VariantOption, createStoreClient, createStoreHelpers, createBetterStore as default };
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 };
package/dist/index.d.ts CHANGED
@@ -54,8 +54,8 @@ interface ProductVariant {
54
54
  lengthInCm?: number;
55
55
  priceInCents: number;
56
56
  billingType: ProductBillingType;
57
- billingInterval?: string | null;
58
- stripeProductId?: string | null;
57
+ billingInterval: ProductBillingInterval;
58
+ billingIntervalCount: number;
59
59
  variantOptions: VariantOption[];
60
60
  }
61
61
  interface ProductOption {
@@ -63,6 +63,7 @@ interface ProductOption {
63
63
  values: string[];
64
64
  }
65
65
  type ProductStatus = "DRAFT" | "ACTIVE" | "ARCHIVED";
66
+ type ProductBillingInterval = "DAY" | "WEEK" | "MONTH" | "YEAR";
66
67
  type ProductBillingType = "ONE_TIME" | "SUBSCRIPTION";
67
68
  interface Product {
68
69
  id: string;
@@ -78,8 +79,8 @@ interface Product {
78
79
  lengthInCm?: number;
79
80
  priceInCents: number;
80
81
  billingType: ProductBillingType;
81
- billingInterval?: string | null;
82
- stripeProductId?: string | null;
82
+ billingInterval: ProductBillingInterval;
83
+ billingIntervalCount: number;
83
84
  trackInventory: boolean;
84
85
  sku?: string;
85
86
  barcode?: string;
@@ -120,9 +121,9 @@ interface ZasilkovnaRate extends BaseRate {
120
121
  clientSecret: string;
121
122
  }
122
123
 
123
- type ProductData = Pick<Product, "title" | "description" | "images" | "category" | "tags" | "sku" | "barcode" | "vendor" | "isPhysical" | "weightInGrams" | "heightInCm" | "widthInCm" | "lengthInCm" | "priceInCents" | "billingType" | "billingInterval" | "stripeProductId"> & {
124
+ type ProductData = Pick<Product, "title" | "description" | "images" | "category" | "tags" | "sku" | "barcode" | "vendor" | "isPhysical" | "weightInGrams" | "heightInCm" | "widthInCm" | "lengthInCm" | "priceInCents" | "billingType" | "billingInterval" | "billingIntervalCount"> & {
124
125
  productId: string;
125
- selectedVariant: Pick<ProductVariant, "title" | "sku" | "barcode" | "images" | "isPhysical" | "weightInGrams" | "heightInCm" | "widthInCm" | "lengthInCm" | "priceInCents" | "billingType" | "billingInterval" | "stripeProductId" | "variantOptions">;
126
+ selectedVariant: Pick<ProductVariant, "title" | "sku" | "barcode" | "images" | "isPhysical" | "weightInGrams" | "heightInCm" | "widthInCm" | "lengthInCm" | "priceInCents" | "billingType" | "billingInterval" | "billingIntervalCount" | "variantOptions">;
126
127
  };
127
128
  interface LineItem {
128
129
  quantity: number;
@@ -189,6 +190,9 @@ type Discount = {
189
190
  maxUsesPerCustomer?: number | null;
190
191
  maxAllowedProductQuantity?: number | null;
191
192
  uses: number;
193
+ subscriptionDiscountDurationType: "ONE_TIME" | "RECURRING" | "FOREVER";
194
+ subscriptionDiscountDurationValue: number;
195
+ stripeDiscountId?: string | null;
192
196
  startsAt: Date;
193
197
  expiresAt?: Date | null;
194
198
  status: "ACTIVE" | "EXPIRED" | "SCHEDULED";
@@ -210,7 +214,10 @@ interface CheckoutSession {
210
214
  appliedDiscounts: {
211
215
  id: string;
212
216
  amount: number;
213
- allowedProductIDs: string[];
217
+ allowedLineItems: {
218
+ productId: string;
219
+ quantity: number;
220
+ }[];
214
221
  discount: Discount;
215
222
  }[];
216
223
  currency: string;
@@ -366,4 +373,4 @@ declare function createStoreHelpers(config?: {
366
373
  proxy?: string;
367
374
  }): Helpers;
368
375
 
369
- 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 ProductBillingType, type ProductOption, type ProductStatus, type ProductVariant, type ProductWithoutVariants, type ShippingRate, type VariantOption, createStoreClient, createStoreHelpers, createBetterStore as default };
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betterstore/sdk",
3
- "version": "0.3.64",
3
+ "version": "0.3.66",
4
4
  "description": "E-commerce for Developers",
5
5
  "private": false,
6
6
  "publishConfig": {