data-primals-engine 1.6.5 → 1.7.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.
Files changed (40) hide show
  1. package/README.md +160 -113
  2. package/client/index.js +3 -0
  3. package/client/package-lock.json +8121 -8824
  4. package/client/package.json +10 -3
  5. package/client/src/AssistantChat.jsx +369 -362
  6. package/client/src/DataEditor.jsx +383 -383
  7. package/client/src/DataLayout.jsx +54 -20
  8. package/client/src/ModelList.jsx +280 -280
  9. package/client/src/ViewSwitcher.scss +0 -31
  10. package/client/src/constants.js +81 -100
  11. package/client/src/contexts/CommandContext.jsx +274 -259
  12. package/client/vite.config.js +30 -30
  13. package/doc/AI-assistance.md +93 -0
  14. package/doc/Advanced-workflows.md +90 -0
  15. package/doc/Event-system.md +79 -0
  16. package/doc/Packs-gallery.md +73 -0
  17. package/package.json +30 -16
  18. package/src/constants.js +1 -1
  19. package/src/core.js +487 -477
  20. package/src/defaultModels.js +1 -1
  21. package/src/email.js +0 -2
  22. package/src/engine.js +342 -335
  23. package/src/filter.js +348 -343
  24. package/src/migrate.js +1 -1
  25. package/src/modules/assistant/assistant.js +30 -20
  26. package/src/modules/data/data.backup.js +4 -4
  27. package/src/modules/data/data.js +311 -302
  28. package/src/modules/data/data.operations.js +79 -64
  29. package/src/modules/data/data.relations.js +2 -1
  30. package/src/modules/data/data.scheduling.js +1 -1
  31. package/src/modules/mongodb.js +16 -8
  32. package/src/modules/user.js +0 -1
  33. package/src/modules/workflow.js +1828 -1815
  34. package/src/packs.js +5701 -5697
  35. package/src/profiles.js +19 -0
  36. package/swagger-en.yml +3390 -3385
  37. package/swagger-fr.yml +3385 -3380
  38. package/test/assistant.test.js +2 -2
  39. package/test/data.backup.integration.test.js +3 -1
  40. package/test/data.history.integration.test.js +0 -1
@@ -168,7 +168,7 @@ describe('Assistant Module Unit Tests', () => {
168
168
  });
169
169
 
170
170
  it('should correct a malformed filter from the AI', async () => {
171
- const aiResponse = JSON.stringify({
171
+ const aiResponse = JSON.stringify([{
172
172
  action: 'search',
173
173
  params: {
174
174
  model: modelName,
@@ -178,7 +178,7 @@ describe('Assistant Module Unit Tests', () => {
178
178
  "$lt": ["$price", 200]
179
179
  }
180
180
  }
181
- });
181
+ }]);
182
182
  const mockLLM = {
183
183
  stream: vi.fn().mockReturnValue(createMockStream(aiResponse)),
184
184
  };
@@ -57,7 +57,7 @@ let engineInstance;
57
57
  let testDatasApi;
58
58
 
59
59
  const backupDir = path.resolve('./test-backups'); // Use an absolute path
60
-
60
+ let engine;
61
61
  beforeAll(async () => {
62
62
 
63
63
  process.env.BACKUP_DIR = backupDir; // Set backup directory
@@ -66,6 +66,8 @@ beforeAll(async () => {
66
66
  if (!fs.existsSync(backupDir)) {
67
67
  fs.mkdirSync(backupDir, { recursive: true });
68
68
  }
69
+ Config.Set("modules", ["mongodb", "data", "file", "bucket", "workflow", "user", "assistant"]);
70
+ engine = await initEngine();
69
71
 
70
72
  // Delete any existing files in the backup directory
71
73
  fs.readdirSync(backupDir).forEach(file => {
@@ -8,7 +8,6 @@ import { insertData, editData, deleteData } from '../src/index.js';
8
8
  import { getCollection, getCollectionForUser } from '../src/modules/mongodb.js';
9
9
  import { generateUniqueName, initEngine } from "../src/setenv.js";
10
10
  import {purgeData} from "../src/modules/data/data.history.js";
11
- import {MongoDatabase} from "../src/engine.js";
12
11
 
13
12
  let engine;
14
13
  let testUser;