data-primals-engine 1.1.3 → 1.1.5
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 +5 -1
- package/client/package-lock.json +11580 -11664
- package/client/package.json +69 -69
- package/client/src/APIInfo.jsx +2 -5
- package/client/src/App.jsx +12 -7
- package/client/src/CalculationBuilder.jsx +2 -2
- package/client/src/ConditionBuilder.scss +24 -0
- package/client/src/ConditionBuilder2.jsx +56 -0
- package/client/src/Dashboard.jsx +2 -2
- package/client/src/DashboardChart.jsx +1 -1
- package/client/src/DashboardFlexViewItem.jsx +1 -1
- package/client/src/DashboardView.jsx +1 -1
- package/client/src/DataEditor.jsx +3 -3
- package/client/src/DataLayout.jsx +23 -20
- package/client/src/DataTable.jsx +80 -13
- package/client/src/Dialog.scss +1 -0
- package/client/src/DisplayFlexNodeRenderer.jsx +2 -2
- package/client/src/Field.jsx +2 -2
- package/client/src/FlexBuilder.jsx +1 -1
- package/client/src/KPIWidget.jsx +1 -1
- package/client/src/KanbanCard.jsx +1 -1
- package/client/src/ModelCreator.jsx +3 -3
- package/client/src/ModelCreatorField.jsx +2 -2
- package/client/src/ModelImporter.jsx +1 -1
- package/client/src/PackGallery.jsx +1 -1
- package/client/src/RTETrans.jsx +1 -1
- package/client/src/RelationField.jsx +1 -1
- package/client/src/RelationValue.jsx +1 -1
- package/client/src/TourSpotlight.jsx +14 -10
- package/client/src/TutorialsMenu.scss +0 -1
- package/client/src/Webpage.jsx +2 -2
- package/client/src/constants.js +2 -1
- package/client/src/contexts/ModelContext.jsx +5 -11
- package/client/src/core/dom.js +26 -0
- package/client/src/filter.js +40 -1
- package/client/src/hooks/data.js +1 -1
- package/client/src/hooks/useTutorials.jsx +1 -1
- package/package.json +4 -6
- package/server.js +3 -2
- package/src/constants.js +3 -0
- package/src/engine.js +18 -13
- package/src/i18n.js +77 -3
- package/src/modules/assistant.js +1 -1
- package/src/modules/bucket.js +1 -1
- package/src/modules/data.js +14 -3
- package/src/modules/file.js +1 -1
- package/src/modules/user.js +1 -1
- package/src/modules/workflow.js +1 -1
- package/src/packs.js +4 -3
- package/src/setenv.js +1 -1
- package/test/data.integration.test.js +4 -10
- package/test/workflow.robustness.test.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "data-primals-engine",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "data-primals-engine is the package responsible from handling large amount of data in a practical and performant way. It can handle large amount of data in a practical and performant way. It can also get workflow models working (for automation), and fully supports internationalisation.",
|
|
5
5
|
"main": "src/engine.js",
|
|
6
6
|
"type": "module",
|
|
@@ -44,7 +44,8 @@
|
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"react": ">=18.0.0",
|
|
47
|
-
"react-query": ">=3.0.0"
|
|
47
|
+
"react-query": ">=3.0.0",
|
|
48
|
+
"express": "^5.1.0"
|
|
48
49
|
},
|
|
49
50
|
"dependencies": {
|
|
50
51
|
"@langchain/core": "^0.3.66",
|
|
@@ -60,15 +61,13 @@
|
|
|
60
61
|
"cookie-parser": "^1.4.7",
|
|
61
62
|
"cronstrue": "^3.2.0",
|
|
62
63
|
"csv-parse": "^6.1.0",
|
|
63
|
-
"data-primals-engine": "^1.0.
|
|
64
|
+
"data-primals-engine": "^1.0.14",
|
|
64
65
|
"date-fns": "^4.1.0",
|
|
65
|
-
"express": "^5.1.0",
|
|
66
66
|
"express-csrf-double-submit-cookie": "^2.0.0",
|
|
67
67
|
"express-formidable": "^1.2.0",
|
|
68
68
|
"express-mongo-sanitize": "^2.2.0",
|
|
69
69
|
"express-rate-limit": "^8.0.1",
|
|
70
70
|
"express-session": "^1.18.2",
|
|
71
|
-
"i18next": "^25.3.2",
|
|
72
71
|
"i18next-browser-languagedetector": "^8.2.0",
|
|
73
72
|
"juice": "^11.0.1",
|
|
74
73
|
"mathjs": "^14.6.0",
|
|
@@ -80,7 +79,6 @@
|
|
|
80
79
|
"process": "^0.11.10",
|
|
81
80
|
"prop-types": "^15.8.1",
|
|
82
81
|
"randomcolor": "^0.6.2",
|
|
83
|
-
"react-helmet": "^6.1.0",
|
|
84
82
|
"react-i18next": "^15.6.1",
|
|
85
83
|
"react-markdown": "^10.1.0",
|
|
86
84
|
"request-ip": "^3.3.0",
|
package/server.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import process from "node:process";
|
|
7
7
|
import {Config, Engine, BenchmarkTool, GameObject, Logger} from "./src/index.js";
|
|
8
8
|
import sirv from "sirv";
|
|
9
|
+
import express from "express";
|
|
9
10
|
|
|
10
11
|
Config.Set("modules", ["mongodb", "data", "file", "bucket", "workflow","user", "assistant", "swagger"])
|
|
11
12
|
Config.Set("middlewares", []);
|
|
@@ -14,8 +15,8 @@ const bench = GameObject.Create("Benchmark");
|
|
|
14
15
|
const timer = bench.addComponent(BenchmarkTool);
|
|
15
16
|
timer.start();
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
const engine = await Engine.Create();
|
|
18
|
+
const app = express();
|
|
19
|
+
const engine = await Engine.Create({app});
|
|
19
20
|
|
|
20
21
|
if (process.argv.length === 3) {
|
|
21
22
|
let arg = process.argv[2];
|
package/src/constants.js
CHANGED
|
@@ -64,6 +64,8 @@ export const emailDefaultConfig = {
|
|
|
64
64
|
pass: 'password'
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
export const useAI = true;
|
|
68
|
+
|
|
67
69
|
/**
|
|
68
70
|
* Maximum number of models per user
|
|
69
71
|
* @type {number}
|
|
@@ -212,6 +214,7 @@ export const maxTotalPrivateFilesSize = 250 * megabytes;
|
|
|
212
214
|
*/
|
|
213
215
|
export const timeoutVM = 5000;
|
|
214
216
|
|
|
217
|
+
export const defaultMaxRequestData = 50000;
|
|
215
218
|
/**
|
|
216
219
|
* Options for the HTML sanitizer
|
|
217
220
|
* @type {{allowedSchemesByTag: {}, selfClosing: string[], allowedSchemes: string[], enforceHtmlBoundary: boolean, disallowedTagsMode: string, allowProtocolRelative: boolean, allowedAttributes: {a: string[], img: string[], code: string[]}, allowedTags: string[], allowedSchemesAppliedToAttributes: string[]}}
|
package/src/engine.js
CHANGED
|
@@ -26,7 +26,7 @@ export const MongoDatabase = MongoClient.db(dbName);
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
export const Engine = {
|
|
29
|
-
Create: async (options) => {
|
|
29
|
+
Create: async (options = { app : null}) => {
|
|
30
30
|
const engine = GameObject.Create("Engine");
|
|
31
31
|
console.log("Creating engine", Config.Get('modules'));
|
|
32
32
|
engine.addComponent(Logger);
|
|
@@ -38,8 +38,11 @@ export const Engine = {
|
|
|
38
38
|
engine.getComponent(Logger).info(`Custom UserProvider '${providerInstance.constructor.name}' has been set.`);
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
+
if (!options.app) {
|
|
42
|
+
options.app = express();
|
|
43
|
+
}
|
|
41
44
|
|
|
42
|
-
const app =
|
|
45
|
+
const { app } = options;
|
|
43
46
|
// Allows you to set port in the project properties.
|
|
44
47
|
app.set('port', process.env.PORT || 3000);
|
|
45
48
|
app.set('engine', engine);
|
|
@@ -106,12 +109,8 @@ export const Engine = {
|
|
|
106
109
|
engine._modules = e;
|
|
107
110
|
return Promise.resolve();
|
|
108
111
|
});
|
|
109
|
-
let server;
|
|
110
112
|
|
|
111
|
-
|
|
112
|
-
single: true,
|
|
113
|
-
dev: process.env.NODE_ENV === 'development'
|
|
114
|
-
}));
|
|
113
|
+
let server;
|
|
115
114
|
|
|
116
115
|
engine.start = async (port, cb) =>{
|
|
117
116
|
// Use connect method to connect to the server
|
|
@@ -132,6 +131,18 @@ export const Engine = {
|
|
|
132
131
|
if (cb)
|
|
133
132
|
await cb();
|
|
134
133
|
|
|
134
|
+
engine.get('/api/health', (req, res) => {
|
|
135
|
+
res.status(200).json({
|
|
136
|
+
status: 'ok',
|
|
137
|
+
timestamp: new Date().toISOString()
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
app.use(sirv('client/dist', {
|
|
142
|
+
single: true,
|
|
143
|
+
dev: process.env.NODE_ENV === 'development'
|
|
144
|
+
}));
|
|
145
|
+
|
|
135
146
|
process.on('uncaughtException', function (exception) {
|
|
136
147
|
console.error(exception);
|
|
137
148
|
fs.appendFile('issues.txt', JSON.stringify({ code: exception.code, message: exception.message, stack: exception.stack }), function (err) {
|
|
@@ -171,12 +182,6 @@ export const Engine = {
|
|
|
171
182
|
engine.resetModels = async () => {
|
|
172
183
|
await deleteModels();
|
|
173
184
|
};
|
|
174
|
-
engine.get('/api/health', (req, res) => {
|
|
175
|
-
res.status(200).json({
|
|
176
|
-
status: 'ok',
|
|
177
|
-
timestamp: new Date().toISOString()
|
|
178
|
-
});
|
|
179
|
-
});
|
|
180
185
|
return engine;
|
|
181
186
|
}
|
|
182
187
|
}
|
package/src/i18n.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import i18n from "i18next";
|
|
2
|
-
import {initReactI18next} from "react-i18next";
|
|
2
|
+
import {Trans, useTranslation, initReactI18next} from "react-i18next";
|
|
3
3
|
import LanguageDetector from "i18next-browser-languagedetector";
|
|
4
4
|
|
|
5
5
|
export const translations = {
|
|
6
6
|
fr: {
|
|
7
7
|
translation: {
|
|
8
|
+
"datatable.advancedFilter.title": "Filtre avancé (MongoDB)",
|
|
9
|
+
"datatable.advancedFilter.desc": "Créez de toute pièce vos filtres avancés, avec les opérateurs d'aggrégation de MongoDB disponibles ici.",
|
|
8
10
|
|
|
11
|
+
"editData": "Éditer dans {{0}}",
|
|
12
|
+
"btns.duplicate": "Dupliquer",
|
|
13
|
+
"btns.edit": "Modifier",
|
|
14
|
+
"btns.delete": "Supprimer",
|
|
9
15
|
"field_return_status_hint": "Le statut actuel de la demande de retour (ex: Demandé, Approuvé, Remboursé).",
|
|
10
16
|
"field_workflowRun_completedAt_hint": "Horodatage de la fin de l'exécution (réussie ou échouée).",
|
|
11
17
|
"field_employee_socialSecurityNumber_hint": "Numéro de sécurité sociale de l'employé.",
|
|
@@ -1235,6 +1241,13 @@ export const translations = {
|
|
|
1235
1241
|
en: {
|
|
1236
1242
|
translation: {
|
|
1237
1243
|
|
|
1244
|
+
"datatable.advancedFilter.title": "Advanced Filter (MongoDB)",
|
|
1245
|
+
"datatable.advancedFilter.desc": "Create your own advanced filters from scratch, using MongoDB's aggregation operators available here.",
|
|
1246
|
+
|
|
1247
|
+
"editData": "Edit in {{0}}",
|
|
1248
|
+
"btns.duplicate": "Duplicate",
|
|
1249
|
+
"btns.edit": "Edit",
|
|
1250
|
+
"btns.delete": "Delete",
|
|
1238
1251
|
"field_workflowRun_completedAt_hint": "Timestamp of when the execution ended (successfully or failed).",
|
|
1239
1252
|
"field_employee_socialSecurityNumber_hint": "Employee's social security number.",
|
|
1240
1253
|
|
|
@@ -2462,6 +2475,13 @@ export const translations = {
|
|
|
2462
2475
|
},
|
|
2463
2476
|
es: {
|
|
2464
2477
|
translation: {
|
|
2478
|
+
"datatable.advancedFilter.title": "Filtro avanzado (MongoDB)",
|
|
2479
|
+
"datatable.advancedFilter.desc": "Cree sus propios filtros avanzados desde cero, utilizando los operadores de agregación de MongoDB disponibles aquí.",
|
|
2480
|
+
|
|
2481
|
+
"editData": "Editar en {{0}}",
|
|
2482
|
+
"btns.duplicate": "Duplicar",
|
|
2483
|
+
"btns.edit": "Editar",
|
|
2484
|
+
"btns.delete": "Eliminar",
|
|
2465
2485
|
"field_return_status_hint": "El estado actual de la solicitud de devolución (ej: Solicitado, Aprobado, Reembolsado).",
|
|
2466
2486
|
"field_workflowRun_completedAt_hint": "Marca de tiempo del final de la ejecución (exitosa o fallida).",
|
|
2467
2487
|
"field_employee_socialSecurityNumber_hint": "Número de seguridad social del empleado.",
|
|
@@ -3724,6 +3744,13 @@ export const translations = {
|
|
|
3724
3744
|
},
|
|
3725
3745
|
pt: {
|
|
3726
3746
|
translation: {
|
|
3747
|
+
"datatable.advancedFilter.title": "Filtro Avançado (MongoDB)",
|
|
3748
|
+
"datatable.advancedFilter.desc": "Crie os seus próprios filtros avançados a partir do zero, utilizando os operadores de agregação do MongoDB disponíveis aqui.",
|
|
3749
|
+
|
|
3750
|
+
"editData": "Editar em {{0}}",
|
|
3751
|
+
"btns.duplicate": "Duplicar",
|
|
3752
|
+
"btns.edit": "Editar",
|
|
3753
|
+
"btns.delete": "Apagar",
|
|
3727
3754
|
"assistant.type": "Digite sua mensagem...",
|
|
3728
3755
|
"assistant.welcome": "Olá! Como posso ajudá-lo com seus dados?",
|
|
3729
3756
|
"assistant.named": "Assistente {{named}}",
|
|
@@ -3789,6 +3816,12 @@ export const translations = {
|
|
|
3789
3816
|
},
|
|
3790
3817
|
de: {
|
|
3791
3818
|
translation: {
|
|
3819
|
+
"datatable.advancedFilter.title": "Erweiterter Filter (MongoDB)",
|
|
3820
|
+
"datatable.advancedFilter.desc": "Erstellen Sie Ihre eigenen erweiterten Filter von Grund auf mit den hier verfügbaren Aggregationsoperatoren von MongoDB.",
|
|
3821
|
+
"editData": "Bearbeiten in {{0}}",
|
|
3822
|
+
"btns.duplicate": "Duplizieren",
|
|
3823
|
+
"btns.edit": "Bearbeiten",
|
|
3824
|
+
"btns.delete": "Löschen",
|
|
3792
3825
|
"field_workflowRun_completedAt_hint": "Zeitstempel des Abschlusses (erfolgreich oder fehlgeschlagen).",
|
|
3793
3826
|
"field_employee_socialSecurityNumber_hint": "Sozialversicherungsnummer des Mitarbeiters.",
|
|
3794
3827
|
"field_shipment_order_hint": "Die mit dieser Sendung verknüpfte Bestellung.",
|
|
@@ -4931,6 +4964,12 @@ export const translations = {
|
|
|
4931
4964
|
},
|
|
4932
4965
|
it: {
|
|
4933
4966
|
translation: {
|
|
4967
|
+
"datatable.advancedFilter.title": "Filtro avanzato (MongoDB)",
|
|
4968
|
+
"datatable.advancedFilter.desc": "Crea i tuoi filtri avanzati da zero, utilizzando gli operatori di aggregazione di MongoDB disponibili qui.",
|
|
4969
|
+
"editData": "Modifica in {{0}}",
|
|
4970
|
+
"btns.duplicate": "Duplica",
|
|
4971
|
+
"btns.edit": "Modifica",
|
|
4972
|
+
"btns.delete": "Elimina",
|
|
4934
4973
|
"field_workflowRun_completedAt_hint": "Timestamp del termine dell'esecuzione (successo o fallimento).",
|
|
4935
4974
|
"field_employee_socialSecurityNumber_hint": "Numero di previdenza sociale del dipendente.",
|
|
4936
4975
|
"field_shipment_order_hint": "L'ordine associato a questa spedizione.",
|
|
@@ -6126,6 +6165,12 @@ export const translations = {
|
|
|
6126
6165
|
},
|
|
6127
6166
|
cs: {
|
|
6128
6167
|
translation: {
|
|
6168
|
+
"datatable.advancedFilter.title": "Rozšířený filtr (MongoDB)",
|
|
6169
|
+
"datatable.advancedFilter.desc": "Vytvořte si vlastní pokročilé filtry od nuly pomocí agregačních operátorů MongoDB dostupných zde.",
|
|
6170
|
+
"editData": "Upravit v {{0}}",
|
|
6171
|
+
"btns.duplicate": "Duplikovat",
|
|
6172
|
+
"btns.edit": "Upravit",
|
|
6173
|
+
"btns.delete": "Smazat",
|
|
6129
6174
|
"field_return_status_hint": "Aktuální stav žádosti o vrácení (např.: Požadováno, Schváleno, Vráceno).",
|
|
6130
6175
|
"field_workflowRun_completedAt_hint": "Časové razítko dokončení provedení (úspěšného nebo neúspěšného).",
|
|
6131
6176
|
"field_employee_socialSecurityNumber_hint": "Rodné číslo zaměstnance.",
|
|
@@ -6966,6 +7011,12 @@ export const translations = {
|
|
|
6966
7011
|
},
|
|
6967
7012
|
ru: {
|
|
6968
7013
|
translation: {
|
|
7014
|
+
"datatable.advancedFilter.title": "Расширенный фильтр (MongoDB)",
|
|
7015
|
+
"datatable.advancedFilter.desc": "Создайте свои собственные расширенные фильтры с нуля, используя операторы агрегации MongoDB, доступные здесь",
|
|
7016
|
+
"editData": "Редактировать в {{0}}",
|
|
7017
|
+
"btns.duplicate": "Дублировать",
|
|
7018
|
+
"btns.edit": "Редактировать",
|
|
7019
|
+
"btns.delete": "Удалить",
|
|
6969
7020
|
"field_workflowRun_completedAt_hint": "Метка времени завершения выполнения (успешного или неудачного).",
|
|
6970
7021
|
"field_employee_socialSecurityNumber_hint": "Номер социального страхования сотрудника.",
|
|
6971
7022
|
"field_shipment_order_hint": "Заказ, связанный с этой отгрузкой.",
|
|
@@ -8161,7 +8212,12 @@ export const translations = {
|
|
|
8161
8212
|
},
|
|
8162
8213
|
ar: {
|
|
8163
8214
|
translation: {
|
|
8164
|
-
|
|
8215
|
+
"datatable.advancedFilter.title": "مرشح متقدم (MongoDB)",
|
|
8216
|
+
"datatable.advancedFilter.desc": "أنشئ مرشحاتك المتقدمة من الصفر، باستخدام عوامل تجميع MongoDB المتوفرة هنا",
|
|
8217
|
+
"editData": "تعديل في {{0}}",
|
|
8218
|
+
"btns.duplicate": "تكرار",
|
|
8219
|
+
"btns.edit": "تعديل",
|
|
8220
|
+
"btns.delete": "حذف",
|
|
8165
8221
|
"field_return_status_hint": "الحالة الحالية لطلب الإرجاع (مثال: مطلوب، معتمد، تم استرداده).",
|
|
8166
8222
|
"field_workflowRun_completedAt_hint": "طابع زمني لانتهاء التنفيذ (نجاحًا أو فشلًا).",
|
|
8167
8223
|
"field_employee_socialSecurityNumber_hint": "رقم الضمان الاجتماعي للموظف.",
|
|
@@ -9407,7 +9463,12 @@ export const translations = {
|
|
|
9407
9463
|
},
|
|
9408
9464
|
sv: {
|
|
9409
9465
|
translation: {
|
|
9410
|
-
|
|
9466
|
+
"datatable.advancedFilter.title": "Avancerat filter (MongoDB)",
|
|
9467
|
+
"datatable.advancedFilter.desc": "Skapa dina egna avancerade filter från grunden med hjälp av MongoDBs aggregeringsoperatorer som finns här.",
|
|
9468
|
+
"editData": "Redigera i {{0}}",
|
|
9469
|
+
"btns.duplicate": "Duplicera",
|
|
9470
|
+
"btns.edit": "Redigera",
|
|
9471
|
+
"btns.delete": "Ta bort",
|
|
9411
9472
|
"field_return_status_hint": "Den aktuella statusen för returförfrågan (t.ex. Begärd, Godkänd, Återbetald).",
|
|
9412
9473
|
"field_workflowRun_completedAt_hint": "Tidsstämpel för när körningen avslutades (lyckad eller misslyckad).",
|
|
9413
9474
|
"field_employee_socialSecurityNumber_hint": "Anställds personnummer.",
|
|
@@ -10551,6 +10612,12 @@ export const translations = {
|
|
|
10551
10612
|
},
|
|
10552
10613
|
el: {
|
|
10553
10614
|
translation: {
|
|
10615
|
+
"datatable.advancedFilter.title": "Προηγμένο Φίλτρο (MongoDB)",
|
|
10616
|
+
"datatable.advancedFilter.desc": "Δημιουργήστε τα δικά σας προηγμένα φίλτρα από την αρχή, χρησιμοποιώντας τους τελεστές συνάθροισης της MongoDB που είναι διαθέσιμοι εδώ.",
|
|
10617
|
+
"editData": "Επεξεργασία στο {{0}}",
|
|
10618
|
+
"btns.duplicate": "Διπλότυπο",
|
|
10619
|
+
"btns.edit": "Επεξεργασία",
|
|
10620
|
+
"btns.delete": "Διαγραφή",
|
|
10554
10621
|
"field_workflowRun_completedAt_hint": "Χρονική σήμανση της ολοκλήρωσης της εκτέλεσης (επιτυχής ή αποτυχημένη).",
|
|
10555
10622
|
"field_employee_socialSecurityNumber_hint": "Ο αριθμός κοινωνικής ασφάλισης του υπαλλήλου.",
|
|
10556
10623
|
"field_shipment_order_hint": "Η παραγγελία που σχετίζεται με αυτήν την αποστολή.",
|
|
@@ -11680,6 +11747,12 @@ export const translations = {
|
|
|
11680
11747
|
},
|
|
11681
11748
|
fa: {
|
|
11682
11749
|
translation: {
|
|
11750
|
+
"datatable.advancedFilter.title": "فیلتر پیشرفته (MongoDB)",
|
|
11751
|
+
"datatable.advancedFilter.desc": "با استفاده از عملگرهای تجمیع MongoDB که در اینجا موجود است، فیلترهای پیشرفته خود را از ابتدا ایجاد کنید.",
|
|
11752
|
+
"editData": "ویرایش در {{0}}",
|
|
11753
|
+
"btns.duplicate": "کپی",
|
|
11754
|
+
"btns.edit": "ویرایش",
|
|
11755
|
+
"btns.delete": "حذف",
|
|
11683
11756
|
"field_return_status_hint": "وضعیت فعلی درخواست مرجوعی (مثال: درخواست شده، تأیید شده، مسترد شده).",
|
|
11684
11757
|
"field_workflowRun_completedAt_hint": "مهر زمانی پایان اجرا (موفق یا ناموفق).",
|
|
11685
11758
|
"field_employee_socialSecurityNumber_hint": "شماره تأمین اجتماعی کارمند.",
|
|
@@ -12368,4 +12441,5 @@ i18n
|
|
|
12368
12441
|
}
|
|
12369
12442
|
});
|
|
12370
12443
|
|
|
12444
|
+
export {Trans, useTranslation};
|
|
12371
12445
|
export default i18n;
|
package/src/modules/assistant.js
CHANGED
|
@@ -7,7 +7,7 @@ import { ChatGoogleGenerativeAI } from "@langchain/google-genai";
|
|
|
7
7
|
import { HumanMessage, SystemMessage } from "@langchain/core/messages";
|
|
8
8
|
import {searchData, patchData, deleteData, insertData} from "./data.js";
|
|
9
9
|
import { getDataAsString } from "../data.js";
|
|
10
|
-
import i18n from "
|
|
10
|
+
import i18n from "../../src/i18n.js";
|
|
11
11
|
import {generateLimiter} from "./user.js";
|
|
12
12
|
import rateLimit from "express-rate-limit";
|
|
13
13
|
|
package/src/modules/bucket.js
CHANGED
|
@@ -9,7 +9,7 @@ import {Logger} from "../gameObject.js";
|
|
|
9
9
|
import {middlewareAuthenticator, userInitiator} from "./user.js";
|
|
10
10
|
import {awsDefaultConfig, maxBytesPerSecondThrottleData} from "../constants.js";
|
|
11
11
|
import crypto from "node:crypto";
|
|
12
|
-
import i18n from "
|
|
12
|
+
import i18n from "../../src/i18n.js";
|
|
13
13
|
import {sendEmail} from "../email.js";
|
|
14
14
|
import {throttleMiddleware} from "../middlewares/throttle.js";
|
|
15
15
|
|
package/src/modules/data.js
CHANGED
|
@@ -64,7 +64,7 @@ import {
|
|
|
64
64
|
import fs from "node:fs";
|
|
65
65
|
import schedule from "node-schedule";
|
|
66
66
|
import {middleware} from "../middlewares/middleware-mongodb.js";
|
|
67
|
-
import i18n from "
|
|
67
|
+
import i18n from "../i18n.js";
|
|
68
68
|
import {
|
|
69
69
|
executeSafeJavascript,
|
|
70
70
|
runScheduledJobWithDbLock,
|
|
@@ -4038,9 +4038,18 @@ export const searchData = async ({user, query}) => {
|
|
|
4038
4038
|
{$eq: ["$_model", fi.relation]},
|
|
4039
4039
|
{$eq: ["$_user", user.username]},
|
|
4040
4040
|
fi.multiple ? {
|
|
4041
|
-
$in: [{$toString: "$_id"}, {
|
|
4041
|
+
$in: [{ $toString: "$_id" }, {
|
|
4042
|
+
$map: {
|
|
4043
|
+
input: { $ifNull: ["$$convertedId", []] }, // On utilise le tableau d'IDs, ou un tableau vide s'il est null
|
|
4044
|
+
as: "relationId",
|
|
4045
|
+
in: { $toString: "$$relationId" }
|
|
4046
|
+
}
|
|
4047
|
+
}]
|
|
4042
4048
|
} : {
|
|
4043
|
-
$eq: [
|
|
4049
|
+
$eq: [
|
|
4050
|
+
{ $toString: "$_id" },
|
|
4051
|
+
{ $convert: { input: '$$convertedId', to: "string", onError: '' } }
|
|
4052
|
+
]
|
|
4044
4053
|
}
|
|
4045
4054
|
]
|
|
4046
4055
|
]
|
|
@@ -4315,6 +4324,7 @@ export const searchData = async ({user, query}) => {
|
|
|
4315
4324
|
} else if (fi.type === 'array') {
|
|
4316
4325
|
// Handle array filtering here
|
|
4317
4326
|
if (data[fi.name]) {
|
|
4327
|
+
console.log('array filtering', data[fi.name]);
|
|
4318
4328
|
pipelines.push({
|
|
4319
4329
|
$match: {
|
|
4320
4330
|
$expr: {
|
|
@@ -4350,6 +4360,7 @@ export const searchData = async ({user, query}) => {
|
|
|
4350
4360
|
|
|
4351
4361
|
let pipelines = [];
|
|
4352
4362
|
if( allIds.length ){
|
|
4363
|
+
console.log({allIds});
|
|
4353
4364
|
const id = {$in: ["$_id", allIds.map(m => new ObjectId(m))]};
|
|
4354
4365
|
pipelines.push({
|
|
4355
4366
|
$match: { $expr: id }
|
package/src/modules/file.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Nouvelle fonction pour ajouter un fichier privé
|
|
3
3
|
import {maxPrivateFileSize, megabytes} from "../constants.js";
|
|
4
4
|
import {isLocalUser} from "../data.js";
|
|
5
|
-
import i18n from "
|
|
5
|
+
import i18n from "../../src/i18n.js";
|
|
6
6
|
import {getCollection} from "./mongodb.js";
|
|
7
7
|
import {getFileExtension, isGUID, uuidv4} from "../core.js";
|
|
8
8
|
import path from "node:path";
|
package/src/modules/user.js
CHANGED
package/src/modules/workflow.js
CHANGED
|
@@ -12,7 +12,7 @@ import {maxExecutionsByStep, maxWorkflowSteps, timeoutVM} from "../constants.js"
|
|
|
12
12
|
import {ChatOpenAI} from "@langchain/openai";
|
|
13
13
|
import {ChatGoogleGenerativeAI} from "@langchain/google-genai";
|
|
14
14
|
import {ChatPromptTemplate} from "@langchain/core/prompts";
|
|
15
|
-
import i18n from "
|
|
15
|
+
import i18n from "../../src/i18n.js";
|
|
16
16
|
import {sendEmail} from "../email.js";
|
|
17
17
|
|
|
18
18
|
import * as workflowModule from './workflow.js';
|
package/src/packs.js
CHANGED
|
@@ -390,8 +390,9 @@ export const getAllPacks = async () => {
|
|
|
390
390
|
return {
|
|
391
391
|
name: m.name,
|
|
392
392
|
permissions: {
|
|
393
|
-
"$
|
|
394
|
-
"$in": ["$name", m.perms]
|
|
393
|
+
"$link": {
|
|
394
|
+
"$in": ["$name", m.perms],
|
|
395
|
+
"_model": "permission"
|
|
395
396
|
}
|
|
396
397
|
}
|
|
397
398
|
}
|
|
@@ -407,7 +408,7 @@ export const getAllPacks = async () => {
|
|
|
407
408
|
"code": "fr"
|
|
408
409
|
}],
|
|
409
410
|
"translation": [
|
|
410
|
-
{ "lang": { "$
|
|
411
|
+
{ "lang": { "$link": { "$eq": ["$code", "fr"]}, "_model": "lang"}, "key": "Visitor alerts", "value": "Alertes visiteurs" }
|
|
411
412
|
]
|
|
412
413
|
}
|
|
413
414
|
}
|
package/src/setenv.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
// __tests__/data.integration.test.js
|
|
2
2
|
import { ObjectId } from 'mongodb';
|
|
3
|
-
import {expect, describe, it, beforeEach,
|
|
3
|
+
import {expect, describe, it, beforeEach, beforeAll} from 'vitest';
|
|
4
4
|
import { Config } from '../src/config.js';
|
|
5
5
|
|
|
6
|
-
// --- Importations des modules de votre application ---
|
|
7
6
|
import {
|
|
8
7
|
insertData,
|
|
9
8
|
editData,
|
|
10
9
|
deleteData,
|
|
11
|
-
|
|
10
|
+
searchData, installPack
|
|
12
11
|
} from 'data-primals-engine/modules/data';
|
|
13
12
|
|
|
14
13
|
import {
|
|
@@ -16,13 +15,8 @@ import {
|
|
|
16
15
|
getCollection,
|
|
17
16
|
getCollectionForUser as getAppUserCollection
|
|
18
17
|
} from 'data-primals-engine/modules/mongodb';
|
|
19
|
-
import {
|
|
20
|
-
import
|
|
21
|
-
import fs from "node:fs";
|
|
22
|
-
import util from "node:util";
|
|
23
|
-
import {getRandom} from "data-primals-engine/core";
|
|
24
|
-
import {generateUniqueName, getUniquePort, initEngine} from "../src/setenv.js";
|
|
25
|
-
import {MongoDatabase} from "../src/engine.js";
|
|
18
|
+
import {getRandom} from "../src/core.js";
|
|
19
|
+
import {generateUniqueName, initEngine} from "../src/setenv.js";
|
|
26
20
|
|
|
27
21
|
let testModelsColInstance;
|
|
28
22
|
let testDatasColInstance;
|
|
@@ -6,7 +6,7 @@ import { insertData, editData } from 'data-primals-engine/modules/data';
|
|
|
6
6
|
import { modelsCollection as getAppModelsCollection, getCollectionForUser, getCollection } from 'data-primals-engine/modules/mongodb';
|
|
7
7
|
import * as workflowModule from 'data-primals-engine/modules/workflow';
|
|
8
8
|
import {initEngine} from "../src/setenv.js";
|
|
9
|
-
import {maxExecutionsByStep} from "
|
|
9
|
+
import {maxExecutionsByStep} from "../src/constants.js";
|
|
10
10
|
|
|
11
11
|
vi.mock('data-primals-engine/modules/workflow', { spy: true })
|
|
12
12
|
|