data-primals-engine 1.6.5 → 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.
- package/README.md +160 -113
- package/client/index.js +3 -0
- package/client/package-lock.json +7562 -8824
- package/client/package.json +6 -2
- package/client/src/AssistantChat.jsx +369 -362
- package/client/src/DataEditor.jsx +383 -383
- package/client/src/DataLayout.jsx +54 -20
- package/client/src/ModelList.jsx +280 -280
- package/client/src/ViewSwitcher.scss +0 -31
- package/client/src/constants.js +81 -100
- package/client/src/contexts/CommandContext.jsx +274 -259
- package/client/vite.config.js +30 -30
- package/doc/AI-assistance.md +93 -0
- package/doc/Advanced-workflows.md +90 -0
- package/doc/Event-system.md +79 -0
- package/doc/Packs-gallery.md +73 -0
- package/package.json +15 -7
- package/src/constants.js +1 -1
- package/src/defaultModels.js +1 -1
- package/src/engine.js +342 -335
- package/src/migrate.js +1 -1
- package/src/modules/assistant/assistant.js +30 -20
- package/src/modules/data/data.backup.js +4 -4
- package/src/modules/data/data.js +6 -6
- package/src/modules/data/data.operations.js +79 -64
- package/src/modules/data/data.relations.js +2 -1
- package/src/modules/data/data.scheduling.js +1 -1
- package/src/modules/mongodb.js +16 -8
- package/src/modules/user.js +0 -1
- package/src/packs.js +5697 -5697
- package/src/profiles.js +19 -0
- package/swagger-en.yml +3390 -3385
- package/swagger-fr.yml +3385 -3380
- package/test/assistant.test.js +2 -2
- package/test/data.backup.integration.test.js +3 -1
- package/test/data.history.integration.test.js +0 -1
package/test/assistant.test.js
CHANGED
|
@@ -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;
|