plaza-sdk 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.
Files changed (91) 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/esm/index.d.ts +1 -0
  8. package/lib/esm/index.js +1 -1
  9. package/lib/esm/modules/index.d.ts +1 -0
  10. package/lib/esm/modules/index.js +1 -1
  11. package/lib/esm/modules/{uzum → uzum-market}/core/products/types.d.ts +5 -5
  12. package/lib/esm/modules/{uzum → uzum-market}/core/types.d.ts +1 -1
  13. package/package.json +1 -2
  14. package/lib/cjs/modules/uzum/core/products/types.d.ts +0 -27
  15. package/lib/cjs/modules/uzum/core/types.d.ts +0 -102
  16. package/lib/common/constants.d.ts +0 -0
  17. package/lib/common/constants.js +0 -1
  18. package/lib/common/enums.d.ts +0 -0
  19. package/lib/common/enums.js +0 -1
  20. package/lib/common/interfaces.d.ts +0 -4
  21. package/lib/common/interfaces.js +0 -1
  22. package/lib/common/types.d.ts +0 -8
  23. package/lib/common/types.js +0 -1
  24. package/lib/common/utils.d.ts +0 -1
  25. package/lib/common/utils.js +0 -10
  26. package/lib/index.d.ts +0 -0
  27. package/lib/index.js +0 -1
  28. package/lib/modules/index.d.ts +0 -0
  29. package/lib/modules/index.js +0 -1
  30. package/lib/modules/uzum-market/common/interfaces.d.ts +0 -36
  31. package/lib/modules/uzum-market/common/interfaces.js +0 -1
  32. package/lib/modules/uzum-market/common/types.d.ts +0 -1
  33. package/lib/modules/uzum-market/common/types.js +0 -1
  34. package/lib/modules/uzum-market/common/utils.d.ts +0 -3
  35. package/lib/modules/uzum-market/common/utils.js +0 -3
  36. package/lib/modules/uzum-market/core/index.d.ts +0 -1
  37. package/lib/modules/uzum-market/core/index.js +0 -1
  38. package/lib/modules/uzum-market/core/products/api.d.ts +0 -8
  39. package/lib/modules/uzum-market/core/products/api.js +0 -24
  40. package/lib/modules/uzum-market/core/products/index.d.ts +0 -1
  41. package/lib/modules/uzum-market/core/products/index.js +0 -1
  42. package/lib/modules/uzum-market/core/products/mappers.d.ts +0 -9
  43. package/lib/modules/uzum-market/core/products/mappers.js +0 -12
  44. package/lib/modules/uzum-market/core/products/params.d.ts +0 -15
  45. package/lib/modules/uzum-market/core/products/params.js +0 -1
  46. package/lib/modules/uzum-market/core/products/types.js +0 -1
  47. package/lib/modules/uzum-market/core/types.js +0 -1
  48. package/lib/modules/uzum-market/index.d.ts +0 -1
  49. package/lib/modules/uzum-market/index.js +0 -1
  50. /package/lib/cjs/modules/{uzum → uzum-market}/common/interfaces.d.ts +0 -0
  51. /package/lib/cjs/modules/{uzum → uzum-market}/common/interfaces.js +0 -0
  52. /package/lib/cjs/modules/{uzum → uzum-market}/common/types.d.ts +0 -0
  53. /package/lib/cjs/modules/{uzum → uzum-market}/common/types.js +0 -0
  54. /package/lib/cjs/modules/{uzum → uzum-market}/common/utils.d.ts +0 -0
  55. /package/lib/cjs/modules/{uzum → uzum-market}/common/utils.js +0 -0
  56. /package/lib/cjs/modules/{uzum → uzum-market}/core/index.d.ts +0 -0
  57. /package/lib/cjs/modules/{uzum → uzum-market}/core/index.js +0 -0
  58. /package/lib/cjs/modules/{uzum → uzum-market}/core/products/api.d.ts +0 -0
  59. /package/lib/cjs/modules/{uzum → uzum-market}/core/products/api.js +0 -0
  60. /package/lib/cjs/modules/{uzum → uzum-market}/core/products/index.d.ts +0 -0
  61. /package/lib/cjs/modules/{uzum → uzum-market}/core/products/index.js +0 -0
  62. /package/lib/cjs/modules/{uzum → uzum-market}/core/products/mappers.d.ts +0 -0
  63. /package/lib/cjs/modules/{uzum → uzum-market}/core/products/mappers.js +0 -0
  64. /package/lib/cjs/modules/{uzum → uzum-market}/core/products/params.d.ts +0 -0
  65. /package/lib/cjs/modules/{uzum → uzum-market}/core/products/params.js +0 -0
  66. /package/lib/{modules → cjs/modules}/uzum-market/core/products/types.d.ts +0 -0
  67. /package/lib/cjs/modules/{uzum → uzum-market}/core/products/types.js +0 -0
  68. /package/lib/{modules → cjs/modules}/uzum-market/core/types.d.ts +0 -0
  69. /package/lib/cjs/modules/{uzum → uzum-market}/core/types.js +0 -0
  70. /package/lib/cjs/modules/{uzum → uzum-market}/index.d.ts +0 -0
  71. /package/lib/cjs/modules/{uzum → uzum-market}/index.js +0 -0
  72. /package/lib/esm/modules/{uzum → uzum-market}/common/interfaces.d.ts +0 -0
  73. /package/lib/esm/modules/{uzum → uzum-market}/common/interfaces.js +0 -0
  74. /package/lib/esm/modules/{uzum → uzum-market}/common/types.d.ts +0 -0
  75. /package/lib/esm/modules/{uzum → uzum-market}/common/types.js +0 -0
  76. /package/lib/esm/modules/{uzum → uzum-market}/common/utils.d.ts +0 -0
  77. /package/lib/esm/modules/{uzum → uzum-market}/common/utils.js +0 -0
  78. /package/lib/esm/modules/{uzum → uzum-market}/core/index.d.ts +0 -0
  79. /package/lib/esm/modules/{uzum → uzum-market}/core/index.js +0 -0
  80. /package/lib/esm/modules/{uzum → uzum-market}/core/products/api.d.ts +0 -0
  81. /package/lib/esm/modules/{uzum → uzum-market}/core/products/api.js +0 -0
  82. /package/lib/esm/modules/{uzum → uzum-market}/core/products/index.d.ts +0 -0
  83. /package/lib/esm/modules/{uzum → uzum-market}/core/products/index.js +0 -0
  84. /package/lib/esm/modules/{uzum → uzum-market}/core/products/mappers.d.ts +0 -0
  85. /package/lib/esm/modules/{uzum → uzum-market}/core/products/mappers.js +0 -0
  86. /package/lib/esm/modules/{uzum → uzum-market}/core/products/params.d.ts +0 -0
  87. /package/lib/esm/modules/{uzum → uzum-market}/core/products/params.js +0 -0
  88. /package/lib/esm/modules/{uzum → uzum-market}/core/products/types.js +0 -0
  89. /package/lib/esm/modules/{uzum → uzum-market}/core/types.js +0 -0
  90. /package/lib/esm/modules/{uzum → uzum-market}/index.d.ts +0 -0
  91. /package/lib/esm/modules/{uzum → uzum-market}/index.js +0 -0
