@betterstore/sdk 0.5.6 → 0.5.8
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 +6 -13
- package/dist/index.d.ts +6 -13
- package/dist/index.js +5 -7
- package/dist/index.mjs +5 -7
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -240,15 +240,15 @@ type RetrieveCollectionParams = {
|
|
|
240
240
|
|
|
241
241
|
type Address = {
|
|
242
242
|
name: string;
|
|
243
|
-
|
|
243
|
+
phone: string;
|
|
244
244
|
line1: string;
|
|
245
245
|
line2?: string;
|
|
246
246
|
city: string;
|
|
247
|
-
|
|
247
|
+
province?: string;
|
|
248
|
+
provinceCode?: string;
|
|
248
249
|
country: string;
|
|
249
250
|
countryCode: string;
|
|
250
251
|
zipCode: string;
|
|
251
|
-
phone: string;
|
|
252
252
|
};
|
|
253
253
|
interface CustomerCreateParams {
|
|
254
254
|
firstName?: string;
|
|
@@ -335,14 +335,7 @@ type RetrieveDiscountParams = {
|
|
|
335
335
|
code: string;
|
|
336
336
|
};
|
|
337
337
|
|
|
338
|
-
type
|
|
339
|
-
line1: string;
|
|
340
|
-
line2: string;
|
|
341
|
-
city: string;
|
|
342
|
-
state: string;
|
|
343
|
-
countryCode: string;
|
|
344
|
-
zipCode: string;
|
|
345
|
-
};
|
|
338
|
+
type AutocompleteAddressResult = Pick<Address, "line1" | "line2" | "city" | "province" | "provinceCode" | "country" | "countryCode" | "zipCode">;
|
|
346
339
|
|
|
347
340
|
interface CustomerSession {
|
|
348
341
|
customerId: string;
|
|
@@ -549,7 +542,7 @@ declare class Helpers {
|
|
|
549
542
|
formatCurrency(currency: string): string;
|
|
550
543
|
formatPrice(priceInCents: number, currency: string, exchangeRate?: number | null): string;
|
|
551
544
|
getExchangeRate(baseCurrency: string, targetCurrency: string): Promise<number>;
|
|
552
|
-
getAutocompleteAddressResults(query: string, locale?: string): Promise<
|
|
545
|
+
getAutocompleteAddressResults(query: string, locale?: string): Promise<AutocompleteAddressResult[]>;
|
|
553
546
|
}
|
|
554
547
|
|
|
555
548
|
declare class Products {
|
|
@@ -577,4 +570,4 @@ declare function createStoreHelpers(config?: {
|
|
|
577
570
|
proxy?: string;
|
|
578
571
|
}): Helpers;
|
|
579
572
|
|
|
580
|
-
export { type Address, type
|
|
573
|
+
export { type Address, type AutocompleteAddressResult, type CheckoutCreateParams, type CheckoutSession, type CheckoutUpdateParams, type Collection, type CollectionWithProducts, type Currency, type Customer$1 as Customer, type CustomerCreateParams, type CustomerSession, type CustomerSubscription, type CustomerSubscriptionUpdateParams, type CustomerUpdateParams, type Discount, type LineItem, type LineItemCreate, type ListCollectionsParams, type ListCollectionsQuery, type ListCollectionsSortBy, type ListDiscountsParams, type ListDiscountsQuery, type ListDiscountsSortBy, type ListProductsParams, type ListProductsQuery, type ListProductsSortBy, type OTPLoginParams, type OTPLoginResponse, type OTPSignupParams, type OTPSignupResponse, type OTPVerifyParams, type OTPVerifyResponse, type Product, type ProductBillingInterval, type ProductBillingType, type ProductOption, type ProductStatus, type ProductVariant, type ProductWithoutVariants, type RetrieveCollectionParams, type RetrieveDiscountParams, type RetrieveProductParams, type ShippingRate, type VariantOption, createStoreClient, createStoreHelpers, createBetterStore as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -240,15 +240,15 @@ type RetrieveCollectionParams = {
|
|
|
240
240
|
|
|
241
241
|
type Address = {
|
|
242
242
|
name: string;
|
|
243
|
-
|
|
243
|
+
phone: string;
|
|
244
244
|
line1: string;
|
|
245
245
|
line2?: string;
|
|
246
246
|
city: string;
|
|
247
|
-
|
|
247
|
+
province?: string;
|
|
248
|
+
provinceCode?: string;
|
|
248
249
|
country: string;
|
|
249
250
|
countryCode: string;
|
|
250
251
|
zipCode: string;
|
|
251
|
-
phone: string;
|
|
252
252
|
};
|
|
253
253
|
interface CustomerCreateParams {
|
|
254
254
|
firstName?: string;
|
|
@@ -335,14 +335,7 @@ type RetrieveDiscountParams = {
|
|
|
335
335
|
code: string;
|
|
336
336
|
};
|
|
337
337
|
|
|
338
|
-
type
|
|
339
|
-
line1: string;
|
|
340
|
-
line2: string;
|
|
341
|
-
city: string;
|
|
342
|
-
state: string;
|
|
343
|
-
countryCode: string;
|
|
344
|
-
zipCode: string;
|
|
345
|
-
};
|
|
338
|
+
type AutocompleteAddressResult = Pick<Address, "line1" | "line2" | "city" | "province" | "provinceCode" | "country" | "countryCode" | "zipCode">;
|
|
346
339
|
|
|
347
340
|
interface CustomerSession {
|
|
348
341
|
customerId: string;
|
|
@@ -549,7 +542,7 @@ declare class Helpers {
|
|
|
549
542
|
formatCurrency(currency: string): string;
|
|
550
543
|
formatPrice(priceInCents: number, currency: string, exchangeRate?: number | null): string;
|
|
551
544
|
getExchangeRate(baseCurrency: string, targetCurrency: string): Promise<number>;
|
|
552
|
-
getAutocompleteAddressResults(query: string, locale?: string): Promise<
|
|
545
|
+
getAutocompleteAddressResults(query: string, locale?: string): Promise<AutocompleteAddressResult[]>;
|
|
553
546
|
}
|
|
554
547
|
|
|
555
548
|
declare class Products {
|
|
@@ -577,4 +570,4 @@ declare function createStoreHelpers(config?: {
|
|
|
577
570
|
proxy?: string;
|
|
578
571
|
}): Helpers;
|
|
579
572
|
|
|
580
|
-
export { type Address, type
|
|
573
|
+
export { type Address, type AutocompleteAddressResult, type CheckoutCreateParams, type CheckoutSession, type CheckoutUpdateParams, type Collection, type CollectionWithProducts, type Currency, type Customer$1 as Customer, type CustomerCreateParams, type CustomerSession, type CustomerSubscription, type CustomerSubscriptionUpdateParams, type CustomerUpdateParams, type Discount, type LineItem, type LineItemCreate, type ListCollectionsParams, type ListCollectionsQuery, type ListCollectionsSortBy, type ListDiscountsParams, type ListDiscountsQuery, type ListDiscountsSortBy, type ListProductsParams, type ListProductsQuery, type ListProductsSortBy, type OTPLoginParams, type OTPLoginResponse, type OTPSignupParams, type OTPSignupResponse, type OTPVerifyParams, type OTPVerifyResponse, type Product, type ProductBillingInterval, type ProductBillingType, type ProductOption, type ProductStatus, type ProductVariant, type ProductWithoutVariants, type RetrieveCollectionParams, type RetrieveDiscountParams, type RetrieveProductParams, type ShippingRate, type VariantOption, createStoreClient, createStoreHelpers, createBetterStore as default };
|
package/dist/index.js
CHANGED
|
@@ -656,14 +656,12 @@ var Helpers = class {
|
|
|
656
656
|
}
|
|
657
657
|
async getAutocompleteAddressResults(query, locale) {
|
|
658
658
|
const apiClient = createApiClient("", this.proxy);
|
|
659
|
-
const { data } = await apiClient.get(
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
locale
|
|
664
|
-
}
|
|
659
|
+
const { data } = await apiClient.get("/helpers/autocomplete-address", {
|
|
660
|
+
params: {
|
|
661
|
+
locale,
|
|
662
|
+
query
|
|
665
663
|
}
|
|
666
|
-
);
|
|
664
|
+
});
|
|
667
665
|
return data;
|
|
668
666
|
}
|
|
669
667
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -618,14 +618,12 @@ var Helpers = class {
|
|
|
618
618
|
}
|
|
619
619
|
async getAutocompleteAddressResults(query, locale) {
|
|
620
620
|
const apiClient = createApiClient("", this.proxy);
|
|
621
|
-
const { data } = await apiClient.get(
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
locale
|
|
626
|
-
}
|
|
621
|
+
const { data } = await apiClient.get("/helpers/autocomplete-address", {
|
|
622
|
+
params: {
|
|
623
|
+
locale,
|
|
624
|
+
query
|
|
627
625
|
}
|
|
628
|
-
);
|
|
626
|
+
});
|
|
629
627
|
return data;
|
|
630
628
|
}
|
|
631
629
|
};
|