plaza-sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/lib/browser/bundle.iife.js +1 -0
- package/lib/browser/bundle.umd.js +1 -0
- package/lib/cjs/common/constants.js +1 -0
- package/lib/cjs/common/enums.js +1 -0
- package/lib/cjs/common/interfaces.d.ts +4 -0
- package/lib/cjs/common/interfaces.js +1 -0
- package/lib/cjs/common/types.d.ts +8 -0
- package/lib/cjs/common/types.js +1 -0
- package/lib/cjs/common/utils.d.ts +1 -0
- package/lib/cjs/common/utils.js +1 -0
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/modules/index.js +1 -0
- package/lib/cjs/modules/uzum/common/interfaces.d.ts +36 -0
- package/lib/cjs/modules/uzum/common/interfaces.js +1 -0
- package/lib/cjs/modules/uzum/common/types.d.ts +1 -0
- package/lib/cjs/modules/uzum/common/types.js +1 -0
- package/lib/cjs/modules/uzum/common/utils.d.ts +3 -0
- package/lib/cjs/modules/uzum/common/utils.js +1 -0
- package/lib/cjs/modules/uzum/core/index.d.ts +1 -0
- package/lib/cjs/modules/uzum/core/index.js +1 -0
- package/lib/cjs/modules/uzum/core/products/api.d.ts +8 -0
- package/lib/cjs/modules/uzum/core/products/api.js +1 -0
- package/lib/cjs/modules/uzum/core/products/index.d.ts +1 -0
- package/lib/cjs/modules/uzum/core/products/index.js +1 -0
- package/lib/cjs/modules/uzum/core/products/mappers.d.ts +9 -0
- package/lib/cjs/modules/uzum/core/products/mappers.js +1 -0
- package/lib/cjs/modules/uzum/core/products/params.d.ts +15 -0
- package/lib/cjs/modules/uzum/core/products/params.js +1 -0
- package/lib/cjs/modules/uzum/core/products/types.d.ts +27 -0
- package/lib/cjs/modules/uzum/core/products/types.js +1 -0
- package/lib/cjs/modules/uzum/core/types.d.ts +102 -0
- package/lib/cjs/modules/uzum/core/types.js +1 -0
- package/lib/cjs/modules/uzum/index.d.ts +1 -0
- package/lib/cjs/modules/uzum/index.js +1 -0
- package/lib/common/constants.d.ts +0 -0
- package/lib/common/constants.js +1 -0
- package/lib/common/enums.d.ts +0 -0
- package/lib/common/enums.js +1 -0
- package/lib/common/interfaces.d.ts +4 -0
- package/lib/common/interfaces.js +1 -0
- package/lib/common/types.d.ts +8 -0
- package/lib/common/types.js +1 -0
- package/lib/common/utils.d.ts +1 -0
- package/lib/common/utils.js +10 -0
- package/lib/esm/common/constants.js +1 -0
- package/lib/esm/common/enums.js +1 -0
- package/lib/esm/common/interfaces.d.ts +4 -0
- package/lib/esm/common/interfaces.js +1 -0
- package/lib/esm/common/types.d.ts +8 -0
- package/lib/esm/common/types.js +1 -0
- package/lib/esm/common/utils.d.ts +1 -0
- package/lib/esm/common/utils.js +1 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/modules/index.js +1 -0
- package/lib/esm/modules/uzum/common/interfaces.d.ts +36 -0
- package/lib/esm/modules/uzum/common/interfaces.js +1 -0
- package/lib/esm/modules/uzum/common/types.d.ts +1 -0
- package/lib/esm/modules/uzum/common/types.js +1 -0
- package/lib/esm/modules/uzum/common/utils.d.ts +3 -0
- package/lib/esm/modules/uzum/common/utils.js +1 -0
- package/lib/esm/modules/uzum/core/index.d.ts +1 -0
- package/lib/esm/modules/uzum/core/index.js +1 -0
- package/lib/esm/modules/uzum/core/products/api.d.ts +8 -0
- package/lib/esm/modules/uzum/core/products/api.js +1 -0
- package/lib/esm/modules/uzum/core/products/index.d.ts +1 -0
- package/lib/esm/modules/uzum/core/products/index.js +1 -0
- package/lib/esm/modules/uzum/core/products/mappers.d.ts +9 -0
- package/lib/esm/modules/uzum/core/products/mappers.js +1 -0
- package/lib/esm/modules/uzum/core/products/params.d.ts +15 -0
- package/lib/esm/modules/uzum/core/products/params.js +1 -0
- package/lib/esm/modules/uzum/core/products/types.d.ts +27 -0
- package/lib/esm/modules/uzum/core/products/types.js +1 -0
- package/lib/esm/modules/uzum/core/types.d.ts +102 -0
- package/lib/esm/modules/uzum/core/types.js +1 -0
- package/lib/esm/modules/uzum/index.d.ts +1 -0
- package/lib/esm/modules/uzum/index.js +1 -0
- package/lib/index.d.ts +0 -0
- package/lib/index.js +1 -0
- package/lib/modules/index.d.ts +0 -0
- package/lib/modules/index.js +1 -0
- package/lib/modules/uzum-market/common/interfaces.d.ts +36 -0
- package/lib/modules/uzum-market/common/interfaces.js +1 -0
- package/lib/modules/uzum-market/common/types.d.ts +1 -0
- package/lib/modules/uzum-market/common/types.js +1 -0
- package/lib/modules/uzum-market/common/utils.d.ts +3 -0
- package/lib/modules/uzum-market/common/utils.js +3 -0
- package/lib/modules/uzum-market/core/index.d.ts +1 -0
- package/lib/modules/uzum-market/core/index.js +1 -0
- package/lib/modules/uzum-market/core/products/api.d.ts +8 -0
- package/lib/modules/uzum-market/core/products/api.js +24 -0
- package/lib/modules/uzum-market/core/products/index.d.ts +1 -0
- package/lib/modules/uzum-market/core/products/index.js +1 -0
- package/lib/modules/uzum-market/core/products/mappers.d.ts +9 -0
- package/lib/modules/uzum-market/core/products/mappers.js +12 -0
- package/lib/modules/uzum-market/core/products/params.d.ts +15 -0
- package/lib/modules/uzum-market/core/products/params.js +1 -0
- package/lib/modules/uzum-market/core/products/types.d.ts +27 -0
- package/lib/modules/uzum-market/core/products/types.js +1 -0
- package/lib/modules/uzum-market/core/types.d.ts +102 -0
- package/lib/modules/uzum-market/core/types.js +1 -0
- package/lib/modules/uzum-market/index.d.ts +1 -0
- package/lib/modules/uzum-market/index.js +1 -0
- package/package.json +70 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Plaza SDK (Software Development Kit)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(n){"function"==typeof define&&define.amd?define(n):n()}(function(){});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,8 @@
|
|
|
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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getNumber: (value: unknown, defaultValue?: number) => number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.getNumber=(r,t=0)=>{if("number"==typeof r)return r;if("string"==typeof r){const e=parseFloat(r);return isNaN(e)?t:e}return t};
|
package/lib/cjs/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ProductStatuses = "READY_TO_SEND" | "ARCHIVED" | "IN_STOCK" | ("RUN_OUT" & (string & {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.pasteAuthHeader=e=>({Authorization:`Bearer ${e}`});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./products";
|
|
@@ -0,0 +1 @@
|
|
|
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;
|
|
@@ -0,0 +1,8 @@
|
|
|
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>;
|
|
@@ -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.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
|
+
export * from "./api";
|
|
@@ -0,0 +1 @@
|
|
|
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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("../../../../common/utils.js"),r=require("lodash");exports.ProductListParamsMapper=t=>({searchQuery:r.get(t,"searchQuery","")||"",filter:r.get(t,"filter")||"ALL",sortBy:r.get(t,"sortBy")||"id",order:r.get(t,"order")||"descending",size:e.getNumber(r.get(t,"size"),250),page:e.getNumber(r.get(t,"page"),0)});
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,102 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./core/products";
|
|
@@ -0,0 +1 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getNumber: (value: unknown, defaultValue?: number) => number;
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,8 @@
|
|
|
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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getNumber: (value: unknown, defaultValue?: number) => number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const r=(r,t=0)=>{if("number"==typeof r)return r;if("string"==typeof r){const e=parseFloat(r);return isNaN(e)?t:e}return t};export{r as getNumber};
|
package/lib/esm/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ProductStatuses = "READY_TO_SEND" | "ARCHIVED" | "IN_STOCK" | ("RUN_OUT" & (string & {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o=o=>({Authorization:`Bearer ${o}`});export{o as pasteAuthHeader};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./products";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{AddPromotion,ArchiveProduct,ProductsList,RemovePromotion,UnarchiveProduct}from"./products/api.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
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>;
|
|
@@ -0,0 +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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./api";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{AddPromotion,ArchiveProduct,ProductsList,RemovePromotion,UnarchiveProduct}from"./api.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getNumber as r}from"../../../../common/utils.js";import{get as e}from"lodash";const o=o=>({searchQuery:e(o,"searchQuery","")||"",filter:e(o,"filter")||"ALL",sortBy:e(o,"sortBy")||"id",order:e(o,"order")||"descending",size:r(e(o,"size"),250),page:r(e(o,"page"),0)});export{o as ProductListParamsMapper};
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,102 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./core/products";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{AddPromotion,ArchiveProduct,ProductsList,RemovePromotion,UnarchiveProduct}from"./core/products/api.js";
|
package/lib/index.d.ts
ADDED
|
File without changes
|
package/lib/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ProductStatuses = "READY_TO_SEND" | "ARCHIVED" | "IN_STOCK" | ("RUN_OUT" & (string & {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./products";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./products";
|
|
@@ -0,0 +1,8 @@
|
|
|
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>;
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./api";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./api";
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { NumberNullable, StringNullable } from "@/common/types";
|
|
2
|
+
import { Dimensions, PromotionSku, RankInfo, SkuCharacteristic, Status, StatusValue } from "../common/interfaces";
|
|
3
|
+
export declare namespace UzumMarketEntity {
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./core/products";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./core/products";
|
package/package.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "plaza-sdk",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"outputDir": "./lib",
|
|
5
|
+
|
|
6
|
+
"exports": {
|
|
7
|
+
"import": {
|
|
8
|
+
"types": "./lib/esm/index.d.ts",
|
|
9
|
+
"default": "./lib/esm/index.js"
|
|
10
|
+
},
|
|
11
|
+
"require": {
|
|
12
|
+
"types": "./lib/cjs/index.d.ts",
|
|
13
|
+
"default": "./lib/cjs/index.js"
|
|
14
|
+
},
|
|
15
|
+
"types": "./lib/esm/index.d.ts"
|
|
16
|
+
},
|
|
17
|
+
"main": "lib/cjs/index.js",
|
|
18
|
+
"module": "lib/esm/index.js",
|
|
19
|
+
"files": [
|
|
20
|
+
"lib/**/*"
|
|
21
|
+
],
|
|
22
|
+
"type": "module",
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "yarn clean && rollup -c",
|
|
25
|
+
"clean": "rimraf lib",
|
|
26
|
+
"start": "node dist/bundle.js",
|
|
27
|
+
"typecheck": "tsc --noEmit true",
|
|
28
|
+
"lint": "eslint . --quiet --max-warnings 0",
|
|
29
|
+
"prettify": "prettier --write \"{src,tools,public}/**/*.{json,ts,tsx,js,jsx,md,scss,css,html}\""
|
|
30
|
+
},
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public"
|
|
33
|
+
},
|
|
34
|
+
"engines": {
|
|
35
|
+
"npm": "please-use-yarn",
|
|
36
|
+
"yarn": ">= 1",
|
|
37
|
+
"node": ">=20"
|
|
38
|
+
},
|
|
39
|
+
"author": {
|
|
40
|
+
"name": "Suhrobbek Soatov",
|
|
41
|
+
"url": "https://soatov.uz",
|
|
42
|
+
"email": "svkhrobbeck@gmail.com"
|
|
43
|
+
},
|
|
44
|
+
"license": "ISC",
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@eslint/js": "^9.32.0",
|
|
47
|
+
"@rollup/plugin-commonjs": "^28.0.6",
|
|
48
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
49
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
50
|
+
"@rollup/plugin-typescript": "^12.1.4",
|
|
51
|
+
"@types/lodash": "^4.17.20",
|
|
52
|
+
"eslint": "^9.32.0",
|
|
53
|
+
"globals": "^16.3.0",
|
|
54
|
+
"jiti": "^2.5.1",
|
|
55
|
+
"prettier": "^3.6.2",
|
|
56
|
+
"rimraf": "^6.0.1",
|
|
57
|
+
"rollup": "^4.46.2",
|
|
58
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
59
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
60
|
+
"tslib": "^2.8.1",
|
|
61
|
+
"typescript": "5.8.3",
|
|
62
|
+
"typescript-eslint": "^8.38.0"
|
|
63
|
+
},
|
|
64
|
+
"dependencies": {
|
|
65
|
+
"@typescript-eslint/parser": "^8.38.0",
|
|
66
|
+
"axios": "^1.11.0",
|
|
67
|
+
"eslint-config-prettier": "^10.1.8",
|
|
68
|
+
"lodash": "^4.17.21"
|
|
69
|
+
}
|
|
70
|
+
}
|