@betterstore/sdk 0.3.40 → 0.3.42

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.42
4
+
5
+ ### Patch Changes
6
+
7
+ - types fix
8
+
9
+ ## 0.3.41
10
+
11
+ ### Patch Changes
12
+
13
+ - new product items logic update
14
+
3
15
  ## 0.3.40
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -39,13 +39,16 @@ interface VariantOption {
39
39
  value: string;
40
40
  }
41
41
  interface ProductVariant {
42
- sku: string;
42
+ title: string;
43
+ sku?: string;
44
+ barcode?: string;
43
45
  images: string[];
44
- stockAvailable: number;
45
- stockCommited: number;
46
- stockUnavailable: number;
46
+ isPhysical: boolean;
47
+ weightInGrams?: number;
48
+ heightInCm?: number;
49
+ widthInCm?: number;
50
+ lengthInCm?: number;
47
51
  priceInCents: number;
48
- productId: string;
49
52
  variantOptions: VariantOption[];
50
53
  }
51
54
  interface ProductOption {
@@ -91,24 +94,17 @@ interface ZasilkovnaRate extends BaseRate {
91
94
  clientSecret: string;
92
95
  }
93
96
 
97
+ type ProductData = Pick<Product, "title" | "description" | "images" | "category" | "tags" | "isPhysical" | "weightInGrams" | "heightInCm" | "widthInCm" | "lengthInCm" | "priceInCents"> & {
98
+ selectedVariant: Pick<ProductVariant, "title" | "sku" | "barcode" | "images" | "isPhysical" | "weightInGrams" | "heightInCm" | "widthInCm" | "lengthInCm" | "priceInCents" | "variantOptions">;
99
+ };
94
100
  interface LineItem {
95
101
  quantity: number;
96
- productId: string;
97
102
  variantOptions: {
98
103
  name: string;
99
104
  value: string;
100
105
  }[];
101
106
  discountId?: string;
102
- product?: Pick<Product, "title" | "priceInCents" | "images" | "id" | "description" | "category" | "tags"> & {
103
- productVariants: {
104
- variantOptions: {
105
- name: string;
106
- value: string;
107
- }[];
108
- priceInCents: number;
109
- images: string[];
110
- }[];
111
- };
107
+ product: ProductData;
112
108
  metadata?: string;
113
109
  }
114
110
  interface LineItemCreate extends Omit<LineItem, "product" | "metadata"> {
package/dist/index.d.ts CHANGED
@@ -39,13 +39,16 @@ interface VariantOption {
39
39
  value: string;
40
40
  }
41
41
  interface ProductVariant {
42
- sku: string;
42
+ title: string;
43
+ sku?: string;
44
+ barcode?: string;
43
45
  images: string[];
44
- stockAvailable: number;
45
- stockCommited: number;
46
- stockUnavailable: number;
46
+ isPhysical: boolean;
47
+ weightInGrams?: number;
48
+ heightInCm?: number;
49
+ widthInCm?: number;
50
+ lengthInCm?: number;
47
51
  priceInCents: number;
48
- productId: string;
49
52
  variantOptions: VariantOption[];
50
53
  }
51
54
  interface ProductOption {
@@ -91,24 +94,17 @@ interface ZasilkovnaRate extends BaseRate {
91
94
  clientSecret: string;
92
95
  }
93
96
 
97
+ type ProductData = Pick<Product, "title" | "description" | "images" | "category" | "tags" | "isPhysical" | "weightInGrams" | "heightInCm" | "widthInCm" | "lengthInCm" | "priceInCents"> & {
98
+ selectedVariant: Pick<ProductVariant, "title" | "sku" | "barcode" | "images" | "isPhysical" | "weightInGrams" | "heightInCm" | "widthInCm" | "lengthInCm" | "priceInCents" | "variantOptions">;
99
+ };
94
100
  interface LineItem {
95
101
  quantity: number;
96
- productId: string;
97
102
  variantOptions: {
98
103
  name: string;
99
104
  value: string;
100
105
  }[];
101
106
  discountId?: string;
102
- product?: Pick<Product, "title" | "priceInCents" | "images" | "id" | "description" | "category" | "tags"> & {
103
- productVariants: {
104
- variantOptions: {
105
- name: string;
106
- value: string;
107
- }[];
108
- priceInCents: number;
109
- images: string[];
110
- }[];
111
- };
107
+ product: ProductData;
112
108
  metadata?: string;
113
109
  }
114
110
  interface LineItemCreate extends Omit<LineItem, "product" | "metadata"> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betterstore/sdk",
3
- "version": "0.3.40",
3
+ "version": "0.3.42",
4
4
  "description": "E-commerce for Developers",
5
5
  "private": false,
6
6
  "publishConfig": {