data-primals-engine 1.3.4 → 1.4.1
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 +72 -2
- package/client/README.md +20 -0
- package/client/package-lock.json +712 -147
- package/client/package.json +38 -37
- package/client/src/App.jsx +9 -10
- package/client/src/App.scss +7 -1
- package/client/src/Dashboard.jsx +349 -208
- package/client/src/DashboardView.jsx +569 -547
- package/client/src/DataEditor.jsx +20 -2
- package/client/src/DataLayout.jsx +24 -12
- package/client/src/DataTable.jsx +807 -760
- package/client/src/DataTable.scss +187 -90
- package/client/src/Field.jsx +1783 -1656
- package/client/src/ModelCreator.jsx +2 -2
- package/client/src/ModelCreatorField.jsx +906 -804
- package/client/src/ModelList.jsx +2 -2
- package/client/src/PackGallery.jsx +391 -290
- package/client/src/PackGallery.scss +231 -210
- package/client/src/constants.js +16 -4
- package/client/src/translations.js +16750 -16392
- package/package.json +14 -11
- package/src/core.js +9 -0
- package/src/defaultModels.js +18 -10
- package/src/email.js +2 -1
- package/src/gameObject.js +1 -1
- package/src/i18n.js +501 -28
- package/src/modules/auth-google/index.js +51 -0
- package/src/modules/auth-microsoft/index.js +82 -0
- package/src/modules/auth-saml/index.js +90 -0
- package/src/modules/data/data.core.js +5 -1
- package/src/modules/data/data.history.js +489 -489
- package/src/modules/data/data.js +86 -12
- package/src/modules/data/data.routes.js +1691 -1663
- package/src/modules/user.js +19 -0
- package/src/modules/workflow.js +2 -12
- package/src/providers.js +110 -1
- package/src/sso.js +194 -0
- package/test/data.integration.test.js +3 -0
- package/test/user.test.js +1 -1
- package/client/public/demo/26899917-d1ba-4df4-bb33-48d09a8778da.jpg +0 -0
- package/client/public/demo/4b9894c7-12cd-466d-8fd3-a2757b09ec96.jpg +0 -0
- package/client/public/demo/7ed369ac-a1a2-4b45-b0cd-4fd5bcf5a75a.jpg +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "data-primals-engine",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "data-primals-engine is a package responsible from handling large amount of data using MongoDB in a practical and performant way. It can also get workflow models working (for automation), and fully supports internationalisation. It also has integrated AI assistant.",
|
|
5
5
|
"main": "src/engine.js",
|
|
6
6
|
"type": "module",
|
|
@@ -31,12 +31,11 @@
|
|
|
31
31
|
"tar-fs": "3.0.9",
|
|
32
32
|
"on-headers": "1.1.0",
|
|
33
33
|
"brace-expansion": "2.0.2",
|
|
34
|
-
"prismjs": "1.30.0"
|
|
34
|
+
"prismjs": "1.30.0",
|
|
35
|
+
"xml2js": ">=0.5.0"
|
|
35
36
|
},
|
|
36
37
|
"overrides": {
|
|
37
|
-
"
|
|
38
|
-
"prismjs": "1.30.0"
|
|
39
|
-
}
|
|
38
|
+
"prismjs": "1.30.0"
|
|
40
39
|
},
|
|
41
40
|
"repository": {
|
|
42
41
|
"type": "git",
|
|
@@ -49,11 +48,6 @@
|
|
|
49
48
|
"./client": "./client/index.js",
|
|
50
49
|
"./*": "./src/*.js"
|
|
51
50
|
},
|
|
52
|
-
"peerDependencies": {
|
|
53
|
-
"express": "^5.1.0",
|
|
54
|
-
"react": "18.3.1",
|
|
55
|
-
"react-query": ">=3.0.0"
|
|
56
|
-
},
|
|
57
51
|
"dependencies": {
|
|
58
52
|
"@langchain/anthropic": "^0.3.26",
|
|
59
53
|
"@langchain/core": "^0.3.66",
|
|
@@ -85,10 +79,11 @@
|
|
|
85
79
|
"node-schedule": "^2.1.1",
|
|
86
80
|
"nodemailer": "^7.0.5",
|
|
87
81
|
"openai": "^5.10.2",
|
|
82
|
+
"passport": "^0.7.0",
|
|
83
|
+
"passport-saml-encrypted": "^0.1.13",
|
|
88
84
|
"process": "^0.11.10",
|
|
89
85
|
"prop-types": "^15.8.1",
|
|
90
86
|
"randomcolor": "^0.6.2",
|
|
91
|
-
"react-i18next": "^15.6.1",
|
|
92
87
|
"react-markdown": "^10.1.0",
|
|
93
88
|
"read-excel-file": "^5.8.8",
|
|
94
89
|
"request-ip": "^3.3.0",
|
|
@@ -102,6 +97,14 @@
|
|
|
102
97
|
"vitest": "^3.2.4",
|
|
103
98
|
"yaml": "^2.8.0"
|
|
104
99
|
},
|
|
100
|
+
"peerDependencies": {
|
|
101
|
+
"express": "^5.1.0",
|
|
102
|
+
"passport-azure-ad": "^4.3.5",
|
|
103
|
+
"passport-google-oauth20": "^2.0.0",
|
|
104
|
+
"react": "18.3.1",
|
|
105
|
+
"react-i18next": "^15.6.1",
|
|
106
|
+
"react-query": ">=3.0.0"
|
|
107
|
+
},
|
|
105
108
|
"devDependencies": {
|
|
106
109
|
"@eslint/js": "^9.32.0",
|
|
107
110
|
"concurrently": "^9.2.0",
|
package/src/core.js
CHANGED
|
@@ -9,6 +9,15 @@ export function escapeRegex(string) {
|
|
|
9
9
|
return string.replace(/[/\-\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
export const sequential = async (tasks) => {
|
|
13
|
+
const res = [];
|
|
14
|
+
for (const task of tasks) {
|
|
15
|
+
const r = await task();
|
|
16
|
+
res.push(r);
|
|
17
|
+
}
|
|
18
|
+
return res;
|
|
19
|
+
};
|
|
20
|
+
|
|
12
21
|
export function isValidRegex(s) {
|
|
13
22
|
try {
|
|
14
23
|
const m = s.match(/^([/~@;%#'])(.*?)\1([gimsuy]*)$/);
|
package/src/defaultModels.js
CHANGED
|
@@ -180,18 +180,25 @@ export const defaultModels = {
|
|
|
180
180
|
cronMask: [false, true, true, true, true, true],
|
|
181
181
|
hint: "À quelle fréquence vérifier si la condition est remplie."
|
|
182
182
|
},
|
|
183
|
+
{ name: "isActive", type: "boolean", default: true },
|
|
183
184
|
{
|
|
184
|
-
name: "
|
|
185
|
-
type: "
|
|
186
|
-
|
|
187
|
-
|
|
185
|
+
name: "sendEmail",
|
|
186
|
+
type: "boolean",
|
|
187
|
+
default: false,
|
|
188
|
+
hint: "Cochez pour envoyer également une notification par e-mail."
|
|
188
189
|
},
|
|
189
|
-
{ name: "isActive", type: "boolean", default: true },
|
|
190
190
|
{
|
|
191
191
|
name: "lastNotifiedAt",
|
|
192
192
|
type: "datetime",
|
|
193
193
|
required: false, // Important: ce champ est géré par le système
|
|
194
194
|
hint: "Timestamp de la dernière notification envoyée pour cette alerte."
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
name: "message",
|
|
198
|
+
type: "richtext_t",
|
|
199
|
+
required: false,
|
|
200
|
+
hint: "Message personnalisé pour l'e-mail. Si vide, un message par défaut sera utilisé. Vous pouvez utiliser les variables {count}, {alert.name}....",
|
|
201
|
+
condition: { $eq: ["$sendEmail", true] }
|
|
195
202
|
}
|
|
196
203
|
]
|
|
197
204
|
},
|
|
@@ -1082,11 +1089,12 @@ export const defaultModels = {
|
|
|
1082
1089
|
hint: "Structure JSON décrivant l'organisation des KPIs. Exemple : { \"type\": \"columns\", \"columns\": [ [\"kpi_id_1\"], [\"kpi_id_2\", \"kpi_id_3\"] ] }."
|
|
1083
1090
|
},
|
|
1084
1091
|
{
|
|
1085
|
-
name: '
|
|
1086
|
-
type: '
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1092
|
+
name: 'refreshInterval',
|
|
1093
|
+
type: 'number',
|
|
1094
|
+
delay: true, // Sera interprété par le front-end comme un champ de durée
|
|
1095
|
+
unit: 's',
|
|
1096
|
+
min: 0,
|
|
1097
|
+
hint: "Intervalle de rafraîchissement automatique en secondes. Laisser vide ou à 0 pour désactiver."
|
|
1090
1098
|
},
|
|
1091
1099
|
{
|
|
1092
1100
|
name: 'isDefault', // Indicateur pour le tableau de bord par défaut
|
package/src/email.js
CHANGED
|
@@ -47,7 +47,7 @@ const createTransporter = (smtpConfig) => {
|
|
|
47
47
|
export const sendEmail = async (email = "", data, smtpConfig = null, lang, tpl = null) => {
|
|
48
48
|
const contactEmail = smtpConfig ? (smtpConfig.from || emailDefaultConfig.from) :"Our company <noreply@ourdomain.tld>";
|
|
49
49
|
const emails = Array.isArray(email) ? email : [email];
|
|
50
|
-
if (emails.length === 0) return;
|
|
50
|
+
if (emails.length === 0) return false;
|
|
51
51
|
|
|
52
52
|
// Choisir le transporteur à utiliser
|
|
53
53
|
const transporter = smtpConfig ? createTransporter(smtpConfig||emailDefaultConfig) : defaultTransporter;
|
|
@@ -76,6 +76,7 @@ export const sendEmail = async (email = "", data, smtpConfig = null, lang, tpl =
|
|
|
76
76
|
try {
|
|
77
77
|
await Promise.all(sendPromises);
|
|
78
78
|
console.log(`Email(s) sent successfully to : ${emails.join(', ')}`);
|
|
79
|
+
return true;
|
|
79
80
|
} catch (error) {
|
|
80
81
|
console.error("Error when sending to one ore more emails :", error);
|
|
81
82
|
// Vous pouvez relancer l'erreur si vous voulez que l'appelant la gère
|
package/src/gameObject.js
CHANGED