@betterstore/sdk 0.3.26 → 0.3.28

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.28
4
+
5
+ ### Patch Changes
6
+
7
+ - bug fix
8
+
9
+ ## 0.3.27
10
+
11
+ ### Patch Changes
12
+
13
+ - migrate from shippo to custom solution
14
+
3
15
  ## 0.3.26
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,6 +1,3 @@
1
- import { Rate } from 'shippo';
2
- export { Rate as ShippingRate } from 'shippo';
3
-
4
1
  type Address = {
5
2
  name: string;
6
3
  company?: string;
@@ -80,6 +77,16 @@ interface Product {
80
77
  productVariants: ProductVariant[];
81
78
  }
82
79
 
80
+ type ShippingRate = ZasilkovnaRate;
81
+ interface BaseRate {
82
+ provider: string;
83
+ price: number;
84
+ }
85
+ interface ZasilkovnaRate extends BaseRate {
86
+ provider: "zasilkovna";
87
+ clientSecret: string;
88
+ }
89
+
83
90
  interface LineItem {
84
91
  quantity: number;
85
92
  productId: string;
@@ -103,10 +110,11 @@ interface CheckoutUpdateParams {
103
110
  customerId?: string;
104
111
  tax?: number;
105
112
  shipping?: number;
106
- shippingInfo?: {
107
- rateId: string;
108
- provider?: string;
113
+ shipmentInfo?: {
114
+ provider: string;
115
+ price: number;
109
116
  name?: string;
117
+ pickupPointId?: string;
110
118
  trackingNumber?: string;
111
119
  trackingUrl?: string;
112
120
  };
@@ -150,7 +158,7 @@ declare class Checkout {
150
158
  /**
151
159
  * Get shipping rates for a checkout session
152
160
  */
153
- getShippingRates(checkoutId: string): Promise<Rate[]>;
161
+ getShippingRates(checkoutId: string): Promise<ShippingRate[]>;
154
162
  /**
155
163
  * Generate payment secret for a checkout session
156
164
  */
@@ -171,7 +179,7 @@ declare class Client {
171
179
  /**
172
180
  * Get shipping rates for a checkout session
173
181
  */
174
- getCheckoutShippingRates(clientSecret: string, checkoutId: string): Promise<Rate[]>;
182
+ getCheckoutShippingRates(clientSecret: string, checkoutId: string): Promise<ShippingRate[]>;
175
183
  /**
176
184
  * Generate payment secret for a checkout session
177
185
  */
@@ -240,4 +248,4 @@ declare function createStoreHelpers(config?: {
240
248
  proxy?: string;
241
249
  }): Helpers;
242
250
 
243
- export { type Address, type CheckoutCreateParams, type CheckoutSession, type CheckoutUpdateParams, type Currency, type Customer$1 as Customer, type CustomerCreateParams, type CustomerUpdateParams, type LineItem, type Product, type ProductOption, ProductStatus, type ProductVariant, type VariantOption, createStoreClient, createStoreHelpers, createBetterStore as default };
251
+ export { type Address, type CheckoutCreateParams, type CheckoutSession, type CheckoutUpdateParams, type Currency, type Customer$1 as Customer, type CustomerCreateParams, type CustomerUpdateParams, type LineItem, type Product, type ProductOption, ProductStatus, type ProductVariant, type ShippingRate, type VariantOption, createStoreClient, createStoreHelpers, createBetterStore as default };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,3 @@
1
- import { Rate } from 'shippo';
2
- export { Rate as ShippingRate } from 'shippo';
3
-
4
1
  type Address = {
5
2
  name: string;
6
3
  company?: string;
@@ -80,6 +77,16 @@ interface Product {
80
77
  productVariants: ProductVariant[];
81
78
  }
82
79
 
80
+ type ShippingRate = ZasilkovnaRate;
81
+ interface BaseRate {
82
+ provider: string;
83
+ price: number;
84
+ }
85
+ interface ZasilkovnaRate extends BaseRate {
86
+ provider: "zasilkovna";
87
+ clientSecret: string;
88
+ }
89
+
83
90
  interface LineItem {
84
91
  quantity: number;
85
92
  productId: string;
@@ -103,10 +110,11 @@ interface CheckoutUpdateParams {
103
110
  customerId?: string;
104
111
  tax?: number;
105
112
  shipping?: number;
106
- shippingInfo?: {
107
- rateId: string;
108
- provider?: string;
113
+ shipmentInfo?: {
114
+ provider: string;
115
+ price: number;
109
116
  name?: string;
117
+ pickupPointId?: string;
110
118
  trackingNumber?: string;
111
119
  trackingUrl?: string;
112
120
  };
@@ -150,7 +158,7 @@ declare class Checkout {
150
158
  /**
151
159
  * Get shipping rates for a checkout session
152
160
  */
153
- getShippingRates(checkoutId: string): Promise<Rate[]>;
161
+ getShippingRates(checkoutId: string): Promise<ShippingRate[]>;
154
162
  /**
155
163
  * Generate payment secret for a checkout session
156
164
  */
@@ -171,7 +179,7 @@ declare class Client {
171
179
  /**
172
180
  * Get shipping rates for a checkout session
173
181
  */
174
- getCheckoutShippingRates(clientSecret: string, checkoutId: string): Promise<Rate[]>;
182
+ getCheckoutShippingRates(clientSecret: string, checkoutId: string): Promise<ShippingRate[]>;
175
183
  /**
176
184
  * Generate payment secret for a checkout session
177
185
  */
@@ -240,4 +248,4 @@ declare function createStoreHelpers(config?: {
240
248
  proxy?: string;
241
249
  }): Helpers;
242
250
 
243
- export { type Address, type CheckoutCreateParams, type CheckoutSession, type CheckoutUpdateParams, type Currency, type Customer$1 as Customer, type CustomerCreateParams, type CustomerUpdateParams, type LineItem, type Product, type ProductOption, ProductStatus, type ProductVariant, type VariantOption, createStoreClient, createStoreHelpers, createBetterStore as default };
251
+ export { type Address, type CheckoutCreateParams, type CheckoutSession, type CheckoutUpdateParams, type Currency, type Customer$1 as Customer, type CustomerCreateParams, type CustomerUpdateParams, type LineItem, type Product, type ProductOption, ProductStatus, type ProductVariant, type ShippingRate, type VariantOption, createStoreClient, createStoreHelpers, createBetterStore as default };
package/dist/index.js CHANGED
@@ -51,7 +51,6 @@ var __async = (__this, __arguments, generator) => {
51
51
  var index_exports = {};
52
52
  __export(index_exports, {
53
53
  ProductStatus: () => ProductStatus,
54
- ShippingRate: () => import_shippo.Rate,
55
54
  createStoreClient: () => createStoreClient,
56
55
  createStoreHelpers: () => createStoreHelpers,
57
56
  default: () => createBetterStore
@@ -431,9 +430,6 @@ var Products = class {
431
430
  };
432
431
  var products_default = Products;
433
432
 
434
- // src/checkout/types.ts
435
- var import_shippo = require("shippo");
436
-
437
433
  // src/products/types.ts
438
434
  var ProductStatus = /* @__PURE__ */ ((ProductStatus2) => {
439
435
  ProductStatus2["DRAFT"] = "DRAFT";
@@ -462,7 +458,6 @@ function createStoreHelpers(config) {
462
458
  // Annotate the CommonJS export names for ESM import in node:
463
459
  0 && (module.exports = {
464
460
  ProductStatus,
465
- ShippingRate,
466
461
  createStoreClient,
467
462
  createStoreHelpers
468
463
  });
package/dist/index.mjs CHANGED
@@ -392,9 +392,6 @@ var Products = class {
392
392
  };
393
393
  var products_default = Products;
394
394
 
395
- // src/checkout/types.ts
396
- import { Rate } from "shippo";
397
-
398
395
  // src/products/types.ts
399
396
  var ProductStatus = /* @__PURE__ */ ((ProductStatus2) => {
400
397
  ProductStatus2["DRAFT"] = "DRAFT";
@@ -422,7 +419,6 @@ function createStoreHelpers(config) {
422
419
  }
423
420
  export {
424
421
  ProductStatus,
425
- Rate as ShippingRate,
426
422
  createStoreClient,
427
423
  createStoreHelpers,
428
424
  createBetterStore as default
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betterstore/sdk",
3
- "version": "0.3.26",
3
+ "version": "0.3.28",
4
4
  "description": "E-commerce for Developers",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -27,7 +27,6 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "axios": "^1.8.2",
30
- "shippo": "^2.15.0",
31
30
  "zod": "^3.24.2"
32
31
  },
33
32
  "scripts": {