@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.
Files changed (83) hide show
  1. package/README.md +8 -0
  2. package/dist/cjs/MIMEByExtension.json +806 -0
  3. package/dist/cjs/constants.d.ts +2 -0
  4. package/dist/cjs/constants.js +9 -0
  5. package/dist/cjs/constants.js.map +1 -0
  6. package/dist/cjs/index.d.ts +11 -0
  7. package/dist/cjs/index.js +31 -0
  8. package/dist/cjs/index.js.map +1 -0
  9. package/dist/cjs/types/applications.d.ts +1 -0
  10. package/dist/cjs/types/applications.js +8 -0
  11. package/dist/cjs/types/applications.js.map +1 -0
  12. package/dist/cjs/types/attributes.d.ts +7 -0
  13. package/dist/cjs/types/attributes.js +15 -0
  14. package/dist/cjs/types/attributes.js.map +1 -0
  15. package/dist/cjs/types/errors.d.ts +5 -0
  16. package/dist/cjs/types/errors.js +13 -0
  17. package/dist/cjs/types/errors.js.map +1 -0
  18. package/dist/cjs/types/events.d.ts +75 -0
  19. package/dist/cjs/types/events.js +37 -0
  20. package/dist/cjs/types/events.js.map +1 -0
  21. package/dist/cjs/types/files.d.ts +16 -0
  22. package/dist/cjs/types/files.js +15 -0
  23. package/dist/cjs/types/files.js.map +1 -0
  24. package/dist/cjs/types/forms.d.ts +60 -0
  25. package/dist/cjs/types/forms.js +29 -0
  26. package/dist/cjs/types/forms.js.map +1 -0
  27. package/dist/cjs/types/helpers.d.ts +13 -0
  28. package/dist/cjs/types/helpers.js +3 -0
  29. package/dist/cjs/types/helpers.js.map +1 -0
  30. package/dist/cjs/types/logs.d.ts +2 -0
  31. package/dist/cjs/types/logs.js +3 -0
  32. package/dist/cjs/types/logs.js.map +1 -0
  33. package/dist/cjs/types/previews.d.ts +5 -0
  34. package/dist/cjs/types/previews.js +13 -0
  35. package/dist/cjs/types/previews.js.map +1 -0
  36. package/dist/cjs/types/values.d.ts +4 -0
  37. package/dist/cjs/types/values.js +3 -0
  38. package/dist/cjs/types/values.js.map +1 -0
  39. package/dist/cjs/utils.d.ts +68 -0
  40. package/dist/cjs/utils.js +312 -0
  41. package/dist/cjs/utils.js.map +1 -0
  42. package/dist/esm/MIMEByExtension.json +806 -0
  43. package/dist/esm/constants.d.ts +2 -0
  44. package/dist/esm/constants.js +6 -0
  45. package/dist/esm/constants.js.map +1 -0
  46. package/dist/esm/index.d.ts +11 -0
  47. package/dist/esm/index.js +15 -0
  48. package/dist/esm/index.js.map +1 -0
  49. package/dist/esm/types/applications.d.ts +1 -0
  50. package/dist/esm/types/applications.js +5 -0
  51. package/dist/esm/types/applications.js.map +1 -0
  52. package/dist/esm/types/attributes.d.ts +7 -0
  53. package/dist/esm/types/attributes.js +12 -0
  54. package/dist/esm/types/attributes.js.map +1 -0
  55. package/dist/esm/types/errors.d.ts +5 -0
  56. package/dist/esm/types/errors.js +10 -0
  57. package/dist/esm/types/errors.js.map +1 -0
  58. package/dist/esm/types/events.d.ts +75 -0
  59. package/dist/esm/types/events.js +34 -0
  60. package/dist/esm/types/events.js.map +1 -0
  61. package/dist/esm/types/files.d.ts +16 -0
  62. package/dist/esm/types/files.js +12 -0
  63. package/dist/esm/types/files.js.map +1 -0
  64. package/dist/esm/types/forms.d.ts +60 -0
  65. package/dist/esm/types/forms.js +26 -0
  66. package/dist/esm/types/forms.js.map +1 -0
  67. package/dist/esm/types/helpers.d.ts +13 -0
  68. package/dist/esm/types/helpers.js +2 -0
  69. package/dist/esm/types/helpers.js.map +1 -0
  70. package/dist/esm/types/logs.d.ts +2 -0
  71. package/dist/esm/types/logs.js +2 -0
  72. package/dist/esm/types/logs.js.map +1 -0
  73. package/dist/esm/types/previews.d.ts +5 -0
  74. package/dist/esm/types/previews.js +10 -0
  75. package/dist/esm/types/previews.js.map +1 -0
  76. package/dist/esm/types/values.d.ts +4 -0
  77. package/dist/esm/types/values.js +2 -0
  78. package/dist/esm/types/values.js.map +1 -0
  79. package/dist/esm/utils.d.ts +68 -0
  80. package/dist/esm/utils.js +262 -0
  81. package/dist/esm/utils.js.map +1 -0
  82. package/dist/tsconfig.tsbuildinfo +1 -0
  83. package/package.json +38 -0
