data-primals-engine 1.6.3 → 1.7.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.
Files changed (55) hide show
  1. package/README.md +52 -900
  2. package/client/index.js +3 -0
  3. package/client/package-lock.json +7563 -8811
  4. package/client/package.json +11 -1
  5. package/client/src/App.scss +29 -0
  6. package/client/src/AssistantChat.jsx +369 -362
  7. package/client/src/DataEditor.jsx +383 -383
  8. package/client/src/DataLayout.jsx +54 -20
  9. package/client/src/ModelList.jsx +280 -280
  10. package/client/src/ViewSwitcher.scss +0 -31
  11. package/client/src/_variables.scss +3 -0
  12. package/client/src/constants.js +81 -100
  13. package/client/src/contexts/CommandContext.jsx +274 -259
  14. package/client/vite.config.js +30 -30
  15. package/doc/AI-assistance.md +93 -0
  16. package/doc/Advanced-workflows.md +90 -0
  17. package/doc/Event-system.md +79 -0
  18. package/doc/Packs-gallery.md +73 -0
  19. package/doc/automation-workflows.md +102 -0
  20. package/doc/core-concepts.md +33 -0
  21. package/doc/custom-api-endpoints.md +40 -0
  22. package/doc/dashboards-kpis-charts.md +49 -0
  23. package/doc/data-management.md +120 -0
  24. package/doc/data-models.md +75 -0
  25. package/doc/index.md +14 -0
  26. package/doc/roles-permissions.md +43 -0
  27. package/doc/users.md +30 -0
  28. package/package.json +20 -10
  29. package/src/client.js +6 -4
  30. package/src/constants.js +1 -1
  31. package/src/core.js +31 -12
  32. package/src/defaultModels.js +1 -1
  33. package/src/engine.js +342 -335
  34. package/src/filter.js +72 -173
  35. package/src/migrate.js +1 -1
  36. package/src/modules/assistant/assistant.js +30 -20
  37. package/src/modules/data/data.backup.js +4 -4
  38. package/src/modules/data/data.js +8 -7
  39. package/src/modules/data/data.operations.js +186 -133
  40. package/src/modules/data/data.relations.js +3 -2
  41. package/src/modules/data/data.scheduling.js +1 -1
  42. package/src/modules/mongodb.js +17 -8
  43. package/src/modules/swagger.js +25 -5
  44. package/src/modules/user.js +108 -79
  45. package/src/modules/workflow.js +138 -3
  46. package/src/packs.js +5697 -5697
  47. package/src/profiles.js +19 -0
  48. package/swagger-en.yml +3391 -1550
  49. package/swagger-fr.yml +3385 -2896
  50. package/test/assistant.test.js +2 -2
  51. package/test/core.test.js +341 -0
  52. package/test/data.backup.integration.test.js +3 -1
  53. package/test/data.history.integration.test.js +0 -1
  54. package/test/data.integration.test.js +137 -2
  55. package/test/user.test.js +33 -29
