plaza-sdk 1.0.0 → 1.0.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 (102) hide show
  1. package/lib/browser/bundle.iife.js +1 -1
  2. package/lib/browser/bundle.umd.js +1 -1
  3. package/lib/cjs/index.d.ts +1 -0
  4. package/lib/cjs/index.js +1 -1
  5. package/lib/cjs/modules/index.d.ts +1 -0
  6. package/lib/cjs/modules/index.js +1 -1
  7. package/lib/cjs/modules/uzum-market/common/interfaces.d.ts +72 -0
  8. package/lib/cjs/modules/uzum-market/core/index.js +1 -0
  9. package/lib/cjs/modules/{uzum → uzum-market}/core/products/api.d.ts +5 -3
  10. package/lib/cjs/modules/uzum-market/core/products/api.js +1 -0
  11. package/lib/cjs/modules/uzum-market/core/products/index.js +1 -0
  12. package/lib/{modules → cjs/modules}/uzum-market/core/products/params.d.ts +12 -4
  13. package/lib/cjs/modules/uzum-market/core/products/types.d.ts +46 -0
  14. package/lib/{modules → cjs/modules}/uzum-market/core/types.d.ts +7 -0
  15. package/lib/cjs/modules/uzum-market/index.js +1 -0
  16. package/lib/esm/index.d.ts +1 -0
  17. package/lib/esm/index.js +1 -1
  18. package/lib/esm/modules/index.d.ts +1 -0
  19. package/lib/esm/modules/index.js +1 -1
  20. package/lib/esm/modules/uzum-market/common/interfaces.d.ts +72 -0
  21. package/lib/esm/modules/uzum-market/core/index.js +1 -0
  22. package/lib/esm/modules/{uzum → uzum-market}/core/products/api.d.ts +5 -3
  23. package/lib/esm/modules/{uzum → uzum-market}/core/products/api.js +1 -1
  24. package/lib/esm/modules/uzum-market/core/products/index.js +1 -0
  25. package/lib/{cjs/modules/uzum → esm/modules/uzum-market}/core/products/params.d.ts +12 -4
  26. package/lib/esm/modules/uzum-market/core/products/types.d.ts +46 -0
  27. package/lib/esm/modules/{uzum → uzum-market}/core/types.d.ts +8 -1
  28. package/lib/esm/modules/uzum-market/index.js +1 -0
  29. package/package.json +1 -2
  30. package/lib/cjs/modules/uzum/common/interfaces.d.ts +0 -36
  31. package/lib/cjs/modules/uzum/core/index.js +0 -1
  32. package/lib/cjs/modules/uzum/core/products/api.js +0 -1
  33. package/lib/cjs/modules/uzum/core/products/index.js +0 -1
  34. package/lib/cjs/modules/uzum/core/products/types.d.ts +0 -27
  35. package/lib/cjs/modules/uzum/core/types.d.ts +0 -102
  36. package/lib/cjs/modules/uzum/index.js +0 -1
  37. package/lib/common/constants.d.ts +0 -0
  38. package/lib/common/constants.js +0 -1
  39. package/lib/common/enums.d.ts +0 -0
  40. package/lib/common/enums.js +0 -1
  41. package/lib/common/interfaces.d.ts +0 -4
  42. package/lib/common/interfaces.js +0 -1
  43. package/lib/common/types.d.ts +0 -8
  44. package/lib/common/types.js +0 -1
  45. package/lib/common/utils.d.ts +0 -1
  46. package/lib/common/utils.js +0 -10
  47. package/lib/esm/modules/uzum/common/interfaces.d.ts +0 -36
  48. package/lib/esm/modules/uzum/core/index.js +0 -1
  49. package/lib/esm/modules/uzum/core/products/index.js +0 -1
  50. package/lib/esm/modules/uzum/core/products/params.d.ts +0 -15
  51. package/lib/esm/modules/uzum/core/products/types.d.ts +0 -27
  52. package/lib/esm/modules/uzum/index.js +0 -1
  53. package/lib/index.d.ts +0 -0
  54. package/lib/index.js +0 -1
  55. package/lib/modules/index.d.ts +0 -0
  56. package/lib/modules/index.js +0 -1
  57. package/lib/modules/uzum-market/common/interfaces.d.ts +0 -36
  58. package/lib/modules/uzum-market/common/interfaces.js +0 -1
  59. package/lib/modules/uzum-market/common/types.d.ts +0 -1
  60. package/lib/modules/uzum-market/common/types.js +0 -1
  61. package/lib/modules/uzum-market/common/utils.d.ts +0 -3
  62. package/lib/modules/uzum-market/common/utils.js +0 -3
  63. package/lib/modules/uzum-market/core/index.d.ts +0 -1
  64. package/lib/modules/uzum-market/core/index.js +0 -1
  65. package/lib/modules/uzum-market/core/products/api.d.ts +0 -8
  66. package/lib/modules/uzum-market/core/products/api.js +0 -24
  67. package/lib/modules/uzum-market/core/products/index.d.ts +0 -1
  68. package/lib/modules/uzum-market/core/products/index.js +0 -1
  69. package/lib/modules/uzum-market/core/products/mappers.d.ts +0 -9
  70. package/lib/modules/uzum-market/core/products/mappers.js +0 -12
  71. package/lib/modules/uzum-market/core/products/params.js +0 -1
  72. package/lib/modules/uzum-market/core/products/types.d.ts +0 -27
  73. package/lib/modules/uzum-market/core/products/types.js +0 -1
  74. package/lib/modules/uzum-market/core/types.js +0 -1
  75. package/lib/modules/uzum-market/index.d.ts +0 -1
  76. package/lib/modules/uzum-market/index.js +0 -1
  77. /package/lib/cjs/modules/{uzum → uzum-market}/common/interfaces.js +0 -0
  78. /package/lib/cjs/modules/{uzum → uzum-market}/common/types.d.ts +0 -0
  79. /package/lib/cjs/modules/{uzum → uzum-market}/common/types.js +0 -0
  80. /package/lib/cjs/modules/{uzum → uzum-market}/common/utils.d.ts +0 -0
  81. /package/lib/cjs/modules/{uzum → uzum-market}/common/utils.js +0 -0
  82. /package/lib/cjs/modules/{uzum → uzum-market}/core/index.d.ts +0 -0
  83. /package/lib/cjs/modules/{uzum → uzum-market}/core/products/index.d.ts +0 -0
  84. /package/lib/cjs/modules/{uzum → uzum-market}/core/products/mappers.d.ts +0 -0
  85. /package/lib/cjs/modules/{uzum → uzum-market}/core/products/mappers.js +0 -0
  86. /package/lib/cjs/modules/{uzum → uzum-market}/core/products/params.js +0 -0
  87. /package/lib/cjs/modules/{uzum → uzum-market}/core/products/types.js +0 -0
  88. /package/lib/cjs/modules/{uzum → uzum-market}/core/types.js +0 -0
  89. /package/lib/cjs/modules/{uzum → uzum-market}/index.d.ts +0 -0
  90. /package/lib/esm/modules/{uzum → uzum-market}/common/interfaces.js +0 -0
  91. /package/lib/esm/modules/{uzum → uzum-market}/common/types.d.ts +0 -0
  92. /package/lib/esm/modules/{uzum → uzum-market}/common/types.js +0 -0
  93. /package/lib/esm/modules/{uzum → uzum-market}/common/utils.d.ts +0 -0
  94. /package/lib/esm/modules/{uzum → uzum-market}/common/utils.js +0 -0
  95. /package/lib/esm/modules/{uzum → uzum-market}/core/index.d.ts +0 -0
  96. /package/lib/esm/modules/{uzum → uzum-market}/core/products/index.d.ts +0 -0
  97. /package/lib/esm/modules/{uzum → uzum-market}/core/products/mappers.d.ts +0 -0
  98. /package/lib/esm/modules/{uzum → uzum-market}/core/products/mappers.js +0 -0
  99. /package/lib/esm/modules/{uzum → uzum-market}/core/products/params.js +0 -0
  100. /package/lib/esm/modules/{uzum → uzum-market}/core/products/types.js +0 -0
  101. /package/lib/esm/modules/{uzum → uzum-market}/core/types.js +0 -0
  102. /package/lib/esm/modules/{uzum → uzum-market}/index.d.ts +0 -0
