plaza-sdk 1.1.0 → 1.1.2

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.
Files changed (83) hide show
  1. package/README.md +49 -1
  2. package/lib/types/src/common/constants.d.ts +2 -0
  3. package/lib/types/src/common/enums.d.ts +2 -0
  4. package/lib/types/src/common/index.d.ts +5 -0
  5. package/lib/types/src/common/interfaces.d.ts +10 -0
  6. package/lib/types/src/common/params.d.ts +6 -0
  7. package/lib/types/src/common/types.d.ts +11 -0
  8. package/lib/types/src/common/utils.d.ts +3 -0
  9. package/lib/types/src/index.d.ts +5 -0
  10. package/lib/types/src/modules/alif-shop-api/common/interfaces.d.ts +2 -0
  11. package/lib/types/src/modules/alif-shop-api/common/types.d.ts +2 -0
  12. package/lib/types/src/modules/alif-shop-api/common/utils.d.ts +2 -0
  13. package/lib/types/src/modules/alif-shop-api/core/auth/api.d.ts +8 -0
  14. package/lib/types/src/modules/alif-shop-api/core/auth/index.d.ts +5 -0
  15. package/lib/{cjs → types/src}/modules/alif-shop-api/core/auth/types.d.ts +3 -1
  16. package/lib/types/src/modules/alif-shop-api/core/index.d.ts +5 -0
  17. package/lib/types/src/modules/alif-shop-api/index.d.ts +5 -0
  18. package/lib/types/src/modules/index.d.ts +14 -0
  19. package/lib/{cjs → types/src}/modules/uzum-market-api/common/interfaces.d.ts +25 -21
  20. package/lib/types/src/modules/uzum-market-api/common/types.d.ts +3 -0
  21. package/lib/types/src/modules/uzum-market-api/common/utils.d.ts +5 -0
  22. package/lib/types/src/modules/uzum-market-api/core/auth/api.d.ts +10 -0
  23. package/lib/{cjs → types/src}/modules/uzum-market-api/core/auth/enums.d.ts +3 -1
  24. package/lib/types/src/modules/uzum-market-api/core/auth/index.d.ts +6 -0
  25. package/lib/types/src/modules/uzum-market-api/core/auth/params.d.ts +2 -0
  26. package/lib/{cjs → types/src}/modules/uzum-market-api/core/auth/types.d.ts +6 -3
  27. package/lib/types/src/modules/uzum-market-api/core/index.d.ts +13 -0
  28. package/lib/types/src/modules/uzum-market-api/core/products/api.d.ts +24 -0
  29. package/lib/types/src/modules/uzum-market-api/core/products/index.d.ts +9 -0
  30. package/lib/types/src/modules/uzum-market-api/core/products/mappers.d.ts +12 -0
  31. package/lib/types/src/modules/uzum-market-api/core/products/params.d.ts +28 -0
  32. package/lib/{esm → types/src}/modules/uzum-market-api/core/products/types.d.ts +10 -2
  33. package/lib/{cjs → types/src}/modules/uzum-market-api/core/types.d.ts +9 -4
  34. package/lib/types/src/modules/uzum-market-api/index.d.ts +14 -0
  35. package/package.json +10 -5
  36. package/lib/cjs/common/index.d.ts +0 -4
  37. package/lib/cjs/common/interfaces.d.ts +0 -8
  38. package/lib/cjs/common/params.d.ts +0 -4
  39. package/lib/cjs/common/types.d.ts +0 -8
  40. package/lib/cjs/common/utils.d.ts +0 -1
  41. package/lib/cjs/index.d.ts +0 -1
  42. package/lib/cjs/modules/alif-shop-api/core/auth/api.d.ts +0 -3
  43. package/lib/cjs/modules/alif-shop-api/core/auth/index.d.ts +0 -1
  44. package/lib/cjs/modules/alif-shop-api/core/index.d.ts +0 -1
  45. package/lib/cjs/modules/alif-shop-api/index.d.ts +0 -1
  46. package/lib/cjs/modules/index.d.ts +0 -1
  47. package/lib/cjs/modules/uzum-market-api/common/types.d.ts +0 -1
  48. package/lib/cjs/modules/uzum-market-api/common/utils.d.ts +0 -3
  49. package/lib/cjs/modules/uzum-market-api/core/auth/api.d.ts +0 -4
  50. package/lib/cjs/modules/uzum-market-api/core/auth/index.d.ts +0 -1
  51. package/lib/cjs/modules/uzum-market-api/core/index.d.ts +0 -2
  52. package/lib/cjs/modules/uzum-market-api/core/products/api.d.ts +0 -16
  53. package/lib/cjs/modules/uzum-market-api/core/products/index.d.ts +0 -1
  54. package/lib/cjs/modules/uzum-market-api/core/products/mappers.d.ts +0 -9
  55. package/lib/cjs/modules/uzum-market-api/core/products/params.d.ts +0 -26
  56. package/lib/cjs/modules/uzum-market-api/core/products/types.d.ts +0 -37
  57. package/lib/cjs/modules/uzum-market-api/index.d.ts +0 -2
  58. package/lib/esm/common/index.d.ts +0 -4
  59. package/lib/esm/common/interfaces.d.ts +0 -8
  60. package/lib/esm/common/params.d.ts +0 -4
  61. package/lib/esm/common/types.d.ts +0 -8
  62. package/lib/esm/common/utils.d.ts +0 -1
  63. package/lib/esm/index.d.ts +0 -1
  64. package/lib/esm/modules/alif-shop-api/core/auth/api.d.ts +0 -3
  65. package/lib/esm/modules/alif-shop-api/core/auth/index.d.ts +0 -1
  66. package/lib/esm/modules/alif-shop-api/core/auth/types.d.ts +0 -14
  67. package/lib/esm/modules/alif-shop-api/core/index.d.ts +0 -1
  68. package/lib/esm/modules/alif-shop-api/index.d.ts +0 -1
  69. package/lib/esm/modules/index.d.ts +0 -1
  70. package/lib/esm/modules/uzum-market-api/common/interfaces.d.ts +0 -108
  71. package/lib/esm/modules/uzum-market-api/common/types.d.ts +0 -1
  72. package/lib/esm/modules/uzum-market-api/common/utils.d.ts +0 -3
  73. package/lib/esm/modules/uzum-market-api/core/auth/api.d.ts +0 -4
  74. package/lib/esm/modules/uzum-market-api/core/auth/enums.d.ts +0 -6
  75. package/lib/esm/modules/uzum-market-api/core/auth/index.d.ts +0 -1
  76. package/lib/esm/modules/uzum-market-api/core/auth/types.d.ts +0 -42
  77. package/lib/esm/modules/uzum-market-api/core/index.d.ts +0 -2
  78. package/lib/esm/modules/uzum-market-api/core/products/api.d.ts +0 -16
  79. package/lib/esm/modules/uzum-market-api/core/products/index.d.ts +0 -1
  80. package/lib/esm/modules/uzum-market-api/core/products/mappers.d.ts +0 -9
  81. package/lib/esm/modules/uzum-market-api/core/products/params.d.ts +0 -26
  82. package/lib/esm/modules/uzum-market-api/core/types.d.ts +0 -220
  83. package/lib/esm/modules/uzum-market-api/index.d.ts +0 -2
