addio-admin-sdk 1.7.100 → 1.7.102
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.
|
@@ -2,7 +2,7 @@ import ITranslation from '../Translation';
|
|
|
2
2
|
import { IImageInfo } from '../../utils/file';
|
|
3
3
|
export default interface IMenu {
|
|
4
4
|
readonly id?: string;
|
|
5
|
-
readonly slug:
|
|
5
|
+
readonly slug: MenuPositionEnum | undefined;
|
|
6
6
|
readonly active: boolean;
|
|
7
7
|
readonly display_name: string;
|
|
8
8
|
readonly menu_entries: IMenuEntry[];
|
|
@@ -16,10 +16,11 @@ export declare enum MenuEntryType {
|
|
|
16
16
|
export interface IMenuEntry {
|
|
17
17
|
entry_type: MenuEntryType;
|
|
18
18
|
value: string;
|
|
19
|
+
sub_value?: string;
|
|
19
20
|
title: ITranslation[];
|
|
20
|
-
aria
|
|
21
|
+
aria?: ITranslation[];
|
|
21
22
|
image?: IImageInfo;
|
|
22
|
-
sub_menu
|
|
23
|
+
sub_menu?: IMenuEntry[];
|
|
23
24
|
}
|
|
24
25
|
export declare enum MenuPositionEnum {
|
|
25
26
|
MAIN_WEB = "main_menu_web",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Interfaces/Menu/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Interfaces/Menu/index.ts"],"names":[],"mappings":";;;AAeA,IAAY,aAKX;AALD,WAAY,aAAa;IACxB,sCAAqB,CAAA;IACrB,wCAAuB,CAAA;IACvB,4BAAW,CAAA;IACX,gCAAe,CAAA;AAChB,CAAC,EALW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAKxB;AAmBD,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC3B,8CAA0B,CAAA;IAC1B,kDAA8B,CAAA;IAC9B,8CAA0B,CAAA;AAC3B,CAAC,EAJW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAI3B"}
|
|
@@ -55,13 +55,19 @@ export default interface IInventoryItem extends IBaseClass {
|
|
|
55
55
|
[key: string]: number;
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
-
export declare const getDefaultInventoryQuantities: () => {
|
|
58
|
+
export declare const getDefaultInventoryQuantities: (addOneToAvailable?: boolean) => {
|
|
59
59
|
available: number;
|
|
60
60
|
processing: number;
|
|
61
61
|
in_transit: number;
|
|
62
62
|
completed: number;
|
|
63
63
|
};
|
|
64
|
-
export declare const getDefaultInventoryItem: (stores: IStore[], userId: string) => {
|
|
64
|
+
export declare const getDefaultInventoryItem: (stores: IStore[], userId: string, addOneToAvailable?: boolean) => {
|
|
65
|
+
web_inventory?: {
|
|
66
|
+
available: number;
|
|
67
|
+
processing: number;
|
|
68
|
+
in_transit: number;
|
|
69
|
+
completed: number;
|
|
70
|
+
} | undefined;
|
|
65
71
|
sku: string;
|
|
66
72
|
parent_slug: string;
|
|
67
73
|
parent_name: never[];
|
|
@@ -6,32 +6,25 @@ var inventoryOperationEnum;
|
|
|
6
6
|
inventoryOperationEnum["ADD"] = "add";
|
|
7
7
|
inventoryOperationEnum["REMOVE"] = "substract";
|
|
8
8
|
})(inventoryOperationEnum = exports.inventoryOperationEnum || (exports.inventoryOperationEnum = {}));
|
|
9
|
-
const getDefaultInventoryQuantities = () => ({
|
|
10
|
-
available: 0,
|
|
9
|
+
const getDefaultInventoryQuantities = (addOneToAvailable) => ({
|
|
10
|
+
available: addOneToAvailable ? 1 : 0,
|
|
11
11
|
processing: 0,
|
|
12
12
|
in_transit: 0,
|
|
13
13
|
completed: 0
|
|
14
14
|
});
|
|
15
15
|
exports.getDefaultInventoryQuantities = getDefaultInventoryQuantities;
|
|
16
|
-
const getDefaultInventoryItem = (stores, userId) => {
|
|
17
|
-
return {
|
|
18
|
-
sku: '',
|
|
19
|
-
parent_slug: '',
|
|
20
|
-
parent_name: [],
|
|
21
|
-
brand: '',
|
|
22
|
-
attributes: [],
|
|
23
|
-
categories: [],
|
|
24
|
-
name: [],
|
|
25
|
-
inventories: !!!stores.length
|
|
16
|
+
const getDefaultInventoryItem = (stores, userId, addOneToAvailable) => {
|
|
17
|
+
return Object.assign({ sku: '', parent_slug: '', parent_name: [], brand: '', attributes: [], categories: [], name: [], inventories: !!!stores.length
|
|
26
18
|
? []
|
|
27
19
|
: stores.map((store) => ({
|
|
28
20
|
store_id: store.id,
|
|
29
|
-
qty: (0, exports.getDefaultInventoryQuantities)(),
|
|
21
|
+
qty: (0, exports.getDefaultInventoryQuantities)(addOneToAvailable && stores.length == 1),
|
|
30
22
|
at: new Date(),
|
|
31
23
|
can_sell_online: store.can_sell_online,
|
|
32
24
|
user: userId
|
|
33
|
-
}))
|
|
34
|
-
|
|
25
|
+
})) }, (addOneToAvailable && stores.length == 1 && stores[0].can_sell_online
|
|
26
|
+
? { web_inventory: (0, exports.getDefaultInventoryQuantities)(true) }
|
|
27
|
+
: {}));
|
|
35
28
|
};
|
|
36
29
|
exports.getDefaultInventoryItem = getDefaultInventoryItem;
|
|
37
30
|
//# sourceMappingURL=IInventoryItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IInventoryItem.js","sourceRoot":"","sources":["../../../src/Interfaces/Product/IInventoryItem.ts"],"names":[],"mappings":";;;AAKA,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IACjC,qCAAW,CAAA;IACX,8CAAoB,CAAA;AACrB,CAAC,EAHW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAGjC;AAoDM,MAAM,6BAA6B,GAAG,
|
|
1
|
+
{"version":3,"file":"IInventoryItem.js","sourceRoot":"","sources":["../../../src/Interfaces/Product/IInventoryItem.ts"],"names":[],"mappings":";;;AAKA,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IACjC,qCAAW,CAAA;IACX,8CAAoB,CAAA;AACrB,CAAC,EAHW,sBAAsB,GAAtB,8BAAsB,KAAtB,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