@betterstore/sdk 0.3.39 → 0.3.41
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 +13 -16
- package/dist/index.d.ts +13 -16
- package/dist/index.js +5 -4
- package/dist/index.mjs +5 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -41,11 +41,12 @@ interface VariantOption {
|
|
|
41
41
|
interface ProductVariant {
|
|
42
42
|
sku: string;
|
|
43
43
|
images: string[];
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
isPhysical: boolean;
|
|
45
|
+
weightInGrams?: number;
|
|
46
|
+
heightInCm?: number;
|
|
47
|
+
widthInCm?: number;
|
|
48
|
+
lengthInCm?: number;
|
|
47
49
|
priceInCents: number;
|
|
48
|
-
productId: string;
|
|
49
50
|
variantOptions: VariantOption[];
|
|
50
51
|
}
|
|
51
52
|
interface ProductOption {
|
|
@@ -91,24 +92,17 @@ interface ZasilkovnaRate extends BaseRate {
|
|
|
91
92
|
clientSecret: string;
|
|
92
93
|
}
|
|
93
94
|
|
|
95
|
+
type ProductData = Pick<Product, "title" | "description" | "images" | "category" | "tags" | "isPhysical" | "weightInGrams" | "heightInCm" | "widthInCm" | "lengthInCm" | "priceInCents"> & {
|
|
96
|
+
selectedVariant: Pick<ProductVariant, "sku" | "images" | "isPhysical" | "weightInGrams" | "heightInCm" | "widthInCm" | "lengthInCm" | "priceInCents" | "variantOptions">;
|
|
97
|
+
};
|
|
94
98
|
interface LineItem {
|
|
95
99
|
quantity: number;
|
|
96
|
-
productId: string;
|
|
97
100
|
variantOptions: {
|
|
98
101
|
name: string;
|
|
99
102
|
value: string;
|
|
100
103
|
}[];
|
|
101
104
|
discountId?: string;
|
|
102
|
-
product
|
|
103
|
-
productVariants: {
|
|
104
|
-
variantOptions: {
|
|
105
|
-
name: string;
|
|
106
|
-
value: string;
|
|
107
|
-
}[];
|
|
108
|
-
priceInCents: number;
|
|
109
|
-
images: string[];
|
|
110
|
-
}[];
|
|
111
|
-
};
|
|
105
|
+
product: ProductData;
|
|
112
106
|
metadata?: string;
|
|
113
107
|
}
|
|
114
108
|
interface LineItemCreate extends Omit<LineItem, "product" | "metadata"> {
|
|
@@ -202,7 +196,10 @@ declare class Client {
|
|
|
202
196
|
/**
|
|
203
197
|
* Generate payment secret for a checkout session
|
|
204
198
|
*/
|
|
205
|
-
generateCheckoutsPaymentSecret(clientSecret: string, checkoutId: string): Promise<
|
|
199
|
+
generateCheckoutsPaymentSecret(clientSecret: string, checkoutId: string): Promise<{
|
|
200
|
+
paymentSecret: string;
|
|
201
|
+
publicKey: string;
|
|
202
|
+
}>;
|
|
206
203
|
/**
|
|
207
204
|
* Create a new customer
|
|
208
205
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -41,11 +41,12 @@ interface VariantOption {
|
|
|
41
41
|
interface ProductVariant {
|
|
42
42
|
sku: string;
|
|
43
43
|
images: string[];
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
isPhysical: boolean;
|
|
45
|
+
weightInGrams?: number;
|
|
46
|
+
heightInCm?: number;
|
|
47
|
+
widthInCm?: number;
|
|
48
|
+
lengthInCm?: number;
|
|
47
49
|
priceInCents: number;
|
|
48
|
-
productId: string;
|
|
49
50
|
variantOptions: VariantOption[];
|
|
50
51
|
}
|
|
51
52
|
interface ProductOption {
|
|
@@ -91,24 +92,17 @@ interface ZasilkovnaRate extends BaseRate {
|
|
|
91
92
|
clientSecret: string;
|
|
92
93
|
}
|
|
93
94
|
|
|
95
|
+
type ProductData = Pick<Product, "title" | "description" | "images" | "category" | "tags" | "isPhysical" | "weightInGrams" | "heightInCm" | "widthInCm" | "lengthInCm" | "priceInCents"> & {
|
|
96
|
+
selectedVariant: Pick<ProductVariant, "sku" | "images" | "isPhysical" | "weightInGrams" | "heightInCm" | "widthInCm" | "lengthInCm" | "priceInCents" | "variantOptions">;
|
|
97
|
+
};
|
|
94
98
|
interface LineItem {
|
|
95
99
|
quantity: number;
|
|
96
|
-
productId: string;
|
|
97
100
|
variantOptions: {
|
|
98
101
|
name: string;
|
|
99
102
|
value: string;
|
|
100
103
|
}[];
|
|
101
104
|
discountId?: string;
|
|
102
|
-
product
|
|
103
|
-
productVariants: {
|
|
104
|
-
variantOptions: {
|
|
105
|
-
name: string;
|
|
106
|
-
value: string;
|
|
107
|
-
}[];
|
|
108
|
-
priceInCents: number;
|
|
109
|
-
images: string[];
|
|
110
|
-
}[];
|
|
111
|
-
};
|
|
105
|
+
product: ProductData;
|
|
112
106
|
metadata?: string;
|
|
113
107
|
}
|
|
114
108
|
interface LineItemCreate extends Omit<LineItem, "product" | "metadata"> {
|
|
@@ -202,7 +196,10 @@ declare class Client {
|
|
|
202
196
|
/**
|
|
203
197
|
* Generate payment secret for a checkout session
|
|
204
198
|
*/
|
|
205
|
-
generateCheckoutsPaymentSecret(clientSecret: string, checkoutId: string): Promise<
|
|
199
|
+
generateCheckoutsPaymentSecret(clientSecret: string, checkoutId: string): Promise<{
|
|
200
|
+
paymentSecret: string;
|
|
201
|
+
publicKey: string;
|
|
202
|
+
}>;
|
|
206
203
|
/**
|
|
207
204
|
* Create a new customer
|
|
208
205
|
*/
|
package/dist/index.js
CHANGED
|
@@ -238,10 +238,11 @@ var Client = class {
|
|
|
238
238
|
generateCheckoutsPaymentSecret(clientSecret, checkoutId) {
|
|
239
239
|
return __async(this, null, function* () {
|
|
240
240
|
const apiClient = createApiClient(clientSecret, this.proxy);
|
|
241
|
-
const data = yield apiClient.post(
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
241
|
+
const data = yield apiClient.post(`/checkout/payment/${checkoutId}`);
|
|
242
|
+
return {
|
|
243
|
+
paymentSecret: data.paymentSecret,
|
|
244
|
+
publicKey: data.publicKey
|
|
245
|
+
};
|
|
245
246
|
});
|
|
246
247
|
}
|
|
247
248
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -202,10 +202,11 @@ var Client = class {
|
|
|
202
202
|
generateCheckoutsPaymentSecret(clientSecret, checkoutId) {
|
|
203
203
|
return __async(this, null, function* () {
|
|
204
204
|
const apiClient = createApiClient(clientSecret, this.proxy);
|
|
205
|
-
const data = yield apiClient.post(
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
205
|
+
const data = yield apiClient.post(`/checkout/payment/${checkoutId}`);
|
|
206
|
+
return {
|
|
207
|
+
paymentSecret: data.paymentSecret,
|
|
208
|
+
publicKey: data.publicKey
|
|
209
|
+
};
|
|
209
210
|
});
|
|
210
211
|
}
|
|
211
212
|
/**
|