package/README.md CHANGED
@@ -1 +1,49 @@
1
- # Plaza SDK (Software Development Kit)
1
+ # Plaza SDK (Software Development Kit)
2
+
3
+ Ushbu kutubxona dasturchilar uchun bir nechta marketplace'lar va online shoplarning dashboard apilarini taqdim etadi.
4
+
5
+ - Uzum Market (Dashboard Api)
6
+ - Uzum Market (Openapi)
7
+ - Alif Shop (Dashboard Api)
8
+ - ...
9
+
10
+ Hozirda kod bazasi kengaytirilishi ustida ishlanmoqda.
11
+
12
+ Loyiha kodlaridan foydalanish uchun bizga eng birinchi o'rinda `nodejs` yoki `browser` javascript muhiti kerak bo'ladi va `axios` kutubxonasi orqali har bir api uchun o'ziga xos `axios instance` yaratib olib uni berib yuborishimiz kerak bo'ladi!
13
+
14
+ ---
15
+
16
+ Masalan `Uzum Market (Dashboard Api)` uchun bunday atigi bitta instance kerak bo'ladi:
17
+
18
+ ```typescript
19
+ // libs/https/uzum-http.ts
20
+
21
+ import axios from "axios";
22
+
23
+ // baseURLni berib qo'yish shart!
24
+ const baseURL = "https://api-seller.uzum.uz/api";
25
+
26
+ const uzumHttp = axios.create({
27
+ baseURL,
28
+ headers: {
29
+ "accept-language": "ru-RU",
30
+ },
31
+ });
32
+
33
+ export default uzumHttp;
34
+ ```
35
+
36
+ ---
37
+
38
+ Va uni quyidagicha ishlatishimiz mumkin:
39
+
40
+ ```typescript
41
+ // lib/api/auth-service.ts
42
+ import { GetToken } from "plaza-sdk/uzum-market"
43
+
44
+
45
+ const getToken = (username: string, password: string) => {
46
+ return GetToken({ username, password })
47
+ }
48
+
49
+ ```
@@ -0,0 +1,2 @@
1
+
2
+ export { };
@@ -0,0 +1,2 @@
1
+
2
+ export { };
@@ -0,0 +1,5 @@
1
+ export { BooleanNullable, CallerNoParam, CallerParam, CallerParamPayload, CallerPayload, NumberNullable, StringNullable } from './types.js';
2
+ export { getNumber } from './utils.js';
3
+ export { UsernamePasswordParams } from './params.js';
4
+ export { IMultiLang, IMultiLangArray } from './interfaces.js';
5
+ import 'axios';
@@ -0,0 +1,10 @@
1
+ interface IMultiLang {
2
+ uz: string;
3
+ ru: string;
4
+ }
5
+ interface IMultiLangArray {
6
+ ru: string[];
7
+ uz: string[];
8
+ }
9
+
10
+ export type { IMultiLang, IMultiLangArray };
@@ -0,0 +1,6 @@
1
+ interface UsernamePasswordParams {
2
+ username: string;
3
+ password: string;
4
+ }
5
+
6
+ export type { UsernamePasswordParams };
@@ -0,0 +1,11 @@
1
+ import { AxiosInstance, AxiosPromise } from 'axios';
2
+
3
+ type CallerNoParam<T = any> = (uzumHttp: AxiosInstance) => AxiosPromise<T>;
4
+ type CallerParam<R, T = any> = (uzumHttp: AxiosInstance, params: R) => AxiosPromise<T>;
5
+ type CallerPayload<S, T = any> = (uzumHttp: AxiosInstance, payload: S) => AxiosPromise<T>;
6
+ type CallerParamPayload<R, S, T = any> = (uzumHttp: AxiosInstance, params: R, payload: S) => AxiosPromise<T>;
7
+ type StringNullable = string | null;
8
+ type NumberNullable = number | null;
9
+ type BooleanNullable = boolean | null;
10
+
11
+ export type { BooleanNullable, CallerNoParam, CallerParam, CallerParamPayload, CallerPayload, NumberNullable, StringNullable };
@@ -0,0 +1,3 @@
1
+ declare const getNumber: (value: unknown, defaultValue?: number) => number;
2
+
3
+ export { getNumber };
@@ -0,0 +1,5 @@
1
+ export { BooleanNullable, CallerNoParam, CallerParam, CallerParamPayload, CallerPayload, NumberNullable, StringNullable } from './common/types.js';
2
+ export { getNumber } from './common/utils.js';
3
+ export { UsernamePasswordParams } from './common/params.js';
4
+ export { IMultiLang, IMultiLangArray } from './common/interfaces.js';
5
+ import 'axios';
@@ -0,0 +1,2 @@
1
+
2
+ export { };
@@ -0,0 +1,2 @@
1
+
2
+ export { };
@@ -0,0 +1,8 @@
1
+ import { CallerPayload } from '../../../../common/types.js';
2
+ import { UsernamePasswordParams } from '../../../../common/params.js';
3
+ import { IAuth } from './types.js';
4
+ import 'axios';
5
+
6
+ declare const GetToken: CallerPayload<UsernamePasswordParams, IAuth.GetToken.Response>;
7
+
8
+ export { GetToken };
@@ -0,0 +1,5 @@
1
+ export { GetToken } from './api.js';
2
+ import '../../../../common/types.js';
3
+ import 'axios';
4
+ import '../../../../common/params.js';
5
+ import './types.js';
@@ -1,4 +1,4 @@
1
- export declare namespace IAuth {
1
+ declare namespace IAuth {
2
2
  namespace GetToken {
3
3
  interface Response {
4
4
  access_token: string;
@@ -12,3 +12,5 @@ export declare namespace IAuth {
12
12
  }
13
13
  }
14
14
  }
15
+
16
+ export { IAuth };
@@ -0,0 +1,5 @@
1
+ export { GetToken } from './auth/api.js';
2
+ import '../../../common/types.js';
3
+ import 'axios';
4
+ import '../../../common/params.js';
5
+ import './auth/types.js';
@@ -0,0 +1,5 @@
1
+ export { GetToken } from './core/auth/api.js';
2
+ import '../../common/types.js';
3
+ import 'axios';
4
+ import '../../common/params.js';
5
+ import './core/auth/types.js';
@@ -0,0 +1,14 @@
1
+ export { pasteAuthHeader } from './uzum-market-api/common/utils.js';
2
+ export { CheckToken, GetToken } from './uzum-market-api/core/auth/api.js';
3
+ export { AddPromotion, ArchiveProduct, CheckSkuExists, CreateProduct, GetProduct, InvolvedProductsList, ProductDescription, ProductsList, RemovePromotion, SendSkuData, UnarchiveProduct } from './uzum-market-api/core/products/api.js';
4
+ import '../common/types.js';
5
+ import 'axios';
6
+ import '../common/params.js';
7
+ import './uzum-market-api/core/auth/types.js';
8
+ import './uzum-market-api/core/auth/enums.js';
9
+ import './uzum-market-api/core/products/types.js';
10
+ import './uzum-market-api/core/types.js';
11
+ import './uzum-market-api/common/interfaces.js';
12
+ import '../common/interfaces.js';
13
+ import './uzum-market-api/common/types.js';
14
+ import './uzum-market-api/core/products/params.js';
@@ -1,16 +1,18 @@
1
- import { BooleanNullable, NumberNullable, StringNullable } from "@/common/types";
2
- import { IMultiLang } from "@/common/interfaces";
3
- import { ProductStatuses } from "./types";
4
- export interface StatusValue {
1
+ import { NumberNullable, BooleanNullable, StringNullable } from '../../../common/types.js';
2
+ import { IMultiLang } from '../../../common/interfaces.js';
3
+ import { ProductStatuses } from './types.js';
4
+ import 'axios';
5
+
6
+ interface StatusValue {
5
7
  value: string;
6
8
  title: string;
7
9
  color: string;
8
10
  }
9
- export interface PromotionSku {
11
+ interface PromotionSku {
10
12
  skuId: number;
11
13
  newPrice: number;
12
14
  }
13
- export interface Status {
15
+ interface Status {
14
16
  id: number;
15
17
  title: string;
16
18
  value: ProductStatuses;
@@ -18,33 +20,33 @@ export interface Status {
18
20
  color: string;
19
21
  additional: unknown[];
20
22
  }
21
- export interface Dimensions {
23
+ interface Dimensions {
22
24
  length: NumberNullable;
23
25
  width: NumberNullable;
24
26
  height: NumberNullable;
25
27
  weight: NumberNullable;
26
28
  }
27
- export interface RankInfo {
29
+ interface RankInfo {
28
30
  rank: string;
29
31
  rankValue: string;
30
32
  dateUpdated: number;
31
33
  }
32
- export interface SkuCharacteristic {
34
+ interface SkuCharacteristic {
33
35
  characteristicTitle: IMultiLang;
34
36
  definedType: boolean;
35
37
  characteristicValue: IMultiLang;
36
38
  }
37
- export interface Commission {
39
+ interface Commission {
38
40
  minCommission: number;
39
41
  maxCommission: number;
40
42
  }
41
- export interface CharacteristicValue {
43
+ interface CharacteristicValue {
42
44
  title: IMultiLang;
43
45
  value: string;
44
46
  skuValue: string;
45
47
  wantToPhotoStudio: BooleanNullable;
46
48
  }
47
- export interface DefinedCharacteristic {
49
+ interface DefinedCharacteristic {
48
50
  orderingNumber: number;
49
51
  characteristicValues: CharacteristicValue[];
50
52
  characteristicTitle: IMultiLang;
@@ -52,14 +54,14 @@ export interface DefinedCharacteristic {
52
54
  defined: boolean;
53
55
  requiredType?: string;
54
56
  }
55
- export interface FilterValue {
57
+ interface FilterValue {
56
58
  id: number;
57
59
  value: string;
58
60
  title: string;
59
61
  predefined: boolean;
60
62
  isApproved: BooleanNullable;
61
63
  }
62
- export interface Filter {
64
+ interface Filter {
63
65
  id: number;
64
66
  title: string;
65
67
  description: StringNullable;
@@ -70,7 +72,7 @@ export interface Filter {
70
72
  maxLength: NumberNullable;
71
73
  brandFilter: boolean;
72
74
  }
73
- export interface ColorImage {
75
+ interface ColorImage {
74
76
  colorImage: string;
75
77
  imageUrl: string;
76
78
  ordering: number;
@@ -78,31 +80,33 @@ export interface ColorImage {
78
80
  color: IMultiLang;
79
81
  status: string;
80
82
  }
81
- export interface Comment {
83
+ interface Comment {
82
84
  comment: IMultiLang;
83
85
  commentType: string;
84
86
  }
85
- export interface ProductFilterValue {
87
+ interface ProductFilterValue {
86
88
  filterId: number;
87
89
  filterValueId: number;
88
90
  }
89
- export interface ProductMedia {
91
+ interface ProductMedia {
90
92
  deletable: boolean;
91
93
  url: string;
92
94
  key: string;
93
95
  status: string;
94
96
  }
95
- export interface DimensionalGroup {
97
+ interface DimensionalGroup {
96
98
  group: string;
97
99
  title: string;
98
100
  }
99
- export interface Category {
101
+ interface Category {
100
102
  id: number;
101
103
  title: string;
102
104
  productAmount: number;
103
105
  parent: Category | null;
104
106
  }
105
- export interface RatingInfo {
107
+ interface RatingInfo {
106
108
  rating: string;
107
109
  feedbackQuantity: string;
108
110
  }
111
+
112
+ export type { Category, CharacteristicValue, ColorImage, Comment, Commission, DefinedCharacteristic, DimensionalGroup, Dimensions, Filter, FilterValue, ProductFilterValue, ProductMedia, PromotionSku, RankInfo, RatingInfo, SkuCharacteristic, Status, StatusValue };
@@ -0,0 +1,3 @@
1
+ type ProductStatuses = "READY_TO_SEND" | "ARCHIVED" | "IN_STOCK" | ("RUN_OUT" & (string & {}));
2
+
3
+ export type { ProductStatuses };
@@ -0,0 +1,5 @@
1
+ declare const pasteAuthHeader: (token: string) => {
2
+ Authorization: string;
3
+ };
4
+
5
+ export { pasteAuthHeader };
@@ -0,0 +1,10 @@
1
+ import { CallerParam } from '../../../../common/types.js';
2
+ import { UsernamePasswordParams } from '../../../../common/params.js';
3
+ import { AuthApi } from './types.js';
4
+ import 'axios';
5
+ import './enums.js';
6
+
7
+ declare const GetToken: CallerParam<UsernamePasswordParams, AuthApi.GetToken.Response>;
8
+ declare const CheckToken: CallerParam<string, AuthApi.CheckToken.Response>;
9
+
10
+ export { CheckToken, GetToken };
@@ -1,6 +1,8 @@
1
- export declare enum AUTHORITIES {
1
+ declare enum AUTHORITIES {
2
2
  "ROLE_CUSTOMER" = "ROLE_CUSTOMER",
3
3
  "PHONE_VERIFIED" = "PHONE_VERIFIED",
4
4
  "VERIFIED" = "VERIFIED",
5
5
  "ROLE_SELLER" = "ROLE_SELLER"
6
6
  }
7
+
8
+ export { AUTHORITIES };
@@ -0,0 +1,6 @@
1
+ export { CheckToken, GetToken } from './api.js';
2
+ import '../../../../common/types.js';
3
+ import 'axios';
4
+ import '../../../../common/params.js';
5
+ import './types.js';
6
+ import './enums.js';
@@ -1,5 +1,6 @@
1
- import { AUTHORITIES } from "./enums";
2
- export declare namespace AuthEntity {
1
+ import { AUTHORITIES } from './enums.js';
2
+
3
+ declare namespace AuthEntity {
3
4
  type Authority = keyof typeof AUTHORITIES;
4
5
  interface User {
5
6
  user_name: string;
@@ -26,7 +27,7 @@ export declare namespace AuthEntity {
26
27
  email: string;
27
28
  }
28
29
  }
29
- export declare namespace AuthApi {
30
+ declare namespace AuthApi {
30
31
  namespace GetToken {
31
32
  interface Response {
32
33
  access_token: string;
@@ -40,3 +41,5 @@ export declare namespace AuthApi {
40
41
  type Response = AuthEntity.User;
41
42
  }
42
43
  }
44
+
45
+ export { AuthApi, AuthEntity };
@@ -0,0 +1,13 @@
1
+ export { CheckToken, GetToken } from './auth/api.js';
2
+ export { AddPromotion, ArchiveProduct, CheckSkuExists, CreateProduct, GetProduct, InvolvedProductsList, ProductDescription, ProductsList, RemovePromotion, SendSkuData, UnarchiveProduct } from './products/api.js';
3
+ import '../../../common/types.js';
4
+ import 'axios';
5
+ import '../../../common/params.js';
6
+ import './auth/types.js';
7
+ import './auth/enums.js';
8
+ import './products/types.js';
9
+ import './types.js';
10
+ import '../common/interfaces.js';
11
+ import '../../../common/interfaces.js';
12
+ import '../common/types.js';
13
+ import './products/params.js';
@@ -0,0 +1,24 @@
1
+ import { IApi } from './types.js';
2
+ import { SkuIdBasedParams, ProductListParams, TokenAndShopId, InvolvedProductsParams, ProductIdBasedParams, SkuBasedParams } from './params.js';
3
+ import { CallerParam, CallerParamPayload } from '../../../../common/types.js';
4
+ import '../types.js';
5
+ import '../../common/interfaces.js';
6
+ import '../../../../common/interfaces.js';
7
+ import '../../common/types.js';
8
+ import 'axios';
9
+
10
+ declare const ArchiveProduct: CallerParam<SkuIdBasedParams, IApi.ArchiveProduct.Response>;
11
+ declare const UnarchiveProduct: CallerParam<SkuIdBasedParams, IApi.UnarchiveProduct.Response>;
12
+ declare const ProductsList: CallerParam<ProductListParams, IApi.ProductsList.Response>;
13
+ declare const RemovePromotion: CallerParamPayload<TokenAndShopId, IApi.RemovePromotion.Request>;
14
+ declare const AddPromotion: CallerParamPayload<TokenAndShopId, IApi.AddPromotion.Request>;
15
+ declare const InvolvedProductsList: CallerParam<InvolvedProductsParams>;
16
+ declare const ProductDescription: CallerParam<ProductIdBasedParams, IApi.ProductDescription.Response>;
17
+ declare const CheckSkuExists: CallerParam<SkuBasedParams, {
18
+ exists: boolean;
19
+ }>;
20
+ declare const CreateProduct: CallerParamPayload<TokenAndShopId, IApi.CreateProduct.Request, IApi.CreateProduct.Response>;
21
+ declare const GetProduct: CallerParam<ProductIdBasedParams, IApi.GetProduct.Response>;
22
+ declare const SendSkuData: CallerParamPayload<TokenAndShopId, unknown>;
23
+
24
+ export { AddPromotion, ArchiveProduct, CheckSkuExists, CreateProduct, GetProduct, InvolvedProductsList, ProductDescription, ProductsList, RemovePromotion, SendSkuData, UnarchiveProduct };
@@ -0,0 +1,9 @@
1
+ export { AddPromotion, ArchiveProduct, CheckSkuExists, CreateProduct, GetProduct, InvolvedProductsList, ProductDescription, ProductsList, RemovePromotion, SendSkuData, UnarchiveProduct } from './api.js';
2
+ import './types.js';
3
+ import '../types.js';
4
+ import '../../../../common/types.js';
5
+ import 'axios';
6
+ import '../../common/interfaces.js';
7
+ import '../../../../common/interfaces.js';
8
+ import '../../common/types.js';
9
+ import './params.js';
@@ -0,0 +1,12 @@
1
+ import { ProductListParams } from './params.js';
2
+
3
+ declare const ProductListParamsMapper: (params: ProductListParams) => {
4
+ searchQuery: string;
5
+ filter: "ALL";
6
+ sortBy: "id";
7
+ order: "ascending" | "descending";
8
+ size: number;
9
+ page: number;
10
+ };
11
+
12
+ export { ProductListParamsMapper };
@@ -0,0 +1,28 @@
1
+ interface TokenAndShopId {
2
+ token: string;
3
+ shopId: number;
4
+ }
5
+ interface ProductIdBasedParams extends TokenAndShopId {
6
+ productId: number;
7
+ }
8
+ interface CorePaginationParams {
9
+ page: number;
10
+ size: number;
11
+ }
12
+ interface SkuIdBasedParams extends TokenAndShopId {
13
+ skuId: number;
14
+ }
15
+ interface SkuBasedParams extends TokenAndShopId {
16
+ sku: string;
17
+ }
18
+ type ProductListParams = TokenAndShopId & CorePaginationParams & {
19
+ searchQuery?: string;
20
+ filter: "ALL" & (string & {});
21
+ sortBy: "id" & (string & {});
22
+ order: "ascending" | "descending";
23
+ };
24
+ type InvolvedProductsParams = TokenAndShopId & CorePaginationParams & {
25
+ eventId: number;
26
+ };
27
+
28
+ export type { CorePaginationParams, InvolvedProductsParams, ProductIdBasedParams, ProductListParams, SkuBasedParams, SkuIdBasedParams, TokenAndShopId };
@@ -1,5 +1,11 @@
1
- import { UzumMarketEntity } from "../types";
2
- export declare namespace IApi {
1
+ import { UzumMarketEntity } from '../types.js';
2
+ import '../../../../common/types.js';
3
+ import 'axios';
4
+ import '../../common/interfaces.js';
5
+ import '../../../../common/interfaces.js';
6
+ import '../../common/types.js';
7
+
8
+ declare namespace IApi {
3
9
  namespace ArchiveProduct {
4
10
  type Response = UzumMarketEntity.SkuCore;
5
11
  }
@@ -35,3 +41,5 @@ export declare namespace IApi {
35
41
  type Response = UzumMarketEntity.FullProductDetails;
36
42
  }
37
43
  }
44
+
45
+ export { IApi };
@@ -1,7 +1,10 @@
1
- import { NumberNullable, StringNullable } from "@/common/types";
2
- import { Category, ColorImage, Commission, DefinedCharacteristic, DimensionalGroup, Dimensions, Filter, ProductFilterValue, ProductMedia, PromotionSku, RankInfo, RatingInfo, SkuCharacteristic, Status, StatusValue } from "../common/interfaces";
3
- import { IMultiLang, IMultiLangArray } from "@/common/interfaces";
4
- export declare namespace UzumMarketEntity {
1
+ import { StringNullable, NumberNullable } from '../../../common/types.js';
2
+ import { SkuCharacteristic, StatusValue, Dimensions, PromotionSku, RankInfo, DimensionalGroup, Status, ColorImage, DefinedCharacteristic, ProductFilterValue, ProductMedia, Commission, Filter, RatingInfo, Category } from '../common/interfaces.js';
3
+ import { IMultiLangArray, IMultiLang } from '../../../common/interfaces.js';
4
+ import 'axios';
5
+ import '../common/types.js';
6
+
7
+ declare namespace UzumMarketEntity {
5
8
  interface SkuCore {
6
9
  id: number;
7
10
  skuTitle: string;
@@ -218,3 +221,5 @@ export declare namespace UzumMarketEntity {
218
221
  pstorage: boolean;
219
222
  }
220
223
  }
224
+
225
+ export { UzumMarketEntity };
@@ -0,0 +1,14 @@
1
+ export { pasteAuthHeader } from './common/utils.js';
2
+ export { CheckToken, GetToken } from './core/auth/api.js';
3
+ export { AddPromotion, ArchiveProduct, CheckSkuExists, CreateProduct, GetProduct, InvolvedProductsList, ProductDescription, ProductsList, RemovePromotion, SendSkuData, UnarchiveProduct } from './core/products/api.js';
4
+ import '../../common/types.js';
5
+ import 'axios';
6
+ import '../../common/params.js';
7
+ import './core/auth/types.js';
8
+ import './core/auth/enums.js';
9
+ import './core/products/types.js';
10
+ import './core/types.js';
11
+ import './common/interfaces.js';
12
+ import '../../common/interfaces.js';
13
+ import './common/types.js';
14
+ import './core/products/params.js';
package/package.json CHANGED
@@ -1,22 +1,24 @@
1
1
  {
2
2
  "name": "plaza-sdk",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "outputDir": "./lib",
5
5
  "exports": {
6
6
  ".": {
7
+ "types": "./lib/types/src/index.d.ts",
7
8
  "import": "./lib/esm/index.js",
8
9
  "require": "./lib/cjs/index.js"
9
10
  },
10
11
  "./uzum-market": {
12
+ "types": "./lib/types/src/modules/uzum-market-api/index.d.ts",
11
13
  "import": "./lib/esm/modules/uzum-market-api/index.js",
12
14
  "require": "./lib/cjs/modules/uzum-market-api/index.js"
13
15
  },
14
16
  "./alif-shop": {
17
+ "types": "./lib/types/src/modules/alif-shop-api/index.d.ts",
15
18
  "import": "./lib/esm/modules/alif-shop-api/index.js",
16
19
  "require": "./lib/cjs/modules/alif-shop-api/index.js"
17
20
  }
18
21
  },
19
- "types": "./lib/esm/index.d.ts",
20
22
  "main": "lib/cjs/index.js",
21
23
  "module": "lib/esm/index.js",
22
24
  "files": [
@@ -48,25 +50,28 @@
48
50
  "license": "ISC",
49
51
  "devDependencies": {
50
52
  "@eslint/js": "^9.32.0",
53
+ "@rollup/plugin-alias": "^5.1.1",
51
54
  "@rollup/plugin-commonjs": "^28.0.6",
52
55
  "@rollup/plugin-json": "^6.1.0",
53
56
  "@rollup/plugin-node-resolve": "^16.0.1",
54
57
  "@rollup/plugin-typescript": "^12.1.4",
55
58
  "@types/lodash": "^4.17.20",
59
+ "@typescript-eslint/parser": "^8.38.0",
56
60
  "eslint": "^9.32.0",
61
+ "eslint-config-prettier": "^10.1.8",
57
62
  "eslint-plugin-import": "^2.32.0",
58
63
  "globals": "^16.3.0",
59
64
  "jiti": "^2.5.1",
60
65
  "prettier": "^3.6.2",
61
66
  "rimraf": "^6.0.1",
62
67
  "rollup": "^4.46.2",
68
+ "rollup-plugin-dts": "^6.2.1",
63
69
  "rollup-plugin-peer-deps-external": "^2.2.4",
64
70
  "rollup-plugin-terser": "^7.0.2",
71
+ "rollup-plugin-tsconfig-paths": "^1.5.2",
65
72
  "tslib": "^2.8.1",
66
73
  "typescript": "5.8.3",
67
- "typescript-eslint": "^8.38.0",
68
- "eslint-config-prettier": "^10.1.8",
69
- "@typescript-eslint/parser": "^8.38.0"
74
+ "typescript-eslint": "^8.38.0"
70
75
  },
71
76
  "dependencies": {
72
77
  "axios": "^1.11.0",
@@ -1,4 +0,0 @@
1
- export * from "./types";
2
- export * from "./utils";
3
- export * from "./params";
4
- export * from "./interfaces";
@@ -1,8 +0,0 @@
1
- export interface IMultiLang {
2
- uz: string;
3
- ru: string;
4
- }
5
- export interface IMultiLangArray {
6
- ru: string[];
7
- uz: string[];
8
- }
@@ -1,4 +0,0 @@
1
- export interface UsernamePasswordParams {
2
- username: string;
3
- password: string;
4
- }
@@ -1,8 +0,0 @@
1
- import { AxiosInstance, AxiosPromise } from "axios";
2
- export type CallerNoParam<T = any> = (uzumHttp: AxiosInstance) => AxiosPromise<T>;
3
- export type CallerParam<R, T = any> = (uzumHttp: AxiosInstance, params: R) => AxiosPromise<T>;
4
- export type CallerPayload<S, T = any> = (uzumHttp: AxiosInstance, payload: S) => AxiosPromise<T>;
5
- export type CallerParamPayload<R, S, T = any> = (uzumHttp: AxiosInstance, params: R, payload: S) => AxiosPromise<T>;
6
- export type StringNullable = string | null;
7
- export type NumberNullable = number | null;
8
- export type BooleanNullable = boolean | null;
@@ -1 +0,0 @@
1
- export declare const getNumber: (value: unknown, defaultValue?: number) => number;
@@ -1 +0,0 @@
1
- export * from "./common";
@@ -1,3 +0,0 @@
1
- import { CallerPayload, UsernamePasswordParams } from "@/common";
2
- import * as Types from "./types";
3
- export declare const GetToken: CallerPayload<UsernamePasswordParams, Types.IAuth.GetToken.Response>;
@@ -1 +0,0 @@
1
- export * from "./api";
@@ -1 +0,0 @@
1
- export * from "./auth";