@betterstore/sdk 0.5.21 → 0.5.22

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/dist/index.d.mts CHANGED
@@ -6,7 +6,7 @@ type ShippingRate = ZasilkovnaRate;
6
6
  interface BaseRate {
7
7
  provider: string;
8
8
  name: string;
9
- price: number;
9
+ priceInCents: number;
10
10
  }
11
11
  interface ZasilkovnaRate extends BaseRate {
12
12
  provider: "zasilkovna";
@@ -45,7 +45,7 @@ interface CheckoutCreateParams {
45
45
  }
46
46
  interface CheckoutUpdateParams {
47
47
  customerId?: string;
48
- shipments: CheckoutShipment[];
48
+ shipments?: CheckoutShipment[];
49
49
  }
50
50
 
51
51
  type ShipmentData = {
@@ -55,6 +55,7 @@ type ShipmentData = {
55
55
  pickupPointId?: string;
56
56
  trackingId?: string;
57
57
  trackingUrl?: string;
58
+ priceInCents: number;
58
59
  };
59
60
  type CheckoutShipment = {
60
61
  id: string;
@@ -71,7 +72,6 @@ interface CheckoutSession {
71
72
  };
72
73
  lineItems: LineItem[];
73
74
  tax: number | null;
74
- shipping: number | null;
75
75
  discountAmount: number | null;
76
76
  appliedDiscounts: {
77
77
  id: string;
@@ -450,7 +450,7 @@ declare class Checkout {
450
450
  /**
451
451
  * Get shipping rates for a checkout session
452
452
  */
453
- getShippingRates(checkoutId: string): Promise<ShippingRate[]>;
453
+ getShippingRates(checkoutId: string, shipmentId: string): Promise<ShippingRate[]>;
454
454
  /**
455
455
  * Generate payment secret for a checkout session
456
456
  */
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ type ShippingRate = ZasilkovnaRate;
6
6
  interface BaseRate {
7
7
  provider: string;
8
8
  name: string;
9
- price: number;
9
+ priceInCents: number;
10
10
  }
11
11
  interface ZasilkovnaRate extends BaseRate {
12
12
  provider: "zasilkovna";
@@ -45,7 +45,7 @@ interface CheckoutCreateParams {
45
45
  }
46
46
  interface CheckoutUpdateParams {
47
47
  customerId?: string;
48
- shipments: CheckoutShipment[];
48
+ shipments?: CheckoutShipment[];
49
49
  }
50
50
 
51
51
  type ShipmentData = {
@@ -55,6 +55,7 @@ type ShipmentData = {
55
55
  pickupPointId?: string;
56
56
  trackingId?: string;
57
57
  trackingUrl?: string;
58
+ priceInCents: number;
58
59
  };
59
60
  type CheckoutShipment = {
60
61
  id: string;
@@ -71,7 +72,6 @@ interface CheckoutSession {
71
72
  };
72
73
  lineItems: LineItem[];
73
74
  tax: number | null;
74
- shipping: number | null;
75
75
  discountAmount: number | null;
76
76
  appliedDiscounts: {
77
77
  id: string;
@@ -450,7 +450,7 @@ declare class Checkout {
450
450
  /**
451
451
  * Get shipping rates for a checkout session
452
452
  */
453
- getShippingRates(checkoutId: string): Promise<ShippingRate[]>;
453
+ getShippingRates(checkoutId: string, shipmentId: string): Promise<ShippingRate[]>;
454
454
  /**
455
455
  * Generate payment secret for a checkout session
456
456
  */
package/dist/index.js CHANGED
@@ -222,9 +222,9 @@ var Checkout = class {
222
222
  /**
223
223
  * Get shipping rates for a checkout session
224
224
  */
225
- async getShippingRates(checkoutId) {
225
+ async getShippingRates(checkoutId, shipmentId) {
226
226
  const data = await this.apiClient.get(
227
- `/checkout/shipping/${checkoutId}`
227
+ `/checkout/${checkoutId}/shipping/${shipmentId}/rates`
228
228
  );
229
229
  if ("isError" in data && data.isError || !data || !Array.isArray(data)) {
230
230
  return [];
package/dist/index.mjs CHANGED
@@ -184,9 +184,9 @@ var Checkout = class {
184
184
  /**
185
185
  * Get shipping rates for a checkout session
186
186
  */
187
- async getShippingRates(checkoutId) {
187
+ async getShippingRates(checkoutId, shipmentId) {
188
188
  const data = await this.apiClient.get(
189
- `/checkout/shipping/${checkoutId}`
189
+ `/checkout/${checkoutId}/shipping/${shipmentId}/rates`
190
190
  );
191
191
  if ("isError" in data && data.isError || !data || !Array.isArray(data)) {
192
192
  return [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betterstore/sdk",
3
- "version": "0.5.21",
3
+ "version": "0.5.22",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",