@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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @betterstore/sdk
2
2
 
3
+ ## 0.3.74
4
+
5
+ ### Patch Changes
6
+
7
+ - bug fixes
8
+
9
+ ## 0.3.73
10
+
11
+ ### Patch Changes
12
+
13
+ - bug fixes
14
+
3
15
  ## 0.3.72
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -66,12 +66,12 @@ type ListProductsQuery = {
66
66
  } | {
67
67
  collectionSeoHandle: string;
68
68
  };
69
- type SortBy = "createdAt" | "updatedAt";
69
+ type ListProductsSortBy = "createdAt" | "updatedAt" | "title";
70
70
  type SortOrder = "asc" | "desc";
71
71
  type ListProductsParams = {
72
- sortBy?: SortBy;
72
+ sortBy?: ListProductsSortBy;
73
73
  sortOrder?: SortOrder;
74
- query?: string;
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 SortBy, type SortOrder, type VariantOption, createStoreClient, createStoreHelpers, createBetterStore as default };
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 SortBy = "createdAt" | "updatedAt";
69
+ type ListProductsSortBy = "createdAt" | "updatedAt" | "title";
70
70
  type SortOrder = "asc" | "desc";
71
71
  type ListProductsParams = {
72
- sortBy?: SortBy;
72
+ sortBy?: ListProductsSortBy;
73
73
  sortOrder?: SortOrder;
74
- query?: string;
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 SortBy, type SortOrder, type VariantOption, createStoreClient, createStoreHelpers, createBetterStore as default };
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 data = yield this.apiClient.get("/collections");
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 data = yield this.apiClient.get("/collections");
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betterstore/sdk",
3
- "version": "0.3.72",
3
+ "version": "0.3.74",
4
4
  "description": "E-commerce for Developers",
5
5
  "private": false,
6
6
  "publishConfig": {