@@ -1,100 +1,81 @@
1
- import {host} from "../../src/constants.js";
2
-
3
- export const seoTitle = 'Self Data Hosting';
4
-
5
-
6
- // Dans ConditionBuilder.jsx ou un fichier de constantes partagé
7
- export const mongoOperators = [
8
- { value: '$eq', label: '==', inputType: 'text' }, // Égal (pour string, number, boolean...)
9
- { value: '$ne', label: '!=', inputType: 'text' }, // Différent
10
- { value: '$gt', label: '>', inputType: 'number' }, // Supérieur (nombre, date)
11
- { value: '$gte', label: '>=', inputType: 'number' }, // Supérieur ou égal à
12
- { value: '$lt', label: '<', inputType: 'number' }, // Inférieur à
13
- { value: '$lte', label: '<=', inputType: 'number' }, // Inférieur ou égal à
14
- { value: '$regex', label: 'contient (regex)', inputType: 'text' }, // Correspondance Regex (pour string)
15
- { value: '$in', label: 'est dans (liste)', inputType: 'csv' }, // Dans un tableau (valeurs séparées par des virgules)
16
- { value: '$nin', label: "n'est pas dans (liste)", inputType: 'csv' }, // Pas dans un tableau
17
- { value: '$exists', label: 'existe', inputType: 'boolean' } // Le champ existe (true/false)
18
- // { value: '$not', label: 'NON (condition)', inputType: 'condition' }, // Pourrait encapsuler une autre condition
19
- // Ajoutez d'autres opérateurs MongoDB pertinents si besoin ($size, $type, $elemMatch...)
20
- ];
21
-
22
- export const MONGO_OPERATORS = {
23
- ADD: { mongo: '$add', label: '+', type: 'numeric', multi: true },
24
- SUBTRACT: { mongo: '$subtract', label: '-', type: 'numeric', multi: false },
25
- MULTIPLY: { mongo: '$multiply', label: '*', type: 'numeric', multi: true },
26
- DIVIDE: { mongo: '$divide', label: '/', type: 'numeric', multi: false },
27
- MODULO: { mongo: '$mod', label: '%', type: 'numeric', multi: false },
28
- POW: { mongo: '$pow', label: 'pow', type: 'numeric', multi: false },
29
- SQRT: { mongo: '$sqrt', label: '√', type: 'numeric', multi: false, unary: true },
30
- ABS: { mongo: '$abs', label: 'abs', type: 'numeric', multi: false, unary: true },
31
- CEIL: { mongo: '$ceil', label: 'ceil', type: 'numeric', multi: false, unary: true },
32
- FLOOR: { mongo: '$floor', label: 'floor', type: 'numeric', multi: false, unary: true },
33
- COS: { mongo: '$cos', label: 'cos', type: 'numeric', multi: false, unary: true },
34
- ACOS: { mongo: '$acos', label: 'acos', type: 'numeric', multi: false, unary: true },
35
- SIN: { mongo: '$sin', label: 'sin', type: 'numeric', multi: false, unary: true },
36
- ASIN: { mongo: '$asin', label: 'asin', type: 'numeric', multi: false, unary: true },
37
- TAN: { mongo: '$tan', label: 'tan', type: 'numeric', multi: false, unary: true },
38
- ATAN: { mongo: '$atan', label: 'atan', type: 'numeric', multi: false, unary: true },
39
- LN: { mongo: '$ln', label: 'ln', type: 'numeric', multi: false, unary: true },
40
- LOG: { mongo: '$log10', label: 'log', type: 'numeric', multi: false, unary: true },
41
-
42
- CONCAT: { mongo: '$concat', label: 'concat', type: 'string', multi: true },
43
-
44
- YEAR: { mongo: '$year', label: 'year', type: 'date', unary: true },
45
- MONTH: { mongo: '$month', label: 'month', type: 'date', unary: true },
46
- WEEK: { mongo: '$week', label: 'week', type: 'date', unary: true },
47
- DAY_OF_MONTH: { mongo: '$dayOfMonth', label: 'day', type: 'date', unary: true },
48
- HOUR: { mongo: '$hour', label: 'hour', type: 'date', unary: true },
49
- MINUTE: { mongo: '$minute', label: 'min', type: 'date', unary: true },
50
- SECOND: { mongo: '$second', label: 'sec', type: 'date', unary: true }
51
- };
52
-
53
- export const profiles = {
54
- 'personal': {
55
- "packs": [],
56
- "models": ['contact', 'location', 'imageGallery', 'budget', 'currency', 'taxonomy']
57
- }, // budget,
58
- 'developer': {
59
- "packs": ["Multilingual starter pack", "Website Starter Pack"],
60
- "models": ['alert','endpoint','request','kpi','webpage', 'content', 'taxonomy', 'resource', 'translation', 'contact', 'location', 'channel', 'lang', 'token', 'message', 'ticket', 'user', 'permission', 'role']
61
- },
62
- 'company': {
63
- "packs": ["Multilingual starter pack", "E-commerce Starter Kit"],
64
- "models": ['alert','request','location', 'order', 'currency', 'product', 'cart', 'cartItem', 'invoice', 'message', 'user', 'role', 'permission', 'token','translation', 'lang', 'webpage', 'content', 'taxonomy', 'contact', 'resource', 'accountingExercise', 'accountingLineItem', 'accountingEntry', 'employee', 'kpi', 'dashboard']
65
- },
66
- 'engineer': {
67
- "packs": ["Multilingual starter pack", "AI Content Generation - Starter Pack"],
68
- "models":['alert','endpoint','request','dashboard', 'kpi', 'user', 'role', 'token', 'permission', 'workflow', 'workflowRun', 'workflowStep', "channel", "message", 'workflowAction', 'workflowTrigger']
69
- }
70
- }
71
-
72
- export const OPERAND_TYPES = {
73
- FIELD: 'field',
74
- CONSTANT: 'constant',
75
- PREVIOUS_STEP: 'previousStep'
76
- };
77
-
78
-
79
- export const getHost = () => {
80
- return import.meta.env.HOST || host || 'localhost';
81
- }
82
-
83
-
84
-
85
- export const langs = {
86
- fr: "Français",
87
- en: "English",
88
- ar: "عربي",
89
- fa: "فارسی",
90
- it: "Italiano",
91
- es: "Español",
92
- el: "Ελληνικά",
93
- de: "Deutsch",
94
- cs: "Čeština",
95
- sv: "Svenska",
96
- pt: "Português",
97
- ja: "日本語",
98
- zh: "简体中文",
99
- ru: "Русский"
100
- };
1
+ import {host} from "../../src/constants.js";
2
+
3
+ export const seoTitle = 'Self Data Hosting';
4
+
5
+
6
+ // Dans ConditionBuilder.jsx ou un fichier de constantes partagé
7
+ export const mongoOperators = [
8
+ { value: '$eq', label: '==', inputType: 'text' }, // Égal (pour string, number, boolean...)
9
+ { value: '$ne', label: '!=', inputType: 'text' }, // Différent
10
+ { value: '$gt', label: '>', inputType: 'number' }, // Supérieur (nombre, date)
11
+ { value: '$gte', label: '>=', inputType: 'number' }, // Supérieur ou égal à
12
+ { value: '$lt', label: '<', inputType: 'number' }, // Inférieur à
13
+ { value: '$lte', label: '<=', inputType: 'number' }, // Inférieur ou égal à
14
+ { value: '$regex', label: 'contient (regex)', inputType: 'text' }, // Correspondance Regex (pour string)
15
+ { value: '$in', label: 'est dans (liste)', inputType: 'csv' }, // Dans un tableau (valeurs séparées par des virgules)
16
+ { value: '$nin', label: "n'est pas dans (liste)", inputType: 'csv' }, // Pas dans un tableau
17
+ { value: '$exists', label: 'existe', inputType: 'boolean' } // Le champ existe (true/false)
18
+ // { value: '$not', label: 'NON (condition)', inputType: 'condition' }, // Pourrait encapsuler une autre condition
19
+ // Ajoutez d'autres opérateurs MongoDB pertinents si besoin ($size, $type, $elemMatch...)
20
+ ];
21
+
22
+ export const MONGO_OPERATORS = {
23
+ ADD: { mongo: '$add', label: '+', type: 'numeric', multi: true },
24
+ SUBTRACT: { mongo: '$subtract', label: '-', type: 'numeric', multi: false },
25
+ MULTIPLY: { mongo: '$multiply', label: '*', type: 'numeric', multi: true },
26
+ DIVIDE: { mongo: '$divide', label: '/', type: 'numeric', multi: false },
27
+ MODULO: { mongo: '$mod', label: '%', type: 'numeric', multi: false },
28
+ POW: { mongo: '$pow', label: 'pow', type: 'numeric', multi: false },
29
+ SQRT: { mongo: '$sqrt', label: '√', type: 'numeric', multi: false, unary: true },
30
+ ABS: { mongo: '$abs', label: 'abs', type: 'numeric', multi: false, unary: true },
31
+ CEIL: { mongo: '$ceil', label: 'ceil', type: 'numeric', multi: false, unary: true },
32
+ FLOOR: { mongo: '$floor', label: 'floor', type: 'numeric', multi: false, unary: true },
33
+ COS: { mongo: '$cos', label: 'cos', type: 'numeric', multi: false, unary: true },
34
+ ACOS: { mongo: '$acos', label: 'acos', type: 'numeric', multi: false, unary: true },
35
+ SIN: { mongo: '$sin', label: 'sin', type: 'numeric', multi: false, unary: true },
36
+ ASIN: { mongo: '$asin', label: 'asin', type: 'numeric', multi: false, unary: true },
37
+ TAN: { mongo: '$tan', label: 'tan', type: 'numeric', multi: false, unary: true },
38
+ ATAN: { mongo: '$atan', label: 'atan', type: 'numeric', multi: false, unary: true },
39
+ LN: { mongo: '$ln', label: 'ln', type: 'numeric', multi: false, unary: true },
40
+ LOG: { mongo: '$log10', label: 'log', type: 'numeric', multi: false, unary: true },
41
+
42
+ CONCAT: { mongo: '$concat', label: 'concat', type: 'string', multi: true },
43
+
44
+ YEAR: { mongo: '$year', label: 'year', type: 'date', unary: true },
45
+ MONTH: { mongo: '$month', label: 'month', type: 'date', unary: true },
46
+ WEEK: { mongo: '$week', label: 'week', type: 'date', unary: true },
47
+ DAY_OF_MONTH: { mongo: '$dayOfMonth', label: 'day', type: 'date', unary: true },
48
+ HOUR: { mongo: '$hour', label: 'hour', type: 'date', unary: true },
49
+ MINUTE: { mongo: '$minute', label: 'min', type: 'date', unary: true },
50
+ SECOND: { mongo: '$second', label: 'sec', type: 'date', unary: true }
51
+ };
52
+
53
+ export const OPERAND_TYPES = {
54
+ FIELD: 'field',
55
+ CONSTANT: 'constant',
56
+ PREVIOUS_STEP: 'previousStep'
57
+ };
58
+
59
+
60
+ export const getHost = () => {
61
+ return import.meta.env.HOST || host || 'localhost';
62
+ }
63
+
64
+
65
+
66
+ export const langs = {
67
+ fr: "Français",
68
+ en: "English",
69
+ ar: "عربي",
70
+ fa: "فارسی",
71
+ it: "Italiano",
72
+ es: "Español",
73
+ el: "Ελληνικά",
74
+ de: "Deutsch",
75
+ cs: "Čeština",
76
+ sv: "Svenska",
77
+ pt: "Português",
78
+ ja: "日本語",
79
+ zh: "简体中文",
80
+ ru: "Русский"
81
+ };