data-primals-engine 1.4.2 → 1.5.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 (59) hide show
  1. package/README.md +878 -856
  2. package/client/package-lock.json +82 -0
  3. package/client/package.json +2 -0
  4. package/client/src/App.jsx +1 -1
  5. package/client/src/App.scss +25 -7
  6. package/client/src/AssistantChat.scss +3 -2
  7. package/client/src/ConditionBuilder.jsx +1 -1
  8. package/client/src/ConditionBuilder2.jsx +2 -1
  9. package/client/src/DashboardView.jsx +569 -569
  10. package/client/src/DataEditor.jsx +376 -368
  11. package/client/src/DataLayout.jsx +4 -10
  12. package/client/src/DataTable.jsx +858 -817
  13. package/client/src/Field.jsx +1825 -1784
  14. package/client/src/FlexDataRenderer.jsx +2 -0
  15. package/client/src/FlexTreeUtils.js +1 -1
  16. package/client/src/GeolocationField.jsx +94 -0
  17. package/client/src/KPIDialog.jsx +11 -1
  18. package/client/src/ModelCreator.jsx +1 -2
  19. package/client/src/ModelCreatorField.jsx +24 -27
  20. package/client/src/ModelList.jsx +1 -1
  21. package/client/src/RelationField.jsx +2 -2
  22. package/client/src/constants.js +3 -3
  23. package/client/src/filter.js +0 -155
  24. package/client/src/hooks/useTutorials.jsx +62 -65
  25. package/client/src/translations.js +14 -2
  26. package/package.json +2 -1
  27. package/perf/README.md +147 -0
  28. package/perf/artillery-hooks.js +37 -0
  29. package/perf/perf-shot-hardwork.yml +84 -0
  30. package/perf/perf-shot-search.yml +45 -0
  31. package/perf/setup.yml +26 -0
  32. package/server.js +1 -1
  33. package/src/constants.js +264 -31
  34. package/src/core.js +15 -1
  35. package/src/data.js +1 -1
  36. package/src/defaultModels.js +1544 -1540
  37. package/src/email.js +5 -2
  38. package/src/engine.js +10 -3
  39. package/src/filter.js +274 -260
  40. package/src/i18n.js +187 -177
  41. package/src/modules/assistant/assistant.js +3 -1
  42. package/src/modules/bucket.js +12 -15
  43. package/src/modules/data/data.backup.js +11 -8
  44. package/src/modules/data/data.core.js +2 -1
  45. package/src/modules/data/data.js +6 -3
  46. package/src/modules/data/data.operations.js +610 -168
  47. package/src/modules/data/data.routes.js +1821 -1785
  48. package/src/modules/data/data.scheduling.js +2 -1
  49. package/src/modules/data/data.validation.js +7 -1
  50. package/src/modules/file.js +4 -2
  51. package/src/modules/user.js +4 -1
  52. package/src/modules/workflow.js +9 -10
  53. package/src/openai.jobs.js +2 -0
  54. package/src/packs.js +22 -5
  55. package/src/providers.js +22 -7
  56. package/swagger-en.yml +133 -0
  57. package/test/data.integration.test.js +1060 -981
  58. package/test/import_export.integration.test.js +1 -1
  59. package/test/model.integration.test.js +377 -221
@@ -2,7 +2,7 @@ import {Logger} from "../../gameObject.js";
2
2
  import {mkdir} from 'node:fs/promises';
3
3
  import {onInit as historyInit} from "./data.history.js";
4
4
  import {isDemoUser, isLocalUser} from "../../data.js";
5
- import {install, maxRequestData, storageSafetyMargin} from "../../constants.js";
5
+ import {install, maxAlertsPerUser, maxRequestData, storageSafetyMargin} from "../../constants.js";
6
6
  import {createCollection, getCollection} from "../mongodb.js";
7
7
  import path from "node:path";
8
8
  import {isGUID, sequential} from "../../core.js";
@@ -22,6 +22,7 @@ import {validateField, onInit as validationInit} from "./data.validation.js";
22
22
  import {cancelAlerts, scheduleAlerts, onInit as scheduleInit} from "./data.scheduling.js";
23
23
  import {deleteData, installPack, onInit as operationsInit} from "./data.operations.js";
24
24
  import {jobDumpUserData, onInit as backupInit} from "./data.backup.js";
25
+ import {Config} from "../../config.js";
25
26
 
26
27
  let engine;
27
28
  let logger;
@@ -54,7 +55,8 @@ export async function onInit(defaultEngine) {
54
55
 
55
56
  let modelsCollection, datasCollection, filesCollection, packsCollection, magnetsCollection, historyCollection;
56
57
 
57
- if( install ) {
58
+ const i = Config.Get('install', install);
59
+ if( i ) {
58
60
  datasCollection = await createCollection("datas");
59
61
  historyCollection = await createCollection("history");
60
62
  filesCollection = await createCollection("files");
@@ -220,8 +222,9 @@ export async function checkServerCapacity(incomingDataSize = 0) {
220
222
  const diskSpace = await checkDiskSpace(DATA_STORAGE_PATH);
221
223
  const { free, size } = diskSpace;
222
224
 
225
+ const storageMargin = Config.Get('storageSafetyMargin', storageSafetyMargin);
223
226
  // Limite maximale d'utilisation du disque (ex: 90% de la taille totale)
224
- const maxAllowedUsage = size * storageSafetyMargin;
227
+ const maxAllowedUsage = size * storageMargin;
225
228
  const currentUsage = size - free;
226
229
  const projectedUsage = currentUsage + incomingDataSize;
227
230