@betterstore/sdk 0.3.47 → 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,17 @@
1
1
  # @betterstore/sdk
2
2
 
3
+ ## 0.3.49
4
+
5
+ ### Patch Changes
6
+
7
+ - collection utility functions
8
+
9
+ ## 0.3.48
10
+
11
+ ### Patch Changes
12
+
13
+ - collections and vendor addded
14
+
3
15
  ## 0.3.47
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -86,12 +86,25 @@ interface Product {
86
86
  seoPageTitle?: string;
87
87
  seoDescription?: string;
88
88
  seoHandle?: string;
89
+ vendor?: string;
89
90
  status: ProductStatus;
90
91
  options: ProductOption[];
91
92
  productVariants: ProductVariant[];
92
93
  }
93
94
  interface ProductWithoutVariants extends Omit<Product, "productVariants"> {
94
95
  }
96
+ interface Collection {
97
+ id: string;
98
+ title: string;
99
+ description?: string;
100
+ images: string[];
101
+ seoPageTitle?: string;
102
+ seoDescription?: string;
103
+ seoHandle?: string;
104
+ }
105
+ interface CollectionWithProducts extends Collection {
106
+ products: ProductWithoutVariants[];
107
+ }
95
108
 
96
109
  type ShippingRate = ZasilkovnaRate;
97
110
  interface BaseRate {
@@ -104,7 +117,7 @@ interface ZasilkovnaRate extends BaseRate {
104
117
  clientSecret: string;
105
118
  }
106
119
 
107
- type ProductData = Pick<Product, "title" | "description" | "images" | "category" | "tags" | "sku" | "barcode" | "isPhysical" | "weightInGrams" | "heightInCm" | "widthInCm" | "lengthInCm" | "priceInCents"> & {
120
+ type ProductData = Pick<Product, "title" | "description" | "images" | "category" | "tags" | "sku" | "barcode" | "vendor" | "isPhysical" | "weightInGrams" | "heightInCm" | "widthInCm" | "lengthInCm" | "priceInCents"> & {
108
121
  selectedVariant: Pick<ProductVariant, "title" | "sku" | "barcode" | "images" | "isPhysical" | "weightInGrams" | "heightInCm" | "widthInCm" | "lengthInCm" | "priceInCents" | "variantOptions">;
109
122
  };
110
123
  interface LineItem {
@@ -261,6 +274,9 @@ declare class Products {
261
274
  constructor(apiKey: string, proxy?: string);
262
275
  list(): Promise<ProductWithoutVariants[]>;
263
276
  retrieve(productId: string): Promise<Product | null>;
277
+ listCollections(): Promise<Collection[]>;
278
+ retrieveCollectionBySeoHandle(collectionSeoHandle: string): Promise<CollectionWithProducts>;
279
+ retrieveCollectionById(collectionId: string): Promise<CollectionWithProducts>;
264
280
  }
265
281
 
266
282
  declare function createBetterStore(config: {
@@ -278,4 +294,4 @@ declare function createStoreHelpers(config?: {
278
294
  proxy?: string;
279
295
  }): Helpers;
280
296
 
281
- export { type Address, type CheckoutCreateParams, type CheckoutSession, type CheckoutUpdateParams, 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
@@ -86,12 +86,25 @@ interface Product {
86
86
  seoPageTitle?: string;
87
87
  seoDescription?: string;
88
88
  seoHandle?: string;
89
+ vendor?: string;
89
90
  status: ProductStatus;
90
91
  options: ProductOption[];
91
92
  productVariants: ProductVariant[];
92
93
  }
93
94
  interface ProductWithoutVariants extends Omit<Product, "productVariants"> {
94
95
  }
96
+ interface Collection {
97
+ id: string;
98
+ title: string;
99
+ description?: string;
100
+ images: string[];
101
+ seoPageTitle?: string;
102
+ seoDescription?: string;
103
+ seoHandle?: string;
104
+ }
105
+ interface CollectionWithProducts extends Collection {
106
+ products: ProductWithoutVariants[];
107
+ }
95
108
 
96
109
  type ShippingRate = ZasilkovnaRate;
97
110
  interface BaseRate {
@@ -104,7 +117,7 @@ interface ZasilkovnaRate extends BaseRate {
104
117
  clientSecret: string;
105
118
  }
106
119
 
107
- type ProductData = Pick<Product, "title" | "description" | "images" | "category" | "tags" | "sku" | "barcode" | "isPhysical" | "weightInGrams" | "heightInCm" | "widthInCm" | "lengthInCm" | "priceInCents"> & {
120
+ type ProductData = Pick<Product, "title" | "description" | "images" | "category" | "tags" | "sku" | "barcode" | "vendor" | "isPhysical" | "weightInGrams" | "heightInCm" | "widthInCm" | "lengthInCm" | "priceInCents"> & {
108
121
  selectedVariant: Pick<ProductVariant, "title" | "sku" | "barcode" | "images" | "isPhysical" | "weightInGrams" | "heightInCm" | "widthInCm" | "lengthInCm" | "priceInCents" | "variantOptions">;
109
122
  };
110
123
  interface LineItem {
@@ -261,6 +274,9 @@ declare class Products {
261
274
  constructor(apiKey: string, proxy?: string);
262
275
  list(): Promise<ProductWithoutVariants[]>;
263
276
  retrieve(productId: string): Promise<Product | null>;
277
+ listCollections(): Promise<Collection[]>;
278
+ retrieveCollectionBySeoHandle(collectionSeoHandle: string): Promise<CollectionWithProducts>;
279
+ retrieveCollectionById(collectionId: string): Promise<CollectionWithProducts>;
264
280
  }
265
281
 
266
282
  declare function createBetterStore(config: {
@@ -278,4 +294,4 @@ declare function createStoreHelpers(config?: {
278
294
  proxy?: string;
279
295
  }): Helpers;
280
296
 
281
- export { type Address, type CheckoutCreateParams, type CheckoutSession, type CheckoutUpdateParams, 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
@@ -463,6 +463,28 @@ var Products = class {
463
463
  return data;
464
464
  });
465
465
  }
466
+ listCollections() {
467
+ return __async(this, null, function* () {
468
+ const data = yield this.apiClient.get("/collections");
469
+ return data;
470
+ });
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
+ }
466
488
  };
467
489
  var products_default = Products;
468
490
 
package/dist/index.mjs CHANGED
@@ -427,6 +427,28 @@ var Products = class {
427
427
  return data;
428
428
  });
429
429
  }
430
+ listCollections() {
431
+ return __async(this, null, function* () {
432
+ const data = yield this.apiClient.get("/collections");
433
+ return data;
434
+ });
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
+ }
430
452
  };
431
453
  var products_default = Products;
432
454
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betterstore/sdk",
3
- "version": "0.3.47",
3
+ "version": "0.3.49",
4
4
  "description": "E-commerce for Developers",
5
5
  "private": false,
6
6
  "publishConfig": {