@teez-sdk/teez-b2c-api 1.0.0 → 1.0.1

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/README.md CHANGED
@@ -1,7 +1,5 @@
1
1
  # @teez-sdk/teez-b2c-api
2
2
 
3
- [← Back to root](../../README.md)
4
-
5
3
  A typed TypeScript client for the Teez B2C API.
6
4
 
7
5
  ## Features
package/dist/index.cjs CHANGED
@@ -74,14 +74,22 @@ const BannersApiListResponseSchema = zod_mini.array(BannersApiBannerItemSchema);
74
74
  * API for retrieving promotional and informational banners.
75
75
  */
76
76
  var BannersApi = class {
77
+ /**
78
+ * Initializes a new instance of the BannersApi.
79
+ *
80
+ * @param http HTTP client instance.
81
+ */
77
82
  constructor(http) {
78
83
  this.http = http;
79
84
  }
80
85
  /**
81
86
  * Retrieves a list of active banners.
87
+ *
88
+ * @example
89
+ * const banners = await client.banners.list();
82
90
  */
83
- async list(params = {}) {
84
- return await this.http.get({
91
+ list(params = {}) {
92
+ return this.http.get({
85
93
  path: "/api/v3/banners",
86
94
  params,
87
95
  schema: BannersApiListResponseSchema
@@ -143,14 +151,22 @@ const CategoriesApiGetParentsResponseSchema = zod_mini.array(CategoriesApiGetPar
143
151
  * API for retrieving product category information.
144
152
  */
145
153
  var CategoriesApi = class {
154
+ /**
155
+ * Initializes a new instance of the CategoriesApi.
156
+ *
157
+ * @param http HTTP client instance.
158
+ */
146
159
  constructor(http) {
147
160
  this.http = http;
148
161
  }
149
162
  /**
150
163
  * Retrieves a list of all categories.
164
+ *
165
+ * @example
166
+ * const categories = await client.categories.list();
151
167
  */
152
- async list(params = {}) {
153
- return await this.http.get({
168
+ list(params = {}) {
169
+ return this.http.get({
154
170
  path: "/categories",
155
171
  params,
156
172
  schema: CategoriesApiListResponseSchema
@@ -158,9 +174,14 @@ var CategoriesApi = class {
158
174
  }
159
175
  /**
160
176
  * Retrieves detailed information about a specific category by its ID.
177
+ *
178
+ * @example
179
+ * const category = await client.categories.get({
180
+ * categoryId: 1234
181
+ * });
161
182
  */
162
- async get(params) {
163
- return await this.http.get({
183
+ get(params) {
184
+ return this.http.get({
164
185
  path: `/categories/${params.categoryId}`,
165
186
  params,
166
187
  schema: CategoriesApiGetResponseSchema
@@ -168,9 +189,14 @@ var CategoriesApi = class {
168
189
  }
169
190
  /**
170
191
  * Retrieves parent categories for specific category IDs.
192
+ *
193
+ * @example
194
+ * const parents = await client.categories.getParents({
195
+ * categoryId: [123, 456]
196
+ * });
171
197
  */
172
- async getParents(params) {
173
- return await this.http.get({
198
+ getParents(params) {
199
+ return this.http.get({
174
200
  path: "/api/v1/categories/parents",
175
201
  params,
176
202
  schema: CategoriesApiGetParentsResponseSchema
@@ -313,14 +339,25 @@ const CollectionsApiGetResponseSchema = zod_mini.object({
313
339
  * API for retrieving curated collections of products.
314
340
  */
315
341
  var CollectionsApi = class {
342
+ /**
343
+ * Initializes a new instance of the CollectionsApi.
344
+ *
345
+ * @param http HTTP client instance.
346
+ */
316
347
  constructor(http) {
317
348
  this.http = http;
318
349
  }
319
350
  /**
320
351
  * Retrieves a list of SKUs belonging to a specific collection with pagination and sorting.
352
+ *
353
+ * @example
354
+ * const skus = await client.collections.getSkus({
355
+ * collectionId: 123,
356
+ * pageSize: 10
357
+ * });
321
358
  */
322
- async getSkus(params) {
323
- return await this.http.get({
359
+ getSkus(params) {
360
+ return this.http.get({
324
361
  path: "/api/v2/collections/skus",
325
362
  params,
326
363
  schema: CollectionsApiGetSkusResponseSchema
@@ -328,9 +365,12 @@ var CollectionsApi = class {
328
365
  }
329
366
  /**
330
367
  * Retrieves a list of all collections.
368
+ *
369
+ * @example
370
+ * const collections = await client.collections.list();
331
371
  */
332
- async list(params = {}) {
333
- return await this.http.get({
372
+ list(params = {}) {
373
+ return this.http.get({
334
374
  path: "/collections",
335
375
  params,
336
376
  schema: CollectionsApiListResponseSchema
@@ -338,9 +378,14 @@ var CollectionsApi = class {
338
378
  }
339
379
  /**
340
380
  * Retrieves detailed information about a specific collection by its ID.
381
+ *
382
+ * @example
383
+ * const collection = await client.collections.get({
384
+ * collectionId: 123
385
+ * });
341
386
  */
342
- async get(params) {
343
- return await this.http.get({
387
+ get(params) {
388
+ return this.http.get({
344
389
  path: `/collections/${params.collectionId}`,
345
390
  params,
346
391
  schema: CollectionsApiGetResponseSchema
@@ -368,14 +413,22 @@ const FeatureFlagsApiListResponseSchema = zod_mini.array(FeatureFlagsApiItemSche
368
413
  * API for retrieving feature flags configuration.
369
414
  */
370
415
  var FeatureFlagsApi = class {
416
+ /**
417
+ * Initializes a new instance of the FeatureFlagsApi.
418
+ *
419
+ * @param http HTTP client instance.
420
+ */
371
421
  constructor(http) {
372
422
  this.http = http;
373
423
  }
374
424
  /**
375
425
  * Retrieves all active feature flags.
426
+ *
427
+ * @example
428
+ * const flags = await client.featureFlags.list();
376
429
  */
377
- async list(params = {}) {
378
- return await this.http.get({
430
+ list(params = {}) {
431
+ return this.http.get({
379
432
  path: "/api/v1/feature-flags",
380
433
  params,
381
434
  schema: FeatureFlagsApiListResponseSchema
@@ -491,14 +544,22 @@ const ProductsApiListResponseSchema = zod_mini.object({
491
544
  * API for retrieving product listings, details, and reviews.
492
545
  */
493
546
  var ProductsApi = class {
547
+ /**
548
+ * Initializes a new instance of the ProductsApi.
549
+ *
550
+ * @param http HTTP client instance.
551
+ */
494
552
  constructor(http) {
495
553
  this.http = http;
496
554
  }
497
555
  /**
498
556
  * Retrieves available sorting options for product lists.
557
+ *
558
+ * @example
559
+ * const sortOptions = await client.products.getSortOptions();
499
560
  */
500
- async getSortOptions(params = {}) {
501
- return await this.http.get({
561
+ getSortOptions(params = {}) {
562
+ return this.http.get({
502
563
  path: "/api/product/sort-options",
503
564
  params,
504
565
  schema: ProductsApiGetSortOptionsResponseSchema
@@ -506,9 +567,15 @@ var ProductsApi = class {
506
567
  }
507
568
  /**
508
569
  * Retrieves a list of products with optional filtering and pagination.
570
+ *
571
+ * @example
572
+ * const products = await client.products.list({
573
+ * pageSize: 20,
574
+ * pageNumber: 1
575
+ * });
509
576
  */
510
- async list(params = {}) {
511
- return await this.http.get({
577
+ list(params = {}) {
578
+ return this.http.get({
512
579
  path: "/api/v2/product",
513
580
  params,
514
581
  schema: ProductsApiListResponseSchema
@@ -516,9 +583,14 @@ var ProductsApi = class {
516
583
  }
517
584
  /**
518
585
  * Retrieves reviews for a specific product.
586
+ *
587
+ * @example
588
+ * const reviews = await client.products.getReviews({
589
+ * productId: 12345
590
+ * });
519
591
  */
520
- async getReviews(params) {
521
- return await this.http.get({
592
+ getReviews(params) {
593
+ return this.http.get({
522
594
  path: `/api/v1/product/${params.productId}/review`,
523
595
  params,
524
596
  schema: ProductsApiGetReviewsResponseSchema
@@ -550,14 +622,22 @@ const PromoApiListResponseSchema = zod_mini.array(PromoApiItemSchema);
550
622
  * API for retrieving active promotions.
551
623
  */
552
624
  var PromoApi = class {
625
+ /**
626
+ * Initializes a new instance of the PromoApi.
627
+ *
628
+ * @param http HTTP client instance.
629
+ */
553
630
  constructor(http) {
554
631
  this.http = http;
555
632
  }
556
633
  /**
557
634
  * Retrieves a list of all active promotions.
635
+ *
636
+ * @example
637
+ * const promos = await client.promo.list();
558
638
  */
559
- async list(params = {}) {
560
- return await this.http.get({
639
+ list(params = {}) {
640
+ return this.http.get({
561
641
  path: "/api/promo",
562
642
  params,
563
643
  schema: PromoApiListResponseSchema
@@ -674,14 +754,24 @@ const ShopsApiGetProductsResponseSchema = zod_mini.object({
674
754
  * API for interacting with shop-related endpoints.
675
755
  */
676
756
  var ShopsApi = class {
757
+ /**
758
+ * Initializes a new instance of the ShopsApi.
759
+ *
760
+ * @param http HTTP client instance.
761
+ */
677
762
  constructor(http) {
678
763
  this.http = http;
679
764
  }
680
765
  /**
681
766
  * Retrieves details of a specific shop.
767
+ *
768
+ * @example
769
+ * const shop = await client.shops.get({
770
+ * shopId: 123
771
+ * });
682
772
  */
683
- async get(params) {
684
- return await this.http.get({
773
+ get(params) {
774
+ return this.http.get({
685
775
  path: `/api/v1/shops/${params.shopId}`,
686
776
  params,
687
777
  schema: ShopsApiGetResponseSchema
@@ -689,9 +779,12 @@ var ShopsApi = class {
689
779
  }
690
780
  /**
691
781
  * Retrieves monobrand shop details.
782
+ *
783
+ * @example
784
+ * const monobrand = await client.shops.getMonobrand();
692
785
  */
693
- async getMonobrand(params = {}) {
694
- return await this.http.get({
786
+ getMonobrand(params = {}) {
787
+ return this.http.get({
695
788
  path: "/api/v1/shops/monobrand",
696
789
  params,
697
790
  schema: ShopsApiGetMonobrandResponseSchema
@@ -699,9 +792,15 @@ var ShopsApi = class {
699
792
  }
700
793
  /**
701
794
  * Retrieves products for a specific shop.
795
+ *
796
+ * @example
797
+ * const shopProducts = await client.shops.getProducts({
798
+ * shopId: 123,
799
+ * pageSize: 10
800
+ * });
702
801
  */
703
- async getProducts(params) {
704
- return await this.http.get({
802
+ getProducts(params) {
803
+ return this.http.get({
705
804
  path: `/api/v2/shops/${params.shopId}/products`,
706
805
  params,
707
806
  schema: ShopsApiGetProductsResponseSchema
@@ -884,14 +983,24 @@ const SkuApiGetReviewAvailableResponseSchema = zod_mini.object({
884
983
  * API for interacting with SKU-related endpoints.
885
984
  */
886
985
  var SkuApi = class {
986
+ /**
987
+ * Initializes a new instance of the SkuApi.
988
+ *
989
+ * @param http HTTP client instance.
990
+ */
887
991
  constructor(http) {
888
992
  this.http = http;
889
993
  }
890
994
  /**
891
995
  * Retrieves details of a specific SKU.
996
+ *
997
+ * @example
998
+ * const sku = await client.sku.get({
999
+ * skuId: 123
1000
+ * });
892
1001
  */
893
- async get(params) {
894
- return await this.http.get({
1002
+ get(params) {
1003
+ return this.http.get({
895
1004
  path: `/api/v2/sku/${params.skuId}`,
896
1005
  params,
897
1006
  schema: SkuApiGetResponseSchema
@@ -899,9 +1008,14 @@ var SkuApi = class {
899
1008
  }
900
1009
  /**
901
1010
  * Retrieves similar SKUs.
1011
+ *
1012
+ * @example
1013
+ * const similar = await client.sku.getSimilar({
1014
+ * skuId: 123
1015
+ * });
902
1016
  */
903
- async getSimilar(params) {
904
- return await this.http.get({
1017
+ getSimilar(params) {
1018
+ return this.http.get({
905
1019
  path: "/api/v2/sku/similar-skus",
906
1020
  params,
907
1021
  schema: SkuApiGetSimilarResponseSchema
@@ -909,9 +1023,14 @@ var SkuApi = class {
909
1023
  }
910
1024
  /**
911
1025
  * Retrieves collections associated with a SKU.
1026
+ *
1027
+ * @example
1028
+ * const collections = await client.sku.getCollections({
1029
+ * skuId: 123
1030
+ * });
912
1031
  */
913
- async getCollections(params) {
914
- return await this.http.get({
1032
+ getCollections(params) {
1033
+ return this.http.get({
915
1034
  path: `/sku/${params.skuId}/collections`,
916
1035
  params,
917
1036
  schema: SkuApiGetCollectionsResponseSchema
@@ -919,9 +1038,14 @@ var SkuApi = class {
919
1038
  }
920
1039
  /**
921
1040
  * Checks if a review is available for a SKU.
1041
+ *
1042
+ * @example
1043
+ * const isAvailable = await client.sku.getReviewAvailable({
1044
+ * skuId: 123
1045
+ * });
922
1046
  */
923
- async getReviewAvailable(params) {
924
- return await this.http.get({
1047
+ getReviewAvailable(params) {
1048
+ return this.http.get({
925
1049
  path: `/sku/${params.skuId}/review-available`,
926
1050
  params,
927
1051
  schema: SkuApiGetReviewAvailableResponseSchema
@@ -1177,6 +1301,11 @@ var HttpClient = class {
1177
1301
  * Request timeout in milliseconds.
1178
1302
  */
1179
1303
  timeout;
1304
+ /**
1305
+ * Initializes a new instance of the HttpClient.
1306
+ *
1307
+ * @param config Resolved client configuration.
1308
+ */
1180
1309
  constructor(config) {
1181
1310
  this.baseUrl = config.baseUrl;
1182
1311
  this.headers = buildHeaders(config);
@@ -1184,6 +1313,8 @@ var HttpClient = class {
1184
1313
  }
1185
1314
  /**
1186
1315
  * Performs a low-level HTTP request.
1316
+ *
1317
+ * @param options Request options.
1187
1318
  */
1188
1319
  async request(options) {
1189
1320
  const { url, headers, ...fetchOptions } = options;
@@ -1248,6 +1379,12 @@ var HttpClient = class {
1248
1379
  //#region src/client.ts
1249
1380
  /**
1250
1381
  * Main client for interacting with the Teez B2C API.
1382
+ *
1383
+ * @example
1384
+ * const client = new TeezClient({
1385
+ * language: "ru",
1386
+ * timeout: 10000
1387
+ * });
1251
1388
  */
1252
1389
  var TeezClient = class {
1253
1390
  /**
@@ -1290,6 +1427,11 @@ var TeezClient = class {
1290
1427
  * API for retrieving SKU details.
1291
1428
  */
1292
1429
  sku;
1430
+ /**
1431
+ * Initializes a new instance of the TeezClient.
1432
+ *
1433
+ * @param config Optional client configuration.
1434
+ */
1293
1435
  constructor(config) {
1294
1436
  this.config = resolveConfig(config);
1295
1437
  this.http = new HttpClient(this.config);