@betterstore/sdk 0.3.48 → 0.3.49

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,11 @@
1
1
  # @betterstore/sdk
2
2
 
3
+ ## 0.3.49
4
+
5
+ ### Patch Changes
6
+
7
+ - collection utility functions
8
+
3
9
  ## 0.3.48
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -102,6 +102,9 @@ interface Collection {
102
102
  seoDescription?: string;
103
103
  seoHandle?: string;
104
104
  }
105
+ interface CollectionWithProducts extends Collection {
106
+ products: ProductWithoutVariants[];
107
+ }
105
108
 
106
109
  type ShippingRate = ZasilkovnaRate;
107
110
  interface BaseRate {
@@ -272,6 +275,8 @@ declare class Products {
272
275
  list(): Promise<ProductWithoutVariants[]>;
273
276
  retrieve(productId: string): Promise<Product | null>;
274
277
  listCollections(): Promise<Collection[]>;
278
+ retrieveCollectionBySeoHandle(collectionSeoHandle: string): Promise<CollectionWithProducts>;
279
+ retrieveCollectionById(collectionId: string): Promise<CollectionWithProducts>;
275
280
  }
276
281
 
277
282
  declare function createBetterStore(config: {
@@ -289,4 +294,4 @@ declare function createStoreHelpers(config?: {
289
294
  proxy?: string;
290
295
  }): Helpers;
291
296
 
292
- export { type Address, type CheckoutCreateParams, type CheckoutSession, type CheckoutUpdateParams, type Collection, type Currency, type Customer$1 as Customer, type CustomerCreateParams, type CustomerUpdateParams, type LineItem, type LineItemCreate, type Product, type ProductOption, ProductStatus, type ProductVariant, type ProductWithoutVariants, type ShippingRate, type VariantOption, createStoreClient, createStoreHelpers, createBetterStore as default };
297
+ export { type Address, type CheckoutCreateParams, type CheckoutSession, type CheckoutUpdateParams, type Collection, type CollectionWithProducts, type Currency, type Customer$1 as Customer, type CustomerCreateParams, type CustomerUpdateParams, type LineItem, type LineItemCreate, type Product, type ProductOption, ProductStatus, type ProductVariant, type ProductWithoutVariants, type ShippingRate, type VariantOption, createStoreClient, createStoreHelpers, createBetterStore as default };
package/dist/index.d.ts CHANGED
@@ -102,6 +102,9 @@ interface Collection {
102
102
  seoDescription?: string;
103
103
  seoHandle?: string;
104
104
  }
105
+ interface CollectionWithProducts extends Collection {
106
+ products: ProductWithoutVariants[];
107
+ }
105
108
 
106
109
  type ShippingRate = ZasilkovnaRate;
107
110
  interface BaseRate {
@@ -272,6 +275,8 @@ declare class Products {
272
275
  list(): Promise<ProductWithoutVariants[]>;
273
276
  retrieve(productId: string): Promise<Product | null>;
274
277
  listCollections(): Promise<Collection[]>;
278
+ retrieveCollectionBySeoHandle(collectionSeoHandle: string): Promise<CollectionWithProducts>;
279
+ retrieveCollectionById(collectionId: string): Promise<CollectionWithProducts>;
275
280
  }
276
281
 
277
282
  declare function createBetterStore(config: {
@@ -289,4 +294,4 @@ declare function createStoreHelpers(config?: {
289
294
  proxy?: string;
290
295
  }): Helpers;
291
296
 
292
- export { type Address, type CheckoutCreateParams, type CheckoutSession, type CheckoutUpdateParams, type Collection, type Currency, type Customer$1 as Customer, type CustomerCreateParams, type CustomerUpdateParams, type LineItem, type LineItemCreate, type Product, type ProductOption, ProductStatus, type ProductVariant, type ProductWithoutVariants, type ShippingRate, type VariantOption, createStoreClient, createStoreHelpers, createBetterStore as default };
297
+ export { type Address, type CheckoutCreateParams, type CheckoutSession, type CheckoutUpdateParams, type Collection, type CollectionWithProducts, type Currency, type Customer$1 as Customer, type CustomerCreateParams, type CustomerUpdateParams, type LineItem, type LineItemCreate, type Product, type ProductOption, ProductStatus, type ProductVariant, type ProductWithoutVariants, type ShippingRate, type VariantOption, createStoreClient, createStoreHelpers, createBetterStore as default };
package/dist/index.js CHANGED
@@ -469,6 +469,22 @@ var Products = class {
469
469
  return data;
470
470
  });
471
471
  }
472
+ retrieveCollectionBySeoHandle(collectionSeoHandle) {
473
+ return __async(this, null, function* () {
474
+ const data = yield this.apiClient.get(
475
+ `/collections/${collectionSeoHandle}`
476
+ );
477
+ return data;
478
+ });
479
+ }
480
+ retrieveCollectionById(collectionId) {
481
+ return __async(this, null, function* () {
482
+ const data = yield this.apiClient.get(
483
+ `/collections/id/${collectionId}`
484
+ );
485
+ return data;
486
+ });
487
+ }
472
488
  };
473
489
  var products_default = Products;
474
490
 
package/dist/index.mjs CHANGED
@@ -433,6 +433,22 @@ var Products = class {
433
433
  return data;
434
434
  });
435
435
  }
436
+ retrieveCollectionBySeoHandle(collectionSeoHandle) {
437
+ return __async(this, null, function* () {
438
+ const data = yield this.apiClient.get(
439
+ `/collections/${collectionSeoHandle}`
440
+ );
441
+ return data;
442
+ });
443
+ }
444
+ retrieveCollectionById(collectionId) {
445
+ return __async(this, null, function* () {
446
+ const data = yield this.apiClient.get(
447
+ `/collections/id/${collectionId}`
448
+ );
449
+ return data;
450
+ });
451
+ }
436
452
  };
437
453
  var products_default = Products;
438
454
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betterstore/sdk",
3
- "version": "0.3.48",
3
+ "version": "0.3.49",
4
4
  "description": "E-commerce for Developers",
5
5
  "private": false,
6
6
  "publishConfig": {