@@ -1 +1 @@
1
-
1
+ var plazaSdk=function(e,r){"use strict";const t=e=>({Authorization:`Bearer ${e}`}),s=(e,r=0)=>{if("number"==typeof e)return e;if("string"==typeof e){const t=parseFloat(e);return isNaN(t)?r:t}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:s(r.get(e,"size"),250),page:s(r.get(e,"page"),0)});return e.AddPromotion=(e,r,s)=>e.post(`/seller/shop/${r.shopId}/marketing/calendar-event/add`,s,{headers:t(r.token)}),e.ArchiveProduct=(e,{token:r,shopId:s,skuId:o})=>e.post(`/seller/shop/${s}/product/sku/${o}/archive`,null,{headers:t(r)}),e.ProductsList=async(e,r)=>await e.get(`/seller/shop/${r.shopId}/product/getProducts`,{params:o(r),headers:t(r.token)}),e.RemovePromotion=(e,r,s)=>e.post(`/seller/shop/${r.shopId}/marketing/calendar-event/remove`,s,{headers:t(r.token)}),e.UnarchiveProduct=(e,{token:r,shopId:s,skuId:o})=>e.post(`/seller/shop/${s}/product/sku/${o}/archive/restore`,null,{headers:t(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 t=e=>({Authorization:`Bearer ${e}`}),r=(e,o=0)=>{if("number"==typeof e)return e;if("string"==typeof e){const t=parseFloat(e);return isNaN(t)?o:t}return o},s=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:r(o.get(e,"size"),250),page:r(o.get(e,"page"),0)});e.AddPromotion=(e,o,r)=>e.post(`/seller/shop/${o.shopId}/marketing/calendar-event/add`,r,{headers:t(o.token)}),e.ArchiveProduct=(e,{token:o,shopId:r,skuId:s})=>e.post(`/seller/shop/${r}/product/sku/${s}/archive`,null,{headers:t(o)}),e.ProductsList=async(e,o)=>await e.get(`/seller/shop/${o.shopId}/product/getProducts`,{params:s(o),headers:t(o.token)}),e.RemovePromotion=(e,o,r)=>e.post(`/seller/shop/${o.shopId}/marketing/calendar-event/remove`,r,{headers:t(o.token)}),e.UnarchiveProduct=(e,{token:o,shopId:r,skuId:s})=>e.post(`/seller/shop/${r}/product/sku/${s}/archive/restore`,null,{headers:t(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.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.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,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,ProductsList,RemovePromotion,UnarchiveProduct}from"./uzum-market/core/products/api.js";
@@ -1,14 +1,14 @@
1
- import { UzumEntity } from "@/modules/uzum/core/types";
1
+ import { UzumMarketEntity } from "@/modules/uzum-market/core/types";
2
2
  export declare namespace IApi {
3
3
  namespace ArchiveProduct {
4
- type Response = UzumEntity.SkuCore;
4
+ type Response = UzumMarketEntity.SkuCore;
5
5
  }
6
6
  namespace UnarchiveProduct {
7
- type Response = UzumEntity.SkuCore;
7
+ type Response = UzumMarketEntity.SkuCore;
8
8
  }
9
9
  namespace ProductsList {
10
10
  interface Response {
11
- productList: UzumEntity.Product[];
11
+ productList: UzumMarketEntity.Product[];
12
12
  totalProductsAmount: number;
13
13
  }
14
14
  }
@@ -21,7 +21,7 @@ export declare namespace IApi {
21
21
  namespace AddPromotion {
22
22
  interface Request {
23
23
  calendarEventId: number;
24
- products: UzumEntity.PromotionProduct[];
24
+ products: UzumMarketEntity.PromotionProduct[];
25
25
  }
26
26
  }
27
27
  }
@@ -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;
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "plaza-sdk",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "outputDir": "./lib",
5
-
6
5
  "exports": {
7
6
  "import": {
8
7
  "types": "./lib/esm/index.d.ts",
@@ -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
- }
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
- };
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,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 +0,0 @@
1
- export {};
@@ -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";
File without changes
File without changes