@@ -1 +1 @@
1
-
1
+ var plazaSdk=function(e,r){"use strict";const s=e=>({Authorization:`Bearer ${e}`}),t=(e,r=0)=>{if("number"==typeof e)return e;if("string"==typeof e){const s=parseFloat(e);return isNaN(s)?r:s}return r},o=e=>({searchQuery:r.get(e,"searchQuery","")||"",filter:r.get(e,"filter")||"ALL",sortBy:r.get(e,"sortBy")||"id",order:r.get(e,"order")||"descending",size:t(r.get(e,"size"),250),page:t(r.get(e,"page"),0)});return e.AddPromotion=(e,r,t)=>e.post(`/seller/shop/${r.shopId}/marketing/calendar-event/add`,t,{headers:s(r.token)}),e.ArchiveProduct=(e,{token:r,shopId:t,skuId:o})=>e.post(`/seller/shop/${t}/product/sku/${o}/archive`,null,{headers:s(r)}),e.InvolvedProductsList=async(e,r)=>e.get(`/seller/shop/${r.shopId}/marketing/calendar-event/products-involved`,{params:{eventId:r.eventId,page:r.page,size:r.size},headers:s(r.token)}),e.ProductDescription=async(e,r)=>e.get(`/seller/shop/${r.shopId}/product/${r.productId}/description-response`,{headers:s(r.token)}),e.ProductsList=async(e,r)=>await e.get(`/seller/shop/${r.shopId}/product/getProducts`,{params:o(r),headers:s(r.token)}),e.RemovePromotion=(e,r,t)=>e.post(`/seller/shop/${r.shopId}/marketing/calendar-event/remove`,t,{headers:s(r.token)}),e.UnarchiveProduct=(e,{token:r,shopId:t,skuId:o})=>e.post(`/seller/shop/${t}/product/sku/${o}/archive/restore`,null,{headers:s(r)}),e}({},lodash);
@@ -1 +1 @@
1
- !function(n){"function"==typeof define&&define.amd?define(n):n()}(function(){});
1
+ !function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("lodash")):"function"==typeof define&&define.amd?define(["exports","lodash"],o):o((e="undefined"!=typeof globalThis?globalThis:e||self).plazaSdk={},e.lodash)}(this,function(e,o){"use strict";const s=e=>({Authorization:`Bearer ${e}`}),t=(e,o=0)=>{if("number"==typeof e)return e;if("string"==typeof e){const s=parseFloat(e);return isNaN(s)?o:s}return o},r=e=>({searchQuery:o.get(e,"searchQuery","")||"",filter:o.get(e,"filter")||"ALL",sortBy:o.get(e,"sortBy")||"id",order:o.get(e,"order")||"descending",size:t(o.get(e,"size"),250),page:t(o.get(e,"page"),0)});e.AddPromotion=(e,o,t)=>e.post(`/seller/shop/${o.shopId}/marketing/calendar-event/add`,t,{headers:s(o.token)}),e.ArchiveProduct=(e,{token:o,shopId:t,skuId:r})=>e.post(`/seller/shop/${t}/product/sku/${r}/archive`,null,{headers:s(o)}),e.InvolvedProductsList=async(e,o)=>e.get(`/seller/shop/${o.shopId}/marketing/calendar-event/products-involved`,{params:{eventId:o.eventId,page:o.page,size:o.size},headers:s(o.token)}),e.ProductDescription=async(e,o)=>e.get(`/seller/shop/${o.shopId}/product/${o.productId}/description-response`,{headers:s(o.token)}),e.ProductsList=async(e,o)=>await e.get(`/seller/shop/${o.shopId}/product/getProducts`,{params:r(o),headers:s(o.token)}),e.RemovePromotion=(e,o,t)=>e.post(`/seller/shop/${o.shopId}/marketing/calendar-event/remove`,t,{headers:s(o.token)}),e.UnarchiveProduct=(e,{token:o,shopId:t,skuId:r})=>e.post(`/seller/shop/${t}/product/sku/${r}/archive/restore`,null,{headers:s(o)})});
@@ -0,0 +1 @@
1
+ export * from "./modules/uzum-market";
package/lib/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";
1
+ "use strict";var o=require("./modules/uzum-market/core/products/api.js");exports.AddPromotion=o.AddPromotion,exports.ArchiveProduct=o.ArchiveProduct,exports.InvolvedProductsList=o.InvolvedProductsList,exports.ProductDescription=o.ProductDescription,exports.ProductsList=o.ProductsList,exports.RemovePromotion=o.RemovePromotion,exports.UnarchiveProduct=o.UnarchiveProduct;
@@ -0,0 +1 @@
1
+ export * from "./uzum-market";
@@ -1 +1 @@
1
- "use strict";
1
+ "use strict";var o=require("./uzum-market/core/products/api.js");exports.AddPromotion=o.AddPromotion,exports.ArchiveProduct=o.ArchiveProduct,exports.InvolvedProductsList=o.InvolvedProductsList,exports.ProductDescription=o.ProductDescription,exports.ProductsList=o.ProductsList,exports.RemovePromotion=o.RemovePromotion,exports.UnarchiveProduct=o.UnarchiveProduct;
@@ -0,0 +1,72 @@
1
+ import { NumberNullable } from "@/common/types";
2
+ import { IMultiLang } from "@/common/interfaces";
3
+ import { ProductStatuses } from "./types";
4
+ export interface StatusValue {
5
+ value: string;
6
+ title: string;
7
+ color: string;
8
+ }
9
+ export interface PromotionSku {
10
+ skuId: number;
11
+ newPrice: number;
12
+ }
13
+ export interface Status {
14
+ id: number;
15
+ title: string;
16
+ value: ProductStatuses;
17
+ description: string;
18
+ color: string;
19
+ additional: unknown[];
20
+ }
21
+ export interface Dimensions {
22
+ length: NumberNullable;
23
+ width: NumberNullable;
24
+ height: NumberNullable;
25
+ weight: NumberNullable;
26
+ }
27
+ export interface RankInfo {
28
+ rank: string;
29
+ rankValue: string;
30
+ dateUpdated: number;
31
+ }
32
+ export interface SkuCharacteristic {
33
+ characteristicTitle: IMultiLang;
34
+ definedType: boolean;
35
+ characteristicValue: IMultiLang;
36
+ }
37
+ export interface CommissionDto {
38
+ minCommission: number;
39
+ maxCommission: number;
40
+ }
41
+ export interface CharacteristicValue {
42
+ title: IMultiLang;
43
+ value: string;
44
+ skuValue: string;
45
+ wantToPhotoStudio: boolean | null;
46
+ }
47
+ export interface DefinedCharacteristic {
48
+ orderingNumber: number;
49
+ characteristicValues: CharacteristicValue[];
50
+ characteristicTitle: IMultiLang;
51
+ characteristicId: number | null;
52
+ defined: boolean;
53
+ requiredType?: string;
54
+ }
55
+ export interface FilterValue {
56
+ id: number;
57
+ value: string;
58
+ title: string;
59
+ predefined: boolean;
60
+ isApproved: boolean | null;
61
+ }
62
+ export interface Filter {
63
+ id: number;
64
+ title: string;
65
+ description: string | null;
66
+ extendableValues: boolean;
67
+ required: boolean;
68
+ values: FilterValue[];
69
+ emptyValue: FilterValue;
70
+ maxLength: number | null;
71
+ brandFilter: boolean;
72
+ }
@@ -0,0 +1 @@
1
+ "use strict";var o=require("./products/api.js");exports.AddPromotion=o.AddPromotion,exports.ArchiveProduct=o.ArchiveProduct,exports.InvolvedProductsList=o.InvolvedProductsList,exports.ProductDescription=o.ProductDescription,exports.ProductsList=o.ProductsList,exports.RemovePromotion=o.RemovePromotion,exports.UnarchiveProduct=o.UnarchiveProduct;
@@ -1,8 +1,10 @@
1
1
  import * as Types from "./types";
