@betterstore/sdk 0.5.2 → 0.5.4

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
@@ -335,6 +335,15 @@ type RetrieveDiscountParams = {
335
335
  code: string;
336
336
  };
337
337
 
338
+ type AutocompleteResult = {
339
+ line1: string;
340
+ line2: string;
341
+ city: string;
342
+ state: string;
343
+ countryCode: string;
344
+ zipCode: string;
345
+ };
346
+
338
347
  interface CustomerSession {
339
348
  customerId: string;
340
349
  expiresAt: Date;
@@ -540,6 +549,7 @@ declare class Helpers {
540
549
  formatCurrency(currency: string): string;
541
550
  formatPrice(priceInCents: number, currency: string, exchangeRate?: number | null): string;
542
551
  getExchangeRate(baseCurrency: string, targetCurrency: string): Promise<number>;
552
+ getAutocompleteAddressResults(query: string, locale?: string): Promise<AutocompleteResult[]>;
543
553
  }
544
554
 
545
555
  declare class Products {
@@ -567,4 +577,4 @@ declare function createStoreHelpers(config?: {
567
577
  proxy?: string;
568
578
  }): Helpers;
569
579
 
570
- export { type Address, 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 };
580
+ export { type Address, type AutocompleteResult, 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
@@ -335,6 +335,15 @@ type RetrieveDiscountParams = {
335
335
  code: string;
336
336
  };
337
337
 
338
+ type AutocompleteResult = {
339
+ line1: string;
340
+ line2: string;
341
+ city: string;
342
+ state: string;
343
+ countryCode: string;
344
+ zipCode: string;
345
+ };
346
+
338
347
  interface CustomerSession {
339
348
  customerId: string;
340
349
  expiresAt: Date;
@@ -540,6 +549,7 @@ declare class Helpers {
540
549
  formatCurrency(currency: string): string;
541
550
  formatPrice(priceInCents: number, currency: string, exchangeRate?: number | null): string;
542
551
  getExchangeRate(baseCurrency: string, targetCurrency: string): Promise<number>;
552
+ getAutocompleteAddressResults(query: string, locale?: string): Promise<AutocompleteResult[]>;
543
553
  }
544
554
 
545
555
  declare class Products {
@@ -567,4 +577,4 @@ declare function createStoreHelpers(config?: {
567
577
  proxy?: string;
568
578
  }): Helpers;
569
579
 
570
- export { type Address, 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 };
580
+ export { type Address, type AutocompleteResult, 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
@@ -654,6 +654,18 @@ var Helpers = class {
654
654
  }
655
655
  return rate;
656
656
  }
657
+ async getAutocompleteAddressResults(query, locale) {
658
+ const apiClient = createApiClient("", this.proxy);
659
+ const { data } = await apiClient.get(
660
+ `/helpers/autocomplete-address/${query}`,
661
+ {
662
+ params: {
663
+ locale
664
+ }
665
+ }
666
+ );
667
+ return data;
668
+ }
657
669
  };
658
670
  var helpers_default = Helpers;
659
671
 
package/dist/index.mjs CHANGED
@@ -616,6 +616,18 @@ var Helpers = class {
616
616
  }
617
617
  return rate;
618
618
  }
619
+ async getAutocompleteAddressResults(query, locale) {
620
+ const apiClient = createApiClient("", this.proxy);
621
+ const { data } = await apiClient.get(
622
+ `/helpers/autocomplete-address/${query}`,
623
+ {
624
+ params: {
625
+ locale
626
+ }
627
+ }
628
+ );
629
+ return data;
630
+ }
619
631
  };
620
632
  var helpers_default = Helpers;
621
633
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betterstore/sdk",
3
- "version": "0.5.2",
3
+ "version": "0.5.4",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",