@betterstore/sdk 0.3.72 → 0.3.74
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 +12 -0
- package/dist/index.d.mts +12 -5
- package/dist/index.d.ts +12 -5
- package/dist/index.js +8 -2
- package/dist/index.mjs +8 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -66,12 +66,12 @@ type ListProductsQuery = {
|
|
|
66
66
|
} | {
|
|
67
67
|
collectionSeoHandle: string;
|
|
68
68
|
};
|
|
69
|
-
type
|
|
69
|
+
type ListProductsSortBy = "createdAt" | "updatedAt" | "title";
|
|
70
70
|
type SortOrder = "asc" | "desc";
|
|
71
71
|
type ListProductsParams = {
|
|
72
|
-
sortBy?:
|
|
72
|
+
sortBy?: ListProductsSortBy;
|
|
73
73
|
sortOrder?: SortOrder;
|
|
74
|
-
query?:
|
|
74
|
+
query?: ListProductsQuery;
|
|
75
75
|
};
|
|
76
76
|
type RetrieveProductParams = {
|
|
77
77
|
seoHandle: string;
|
|
@@ -91,6 +91,13 @@ interface Collection {
|
|
|
91
91
|
interface CollectionWithProducts extends Collection {
|
|
92
92
|
products: ProductWithoutVariants[];
|
|
93
93
|
}
|
|
94
|
+
type ListCollectionsQuery = undefined;
|
|
95
|
+
type ListCollectionsSortBy = "createdAt" | "updatedAt" | "title";
|
|
96
|
+
type ListCollectionsParams = {
|
|
97
|
+
sortBy?: ListCollectionsSortBy;
|
|
98
|
+
sortOrder?: SortOrder;
|
|
99
|
+
query?: string;
|
|
100
|
+
};
|
|
94
101
|
type RetrieveCollectionParams = {
|
|
95
102
|
seoHandle: string;
|
|
96
103
|
} | {
|
|
@@ -358,7 +365,7 @@ declare class Client {
|
|
|
358
365
|
declare class Collections {
|
|
359
366
|
private apiClient;
|
|
360
367
|
constructor(apiKey: string, proxy?: string);
|
|
361
|
-
list(): Promise<Collection[]>;
|
|
368
|
+
list(params?: ListCollectionsParams): Promise<Collection[]>;
|
|
362
369
|
retrieve(params: RetrieveCollectionParams): Promise<CollectionWithProducts | null>;
|
|
363
370
|
}
|
|
364
371
|
|
|
@@ -426,4 +433,4 @@ declare function createStoreHelpers(config?: {
|
|
|
426
433
|
proxy?: string;
|
|
427
434
|
}): Helpers;
|
|
428
435
|
|
|
429
|
-
export { type Address, type CheckoutCreateParams, type CheckoutSession, type CheckoutUpdateParams, type Collection, type CollectionWithProducts, type Currency, type Customer$1 as Customer, type CustomerCreateParams, type CustomerSubscription, type CustomerSubscriptionUpdateParams, type CustomerUpdateParams, type Discount, type LineItem, type LineItemCreate, type ListProductsParams, type ListProductsQuery, type Product, type ProductBillingInterval, type ProductBillingType, type ProductOption, type ProductStatus, type ProductVariant, type ProductWithoutVariants, type RetrieveCollectionParams, type RetrieveDiscountParams, type RetrieveProductParams, type ShippingRate, type
|
|
436
|
+
export { type Address, type CheckoutCreateParams, type CheckoutSession, type CheckoutUpdateParams, type Collection, type CollectionWithProducts, type Currency, type Customer$1 as Customer, type CustomerCreateParams, type CustomerSubscription, type CustomerSubscriptionUpdateParams, type CustomerUpdateParams, type Discount, type LineItem, type LineItemCreate, type ListCollectionsParams, type ListCollectionsQuery, type ListCollectionsSortBy, type ListProductsParams, type ListProductsQuery, type ListProductsSortBy, type Product, type ProductBillingInterval, type ProductBillingType, type ProductOption, type ProductStatus, type ProductVariant, type ProductWithoutVariants, type RetrieveCollectionParams, type RetrieveDiscountParams, type RetrieveProductParams, type ShippingRate, type SortOrder, type VariantOption, createStoreClient, createStoreHelpers, createBetterStore as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -66,12 +66,12 @@ type ListProductsQuery = {
|
|
|
66
66
|
} | {
|
|
67
67
|
collectionSeoHandle: string;
|
|
68
68
|
};
|
|
69
|
-
type
|
|
69
|
+
type ListProductsSortBy = "createdAt" | "updatedAt" | "title";
|
|
70
70
|
type SortOrder = "asc" | "desc";
|
|
71
71
|
type ListProductsParams = {
|
|
72
|
-
sortBy?:
|
|
72
|
+
sortBy?: ListProductsSortBy;
|
|
73
73
|
sortOrder?: SortOrder;
|
|
74
|
-
query?:
|
|
74
|
+
query?: ListProductsQuery;
|
|
75
75
|
};
|
|
76
76
|
type RetrieveProductParams = {
|
|
77
77
|
seoHandle: string;
|
|
@@ -91,6 +91,13 @@ interface Collection {
|
|
|
91
91
|
interface CollectionWithProducts extends Collection {
|
|
92
92
|
products: ProductWithoutVariants[];
|
|
93
93
|
}
|
|
94
|
+
type ListCollectionsQuery = undefined;
|
|
95
|
+
type ListCollectionsSortBy = "createdAt" | "updatedAt" | "title";
|
|
96
|
+
type ListCollectionsParams = {
|
|
97
|
+
sortBy?: ListCollectionsSortBy;
|
|
98
|
+
sortOrder?: SortOrder;
|
|
99
|
+
query?: string;
|
|
100
|
+
};
|
|
94
101
|
type RetrieveCollectionParams = {
|
|
95
102
|
seoHandle: string;
|
|
96
103
|
} | {
|
|
@@ -358,7 +365,7 @@ declare class Client {
|
|
|
358
365
|
declare class Collections {
|
|
359
366
|
private apiClient;
|
|
360
367
|
constructor(apiKey: string, proxy?: string);
|
|
361
|
-
list(): Promise<Collection[]>;
|
|
368
|
+
list(params?: ListCollectionsParams): Promise<Collection[]>;
|
|
362
369
|
retrieve(params: RetrieveCollectionParams): Promise<CollectionWithProducts | null>;
|
|
363
370
|
}
|
|
364
371
|
|
|
@@ -426,4 +433,4 @@ declare function createStoreHelpers(config?: {
|
|
|
426
433
|
proxy?: string;
|
|
427
434
|
}): Helpers;
|
|
428
435
|
|
|
429
|
-
export { type Address, type CheckoutCreateParams, type CheckoutSession, type CheckoutUpdateParams, type Collection, type CollectionWithProducts, type Currency, type Customer$1 as Customer, type CustomerCreateParams, type CustomerSubscription, type CustomerSubscriptionUpdateParams, type CustomerUpdateParams, type Discount, type LineItem, type LineItemCreate, type ListProductsParams, type ListProductsQuery, type Product, type ProductBillingInterval, type ProductBillingType, type ProductOption, type ProductStatus, type ProductVariant, type ProductWithoutVariants, type RetrieveCollectionParams, type RetrieveDiscountParams, type RetrieveProductParams, type ShippingRate, type
|
|
436
|
+
export { type Address, type CheckoutCreateParams, type CheckoutSession, type CheckoutUpdateParams, type Collection, type CollectionWithProducts, type Currency, type Customer$1 as Customer, type CustomerCreateParams, type CustomerSubscription, type CustomerSubscriptionUpdateParams, type CustomerUpdateParams, type Discount, type LineItem, type LineItemCreate, type ListCollectionsParams, type ListCollectionsQuery, type ListCollectionsSortBy, type ListProductsParams, type ListProductsQuery, type ListProductsSortBy, type Product, type ProductBillingInterval, type ProductBillingType, type ProductOption, type ProductStatus, type ProductVariant, type ProductWithoutVariants, type RetrieveCollectionParams, type RetrieveDiscountParams, type RetrieveProductParams, type ShippingRate, type SortOrder, type VariantOption, createStoreClient, createStoreHelpers, createBetterStore as default };
|
package/dist/index.js
CHANGED
|
@@ -339,9 +339,15 @@ var Collections = class {
|
|
|
339
339
|
constructor(apiKey, proxy) {
|
|
340
340
|
this.apiClient = createApiClient(apiKey, proxy);
|
|
341
341
|
}
|
|
342
|
-
list() {
|
|
342
|
+
list(params) {
|
|
343
343
|
return __async(this, null, function* () {
|
|
344
|
-
const
|
|
344
|
+
const queryParams = new URLSearchParams();
|
|
345
|
+
if (params) {
|
|
346
|
+
queryParams.set("params", JSON.stringify(params));
|
|
347
|
+
}
|
|
348
|
+
const data = yield this.apiClient.get(
|
|
349
|
+
`/collections?${queryParams.toString()}`
|
|
350
|
+
);
|
|
345
351
|
return data;
|
|
346
352
|
});
|
|
347
353
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -302,9 +302,15 @@ var Collections = class {
|
|
|
302
302
|
constructor(apiKey, proxy) {
|
|
303
303
|
this.apiClient = createApiClient(apiKey, proxy);
|
|
304
304
|
}
|
|
305
|
-
list() {
|
|
305
|
+
list(params) {
|
|
306
306
|
return __async(this, null, function* () {
|
|
307
|
-
const
|
|
307
|
+
const queryParams = new URLSearchParams();
|
|
308
|
+
if (params) {
|
|
309
|
+
queryParams.set("params", JSON.stringify(params));
|
|
310
|
+
}
|
|
311
|
+
const data = yield this.apiClient.get(
|
|
312
|
+
`/collections?${queryParams.toString()}`
|
|
313
|
+
);
|
|
308
314
|
return data;
|
|
309
315
|
});
|
|
310
316
|
}
|