2
2
  import * as Params from "./params";
3
3
  import { CallerParam, CallerParamPayload } from "@/common/types";
4
- export declare const ArchiveProduct: CallerParam<Params.SkuIdBasedParams>;
5
- export declare const UnarchiveProduct: CallerParam<Params.SkuIdBasedParams>;
6
- export declare const ProductsList: CallerParam<Params.ProductListParams>;
4
+ export declare const ArchiveProduct: CallerParam<Params.SkuIdBasedParams, Types.IApi.ArchiveProduct.Response>;
5
+ export declare const UnarchiveProduct: CallerParam<Params.SkuIdBasedParams, Types.IApi.UnarchiveProduct.Response>;
6
+ export declare const ProductsList: CallerParam<Params.ProductListParams, Types.IApi.ProductsList.Response>;
7
7
  export declare const RemovePromotion: CallerParamPayload<Params.TokenAndShopId, Types.IApi.RemovePromotion.Request>;
8
8
  export declare const AddPromotion: CallerParamPayload<Params.TokenAndShopId, Types.IApi.AddPromotion.Request>;
9
+ export declare const InvolvedProductsList: CallerParam<Params.InvolvedProductsParams>;
10
+ export declare const ProductDescription: CallerParam<Params.ProductIdBasedParams, Types.IApi.ProductDescription.Response>;
@@ -0,0 +1 @@
1
+ "use strict";var e=require("../../common/utils.js"),s=require("./mappers.js");exports.AddPromotion=(s,r,t)=>s.post(`/seller/shop/${r.shopId}/marketing/calendar-event/add`,t,{headers:e.pasteAuthHeader(r.token)}),exports.ArchiveProduct=(s,{token:r,shopId:t,skuId:o})=>s.post(`/seller/shop/${t}/product/sku/${o}/archive`,null,{headers:e.pasteAuthHeader(r)}),exports.InvolvedProductsList=async(s,r)=>s.get(`/seller/shop/${r.shopId}/marketing/calendar-event/products-involved`,{params:{eventId:r.eventId,page:r.page,size:r.size},headers:e.pasteAuthHeader(r.token)}),exports.ProductDescription=async(s,r)=>s.get(`/seller/shop/${r.shopId}/product/${r.productId}/description-response`,{headers:e.pasteAuthHeader(r.token)}),exports.ProductsList=async(r,t)=>await r.get(`/seller/shop/${t.shopId}/product/getProducts`,{params:s.ProductListParamsMapper(t),headers:e.pasteAuthHeader(t.token)}),exports.RemovePromotion=(s,r,t)=>s.post(`/seller/shop/${r.shopId}/marketing/calendar-event/remove`,t,{headers:e.pasteAuthHeader(r.token)}),exports.UnarchiveProduct=(s,{token:r,shopId:t,skuId:o})=>s.post(`/seller/shop/${t}/product/sku/${o}/archive/restore`,null,{headers:e.pasteAuthHeader(r)});
@@ -0,0 +1 @@
1
+ "use strict";var o=require("./api.js");exports.AddPromotion=o.AddPromotion,exports.ArchiveProduct=o.ArchiveProduct,exports.InvolvedProductsList=o.InvolvedProductsList,exports.ProductDescription=o.ProductDescription,exports.ProductsList=o.ProductsList,exports.RemovePromotion=o.RemovePromotion,exports.UnarchiveProduct=o.UnarchiveProduct;
@@ -2,14 +2,22 @@ export interface TokenAndShopId {
2
2
  token: string;
3
3
  shopId: number;
4
4
  }
