@leav/utils 0.0.1-test
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 +8 -0
- package/dist/cjs/MIMEByExtension.json +806 -0
- package/dist/cjs/constants.d.ts +2 -0
- package/dist/cjs/constants.js +9 -0
- package/dist/cjs/constants.js.map +1 -0
- package/dist/cjs/index.d.ts +11 -0
- package/dist/cjs/index.js +31 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/types/applications.d.ts +1 -0
- package/dist/cjs/types/applications.js +8 -0
- package/dist/cjs/types/applications.js.map +1 -0
- package/dist/cjs/types/attributes.d.ts +7 -0
- package/dist/cjs/types/attributes.js +15 -0
- package/dist/cjs/types/attributes.js.map +1 -0
- package/dist/cjs/types/errors.d.ts +5 -0
- package/dist/cjs/types/errors.js +13 -0
- package/dist/cjs/types/errors.js.map +1 -0
- package/dist/cjs/types/events.d.ts +75 -0
- package/dist/cjs/types/events.js +37 -0
- package/dist/cjs/types/events.js.map +1 -0
- package/dist/cjs/types/files.d.ts +16 -0
- package/dist/cjs/types/files.js +15 -0
- package/dist/cjs/types/files.js.map +1 -0
- package/dist/cjs/types/forms.d.ts +60 -0
- package/dist/cjs/types/forms.js +29 -0
- package/dist/cjs/types/forms.js.map +1 -0
- package/dist/cjs/types/helpers.d.ts +13 -0
- package/dist/cjs/types/helpers.js +3 -0
- package/dist/cjs/types/helpers.js.map +1 -0
- package/dist/cjs/types/logs.d.ts +2 -0
- package/dist/cjs/types/logs.js +3 -0
- package/dist/cjs/types/logs.js.map +1 -0
- package/dist/cjs/types/previews.d.ts +5 -0
- package/dist/cjs/types/previews.js +13 -0
- package/dist/cjs/types/previews.js.map +1 -0
- package/dist/cjs/types/values.d.ts +4 -0
- package/dist/cjs/types/values.js +3 -0
- package/dist/cjs/types/values.js.map +1 -0
- package/dist/cjs/utils.d.ts +68 -0
- package/dist/cjs/utils.js +312 -0
- package/dist/cjs/utils.js.map +1 -0
- package/dist/esm/MIMEByExtension.json +806 -0
- package/dist/esm/constants.d.ts +2 -0
- package/dist/esm/constants.js +6 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/index.d.ts +11 -0
- package/dist/esm/index.js +15 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/types/applications.d.ts +1 -0
- package/dist/esm/types/applications.js +5 -0
- package/dist/esm/types/applications.js.map +1 -0
- package/dist/esm/types/attributes.d.ts +7 -0
- package/dist/esm/types/attributes.js +12 -0
- package/dist/esm/types/attributes.js.map +1 -0
- package/dist/esm/types/errors.d.ts +5 -0
- package/dist/esm/types/errors.js +10 -0
- package/dist/esm/types/errors.js.map +1 -0
- package/dist/esm/types/events.d.ts +75 -0
- package/dist/esm/types/events.js +34 -0
- package/dist/esm/types/events.js.map +1 -0
- package/dist/esm/types/files.d.ts +16 -0
- package/dist/esm/types/files.js +12 -0
- package/dist/esm/types/files.js.map +1 -0
- package/dist/esm/types/forms.d.ts +60 -0
- package/dist/esm/types/forms.js +26 -0
- package/dist/esm/types/forms.js.map +1 -0
- package/dist/esm/types/helpers.d.ts +13 -0
- package/dist/esm/types/helpers.js +2 -0
- package/dist/esm/types/helpers.js.map +1 -0
- package/dist/esm/types/logs.d.ts +2 -0
- package/dist/esm/types/logs.js +2 -0
- package/dist/esm/types/logs.js.map +1 -0
- package/dist/esm/types/previews.d.ts +5 -0
- package/dist/esm/types/previews.js +10 -0
- package/dist/esm/types/previews.js.map +1 -0
- package/dist/esm/types/values.d.ts +4 -0
- package/dist/esm/types/values.js +2 -0
- package/dist/esm/types/values.js.map +1 -0
- package/dist/esm/utils.d.ts +68 -0
- package/dist/esm/utils.js +262 -0
- package/dist/esm/utils.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +38 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.endpointFormatRegex = exports.idFormatRegex = void 0;
|
|
4
|
+
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
5
|
+
// This file is released under LGPL V3
|
|
6
|
+
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
7
|
+
exports.idFormatRegex = /^[a-z0-9_]+$/;
|
|
8
|
+
exports.endpointFormatRegex = /^[a-z0-9-]+$/;
|
|
9
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;;AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACzD,QAAA,aAAa,GAAG,cAAc,CAAC;AAC/B,QAAA,mBAAmB,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './constants';
|
|
2
|
+
export * from './types/applications';
|
|
3
|
+
export * from './types/errors';
|
|
4
|
+
export * from './types/events';
|
|
5
|
+
export * from './types/files';
|
|
6
|
+
export * from './types/forms';
|
|
7
|
+
export * from './types/helpers';
|
|
8
|
+
export * from './types/logs';
|
|
9
|
+
export * from './types/previews';
|
|
10
|
+
export * from './types/values';
|
|
11
|
+
export * from './utils';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
18
|
+
// This file is released under LGPL V3
|
|
19
|
+
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
20
|
+
__exportStar(require("./constants"), exports);
|
|
21
|
+
__exportStar(require("./types/applications"), exports);
|
|
22
|
+
__exportStar(require("./types/errors"), exports);
|
|
23
|
+
__exportStar(require("./types/events"), exports);
|
|
24
|
+
__exportStar(require("./types/files"), exports);
|
|
25
|
+
__exportStar(require("./types/forms"), exports);
|
|
26
|
+
__exportStar(require("./types/helpers"), exports);
|
|
27
|
+
__exportStar(require("./types/logs"), exports);
|
|
28
|
+
__exportStar(require("./types/previews"), exports);
|
|
29
|
+
__exportStar(require("./types/values"), exports);
|
|
30
|
+
__exportStar(require("./utils"), exports);
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,8CAA4B;AAC5B,uDAAqC;AACrC,iDAA+B;AAC/B,iDAA+B;AAC/B,gDAA8B;AAC9B,gDAA8B;AAC9B,kDAAgC;AAChC,+CAA6B;AAC7B,mDAAiC;AACjC,iDAA+B;AAC/B,0CAAwB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CONSULTED_APPS_KEY = "applications_consultation";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CONSULTED_APPS_KEY = void 0;
|
|
4
|
+
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
5
|
+
// This file is released under LGPL V3
|
|
6
|
+
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
7
|
+
exports.CONSULTED_APPS_KEY = 'applications_consultation';
|
|
8
|
+
//# sourceMappingURL=applications.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applications.js","sourceRoot":"","sources":["../../../src/types/applications.ts"],"names":[],"mappings":";;;AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACzD,QAAA,kBAAkB,GAAG,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AttributeType = void 0;
|
|
4
|
+
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
5
|
+
// This file is released under LGPL V3
|
|
6
|
+
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
7
|
+
var AttributeType;
|
|
8
|
+
(function (AttributeType) {
|
|
9
|
+
AttributeType["advanced"] = "advanced";
|
|
10
|
+
AttributeType["advanced_link"] = "advanced_link";
|
|
11
|
+
AttributeType["simple"] = "simple";
|
|
12
|
+
AttributeType["simple_link"] = "simple_link";
|
|
13
|
+
AttributeType["tree"] = "tree";
|
|
14
|
+
})(AttributeType || (exports.AttributeType = AttributeType = {}));
|
|
15
|
+
//# sourceMappingURL=attributes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attributes.js","sourceRoot":"","sources":["../../../src/types/attributes.ts"],"names":[],"mappings":";;;AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,IAAY,aAMX;AAND,WAAY,aAAa;IACrB,sCAAqB,CAAA;IACrB,gDAA+B,CAAA;IAC/B,kCAAiB,CAAA;IACjB,4CAA2B,CAAA;IAC3B,8BAAa,CAAA;AACjB,CAAC,EANW,aAAa,6BAAb,aAAa,QAMxB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ErrorTypes = void 0;
|
|
4
|
+
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
5
|
+
// This file is released under LGPL V3
|
|
6
|
+
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
7
|
+
var ErrorTypes;
|
|
8
|
+
(function (ErrorTypes) {
|
|
9
|
+
ErrorTypes["VALIDATION_ERROR"] = "VALIDATION_ERROR";
|
|
10
|
+
ErrorTypes["PERMISSION_ERROR"] = "PERMISSION_ERROR";
|
|
11
|
+
ErrorTypes["INTERNAL_ERROR"] = "INTERNAL_ERROR";
|
|
12
|
+
})(ErrorTypes || (exports.ErrorTypes = ErrorTypes = {}));
|
|
13
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/types/errors.ts"],"names":[],"mappings":";;;AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,IAAY,UAIX;AAJD,WAAY,UAAU;IAClB,mDAAqC,CAAA;IACrC,mDAAqC,CAAA;IACrC,+CAAiC,CAAA;AACrC,CAAC,EAJW,UAAU,0BAAV,UAAU,QAIrB"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export interface IEvent {
|
|
2
|
+
time: number;
|
|
3
|
+
userId: string;
|
|
4
|
+
emitter: string;
|
|
5
|
+
queryId: string;
|
|
6
|
+
instanceId: string;
|
|
7
|
+
}
|
|
8
|
+
/*** Database events ***/
|
|
9
|
+
export declare enum EventAction {
|
|
10
|
+
API_KEY_DELETE = "API_KEY_DELETE",
|
|
11
|
+
API_KEY_SAVE = "API_KEY_SAVE",
|
|
12
|
+
APP_DELETE = "APP_DELETE",
|
|
13
|
+
APP_SAVE = "APP_SAVE",
|
|
14
|
+
ATTRIBUTE_DELETE = "ATTRIBUTE_DELETE",
|
|
15
|
+
ATTRIBUTE_SAVE = "ATTRIBUTE_SAVE",
|
|
16
|
+
EXPORT_START = "EXPORT_START",
|
|
17
|
+
EXPORT_END = "EXPORT_END",
|
|
18
|
+
DATA_IMPORT_START = "DATA_IMPORT_START",
|
|
19
|
+
DATA_IMPORT_END = "DATA_IMPORT_END",
|
|
20
|
+
CONFIG_IMPORT_START = "CONFIG_IMPORT_START",
|
|
21
|
+
CONFIG_IMPORT_END = "CONFIG_IMPORT_END",
|
|
22
|
+
GLOBAL_SETTINGS_SAVE = "GLOBAL_SETTINGS_SAVE",
|
|
23
|
+
LIBRARY_DELETE = "LIBRARY_DELETE",
|
|
24
|
+
LIBRARY_PURGE = "LIBRARY_PURGE",
|
|
25
|
+
LIBRARY_SAVE = "LIBRARY_SAVE",
|
|
26
|
+
TASKS_DELETE = "TASKS_DELETE",
|
|
27
|
+
PERMISSION_SAVE = "PERMISSION_SAVE",
|
|
28
|
+
RECORD_DELETE = "RECORD_DELETE",
|
|
29
|
+
RECORD_SAVE = "RECORD_SAVE",
|
|
30
|
+
TREE_ADD_ELEMENT = "TREE_ADD_ELEMENT",
|
|
31
|
+
TREE_DELETE = "TREE_DELETE",
|
|
32
|
+
TREE_DELETE_ELEMENT = "TREE_DELETE_ELEMENT",
|
|
33
|
+
TREE_MOVE_ELEMENT = "TREE_MOVE_ELEMENT",
|
|
34
|
+
TREE_SAVE = "TREE_SAVE",
|
|
35
|
+
VALUE_DELETE = "VALUE_DELETE",
|
|
36
|
+
VALUE_SAVE = "VALUE_SAVE",
|
|
37
|
+
VERSION_PROFILE_DELETE = "VERSION_PROFILE_DELETE",
|
|
38
|
+
VERSION_PROFILE_SAVE = "VERSION_PROFILE_SAVE"
|
|
39
|
+
}
|
|
40
|
+
export interface IDbPayload {
|
|
41
|
+
trigger?: string;
|
|
42
|
+
action: EventAction | string;
|
|
43
|
+
topic: {
|
|
44
|
+
record?: {
|
|
45
|
+
id: string;
|
|
46
|
+
libraryId: string;
|
|
47
|
+
};
|
|
48
|
+
library?: string;
|
|
49
|
+
attribute?: string;
|
|
50
|
+
tree?: string;
|
|
51
|
+
profile?: string;
|
|
52
|
+
permission?: {
|
|
53
|
+
type: string;
|
|
54
|
+
applyTo?: any;
|
|
55
|
+
};
|
|
56
|
+
apiKey?: string;
|
|
57
|
+
application?: string;
|
|
58
|
+
filename?: string;
|
|
59
|
+
};
|
|
60
|
+
before?: any;
|
|
61
|
+
after?: any;
|
|
62
|
+
metadata?: any;
|
|
63
|
+
}
|
|
64
|
+
export interface IDbEvent extends IEvent {
|
|
65
|
+
payload: IDbPayload;
|
|
66
|
+
}
|
|
67
|
+
/*** PubSub events ***/
|
|
68
|
+
export type PublishedEvent<T> = IEvent & T;
|
|
69
|
+
export interface IPubSubEvent extends IEvent {
|
|
70
|
+
payload: IPubSubPayload;
|
|
71
|
+
}
|
|
72
|
+
export interface IPubSubPayload {
|
|
73
|
+
triggerName: string;
|
|
74
|
+
data: any;
|
|
75
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EventAction = void 0;
|
|
4
|
+
/*** Database events ***/
|
|
5
|
+
var EventAction;
|
|
6
|
+
(function (EventAction) {
|
|
7
|
+
EventAction["API_KEY_DELETE"] = "API_KEY_DELETE";
|
|
8
|
+
EventAction["API_KEY_SAVE"] = "API_KEY_SAVE";
|
|
9
|
+
EventAction["APP_DELETE"] = "APP_DELETE";
|
|
10
|
+
EventAction["APP_SAVE"] = "APP_SAVE";
|
|
11
|
+
EventAction["ATTRIBUTE_DELETE"] = "ATTRIBUTE_DELETE";
|
|
12
|
+
EventAction["ATTRIBUTE_SAVE"] = "ATTRIBUTE_SAVE";
|
|
13
|
+
EventAction["EXPORT_START"] = "EXPORT_START";
|
|
14
|
+
EventAction["EXPORT_END"] = "EXPORT_END";
|
|
15
|
+
EventAction["DATA_IMPORT_START"] = "DATA_IMPORT_START";
|
|
16
|
+
EventAction["DATA_IMPORT_END"] = "DATA_IMPORT_END";
|
|
17
|
+
EventAction["CONFIG_IMPORT_START"] = "CONFIG_IMPORT_START";
|
|
18
|
+
EventAction["CONFIG_IMPORT_END"] = "CONFIG_IMPORT_END";
|
|
19
|
+
EventAction["GLOBAL_SETTINGS_SAVE"] = "GLOBAL_SETTINGS_SAVE";
|
|
20
|
+
EventAction["LIBRARY_DELETE"] = "LIBRARY_DELETE";
|
|
21
|
+
EventAction["LIBRARY_PURGE"] = "LIBRARY_PURGE";
|
|
22
|
+
EventAction["LIBRARY_SAVE"] = "LIBRARY_SAVE";
|
|
23
|
+
EventAction["TASKS_DELETE"] = "TASKS_DELETE";
|
|
24
|
+
EventAction["PERMISSION_SAVE"] = "PERMISSION_SAVE";
|
|
25
|
+
EventAction["RECORD_DELETE"] = "RECORD_DELETE";
|
|
26
|
+
EventAction["RECORD_SAVE"] = "RECORD_SAVE";
|
|
27
|
+
EventAction["TREE_ADD_ELEMENT"] = "TREE_ADD_ELEMENT";
|
|
28
|
+
EventAction["TREE_DELETE"] = "TREE_DELETE";
|
|
29
|
+
EventAction["TREE_DELETE_ELEMENT"] = "TREE_DELETE_ELEMENT";
|
|
30
|
+
EventAction["TREE_MOVE_ELEMENT"] = "TREE_MOVE_ELEMENT";
|
|
31
|
+
EventAction["TREE_SAVE"] = "TREE_SAVE";
|
|
32
|
+
EventAction["VALUE_DELETE"] = "VALUE_DELETE";
|
|
33
|
+
EventAction["VALUE_SAVE"] = "VALUE_SAVE";
|
|
34
|
+
EventAction["VERSION_PROFILE_DELETE"] = "VERSION_PROFILE_DELETE";
|
|
35
|
+
EventAction["VERSION_PROFILE_SAVE"] = "VERSION_PROFILE_SAVE";
|
|
36
|
+
})(EventAction || (exports.EventAction = EventAction = {}));
|
|
37
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../../src/types/events.ts"],"names":[],"mappings":";;;AAWA,yBAAyB;AAEzB,IAAY,WA8BX;AA9BD,WAAY,WAAW;IACnB,gDAAiC,CAAA;IACjC,4CAA6B,CAAA;IAC7B,wCAAyB,CAAA;IACzB,oCAAqB,CAAA;IACrB,oDAAqC,CAAA;IACrC,gDAAiC,CAAA;IACjC,4CAA6B,CAAA;IAC7B,wCAAyB,CAAA;IACzB,sDAAuC,CAAA;IACvC,kDAAmC,CAAA;IACnC,0DAA2C,CAAA;IAC3C,sDAAuC,CAAA;IACvC,4DAA6C,CAAA;IAC7C,gDAAiC,CAAA;IACjC,8CAA+B,CAAA;IAC/B,4CAA6B,CAAA;IAC7B,4CAA6B,CAAA;IAC7B,kDAAmC,CAAA;IACnC,8CAA+B,CAAA;IAC/B,0CAA2B,CAAA;IAC3B,oDAAqC,CAAA;IACrC,0CAA2B,CAAA;IAC3B,0DAA2C,CAAA;IAC3C,sDAAuC,CAAA;IACvC,sCAAuB,CAAA;IACvB,4CAA6B,CAAA;IAC7B,wCAAyB,CAAA;IACzB,gEAAiD,CAAA;IACjD,4DAA6C,CAAA;AACjD,CAAC,EA9BW,WAAW,2BAAX,WAAW,QA8BtB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare enum FileType {
|
|
2
|
+
IMAGE = "image",
|
|
3
|
+
VIDEO = "video",
|
|
4
|
+
AUDIO = "audio",
|
|
5
|
+
DOCUMENT = "document",
|
|
6
|
+
OTHER = "other"
|
|
7
|
+
}
|
|
8
|
+
export type FileRecord = Record<string, any> & {
|
|
9
|
+
type: FileType;
|
|
10
|
+
};
|
|
11
|
+
export interface IPreviewScalar {
|
|
12
|
+
pdf?: string;
|
|
13
|
+
file: FileRecord;
|
|
14
|
+
original: string;
|
|
15
|
+
[key: string]: string | FileRecord;
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileType = void 0;
|
|
4
|
+
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
5
|
+
// This file is released under LGPL V3
|
|
6
|
+
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
7
|
+
var FileType;
|
|
8
|
+
(function (FileType) {
|
|
9
|
+
FileType["IMAGE"] = "image";
|
|
10
|
+
FileType["VIDEO"] = "video";
|
|
11
|
+
FileType["AUDIO"] = "audio";
|
|
12
|
+
FileType["DOCUMENT"] = "document";
|
|
13
|
+
FileType["OTHER"] = "other";
|
|
14
|
+
})(FileType || (exports.FileType = FileType = {}));
|
|
15
|
+
//# sourceMappingURL=files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../../src/types/files.ts"],"names":[],"mappings":";;;AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,IAAY,QAMX;AAND,WAAY,QAAQ;IAChB,2BAAe,CAAA;IACf,2BAAe,CAAA;IACf,2BAAe,CAAA;IACf,iCAAqB,CAAA;IACrB,2BAAe,CAAA;AACnB,CAAC,EANW,QAAQ,wBAAR,QAAQ,QAMnB"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { IKeyValue } from './helpers';
|
|
2
|
+
export declare enum FormUIElementTypes {
|
|
3
|
+
DIVIDER = "divider",
|
|
4
|
+
FIELDS_CONTAINER = "fields_container",
|
|
5
|
+
TAB_FIELDS_CONTAINER = "tab_fields_container",
|
|
6
|
+
TEXT_BLOCK = "text_block",
|
|
7
|
+
TABS = "tabs",
|
|
8
|
+
FRAME = "frame"
|
|
9
|
+
}
|
|
10
|
+
export declare enum FormFieldTypes {
|
|
11
|
+
TEXT_INPUT = "input_field",
|
|
12
|
+
DATE = "date",
|
|
13
|
+
CHECKBOX = "checkbox",
|
|
14
|
+
ENCRYPTED = "encrypted",
|
|
15
|
+
DROPDOWN = "dropdown",
|
|
16
|
+
LINK = "link",
|
|
17
|
+
TREE = "tree"
|
|
18
|
+
}
|
|
19
|
+
export declare enum TabsDirection {
|
|
20
|
+
HORIZONTAL = "horizontal",
|
|
21
|
+
VERTICAL = "vertical"
|
|
22
|
+
}
|
|
23
|
+
export interface ICommonFieldsSettings {
|
|
24
|
+
label?: Record<string, string | null>;
|
|
25
|
+
attribute?: string;
|
|
26
|
+
useAttributeLabel?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface IRequiredFieldsSettings extends ICommonFieldsSettings {
|
|
29
|
+
required?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface IFormDividerSettings {
|
|
32
|
+
title?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface IFormTabSettings {
|
|
35
|
+
label?: IKeyValue<string>;
|
|
36
|
+
id: string;
|
|
37
|
+
}
|
|
38
|
+
export interface IFormTabsSettings {
|
|
39
|
+
tabs: IFormTabSettings[];
|
|
40
|
+
direction: TabsDirection;
|
|
41
|
+
}
|
|
42
|
+
export interface IFormTextBlockSettings {
|
|
43
|
+
content?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface IFormFrameSettings {
|
|
46
|
+
url: string;
|
|
47
|
+
height?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface IFormDateFieldSettings extends ICommonFieldsSettings {
|
|
50
|
+
withTime: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface IFormLinkFieldSettings extends ICommonFieldsSettings {
|
|
53
|
+
columns: Array<{
|
|
54
|
+
id: string;
|
|
55
|
+
label: Record<string, string>;
|
|
56
|
+
}>;
|
|
57
|
+
displayRecordIdentity: boolean;
|
|
58
|
+
tagDisplayMode: boolean;
|
|
59
|
+
}
|
|
60
|
+
export declare const FORM_ROOT_CONTAINER_ID = "__root";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FORM_ROOT_CONTAINER_ID = exports.TabsDirection = exports.FormFieldTypes = exports.FormUIElementTypes = void 0;
|
|
4
|
+
var FormUIElementTypes;
|
|
5
|
+
(function (FormUIElementTypes) {
|
|
6
|
+
FormUIElementTypes["DIVIDER"] = "divider";
|
|
7
|
+
FormUIElementTypes["FIELDS_CONTAINER"] = "fields_container";
|
|
8
|
+
FormUIElementTypes["TAB_FIELDS_CONTAINER"] = "tab_fields_container";
|
|
9
|
+
FormUIElementTypes["TEXT_BLOCK"] = "text_block";
|
|
10
|
+
FormUIElementTypes["TABS"] = "tabs";
|
|
11
|
+
FormUIElementTypes["FRAME"] = "frame";
|
|
12
|
+
})(FormUIElementTypes || (exports.FormUIElementTypes = FormUIElementTypes = {}));
|
|
13
|
+
var FormFieldTypes;
|
|
14
|
+
(function (FormFieldTypes) {
|
|
15
|
+
FormFieldTypes["TEXT_INPUT"] = "input_field";
|
|
16
|
+
FormFieldTypes["DATE"] = "date";
|
|
17
|
+
FormFieldTypes["CHECKBOX"] = "checkbox";
|
|
18
|
+
FormFieldTypes["ENCRYPTED"] = "encrypted";
|
|
19
|
+
FormFieldTypes["DROPDOWN"] = "dropdown";
|
|
20
|
+
FormFieldTypes["LINK"] = "link";
|
|
21
|
+
FormFieldTypes["TREE"] = "tree";
|
|
22
|
+
})(FormFieldTypes || (exports.FormFieldTypes = FormFieldTypes = {}));
|
|
23
|
+
var TabsDirection;
|
|
24
|
+
(function (TabsDirection) {
|
|
25
|
+
TabsDirection["HORIZONTAL"] = "horizontal";
|
|
26
|
+
TabsDirection["VERTICAL"] = "vertical";
|
|
27
|
+
})(TabsDirection || (exports.TabsDirection = TabsDirection = {}));
|
|
28
|
+
exports.FORM_ROOT_CONTAINER_ID = '__root';
|
|
29
|
+
//# sourceMappingURL=forms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forms.js","sourceRoot":"","sources":["../../../src/types/forms.ts"],"names":[],"mappings":";;;AAKA,IAAY,kBAOX;AAPD,WAAY,kBAAkB;IAC1B,yCAAmB,CAAA;IACnB,2DAAqC,CAAA;IACrC,mEAA6C,CAAA;IAC7C,+CAAyB,CAAA;IACzB,mCAAa,CAAA;IACb,qCAAe,CAAA;AACnB,CAAC,EAPW,kBAAkB,kCAAlB,kBAAkB,QAO7B;AAED,IAAY,cAQX;AARD,WAAY,cAAc;IACtB,4CAA0B,CAAA;IAC1B,+BAAa,CAAA;IACb,uCAAqB,CAAA;IACrB,yCAAuB,CAAA;IACvB,uCAAqB,CAAA;IACrB,+BAAa,CAAA;IACb,+BAAa,CAAA;AACjB,CAAC,EARW,cAAc,8BAAd,cAAc,QAQzB;AAED,IAAY,aAGX;AAHD,WAAY,aAAa;IACrB,0CAAyB,CAAA;IACzB,sCAAqB,CAAA;AACzB,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB;AAgDY,QAAA,sBAAsB,GAAG,QAAQ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface IKeyValue<T> {
|
|
2
|
+
[key: string]: T;
|
|
3
|
+
}
|
|
4
|
+
export type AnyPrimitive = string | number | boolean;
|
|
5
|
+
export type Override<T1, T2> = Omit<T1, keyof T2> & T2;
|
|
6
|
+
export type WithTypename<T> = {
|
|
7
|
+
[P in keyof T]: T[P] extends object ? WithTypename<T[P]> : T[P];
|
|
8
|
+
} & {
|
|
9
|
+
readonly __typename?: string;
|
|
10
|
+
};
|
|
11
|
+
export type Mockify<T> = {
|
|
12
|
+
[P in keyof T]?: T[P] extends (...args: any[]) => any ? jest.Mock<ReturnType<T[P]> extends never ? never : any> : T[P];
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/types/helpers.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logs.js","sourceRoot":"","sources":["../../../src/types/logs.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PreviewPriority = void 0;
|
|
4
|
+
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
5
|
+
// This file is released under LGPL V3
|
|
6
|
+
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
7
|
+
var PreviewPriority;
|
|
8
|
+
(function (PreviewPriority) {
|
|
9
|
+
PreviewPriority[PreviewPriority["LOW"] = 1] = "LOW";
|
|
10
|
+
PreviewPriority[PreviewPriority["MEDIUM"] = 2] = "MEDIUM";
|
|
11
|
+
PreviewPriority[PreviewPriority["HIGH"] = 3] = "HIGH";
|
|
12
|
+
})(PreviewPriority || (exports.PreviewPriority = PreviewPriority = {}));
|
|
13
|
+
//# sourceMappingURL=previews.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"previews.js","sourceRoot":"","sources":["../../../src/types/previews.ts"],"names":[],"mappings":";;;AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,IAAY,eAIX;AAJD,WAAY,eAAe;IACvB,mDAAO,CAAA;IACP,yDAAU,CAAA;IACV,qDAAQ,CAAA;AACZ,CAAC,EAJW,eAAe,+BAAf,eAAe,QAI1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"values.js","sourceRoot":"","sources":["../../../src/types/values.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { AttributeType } from './types/attributes';
|
|
2
|
+
import { FileType } from './types/files';
|
|
3
|
+
import { IKeyValue } from './types/helpers';
|
|
4
|
+
export declare const getGraphqlTypeFromLibraryName: (library: string) => string;
|
|
5
|
+
export declare const getGraphqlQueryNameFromLibraryName: (library: string) => string;
|
|
6
|
+
export declare const isFileAllowed: (fsPath: string, allowList: string[], ignoreList: string[], filePath: string) => boolean;
|
|
7
|
+
export declare const localizedTranslation: (translations: Record<string, string>, availableLanguages: string[]) => string;
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param str
|
|
11
|
+
* @param format 'hsl' || 'rgb' || 'hex'
|
|
12
|
+
* @param saturation in percent, default to 30
|
|
13
|
+
* @param luminosity in percent, default to 80
|
|
14
|
+
*/
|
|
15
|
+
export declare const stringToColor: (str?: string | null, format?: string, saturation?: number, luminosity?: number) => string;
|
|
16
|
+
export declare const getInvertColor: (color: string) => string;
|
|
17
|
+
/**
|
|
18
|
+
* Parse string to extract args.
|
|
19
|
+
* Arg is a string with format:
|
|
20
|
+
* -[argName] argValue
|
|
21
|
+
*
|
|
22
|
+
* eg. "-library product -type link" => {library: product, type: link}
|
|
23
|
+
* @param mapping
|
|
24
|
+
*/
|
|
25
|
+
export declare const extractArgsFromString: (mapping: string) => {
|
|
26
|
+
[arg: string]: string;
|
|
27
|
+
};
|
|
28
|
+
export declare const objectToNameValueArray: <T>(obj: IKeyValue<T>) => Array<{
|
|
29
|
+
name: string;
|
|
30
|
+
value: T;
|
|
31
|
+
}>;
|
|
32
|
+
export declare const nameValArrayToObj: (arr?: Array<{}>, keyFieldName?: string, valueFieldName?: string) => {
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
};
|
|
35
|
+
export declare const getFileType: (fileName: string) => FileType;
|
|
36
|
+
/**
|
|
37
|
+
* Return a simplified call stack (for the function who called this function, not this one, obviously)
|
|
38
|
+
*
|
|
39
|
+
* @param depth Number of calls to return
|
|
40
|
+
*/
|
|
41
|
+
export declare const getCallStack: (depth?: number) => string[];
|
|
42
|
+
export declare const getInitials: (label: string, length?: number) => string;
|
|
43
|
+
export declare const _getInitialEngine: (words: string[], length: number) => string;
|
|
44
|
+
/**
|
|
45
|
+
* Format an ID: remove accents, any special characters, replace spaces by underscore and make sure there is no double underscore
|
|
46
|
+
*
|
|
47
|
+
* @param id
|
|
48
|
+
* @returns formatted ID
|
|
49
|
+
*/
|
|
50
|
+
export declare const slugifyString: (id: string, separator?: "-" | "_") => string;
|
|
51
|
+
/**
|
|
52
|
+
* Returns a hash code from a string
|
|
53
|
+
* @param {String} str The string to hash.
|
|
54
|
+
* @return {Number} A 32bit integer
|
|
55
|
+
*/
|
|
56
|
+
export declare const simpleStringHash: (str: string) => number;
|
|
57
|
+
export declare const getFlagByLang: (lang: string) => string;
|
|
58
|
+
export declare const getLogsIndexName: (indexPrefix: string, instanceId: string) => string;
|
|
59
|
+
export declare const waitFor: (predicate: () => Promise<boolean> | boolean, options?: {
|
|
60
|
+
timeout?: number;
|
|
61
|
+
interval?: number;
|
|
62
|
+
}) => Promise<boolean>;
|
|
63
|
+
export declare const isTypeLink: (type: AttributeType) => type is AttributeType.advanced_link | AttributeType.simple_link;
|
|
64
|
+
export declare const isTypeStandard: (type: AttributeType) => type is AttributeType.advanced | AttributeType.simple;
|
|
65
|
+
/**
|
|
66
|
+
* Return a new object without the keys passed in parameter
|
|
67
|
+
*/
|
|
68
|
+
export declare const omit: <T extends object, K extends keyof T>(obj: T, ...keys: K[]) => Omit<T, K>;
|