data-primals-engine 1.0.10 → 1.1.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.
- package/client/README.md +8 -0
- package/client/index.html +31 -0
- package/client/index.js +25 -0
- package/client/package-lock.json +11664 -0
- package/client/package.json +70 -0
- 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/client/public/doc/API.postman_collection.json +214 -0
- package/client/public/github.svg +1 -0
- package/client/public/profilCompany.jpg +0 -0
- package/client/public/profilDeveloper.jpg +0 -0
- package/client/public/profilEngineer.jpg +0 -0
- package/client/public/profilPersonal.jpg +0 -0
- package/client/public/profils .psd +0 -0
- package/client/public/react.svg +9 -0
- package/client/src/APIInfo.jsx +328 -0
- package/client/src/AddWidgetTypeModal.jsx +44 -0
- package/client/src/AddWidgetTypeModal.scss +87 -0
- package/client/src/App.css +42 -0
- package/client/src/App.jsx +586 -0
- package/client/src/App.scss +1466 -0
- package/client/src/AssistantChat.jsx +280 -0
- package/client/src/AssistantChat.scss +229 -0
- package/client/src/Button.jsx +12 -0
- package/client/src/Button.scss +197 -0
- package/client/src/CalculationBuilder.jsx +338 -0
- package/client/src/CalculationStepRow.jsx +199 -0
- package/client/src/CalendarConfigModal.jsx +49 -0
- package/client/src/ChartConfigModal.jsx +402 -0
- package/client/src/ConditionBuilder.jsx +622 -0
- package/client/src/ConditionBuilder.scss +672 -0
- package/client/src/ConditionBuilder2.jsx +757 -0
- package/client/src/ContentView.jsx +274 -0
- package/client/src/CronBuilder.jsx +126 -0
- package/client/src/CronBuilder.scss +128 -0
- package/client/src/CronPartBuilder.jsx +150 -0
- package/client/src/Dashboard.jsx +210 -0
- package/client/src/Dashboard.scss +445 -0
- package/client/src/DashboardChart.jsx +362 -0
- package/client/src/DashboardFlexViewItem.jsx +129 -0
- package/client/src/DashboardView.jsx +554 -0
- package/client/src/DataChart.jsx +349 -0
- package/client/src/DataEditor.jsx +556 -0
- package/client/src/DataLayout.jsx +709 -0
- package/client/src/DataTable.jsx +996 -0
- package/client/src/DataTable.scss +73 -0
- package/client/src/Dialog.jsx +90 -0
- package/client/src/Dialog.scss +117 -0
- package/client/src/DisplayFlexNodeRenderer.jsx +115 -0
- package/client/src/DocumentationPageLayout.jsx +93 -0
- package/client/src/DocumentationPageLayout.scss +262 -0
- package/client/src/Draggable.jsx +222 -0
- package/client/src/Draggable.scss +49 -0
- package/client/src/ExportDialog.jsx +172 -0
- package/client/src/Field.jsx +1558 -0
- package/client/src/FlexBuilder.jsx +269 -0
- package/client/src/FlexBuilder.scss +226 -0
- package/client/src/FlexBuilderControls.jsx +170 -0
- package/client/src/FlexBuilderModal.jsx +75 -0
- package/client/src/FlexBuilderModal.scss +109 -0
- package/client/src/FlexBuilderPreview.jsx +48 -0
- package/client/src/FlexBuilderUtils.js +84 -0
- package/client/src/FlexDataRenderer.jsx +170 -0
- package/client/src/FlexDataRenderer.scss +80 -0
- package/client/src/FlexNode.jsx +290 -0
- package/client/src/FlexTreeUtils.js +129 -0
- package/client/src/HiddenableCell.jsx +46 -0
- package/client/src/HiddenableCell.scss +36 -0
- package/client/src/KPIDialog.jsx +39 -0
- package/client/src/KPIWidget.jsx +139 -0
- package/client/src/KanbanCard.jsx +92 -0
- package/client/src/KanbanColumn.jsx +29 -0
- package/client/src/KanbanConfigModal.jsx +115 -0
- package/client/src/KanbanView.jsx +113 -0
- package/client/src/KanbanView.scss +107 -0
- package/client/src/MessageRotator.jsx +77 -0
- package/client/src/MessageRotator.scss +14 -0
- package/client/src/ModelCreator.jsx +640 -0
- package/client/src/ModelCreator.scss +154 -0
- package/client/src/ModelCreatorField.jsx +810 -0
- package/client/src/ModelImporter.jsx +120 -0
- package/client/src/ModelList.jsx +205 -0
- package/client/src/Notification.jsx +137 -0
- package/client/src/Notification.scss +126 -0
- package/client/src/NotificationProvider.jsx +73 -0
- package/client/src/PackGallery.jsx +211 -0
- package/client/src/PackGallery.scss +156 -0
- package/client/src/Pagination.jsx +141 -0
- package/client/src/RTE.jsx +415 -0
- package/client/src/RTETrans.jsx +103 -0
- package/client/src/RelationField.jsx +247 -0
- package/client/src/RelationValue.jsx +230 -0
- package/client/src/RestoreConfirmationModal.jsx +183 -0
- package/client/src/RestoreDialog.jsx +134 -0
- package/client/src/RestoreDialog.scss +67 -0
- package/client/src/RichTextEditorModal.jsx +34 -0
- package/client/src/RichTextEditorModal.scss +54 -0
- package/client/src/TourSpotlight.jsx +234 -0
- package/client/src/TourSpotlight.scss +100 -0
- package/client/src/TutorialsMenu.jsx +83 -0
- package/client/src/TutorialsMenu.scss +217 -0
- package/client/src/TutorialsRewardModal.jsx +65 -0
- package/client/src/Utils.jsx +78 -0
- package/client/src/ViewSwitcher.jsx +54 -0
- package/client/src/ViewSwitcher.scss +74 -0
- package/client/src/Webpage.jsx +69 -0
- package/client/src/_variables.scss +21 -0
- package/client/src/assets/react.svg +1 -0
- package/client/src/constants.js +68 -0
- package/client/src/contexts/AuthContext.jsx +28 -0
- package/client/src/contexts/ModelContext.jsx +328 -0
- package/client/src/contexts/UIContext.jsx +52 -0
- package/client/src/core/data.js +35 -0
- package/client/src/entry-client.jsx +15 -0
- package/client/src/entry-server.jsx +13 -0
- package/client/src/filter.js +222 -0
- package/client/src/hooks/data.js +101 -0
- package/client/src/hooks/useDebounce.js +20 -0
- package/client/src/hooks/useDragAndDrop.js +59 -0
- package/client/src/hooks/useLocalStorage.js +100 -0
- package/client/src/hooks/useMount.js +42 -0
- package/client/src/hooks/useTutorials.jsx +227 -0
- package/client/src/hooks/useWindowSize.js +24 -0
- package/client/src/i18n.js +47 -0
- package/client/src/index.css +90 -0
- package/client/src/index.js +10 -0
- package/client/src/main.jsx +11 -0
- package/client/src/translations.js +15940 -0
- package/client/src/tutorials.js +112 -0
- package/client/vite.config.js +30 -0
- package/eslint.config.js +50 -0
- package/package.json +48 -27
- package/server.js +9 -0
- package/src/constants.js +12 -23
- package/src/core.js +9 -8
- package/src/data.js +81 -80
- package/src/defaultModels.js +114 -115
- package/src/email.js +8 -9
- package/src/engine.js +5 -5
- package/src/events.js +1 -2
- package/src/i18n.js +5390 -211
- package/src/middlewares/middleware-mongodb.js +94 -93
- package/src/migrate.js +24 -24
- package/src/modules/assistant.js +55 -55
- package/src/modules/bucket.js +10 -9
- package/src/modules/data.js +387 -357
- package/src/modules/file.js +3 -6
- package/src/modules/mongodb.js +6 -7
- package/src/modules/user.js +24 -47
- package/src/modules/workflow.js +68 -67
- package/src/openai.jobs.js +2 -2
- package/src/packs.js +30 -31
- package/src/providers.js +101 -3
- package/src/setenv.js +1 -1
- package/src/user.js +0 -17
- package/src/workers/crypto-worker.js +21 -20
- package/src/workers/import-export-worker.js +18 -18
- package/test/data.backup.integration.test.js +7 -12
- package/test/data.integration.test.js +27 -25
- package/test/globalSetup.js +2 -2
- package/test/import_export.integration.test.js +6 -6
- package/test/model.integration.test.js +21 -22
- package/test/workflow.integration.test.js +2 -5
- package/test/workflow.robustness.test.js +6 -13
- package/vitest.config.js +2 -2
|
@@ -33,7 +33,7 @@ const targetDataModel = {
|
|
|
33
33
|
{ name: 'projectName', type: 'string', required: true },
|
|
34
34
|
{ name: 'status', type: 'string', required: true }, // ex: 'new', 'active', 'archived'
|
|
35
35
|
{ name: 'budget', type: 'number' }
|
|
36
|
-
]
|
|
36
|
+
]
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
// Les modèles qui définissent le système de workflow lui-même.
|
|
@@ -130,9 +130,6 @@ const workflowMetaModels = [
|
|
|
130
130
|
|
|
131
131
|
let testModelsColInstance;
|
|
132
132
|
let testDatasColInstance;
|
|
133
|
-
let engineInstance;
|
|
134
|
-
|
|
135
|
-
const port = process.env.PORT || getUniquePort(); // Port différent
|
|
136
133
|
|
|
137
134
|
// On "espionne" `c` pour vérifier qu'elle est appelée sans l'exécuter réellement.
|
|
138
135
|
// Cela nous permet de tester uniquement la logique de déclenchement.
|
|
@@ -140,7 +137,7 @@ const processWorkflowRunSpy = vi.spyOn(workflowModule, 'processWorkflowRun');
|
|
|
140
137
|
|
|
141
138
|
beforeEach(async () => {
|
|
142
139
|
testModelsColInstance = getAppModelsCollection;
|
|
143
|
-
testDatasColInstance = getCollectionForUser(mockUser);
|
|
140
|
+
testDatasColInstance = await getCollectionForUser(mockUser);
|
|
144
141
|
// Nettoyer les données avant chaque test
|
|
145
142
|
await testDatasColInstance.deleteMany({_user: "testuserWorkflow"});
|
|
146
143
|
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
import { ObjectId } from 'mongodb';
|
|
2
|
-
import { expect, describe, it, beforeEach,
|
|
2
|
+
import { expect, describe, it, beforeEach, beforeAll, vi } from 'vitest';
|
|
3
3
|
import { Config } from "data-primals-engine/config";
|
|
4
|
-
|
|
5
|
-
// --- Configuration initiale (similaire à workflow.integration.test.js) ---
|
|
6
|
-
let mongod;
|
|
7
|
-
let testDbUri;
|
|
8
|
-
const testDbName = 'testRobustnessDbHO_Workflow';
|
|
9
|
-
|
|
10
4
|
// --- Importations des modules de l'application ---
|
|
11
|
-
import { Engine } from "data-primals-engine/engine";
|
|
12
5
|
import { insertData, editData } from 'data-primals-engine/modules/data';
|
|
13
6
|
import { modelsCollection as getAppModelsCollection, getCollectionForUser, getCollection } from 'data-primals-engine/modules/mongodb';
|
|
14
7
|
import * as workflowModule from 'data-primals-engine/modules/workflow';
|
|
15
|
-
import {
|
|
8
|
+
import {initEngine} from "../src/setenv.js";
|
|
16
9
|
import {maxExecutionsByStep} from "data-primals-engine/constants";
|
|
17
10
|
|
|
18
11
|
vi.mock('data-primals-engine/modules/workflow', { spy: true })
|
|
@@ -44,7 +37,7 @@ beforeAll(async () =>{
|
|
|
44
37
|
|
|
45
38
|
beforeEach(async () => {
|
|
46
39
|
testModelsColInstance = getAppModelsCollection;
|
|
47
|
-
testDatasColInstance = getCollectionForUser(mockUser);
|
|
40
|
+
testDatasColInstance = await getCollectionForUser(mockUser);
|
|
48
41
|
await testDatasColInstance.deleteMany({ _user: mockUser.username });
|
|
49
42
|
await getCollection('job_locks').deleteMany({}); // Nettoyer les verrous
|
|
50
43
|
const mods = await testModelsColInstance.find({ $and: [{_user: mockUser.username}, {$or: [{name: targetDataModel.name}, ...workflowMetaModels.map(m =>({name: m.name}))] }]}).toArray();
|
|
@@ -71,7 +64,7 @@ describe('Tests de robustesse et des cas limites du module Workflow', () => {
|
|
|
71
64
|
const now = new Date();
|
|
72
65
|
await jobsCollection.insertOne({
|
|
73
66
|
jobId: jobId,
|
|
74
|
-
lockedUntil: new Date(now.getTime() + 10 * 60 * 1000)
|
|
67
|
+
lockedUntil: new Date(now.getTime() + 10 * 60 * 1000) // Verrouillé pour 10 min
|
|
75
68
|
});
|
|
76
69
|
|
|
77
70
|
// 2. Act: Tenter de lancer le job
|
|
@@ -89,7 +82,7 @@ describe('Tests de robustesse et des cas limites du module Workflow', () => {
|
|
|
89
82
|
// 1. Arrange: Insérer un verrou qui a déjà expiré (simule un crash)
|
|
90
83
|
await jobsCollection.insertOne({
|
|
91
84
|
jobId: jobId,
|
|
92
|
-
lockedUntil: new Date(Date.now() - 1000)
|
|
85
|
+
lockedUntil: new Date(Date.now() - 1000) // Expiré depuis 1 seconde
|
|
93
86
|
});
|
|
94
87
|
|
|
95
88
|
// 2. Act: Lancer le job
|
|
@@ -155,7 +148,7 @@ describe('Tests de robustesse et des cas limites du module Workflow', () => {
|
|
|
155
148
|
// Cette condition est conçue pour échouer car la donnée n'existera pas
|
|
156
149
|
conditions: { status: 'must-be-this-to-succeed' },
|
|
157
150
|
onSuccessStep: successStep.toString(),
|
|
158
|
-
onFailureStep: failureStep.toString()
|
|
151
|
+
onFailureStep: failureStep.toString()
|
|
159
152
|
};
|
|
160
153
|
const startStep = (await insertData('workflowStep', startStepDef, {}, mockUser)).insertedIds[0];
|
|
161
154
|
const workflow = (await insertData('workflow', { name: 'Failure Path Workflow', startStep: startStep.toString() }, {}, mockUser)).insertedIds[0];
|
package/vitest.config.js
CHANGED