@betterstore/sdk 0.3.9 → 0.3.10

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,11 @@
1
1
  # @betterstore/sdk
2
2
 
3
+ ## 0.3.10
4
+
5
+ ### Patch Changes
6
+
7
+ - shipping rate type fix metadata added
8
+
3
9
  ## 0.3.9
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,3 +1,6 @@
1
+ import { Rate } from 'shippo';
2
+ export { Rate as ShippingRate } from 'shippo';
3
+
1
4
  type Address = {
2
5
  name: string;
3
6
  company?: string;
@@ -85,6 +88,7 @@ interface LineItem {
85
88
  value: string;
86
89
  }[];
87
90
  discountId?: string;
91
+ metadata?: string;
88
92
  }
89
93
  interface CheckoutCreateParams {
90
94
  type: "hosted" | "embed";
@@ -95,35 +99,13 @@ interface CheckoutUpdateParams {
95
99
  lineItems?: LineItem[];
96
100
  customerId?: string;
97
101
  }
98
- interface ShippingRate {
99
- id: string;
100
- rate: number;
101
- provider: string;
102
- service: string;
103
- estimatedDays: number;
104
- }
102
+
105
103
  interface CheckoutSession {
106
104
  id: string;
107
105
  createdAt: Date;
108
106
  updatedAt: Date;
109
107
  clientSecret: string;
110
- lineItems: {
111
- quantity: number;
112
- discount?: any;
113
- variantOptions: {
114
- name: string;
115
- value: string;
116
- }[];
117
- product?: {
118
- id: string;
119
- title: string;
120
- description?: string;
121
- images: string[];
122
- category: string;
123
- tags: string[];
124
- priceInCents: number;
125
- };
126
- }[];
108
+ lineItems: LineItem[];
127
109
  total?: number;
128
110
  subtotal?: number;
129
111
  tax?: number;
@@ -154,7 +136,7 @@ declare class Checkout {
154
136
  /**
155
137
  * Get shipping rates for a checkout session
156
138
  */
157
- getShippingRates(checkoutId: string): Promise<ShippingRate[]>;
139
+ getShippingRates(checkoutId: string): Promise<Rate[]>;
158
140
  /**
159
141
  * Generate payment secret for a checkout session
160
142
  */
@@ -175,7 +157,7 @@ declare class Client {
175
157
  /**
176
158
  * Get shipping rates for a checkout session
177
159
  */
178
- getCheckoutShippingRates(clientSecret: string, checkoutId: string): Promise<ShippingRate[]>;
160
+ getCheckoutShippingRates(clientSecret: string, checkoutId: string): Promise<Rate[]>;
179
161
  /**
180
162
  * Generate payment secret for a checkout session
181
163
  */
@@ -234,4 +216,4 @@ declare function createStoreClient(config: {
234
216
  proxy?: string;
235
217
  }): Client;
236
218
 
237
- export { type Address, type CheckoutCreateParams, type CheckoutSession, type CheckoutUpdateParams, type Customer$1 as Customer, type CustomerCreateParams, type CustomerUpdateParams, type LineItem, type Product, type ProductOption, ProductStatus, type ProductVariant, type ShippingRate, type VariantOption, createStoreClient, betterStore as default };
219
+ export { type Address, type CheckoutCreateParams, type CheckoutSession, type CheckoutUpdateParams, type Customer$1 as Customer, type CustomerCreateParams, type CustomerUpdateParams, type LineItem, type Product, type ProductOption, ProductStatus, type ProductVariant, type VariantOption, createStoreClient, betterStore as default };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,6 @@
1
+ import { Rate } from 'shippo';
2
+ export { Rate as ShippingRate } from 'shippo';
3
+
1
4
  type Address = {
2
5
  name: string;
3
6
  company?: string;
@@ -85,6 +88,7 @@ interface LineItem {
85
88
  value: string;
86
89
  }[];
87
90
  discountId?: string;
91
+ metadata?: string;
88
92
  }
89
93
  interface CheckoutCreateParams {
90
94
  type: "hosted" | "embed";
@@ -95,35 +99,13 @@ interface CheckoutUpdateParams {
95
99
  lineItems?: LineItem[];
96
100
  customerId?: string;
97
101
  }
98
- interface ShippingRate {
99
- id: string;
100
- rate: number;
101
- provider: string;
102
- service: string;
103
- estimatedDays: number;
104
- }
102
+
105
103
  interface CheckoutSession {
106
104
  id: string;
107
105
  createdAt: Date;
108
106
  updatedAt: Date;
109
107
  clientSecret: string;
110
- lineItems: {
111
- quantity: number;
112
- discount?: any;
113
- variantOptions: {
114
- name: string;
115
- value: string;
116
- }[];
117
- product?: {
118
- id: string;
119
- title: string;
120
- description?: string;
121
- images: string[];
122
- category: string;
123
- tags: string[];
124
- priceInCents: number;
125
- };
126
- }[];
108
+ lineItems: LineItem[];
127
109
  total?: number;
128
110
  subtotal?: number;
129
111
  tax?: number;
@@ -154,7 +136,7 @@ declare class Checkout {
154
136
  /**
155
137
  * Get shipping rates for a checkout session
156
138
  */
157
- getShippingRates(checkoutId: string): Promise<ShippingRate[]>;
139
+ getShippingRates(checkoutId: string): Promise<Rate[]>;
158
140
  /**
159
141
  * Generate payment secret for a checkout session
160
142
  */
@@ -175,7 +157,7 @@ declare class Client {
175
157
  /**
176
158
  * Get shipping rates for a checkout session
177
159
  */
178
- getCheckoutShippingRates(clientSecret: string, checkoutId: string): Promise<ShippingRate[]>;
160
+ getCheckoutShippingRates(clientSecret: string, checkoutId: string): Promise<Rate[]>;
179
161
  /**
180
162
  * Generate payment secret for a checkout session
181
163
  */
@@ -234,4 +216,4 @@ declare function createStoreClient(config: {
234
216
  proxy?: string;
235
217
  }): Client;
236
218
 
237
- export { type Address, type CheckoutCreateParams, type CheckoutSession, type CheckoutUpdateParams, type Customer$1 as Customer, type CustomerCreateParams, type CustomerUpdateParams, type LineItem, type Product, type ProductOption, ProductStatus, type ProductVariant, type ShippingRate, type VariantOption, createStoreClient, betterStore as default };
219
+ export { type Address, type CheckoutCreateParams, type CheckoutSession, type CheckoutUpdateParams, type Customer$1 as Customer, type CustomerCreateParams, type CustomerUpdateParams, type LineItem, type Product, type ProductOption, ProductStatus, type ProductVariant, type VariantOption, createStoreClient, betterStore as default };