@betterstore/sdk 0.5.15 → 0.5.17
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 +13 -2
- package/dist/index.d.ts +13 -2
- package/dist/index.js +9 -2
- package/dist/index.mjs +9 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -93,12 +93,19 @@ interface CheckoutSession {
|
|
|
93
93
|
type AutosuggestAddressResult = {
|
|
94
94
|
id: string;
|
|
95
95
|
title: string;
|
|
96
|
-
address:
|
|
96
|
+
address: {
|
|
97
|
+
label: string;
|
|
98
|
+
};
|
|
97
99
|
position: {
|
|
98
100
|
lat: number;
|
|
99
101
|
lng: number;
|
|
100
102
|
};
|
|
101
103
|
};
|
|
104
|
+
type LookupAddressResult = {
|
|
105
|
+
id: string;
|
|
106
|
+
title: string;
|
|
107
|
+
address: Pick<Address, "line1" | "city" | "province" | "provinceCode" | "country" | "countryCode" | "zipCode">;
|
|
108
|
+
};
|
|
102
109
|
|
|
103
110
|
type SortOrder = "asc" | "desc";
|
|
104
111
|
type GetListParams<A, B> = {
|
|
@@ -517,6 +524,10 @@ declare class Client {
|
|
|
517
524
|
longitude?: string;
|
|
518
525
|
countryCode?: string;
|
|
519
526
|
}): Promise<AutosuggestAddressResult[]>;
|
|
527
|
+
lookupAddress(clientSecret: string, params: {
|
|
528
|
+
id: string;
|
|
529
|
+
locale?: string;
|
|
530
|
+
}): Promise<LookupAddressResult>;
|
|
520
531
|
}
|
|
521
532
|
|
|
522
533
|
declare class Collections {
|
|
@@ -590,4 +601,4 @@ declare function createStoreHelpers(config?: {
|
|
|
590
601
|
proxy?: string;
|
|
591
602
|
}): Helpers;
|
|
592
603
|
|
|
593
|
-
export { type Address, type AutosuggestAddressResult, 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 };
|
|
604
|
+
export { type Address, type AutosuggestAddressResult, 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 LookupAddressResult, 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
|
@@ -93,12 +93,19 @@ interface CheckoutSession {
|
|
|
93
93
|
type AutosuggestAddressResult = {
|
|
94
94
|
id: string;
|
|
95
95
|
title: string;
|
|
96
|
-
address:
|
|
96
|
+
address: {
|
|
97
|
+
label: string;
|
|
98
|
+
};
|
|
97
99
|
position: {
|
|
98
100
|
lat: number;
|
|
99
101
|
lng: number;
|
|
100
102
|
};
|
|
101
103
|
};
|
|
104
|
+
type LookupAddressResult = {
|
|
105
|
+
id: string;
|
|
106
|
+
title: string;
|
|
107
|
+
address: Pick<Address, "line1" | "city" | "province" | "provinceCode" | "country" | "countryCode" | "zipCode">;
|
|
108
|
+
};
|
|
102
109
|
|
|
103
110
|
type SortOrder = "asc" | "desc";
|
|
104
111
|
type GetListParams<A, B> = {
|
|
@@ -517,6 +524,10 @@ declare class Client {
|
|
|
517
524
|
longitude?: string;
|
|
518
525
|
countryCode?: string;
|
|
519
526
|
}): Promise<AutosuggestAddressResult[]>;
|
|
527
|
+
lookupAddress(clientSecret: string, params: {
|
|
528
|
+
id: string;
|
|
529
|
+
locale?: string;
|
|
530
|
+
}): Promise<LookupAddressResult>;
|
|
520
531
|
}
|
|
521
532
|
|
|
522
533
|
declare class Collections {
|
|
@@ -590,4 +601,4 @@ declare function createStoreHelpers(config?: {
|
|
|
590
601
|
proxy?: string;
|
|
591
602
|
}): Helpers;
|
|
592
603
|
|
|
593
|
-
export { type Address, type AutosuggestAddressResult, 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 };
|
|
604
|
+
export { type Address, type AutosuggestAddressResult, 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 LookupAddressResult, 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
|
@@ -38,7 +38,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
38
38
|
|
|
39
39
|
// src/utils/axios.ts
|
|
40
40
|
var import_axios = __toESM(require("axios"));
|
|
41
|
-
var API_BASE_URL = "https://
|
|
41
|
+
var API_BASE_URL = "https://v1.betterstore.io";
|
|
42
42
|
var createApiClient = (apiKey, proxy) => {
|
|
43
43
|
const client = import_axios.default.create({
|
|
44
44
|
baseURL: proxy ?? API_BASE_URL,
|
|
@@ -415,7 +415,14 @@ var Client = class {
|
|
|
415
415
|
*/
|
|
416
416
|
async getAutosuggestAddressResults(clientSecret, params) {
|
|
417
417
|
const apiClient = createApiClient(clientSecret, this.proxy);
|
|
418
|
-
const { data } = await apiClient.get("/helpers/autosuggest
|
|
418
|
+
const { data } = await apiClient.get("/helpers/address/autosuggest", {
|
|
419
|
+
params
|
|
420
|
+
});
|
|
421
|
+
return data;
|
|
422
|
+
}
|
|
423
|
+
async lookupAddress(clientSecret, params) {
|
|
424
|
+
const apiClient = createApiClient(clientSecret, this.proxy);
|
|
425
|
+
const { data } = await apiClient.get("/helpers/address/lookup", {
|
|
419
426
|
params
|
|
420
427
|
});
|
|
421
428
|
return data;
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/utils/axios.ts
|
|
2
2
|
import axios from "axios";
|
|
3
|
-
var API_BASE_URL = "https://
|
|
3
|
+
var API_BASE_URL = "https://v1.betterstore.io";
|
|
4
4
|
var createApiClient = (apiKey, proxy) => {
|
|
5
5
|
const client = axios.create({
|
|
6
6
|
baseURL: proxy ?? API_BASE_URL,
|
|
@@ -377,7 +377,14 @@ var Client = class {
|
|
|
377
377
|
*/
|
|
378
378
|
async getAutosuggestAddressResults(clientSecret, params) {
|
|
379
379
|
const apiClient = createApiClient(clientSecret, this.proxy);
|
|
380
|
-
const { data } = await apiClient.get("/helpers/autosuggest
|
|
380
|
+
const { data } = await apiClient.get("/helpers/address/autosuggest", {
|
|
381
|
+
params
|
|
382
|
+
});
|
|
383
|
+
return data;
|
|
384
|
+
}
|
|
385
|
+
async lookupAddress(clientSecret, params) {
|
|
386
|
+
const apiClient = createApiClient(clientSecret, this.proxy);
|
|
387
|
+
const { data } = await apiClient.get("/helpers/address/lookup", {
|
|
381
388
|
params
|
|
382
389
|
});
|
|
383
390
|
return data;
|