@teez-sdk/teez-b2c-api 1.0.0 → 2.0.0
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 +0 -2
- package/dist/index.cjs +180 -50
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +254 -145
- package/dist/index.d.mts +254 -145
- package/dist/index.mjs +181 -50
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
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
|
-
|
|
84
|
-
return
|
|
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
|
-
|
|
153
|
-
return
|
|
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
|
-
|
|
163
|
-
return
|
|
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
|
-
|
|
173
|
-
return
|
|
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
|
-
|
|
323
|
-
return
|
|
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
|
-
|
|
333
|
-
return
|
|
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
|
-
|
|
343
|
-
return
|
|
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
|
-
|
|
378
|
-
return
|
|
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
|
-
|
|
501
|
-
return
|
|
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
|
-
|
|
511
|
-
return
|
|
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
|
-
|
|
521
|
-
return
|
|
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
|
-
|
|
560
|
-
return
|
|
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
|
-
|
|
684
|
-
return
|
|
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
|
-
|
|
694
|
-
return
|
|
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
|
-
|
|
704
|
-
return
|
|
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
|
-
|
|
894
|
-
return
|
|
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
|
-
|
|
904
|
-
return
|
|
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
|
-
|
|
914
|
-
return
|
|
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
|
-
|
|
924
|
-
return
|
|
1047
|
+
getReviewAvailable(params) {
|
|
1048
|
+
return this.http.get({
|
|
925
1049
|
path: `/sku/${params.skuId}/review-available`,
|
|
926
1050
|
params,
|
|
927
1051
|
schema: SkuApiGetReviewAvailableResponseSchema
|
|
@@ -943,17 +1067,6 @@ const LANGUAGES = {
|
|
|
943
1067
|
KZ: "kz"
|
|
944
1068
|
};
|
|
945
1069
|
/**
|
|
946
|
-
* Standard sort options for product and collection searches
|
|
947
|
-
*/
|
|
948
|
-
const SORT_OPTIONS = {
|
|
949
|
-
BY_RELEVANCE: "byRelevance",
|
|
950
|
-
POPULARITY: "popularity",
|
|
951
|
-
HIGHEST_RATED: "highestRated",
|
|
952
|
-
NEW: "new",
|
|
953
|
-
PRICE: "price",
|
|
954
|
-
PRICE_DESC: "priceDesc"
|
|
955
|
-
};
|
|
956
|
-
/**
|
|
957
1070
|
* Default application version code.
|
|
958
1071
|
*/
|
|
959
1072
|
const DEFAULT_APP_VERSION = "193";
|
|
@@ -1177,6 +1290,11 @@ var HttpClient = class {
|
|
|
1177
1290
|
* Request timeout in milliseconds.
|
|
1178
1291
|
*/
|
|
1179
1292
|
timeout;
|
|
1293
|
+
/**
|
|
1294
|
+
* Initializes a new instance of the HttpClient.
|
|
1295
|
+
*
|
|
1296
|
+
* @param config Resolved client configuration.
|
|
1297
|
+
*/
|
|
1180
1298
|
constructor(config) {
|
|
1181
1299
|
this.baseUrl = config.baseUrl;
|
|
1182
1300
|
this.headers = buildHeaders(config);
|
|
@@ -1184,6 +1302,8 @@ var HttpClient = class {
|
|
|
1184
1302
|
}
|
|
1185
1303
|
/**
|
|
1186
1304
|
* Performs a low-level HTTP request.
|
|
1305
|
+
*
|
|
1306
|
+
* @param options Request options.
|
|
1187
1307
|
*/
|
|
1188
1308
|
async request(options) {
|
|
1189
1309
|
const { url, headers, ...fetchOptions } = options;
|
|
@@ -1248,6 +1368,12 @@ var HttpClient = class {
|
|
|
1248
1368
|
//#region src/client.ts
|
|
1249
1369
|
/**
|
|
1250
1370
|
* Main client for interacting with the Teez B2C API.
|
|
1371
|
+
*
|
|
1372
|
+
* @example
|
|
1373
|
+
* const client = new TeezClient({
|
|
1374
|
+
* language: "ru",
|
|
1375
|
+
* timeout: 10000
|
|
1376
|
+
* });
|
|
1251
1377
|
*/
|
|
1252
1378
|
var TeezClient = class {
|
|
1253
1379
|
/**
|
|
@@ -1290,6 +1416,11 @@ var TeezClient = class {
|
|
|
1290
1416
|
* API for retrieving SKU details.
|
|
1291
1417
|
*/
|
|
1292
1418
|
sku;
|
|
1419
|
+
/**
|
|
1420
|
+
* Initializes a new instance of the TeezClient.
|
|
1421
|
+
*
|
|
1422
|
+
* @param config Optional client configuration.
|
|
1423
|
+
*/
|
|
1293
1424
|
constructor(config) {
|
|
1294
1425
|
this.config = resolveConfig(config);
|
|
1295
1426
|
this.http = new HttpClient(this.config);
|
|
@@ -1354,7 +1485,6 @@ exports.ProductsStockAvailabilityTypeSchema = ProductsStockAvailabilityTypeSchem
|
|
|
1354
1485
|
exports.PromoApi = PromoApi;
|
|
1355
1486
|
exports.PromoApiItemSchema = PromoApiItemSchema;
|
|
1356
1487
|
exports.PromoApiListResponseSchema = PromoApiListResponseSchema;
|
|
1357
|
-
exports.SORT_OPTIONS = SORT_OPTIONS;
|
|
1358
1488
|
exports.ShopsApi = ShopsApi;
|
|
1359
1489
|
exports.ShopsApiContactInfoSchema = ShopsApiContactInfoSchema;
|
|
1360
1490
|
exports.ShopsApiGetMonobrandResponseSchema = ShopsApiGetMonobrandResponseSchema;
|