5
- export interface SkuIdBasedParams extends TokenAndShopId {
6
- skuId: number;
5
+ export interface ProductIdBasedParams extends TokenAndShopId {
6
+ productId: number;
7
7
  }
8
- export interface ProductListParams extends TokenAndShopId {
8
+ export interface CorePaginationParams {
9
9
  page: number;
10
10
  size: number;
11
+ }
12
+ export interface SkuIdBasedParams extends TokenAndShopId {
13
+ skuId: number;
14
+ }
15
+ export type ProductListParams = TokenAndShopId & CorePaginationParams & {
11
16
  searchQuery?: string;
12
17
  filter: "ALL" & (string & {});
13
18
  sortBy: "id" & (string & {});
14
19
  order: "ascending" | "descending";
15
- }
20
+ };
21
+ export type InvolvedProductsParams = TokenAndShopId & CorePaginationParams & {
22
+ eventId: number;
23
+ };
@@ -0,0 +1,46 @@
1
+ import { IMultiLang } from "@/common/interfaces";
2
+ import { CommissionDto, DefinedCharacteristic, Filter, Status } from "@/modules/uzum-market/common/interfaces";
3
+ import { UzumMarketEntity } from "../types";
4
+ export declare namespace IApi {
5
+ namespace ArchiveProduct {
6
+ type Response = UzumMarketEntity.SkuCore;
7
+ }
8
+ namespace UnarchiveProduct {
9
+ type Response = UzumMarketEntity.SkuCore;
10
+ }
11
+ namespace ProductsList {
12
+ interface Response {
13
+ productList: UzumMarketEntity.Product[];
14
+ totalProductsAmount: number;
15
+ }
16
+ }
17
+ namespace RemovePromotion {
18
+ interface Request {
19
+ calendarEventId: number;
20
+ productId: number;
21
+ }
22
+ }
23
+ namespace AddPromotion {
24
+ interface Request {
25
+ calendarEventId: number;
26
+ products: UzumMarketEntity.PromotionProduct[];
27
+ }
28
+ }
29
+ namespace ProductDescription {
30
+ interface Response {
31
+ id: number;
32
+ shopSkuTitle: string;
33
+ title: IMultiLang;
34
+ productSkuTitle: string;
35
+ commission: number;
36
+ commissionDto: CommissionDto;
37
+ hasCustomCharacteristics: boolean;
38
+ definedCharacteristicList: DefinedCharacteristic[];
39
+ customCharacteristicList: DefinedCharacteristic[];
40
+ skuList: UzumMarketEntity.FilledSkuItem[];
41
+ filters: Filter[];
42
+ newYearStatus: Status;
43
+ hasActiveCalendarEvents: boolean;
44
+ }
45
+ }
46
+ }
@@ -16,6 +16,13 @@ export declare namespace UzumMarketEntity {
16
16
  status: StatusValue;
17
17
  commission: number;
18
18
  }
19
+ interface FilledSkuItem extends SkuCore {
20
+ dimensions: Dimensions;
21
+ article: string | null;
22
+ switchbackActive: boolean;
23
+ marketPrice: number;
24
+ blockReasons: unknown[];
25
+ }
19
26
  interface SkuWithDetails extends SkuCore {
20
27
  dimensions: Dimensions;
21
28
  article: StringNullable;
@@ -0,0 +1 @@
1
+ "use strict";var o=require("./core/products/api.js");exports.AddPromotion=o.AddPromotion,exports.ArchiveProduct=o.ArchiveProduct,exports.InvolvedProductsList=o.InvolvedProductsList,exports.ProductDescription=o.ProductDescription,exports.ProductsList=o.ProductsList,exports.RemovePromotion=o.RemovePromotion,exports.UnarchiveProduct=o.UnarchiveProduct;
@@ -0,0 +1 @@
1
+ export * from "./modules/uzum-market";
package/lib/esm/index.js CHANGED
@@ -1 +1 @@
1
-
1
+ export{AddPromotion,ArchiveProduct,InvolvedProductsList,ProductDescription,ProductsList,RemovePromotion,UnarchiveProduct}from"./modules/uzum-market/core/products/api.js";
@@ -0,0 +1 @@
1
+ export * from "./uzum-market";
@@ -1 +1 @@
1
-
1
+ export{AddPromotion,ArchiveProduct,InvolvedProductsList,ProductDescription,ProductsList,RemovePromotion,UnarchiveProduct}from"./uzum-market/core/products/api.js";
@@ -0,0 +1,72 @@
1
+ import { NumberNullable } from "@/common/types";
2
+ import { IMultiLang } from "@/common/interfaces";
3
+ import { ProductStatuses } from "./types";
4
+ export interface StatusValue {
5
+ value: string;
6
+ title: string;
7
+ color: string;
8
+ }
9
+ export interface PromotionSku {
10
+ skuId: number;
11
+ newPrice: number;
12
+ }
13
+ export interface Status {
14
+ id: number;
15
+ title: string;
16
+ value: ProductStatuses;
17
+ description: string;
18
+ color: string;
19
+ additional: unknown[];
20
+ }
21
+ export interface Dimensions {
22
+ length: NumberNullable;
23
+ width: NumberNullable;
24
+ height: NumberNullable;
25
+ weight: NumberNullable;
26
+ }
27
+ export interface RankInfo {
28
+ rank: string;
29
+ rankValue: string;
30
+ dateUpdated: number;
31
+ }
32
+ export interface SkuCharacteristic {
33
+ characteristicTitle: IMultiLang;
34
+ definedType: boolean;
35
+ characteristicValue: IMultiLang;
36
+ }
37
+ export interface CommissionDto {
38
+ minCommission: number;
39
+ maxCommission: number;
40
+ }
41
+ export interface CharacteristicValue {
42
+ title: IMultiLang;
43
+ value: string;
44
+ skuValue: string;
45
+ wantToPhotoStudio: boolean | null;
46
+ }
47
+ export interface DefinedCharacteristic {
48
+ orderingNumber: number;
49
+ characteristicValues: CharacteristicValue[];
50
+ characteristicTitle: IMultiLang;
51
+ characteristicId: number | null;
52
+ defined: boolean;
53
+ requiredType?: string;
54
+ }
55
+ export interface FilterValue {
56
+ id: number;
57
+ value: string;
58
+ title: string;
59
+ predefined: boolean;
60
+ isApproved: boolean | null;
61
+ }
62
+ export interface Filter {
63
+ id: number;
64
+ title: string;
65
+ description: string | null;
66
+ extendableValues: boolean;
67
+ required: boolean;
68
+ values: FilterValue[];
69
+ emptyValue: FilterValue;
70
+ maxLength: number | null;
71
+ brandFilter: boolean;
72
+ }
@@ -0,0 +1 @@
1
+ export{AddPromotion,ArchiveProduct,InvolvedProductsList,ProductDescription,ProductsList,RemovePromotion,UnarchiveProduct}from"./products/api.js";
@@ -1,8 +1,10 @@
1
1
  import * as Types from "./types";
2
2
  import * as Params from "./params";
3
3
  import { CallerParam, CallerParamPayload } from "@/common/types";
4
- export declare const ArchiveProduct: CallerParam<Params.SkuIdBasedParams>;
5
- export declare const UnarchiveProduct: CallerParam<Params.SkuIdBasedParams>;
6
- export declare const ProductsList: CallerParam<Params.ProductListParams>;
4
+ export declare const ArchiveProduct: CallerParam<Params.SkuIdBasedParams, Types.IApi.ArchiveProduct.Response>;
5
+ export declare const UnarchiveProduct: CallerParam<Params.SkuIdBasedParams, Types.IApi.UnarchiveProduct.Response>;
6
+ export declare const ProductsList: CallerParam<Params.ProductListParams, Types.IApi.ProductsList.Response>;
7
7
  export declare const RemovePromotion: CallerParamPayload<Params.TokenAndShopId, Types.IApi.RemovePromotion.Request>;
8
8
  export declare const AddPromotion: CallerParamPayload<Params.TokenAndShopId, Types.IApi.AddPromotion.Request>;
9
+ export declare const InvolvedProductsList: CallerParam<Params.InvolvedProductsParams>;
10
+ export declare const ProductDescription: CallerParam<Params.ProductIdBasedParams, Types.IApi.ProductDescription.Response>;
@@ -1 +1 @@
1
- import{pasteAuthHeader as e}from"../../common/utils.js";import{ProductListParamsMapper as s}from"./mappers.js";const o=(s,{token:o,shopId:r,skuId:t})=>s.post(`/seller/shop/${r}/product/sku/${t}/archive`,null,{headers:e(o)}),r=(s,{token:o,shopId:r,skuId:t})=>s.post(`/seller/shop/${r}/product/sku/${t}/archive/restore`,null,{headers:e(o)}),t=async(o,r)=>await o.get(`/seller/shop/${r.shopId}/product/getProducts`,{params:s(r),headers:e(r.token)}),p=(s,o,r)=>s.post(`/seller/shop/${o.shopId}/marketing/calendar-event/remove`,r,{headers:e(o.token)}),a=(s,o,r)=>s.post(`/seller/shop/${o.shopId}/marketing/calendar-event/add`,r,{headers:e(o.token)});export{a as AddPromotion,o as ArchiveProduct,t as ProductsList,p as RemovePromotion,r as UnarchiveProduct};
1
+ import{pasteAuthHeader as e}from"../../common/utils.js";import{ProductListParamsMapper as s}from"./mappers.js";const o=(s,{token:o,shopId:r,skuId:t})=>s.post(`/seller/shop/${r}/product/sku/${t}/archive`,null,{headers:e(o)}),r=(s,{token:o,shopId:r,skuId:t})=>s.post(`/seller/shop/${r}/product/sku/${t}/archive/restore`,null,{headers:e(o)}),t=async(o,r)=>await o.get(`/seller/shop/${r.shopId}/product/getProducts`,{params:s(r),headers:e(r.token)}),p=(s,o,r)=>s.post(`/seller/shop/${o.shopId}/marketing/calendar-event/remove`,r,{headers:e(o.token)}),d=(s,o,r)=>s.post(`/seller/shop/${o.shopId}/marketing/calendar-event/add`,r,{headers:e(o.token)}),a=async(s,o)=>s.get(`/seller/shop/${o.shopId}/marketing/calendar-event/products-involved`,{params:{eventId:o.eventId,page:o.page,size:o.size},headers:e(o.token)}),n=async(s,o)=>s.get(`/seller/shop/${o.shopId}/product/${o.productId}/description-response`,{headers:e(o.token)});export{d as AddPromotion,o as ArchiveProduct,a as InvolvedProductsList,n as ProductDescription,t as ProductsList,p as RemovePromotion,r as UnarchiveProduct};
@@ -0,0 +1 @@
1
+ export{AddPromotion,ArchiveProduct,InvolvedProductsList,ProductDescription,ProductsList,RemovePromotion,UnarchiveProduct}from"./api.js";
@@ -2,14 +2,22 @@ export interface TokenAndShopId {
2
2
  token: string;
3
3
  shopId: number;
4
4
  }
5
- export interface SkuIdBasedParams extends TokenAndShopId {
6
- skuId: number;
5
+ export interface ProductIdBasedParams extends TokenAndShopId {
6
+ productId: number;
7
7
  }
8
- export interface ProductListParams extends TokenAndShopId {
8
+ export interface CorePaginationParams {
9
9
  page: number;
10
10
  size: number;
11
+ }
12
+ export interface SkuIdBasedParams extends TokenAndShopId {
13
+ skuId: number;
14
+ }
15
+ export type ProductListParams = TokenAndShopId & CorePaginationParams & {
11
16
  searchQuery?: string;
12
17
  filter: "ALL" & (string & {});
13
18
  sortBy: "id" & (string & {});
14
19
  order: "ascending" | "descending";
15
- }
20
+ };
21
+ export type InvolvedProductsParams = TokenAndShopId & CorePaginationParams & {
22
+ eventId: number;
23
+ };
@@ -0,0 +1,46 @@
1
+ import { IMultiLang } from "@/common/interfaces";
2
+ import { CommissionDto, DefinedCharacteristic, Filter, Status } from "@/modules/uzum-market/common/interfaces";
3
+ import { UzumMarketEntity } from "../types";
4
+ export declare namespace IApi {
5
+ namespace ArchiveProduct {
6
+ type Response = UzumMarketEntity.SkuCore;
7
+ }
8
+ namespace UnarchiveProduct {
9
+ type Response = UzumMarketEntity.SkuCore;
10
+ }
11
+ namespace ProductsList {
12
+ interface Response {
13
+ productList: UzumMarketEntity.Product[];
14
+ totalProductsAmount: number;
15
+ }
16
+ }
17
+ namespace RemovePromotion {
18
+ interface Request {
19
+ calendarEventId: number;
20
+ productId: number;
21
+ }
22
+ }
23
+ namespace AddPromotion {
24
+ interface Request {
25
+ calendarEventId: number;
26
+ products: UzumMarketEntity.PromotionProduct[];
27
+ }
28
+ }
29
+ namespace ProductDescription {
30
+ interface Response {
31
+ id: number;
32
+ shopSkuTitle: string;
33
+ title: IMultiLang;
34
+ productSkuTitle: string;
35
+ commission: number;
36
+ commissionDto: CommissionDto;
37
+ hasCustomCharacteristics: boolean;
38
+ definedCharacteristicList: DefinedCharacteristic[];
39
+ customCharacteristicList: DefinedCharacteristic[];
40
+ skuList: UzumMarketEntity.FilledSkuItem[];
41
+ filters: Filter[];
42
+ newYearStatus: Status;
43
+ hasActiveCalendarEvents: boolean;
44
+ }
45
+ }
46
+ }
@@ -1,6 +1,6 @@
1
1
  import { NumberNullable, StringNullable } from "@/common/types";
2
2
  import { Dimensions, PromotionSku, RankInfo, SkuCharacteristic, Status, StatusValue } from "../common/interfaces";
3
- export declare namespace UzumEntity {
3
+ export declare namespace UzumMarketEntity {
4
4
  interface SkuCore {
5
5
  id: number;
6
6
  skuTitle: string;
@@ -16,6 +16,13 @@ export declare namespace UzumEntity {
16
16
  status: StatusValue;
17
17
  commission: number;
18
18
  }
19
+ interface FilledSkuItem extends SkuCore {
20
+ dimensions: Dimensions;
21
+ article: string | null;
22
+ switchbackActive: boolean;
23
+ marketPrice: number;
24
+ blockReasons: unknown[];
25
+ }
19
26
  interface SkuWithDetails extends SkuCore {
20
27
  dimensions: Dimensions;
21
28
  article: StringNullable;
@@ -0,0 +1 @@
1
+ export{AddPromotion,ArchiveProduct,InvolvedProductsList,ProductDescription,ProductsList,RemovePromotion,UnarchiveProduct}from"./core/products/api.js";
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "plaza-sdk",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "outputDir": "./lib",
5
-
6
5
  "exports": {
7
6
  "import": {
8
7
  "types": "./lib/esm/index.d.ts",
@@ -1,36 +0,0 @@
1
- import { NumberNullable } from "@/common/types";
2
- import { IMultiLang } from "@/common/interfaces";
3
- import { ProductStatuses } from "./types";
4
- export interface StatusValue {
5
- value: string;
6
- title: string;
7
- color: string;
8
- }
9
- export interface PromotionSku {
10
- skuId: number;
11
- newPrice: number;
12
- }
13
- export interface Status {
14
- id: number;
15
- title: string;
16
- value: ProductStatuses;
17
- description: string;
18
- color: string;
19
- additional: unknown[];
20
- }
21
- export interface Dimensions {
22
- length: NumberNullable;
23
- width: NumberNullable;
24
- height: NumberNullable;
25
- weight: NumberNullable;
26
- }
27
- export interface RankInfo {
28
- rank: string;
29
- rankValue: string;
30
- dateUpdated: number;
31
- }
32
- export interface SkuCharacteristic {
33
- characteristicTitle: IMultiLang;
34
- definedType: boolean;
35
- characteristicValue: IMultiLang;
36
- }
@@ -1 +0,0 @@
1
- "use strict";var o=require("./products/api.js");exports.AddPromotion=o.AddPromotion,exports.ArchiveProduct=o.ArchiveProduct,exports.ProductsList=o.ProductsList,exports.RemovePromotion=o.RemovePromotion,exports.UnarchiveProduct=o.UnarchiveProduct;
@@ -1 +0,0 @@
1
- "use strict";var e=require("../../common/utils.js"),s=require("./mappers.js");exports.AddPromotion=(s,r,t)=>s.post(`/seller/shop/${r.shopId}/marketing/calendar-event/add`,t,{headers:e.pasteAuthHeader(r.token)}),exports.ArchiveProduct=(s,{token:r,shopId:t,skuId:o})=>s.post(`/seller/shop/${t}/product/sku/${o}/archive`,null,{headers:e.pasteAuthHeader(r)}),exports.ProductsList=async(r,t)=>await r.get(`/seller/shop/${t.shopId}/product/getProducts`,{params:s.ProductListParamsMapper(t),headers:e.pasteAuthHeader(t.token)}),exports.RemovePromotion=(s,r,t)=>s.post(`/seller/shop/${r.shopId}/marketing/calendar-event/remove`,t,{headers:e.pasteAuthHeader(r.token)}),exports.UnarchiveProduct=(s,{token:r,shopId:t,skuId:o})=>s.post(`/seller/shop/${t}/product/sku/${o}/archive/restore`,null,{headers:e.pasteAuthHeader(r)});
@@ -1 +0,0 @@
1
- "use strict";var o=require("./api.js");exports.AddPromotion=o.AddPromotion,exports.ArchiveProduct=o.ArchiveProduct,exports.ProductsList=o.ProductsList,exports.RemovePromotion=o.RemovePromotion,exports.UnarchiveProduct=o.UnarchiveProduct;
@@ -1,27 +0,0 @@
1
- import { UzumEntity } from "@/modules/uzum/core/types";
2
- export declare namespace IApi {
3
- namespace ArchiveProduct {
4
- type Response = UzumEntity.SkuCore;
5
- }
6
- namespace UnarchiveProduct {
7
- type Response = UzumEntity.SkuCore;
8
- }
9
- namespace ProductsList {
10
- interface Response {
11
- productList: UzumEntity.Product[];
12
- totalProductsAmount: number;
13
- }
14
- }
15
- namespace RemovePromotion {
16
- interface Request {
17
- calendarEventId: number;
18
- productId: number;
19
- }
20
- }
21
- namespace AddPromotion {
22
- interface Request {
23
- calendarEventId: number;
24
- products: UzumEntity.PromotionProduct[];
25
- }
26
- }
27
- }
@@ -1,102 +0,0 @@
1
- import { NumberNullable, StringNullable } from "@/common/types";
2
- import { Dimensions, PromotionSku, RankInfo, SkuCharacteristic, Status, StatusValue } from "../common/interfaces";
3
- export declare namespace UzumEntity {
4
- interface SkuCore {
5
- id: number;
6
- skuTitle: string;
7
- quantityCreated: number;
8
- fullPrice: number;
9
- sellPrice: number;
10
- barcode: string;
11
- ikpu: string;
12
- skuCharacteristicList: SkuCharacteristic[];
13
- isActive: boolean;
14
- canEdit: boolean;
15
- blocked: boolean;
16
- status: StatusValue;
17
- commission: number;
18
- }
19
- interface SkuWithDetails extends SkuCore {
20
- dimensions: Dimensions;
21
- article: StringNullable;
22
- switchbackActive: boolean;
23
- marketPrice: number;
24
- blockReasons: unknown[];
25
- }
26
- interface PromotionProduct {
27
- productId: number;
28
- skus: PromotionSku[];
29
- }
30
- interface ProductQuantity {
31
- quantityCreated: number;
32
- quantityActive: number;
33
- quantityFbs: number;
34
- quantityAdditional: number;
35
- quantityOnPhotoStudio: number;
36
- quantityArchived?: number;
37
- quantitySold: number;
38
- quantityReturned: number;
39
- quantityMissing: number;
40
- quantityDefected: number;
41
- quantityPending: number;
42
- returnedPercentage: number;
43
- pstorage: boolean;
44
- }
45
- interface SkuWithQuantities extends Required<ProductQuantity> {
46
- skuTitle: string;
47
- skuFullTitle: string;
48
- productTitle: string;
49
- skuId: number;
50
- barcode: number;
51
- archived: boolean;
52
- commission: NumberNullable;
53
- characteristics: string;
54
- previewImage: string;
55
- ikpu: string;
56
- purchasePrice: NumberNullable;
57
- price: number;
58
- recommendedTotalPrice: NumberNullable;
59
- blockingReason: StringNullable;
60
- blockReasons: string[];
61
- skuBlockReason: StringNullable;
62
- blocked: boolean;
63
- rankInfo: RankInfo;
64
- article: unknown;
65
- turnover: StringNullable;
66
- dimensionalGroup: StringNullable;
67
- paidStorageDimensionalGroup: StringNullable;
68
- paidStoragePriceItem: StringNullable;
69
- paidStorageAmount: StringNullable;
70
- actualDimensionalGroup: StringNullable;
71
- hasStudioPhoto: unknown;
72
- forecastOutOfStock: boolean;
73
- activeSale: boolean;
74
- switchbackActive: boolean;
75
- marketPrice: number;
76
- characteristicsList: SkuCharacteristic[];
77
- status: StatusValue;
78
- skuDimension: Dimensions;
79
- avgdsales: NumberNullable;
80
- avgdquantity: NumberNullable;
81
- }
82
- interface Product extends ProductQuantity {
83
- productId: number;
84
- category: string;
85
- rating: string;
86
- commission: NumberNullable;
87
- status: Status;
88
- skuList: SkuWithQuantities[];
89
- skuTitle: string;
90
- image: string;
91
- title: string;
92
- price: number;
93
- clicks: NumberNullable;
94
- viewers: number;
95
- conversion: number;
96
- blockReason: StringNullable;
97
- blockComment: StringNullable;
98
- dateModerated: StringNullable;
99
- auctionMember: boolean;
100
- isActive: boolean;
101
- }
102
- }
@@ -1 +0,0 @@
1
- "use strict";var o=require("./core/products/api.js");exports.AddPromotion=o.AddPromotion,exports.ArchiveProduct=o.ArchiveProduct,exports.ProductsList=o.ProductsList,exports.RemovePromotion=o.RemovePromotion,exports.UnarchiveProduct=o.UnarchiveProduct;
File without changes
@@ -1 +0,0 @@
1
- "use strict";
File without changes
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,4 +0,0 @@
1
- export interface IMultiLang {
2
- uz: string;
3
- ru: string;
4
- }
@@ -1 +0,0 @@
1
- export {};
@@ -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 {};
@@ -1 +0,0 @@
1
- export declare const getNumber: (value: unknown, defaultValue?: number) => number;
@@ -1,10 +0,0 @@
1
- export const getNumber = (value, defaultValue = 0) => {
2
- if (typeof value === "number") {
3
- return value;
4
- }
5
- if (typeof value === "string") {
6
- const parsed = parseFloat(value);
7
- return isNaN(parsed) ? defaultValue : parsed;
8
- }
9
- return defaultValue;
10
- };
@@ -1,36 +0,0 @@
1
- import { NumberNullable } from "@/common/types";
2
- import { IMultiLang } from "@/common/interfaces";
3
- import { ProductStatuses } from "./types";
4
- export interface StatusValue {
5
- value: string;
6
- title: string;
7
- color: string;
8
- }
9
- export interface PromotionSku {
10
- skuId: number;
11
- newPrice: number;
12
- }
13
- export interface Status {
14
- id: number;
15
- title: string;
16
- value: ProductStatuses;
17
- description: string;
18
- color: string;
19
- additional: unknown[];
20
- }
21
- export interface Dimensions {
22
- length: NumberNullable;
23
- width: NumberNullable;
24
- height: NumberNullable;
25
- weight: NumberNullable;
26
- }
27
- export interface RankInfo {
28
- rank: string;
29
- rankValue: string;
30
- dateUpdated: number;
31
- }
32
- export interface SkuCharacteristic {
33
- characteristicTitle: IMultiLang;
34
- definedType: boolean;
35
- characteristicValue: IMultiLang;
36
- }
@@ -1 +0,0 @@
1
- export{AddPromotion,ArchiveProduct,ProductsList,RemovePromotion,UnarchiveProduct}from"./products/api.js";
@@ -1 +0,0 @@
1
- export{AddPromotion,ArchiveProduct,ProductsList,RemovePromotion,UnarchiveProduct}from"./api.js";
@@ -1,15 +0,0 @@
1
- export interface TokenAndShopId {
2
- token: string;
3
- shopId: number;
4
- }
5
- export interface SkuIdBasedParams extends TokenAndShopId {
6
- skuId: number;
7
- }
8
- export interface ProductListParams extends TokenAndShopId {
9
- page: number;
10
- size: number;
11
- searchQuery?: string;
12
- filter: "ALL" & (string & {});
13
- sortBy: "id" & (string & {});
14
- order: "ascending" | "descending";
15
- }
@@ -1,27 +0,0 @@
1
- import { UzumEntity } from "@/modules/uzum/core/types";
2
- export declare namespace IApi {
3
- namespace ArchiveProduct {
4
- type Response = UzumEntity.SkuCore;
5
- }
6
- namespace UnarchiveProduct {
7
- type Response = UzumEntity.SkuCore;
8
- }
9
- namespace ProductsList {
10
- interface Response {
11
- productList: UzumEntity.Product[];
12
- totalProductsAmount: number;
13
- }
14
- }
15
- namespace RemovePromotion {
16
- interface Request {
17
- calendarEventId: number;
18
- productId: number;
19
- }
20
- }
21
- namespace AddPromotion {
22
- interface Request {
23
- calendarEventId: number;
24
- products: UzumEntity.PromotionProduct[];
25
- }
26
- }
27
- }
@@ -1 +0,0 @@
1
- export{AddPromotion,ArchiveProduct,ProductsList,RemovePromotion,UnarchiveProduct}from"./core/products/api.js";
package/lib/index.d.ts DELETED
File without changes
package/lib/index.js DELETED
@@ -1 +0,0 @@
1
- "use strict";
File without changes
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,36 +0,0 @@
1
- import { NumberNullable } from "@/common/types";
2
- import { IMultiLang } from "@/common/interfaces";
3
- import { ProductStatuses } from "./types";
4
- export interface StatusValue {
5
- value: string;
6
- title: string;
7
- color: string;
8
- }
9
- export interface PromotionSku {
10
- skuId: number;
11
- newPrice: number;
12
- }
13
- export interface Status {
14
- id: number;
15
- title: string;
16
- value: ProductStatuses;
17
- description: string;
18
- color: string;
19
- additional: unknown[];
20
- }
21
- export interface Dimensions {
22
- length: NumberNullable;
23
- width: NumberNullable;
24
- height: NumberNullable;
25
- weight: NumberNullable;
26
- }
27
- export interface RankInfo {
28
- rank: string;
29
- rankValue: string;
30
- dateUpdated: number;
31
- }
32
- export interface SkuCharacteristic {
33
- characteristicTitle: IMultiLang;
34
- definedType: boolean;
35
- characteristicValue: IMultiLang;
36
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export type ProductStatuses = "READY_TO_SEND" | "ARCHIVED" | "IN_STOCK" | ("RUN_OUT" & (string & {}));
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +0,0 @@
1
- export declare const pasteAuthHeader: (token: string) => {
2
- Authorization: string;
3
- };
@@ -1,3 +0,0 @@
1
- export const pasteAuthHeader = (token) => {
2
- return { Authorization: `Bearer ${token}` };
3
- };
@@ -1 +0,0 @@
1
- export * from "./products";
@@ -1 +0,0 @@
1
- export * from "./products";
@@ -1,8 +0,0 @@
1
- import * as Types from "./types";
2
- import * as Params from "./params";
3
- import { CallerParam, CallerParamPayload } from "@/common/types";
4
- export declare const ArchiveProduct: CallerParam<Params.SkuIdBasedParams>;
5
- export declare const UnarchiveProduct: CallerParam<Params.SkuIdBasedParams>;
6
- export declare const ProductsList: CallerParam<Params.ProductListParams>;
7
- export declare const RemovePromotion: CallerParamPayload<Params.TokenAndShopId, Types.IApi.RemovePromotion.Request>;
8
- export declare const AddPromotion: CallerParamPayload<Params.TokenAndShopId, Types.IApi.AddPromotion.Request>;
@@ -1,24 +0,0 @@
1
- import { pasteAuthHeader } from "@/modules/uzum-market/common/utils";
2
- import * as Mappers from "./mappers";
3
- export const ArchiveProduct = (uzumHttp, { token, shopId, skuId }) => {
4
- return uzumHttp.post(`/seller/shop/${shopId}/product/sku/${skuId}/archive`, null, {
5
- headers: pasteAuthHeader(token),
6
- });
7
- };
8
- export const UnarchiveProduct = (uzumHttp, { token, shopId, skuId }) => {
9
- return uzumHttp.post(`/seller/shop/${shopId}/product/sku/${skuId}/archive/restore`, null, {
10
- headers: pasteAuthHeader(token),
11
- });
12
- };
13
- export const ProductsList = async (uzumHttp, params) => {
14
- return await uzumHttp.get(`/seller/shop/${params.shopId}/product/getProducts`, {
15
- params: Mappers.ProductListParamsMapper(params),
16
- headers: pasteAuthHeader(params.token),
17
- });
18
- };
19
- export const RemovePromotion = (uzumHttp, params, payload) => {
20
- return uzumHttp.post(`/seller/shop/${params.shopId}/marketing/calendar-event/remove`, payload, { headers: pasteAuthHeader(params.token) });
21
- };
22
- export const AddPromotion = (uzumHttp, params, payload) => {
23
- return uzumHttp.post(`/seller/shop/${params.shopId}/marketing/calendar-event/add`, payload, { headers: pasteAuthHeader(params.token) });
24
- };
@@ -1 +0,0 @@
1
- export * from "./api";
@@ -1 +0,0 @@
1
- export * from "./api";
@@ -1,9 +0,0 @@
1
- import { ProductListParams } from "./params";
2
- export declare const ProductListParamsMapper: (params: ProductListParams) => {
3
- searchQuery: string;
4
- filter: "ALL";
5
- sortBy: "id";
6
- order: "ascending" | "descending";
7
- size: number;
8
- page: number;
9
- };
@@ -1,12 +0,0 @@
1
- import { getNumber } from "@/common/utils";
2
- import { get } from "lodash";
3
- export const ProductListParamsMapper = (params) => {
4
- return {
5
- searchQuery: get(params, "searchQuery", "") || "",
6
- filter: get(params, "filter") || "ALL",
7
- sortBy: get(params, "sortBy") || "id",
8
- order: get(params, "order") || "descending",
9
- size: getNumber(get(params, "size"), 250),
10
- page: getNumber(get(params, "page"), 0),
11
- };
12
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,27 +0,0 @@
1
- import { UzumMarketEntity } from "@/modules/uzum-market/core/types";
2
- export declare namespace IApi {
3
- namespace ArchiveProduct {
4
- type Response = UzumMarketEntity.SkuCore;
5
- }
6
- namespace UnarchiveProduct {
7
- type Response = UzumMarketEntity.SkuCore;
8
- }
9
- namespace ProductsList {
10
- interface Response {
11
- productList: UzumMarketEntity.Product[];
12
- totalProductsAmount: number;
13
- }
14
- }
15
- namespace RemovePromotion {
16
- interface Request {
17
- calendarEventId: number;
18
- productId: number;
19
- }
20
- }
21
- namespace AddPromotion {
22
- interface Request {
23
- calendarEventId: number;
24
- products: UzumMarketEntity.PromotionProduct[];
25
- }
26
- }
27
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export * from "./core/products";
@@ -1 +0,0 @@
1
- export * from "./core/products";