@@ -0,0 +1,2 @@
1
+ export declare const idFormatRegex: RegExp;
2
+ export declare const endpointFormatRegex: RegExp;
@@ -0,0 +1,6 @@
1
+ // Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
2
+ // This file is released under LGPL V3
3
+ // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
4
+ export const idFormatRegex = /^[a-z0-9_]+$/;
5
+ export const endpointFormatRegex = /^[a-z0-9-]+$/;
6
+ //# 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;AACtE,MAAM,CAAC,MAAM,aAAa,GAAG,cAAc,CAAC;AAC5C,MAAM,CAAC,MAAM,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,15 @@
1
+ // Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
2
+ // This file is released under LGPL V3
3
+ // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
4
+ export * from './constants';
5
+ export * from './types/applications';
6
+ export * from './types/errors';
7
+ export * from './types/events';
8
+ export * from './types/files';
9
+ export * from './types/forms';
10
+ export * from './types/helpers';
11
+ export * from './types/logs';
12
+ export * from './types/previews';
13
+ export * from './types/values';
14
+ export * from './utils';
15
+ //# 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,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const CONSULTED_APPS_KEY = "applications_consultation";
@@ -0,0 +1,5 @@
1
+ // Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
2
+ // This file is released under LGPL V3
3
+ // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
4
+ export const CONSULTED_APPS_KEY = 'applications_consultation';
5
+ //# 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;AACtE,MAAM,CAAC,MAAM,kBAAkB,GAAG,2BAA2B,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare enum AttributeType {
2
+ advanced = "advanced",
3
+ advanced_link = "advanced_link",
4
+ simple = "simple",
5
+ simple_link = "simple_link",
6
+ tree = "tree"
7
+ }
@@ -0,0 +1,12 @@
1
+ // Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
2
+ // This file is released under LGPL V3
3
+ // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
4
+ export var AttributeType;
5
+ (function (AttributeType) {
6
+ AttributeType["advanced"] = "advanced";
7
+ AttributeType["advanced_link"] = "advanced_link";
8
+ AttributeType["simple"] = "simple";
9
+ AttributeType["simple_link"] = "simple_link";
10
+ AttributeType["tree"] = "tree";
11
+ })(AttributeType || (AttributeType = {}));
12
+ //# 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,MAAM,CAAN,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,KAAb,aAAa,QAMxB"}
@@ -0,0 +1,5 @@
1
+ export declare enum ErrorTypes {
2
+ VALIDATION_ERROR = "VALIDATION_ERROR",
3
+ PERMISSION_ERROR = "PERMISSION_ERROR",
4
+ INTERNAL_ERROR = "INTERNAL_ERROR"
5
+ }
@@ -0,0 +1,10 @@
1
+ // Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
2
+ // This file is released under LGPL V3
3
+ // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
4
+ export var ErrorTypes;
5
+ (function (ErrorTypes) {
6
+ ErrorTypes["VALIDATION_ERROR"] = "VALIDATION_ERROR";
7
+ ErrorTypes["PERMISSION_ERROR"] = "PERMISSION_ERROR";
8
+ ErrorTypes["INTERNAL_ERROR"] = "INTERNAL_ERROR";
9
+ })(ErrorTypes || (ErrorTypes = {}));
10
+ //# 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,MAAM,CAAN,IAAY,UAIX;AAJD,WAAY,UAAU;IAClB,mDAAqC,CAAA;IACrC,mDAAqC,CAAA;IACrC,+CAAiC,CAAA;AACrC,CAAC,EAJW,UAAU,KAAV,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,34 @@
1
+ /*** Database events ***/
2
+ export var EventAction;
3
+ (function (EventAction) {
4
+ EventAction["API_KEY_DELETE"] = "API_KEY_DELETE";
5
+ EventAction["API_KEY_SAVE"] = "API_KEY_SAVE";
6
+ EventAction["APP_DELETE"] = "APP_DELETE";
7
+ EventAction["APP_SAVE"] = "APP_SAVE";
8
+ EventAction["ATTRIBUTE_DELETE"] = "ATTRIBUTE_DELETE";
9
+ EventAction["ATTRIBUTE_SAVE"] = "ATTRIBUTE_SAVE";
10
+ EventAction["EXPORT_START"] = "EXPORT_START";
11
+ EventAction["EXPORT_END"] = "EXPORT_END";
12
+ EventAction["DATA_IMPORT_START"] = "DATA_IMPORT_START";
13
+ EventAction["DATA_IMPORT_END"] = "DATA_IMPORT_END";
14
+ EventAction["CONFIG_IMPORT_START"] = "CONFIG_IMPORT_START";
15
+ EventAction["CONFIG_IMPORT_END"] = "CONFIG_IMPORT_END";
16
+ EventAction["GLOBAL_SETTINGS_SAVE"] = "GLOBAL_SETTINGS_SAVE";
17
+ EventAction["LIBRARY_DELETE"] = "LIBRARY_DELETE";
18
+ EventAction["LIBRARY_PURGE"] = "LIBRARY_PURGE";
19
+ EventAction["LIBRARY_SAVE"] = "LIBRARY_SAVE";
20
+ EventAction["TASKS_DELETE"] = "TASKS_DELETE";
21
+ EventAction["PERMISSION_SAVE"] = "PERMISSION_SAVE";
22
+ EventAction["RECORD_DELETE"] = "RECORD_DELETE";
23
+ EventAction["RECORD_SAVE"] = "RECORD_SAVE";
24
+ EventAction["TREE_ADD_ELEMENT"] = "TREE_ADD_ELEMENT";
25
+ EventAction["TREE_DELETE"] = "TREE_DELETE";
26
+ EventAction["TREE_DELETE_ELEMENT"] = "TREE_DELETE_ELEMENT";
27
+ EventAction["TREE_MOVE_ELEMENT"] = "TREE_MOVE_ELEMENT";
28
+ EventAction["TREE_SAVE"] = "TREE_SAVE";
29
+ EventAction["VALUE_DELETE"] = "VALUE_DELETE";
30
+ EventAction["VALUE_SAVE"] = "VALUE_SAVE";
31
+ EventAction["VERSION_PROFILE_DELETE"] = "VERSION_PROFILE_DELETE";
32
+ EventAction["VERSION_PROFILE_SAVE"] = "VERSION_PROFILE_SAVE";
33
+ })(EventAction || (EventAction = {}));
34
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../../../src/types/events.ts"],"names":[],"mappings":"AAWA,yBAAyB;AAEzB,MAAM,CAAN,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,KAAX,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,12 @@
1
+ // Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
2
+ // This file is released under LGPL V3
3
+ // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
4
+ export var FileType;
5
+ (function (FileType) {
6
+ FileType["IMAGE"] = "image";
7
+ FileType["VIDEO"] = "video";
8
+ FileType["AUDIO"] = "audio";
9
+ FileType["DOCUMENT"] = "document";
10
+ FileType["OTHER"] = "other";
11
+ })(FileType || (FileType = {}));
12
+ //# 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,MAAM,CAAN,IAAY,QAMX;AAND,WAAY,QAAQ;IAChB,2BAAe,CAAA;IACf,2BAAe,CAAA;IACf,2BAAe,CAAA;IACf,iCAAqB,CAAA;IACrB,2BAAe,CAAA;AACnB,CAAC,EANW,QAAQ,KAAR,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,26 @@
1
+ export var FormUIElementTypes;
2
+ (function (FormUIElementTypes) {
3
+ FormUIElementTypes["DIVIDER"] = "divider";
4
+ FormUIElementTypes["FIELDS_CONTAINER"] = "fields_container";
5
+ FormUIElementTypes["TAB_FIELDS_CONTAINER"] = "tab_fields_container";
6
+ FormUIElementTypes["TEXT_BLOCK"] = "text_block";
7
+ FormUIElementTypes["TABS"] = "tabs";
8
+ FormUIElementTypes["FRAME"] = "frame";
9
+ })(FormUIElementTypes || (FormUIElementTypes = {}));
10
+ export var FormFieldTypes;
11
+ (function (FormFieldTypes) {
12
+ FormFieldTypes["TEXT_INPUT"] = "input_field";
13
+ FormFieldTypes["DATE"] = "date";
14
+ FormFieldTypes["CHECKBOX"] = "checkbox";
15
+ FormFieldTypes["ENCRYPTED"] = "encrypted";
16
+ FormFieldTypes["DROPDOWN"] = "dropdown";
17
+ FormFieldTypes["LINK"] = "link";
18
+ FormFieldTypes["TREE"] = "tree";
19
+ })(FormFieldTypes || (FormFieldTypes = {}));
20
+ export var TabsDirection;
21
+ (function (TabsDirection) {
22
+ TabsDirection["HORIZONTAL"] = "horizontal";
23
+ TabsDirection["VERTICAL"] = "vertical";
24
+ })(TabsDirection || (TabsDirection = {}));
25
+ export const FORM_ROOT_CONTAINER_ID = '__root';
26
+ //# sourceMappingURL=forms.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forms.js","sourceRoot":"","sources":["../../../src/types/forms.ts"],"names":[],"mappings":"AAKA,MAAM,CAAN,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,KAAlB,kBAAkB,QAO7B;AAED,MAAM,CAAN,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,KAAd,cAAc,QAQzB;AAED,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACrB,0CAAyB,CAAA;IACzB,sCAAqB,CAAA;AACzB,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB;AAgDD,MAAM,CAAC,MAAM,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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/types/helpers.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import { IDbEvent, IDbPayload } from './events';
2
+ export type Log = Omit<IDbEvent, 'payload' | 'emitter'> & IDbPayload;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=logs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logs.js","sourceRoot":"","sources":["../../../src/types/logs.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export declare enum PreviewPriority {
2
+ LOW = 1,
3
+ MEDIUM = 2,
4
+ HIGH = 3
5
+ }
@@ -0,0 +1,10 @@
1
+ // Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
2
+ // This file is released under LGPL V3
3
+ // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
4
+ export var PreviewPriority;
5
+ (function (PreviewPriority) {
6
+ PreviewPriority[PreviewPriority["LOW"] = 1] = "LOW";
7
+ PreviewPriority[PreviewPriority["MEDIUM"] = 2] = "MEDIUM";
8
+ PreviewPriority[PreviewPriority["HIGH"] = 3] = "HIGH";
9
+ })(PreviewPriority || (PreviewPriority = {}));
10
+ //# 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,MAAM,CAAN,IAAY,eAIX;AAJD,WAAY,eAAe;IACvB,mDAAO,CAAA;IACP,yDAAU,CAAA;IACV,qDAAQ,CAAA;AACZ,CAAC,EAJW,eAAe,KAAf,eAAe,QAI1B"}
@@ -0,0 +1,4 @@
1
+ export interface IDateRangeValue {
2
+ from: string;
3
+ to: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=values.js.map
@@ -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>;