isite 2024.10.2 → 2024.10.3
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 +7 -7
- package/apps/charts/site_files/html/PieChart.html +1 -1
- package/apps/charts/site_files/html/PieChart2.html +1 -1
- package/apps/charts/site_files/html/XYChart.html +1 -1
- package/apps/charts/site_files/html/column.html +1 -1
- package/apps/charts/site_files/html/gauge.html +1 -1
- package/apps/charts/site_files/html/index.html +1 -1
- package/apps/charts/site_files/html/line-graph.html +1 -1
- package/apps/charts/site_files/html/pie-chart-rounded-corners.html +1 -1
- package/apps/charts/site_files/html/simple-3D-pie-chart.html +1 -1
- package/apps/client-side/README.md +2 -2
- package/apps/client-side/site_files/css/form.css +1 -0
- package/apps/client-side/site_files/html/require_features.html +1 -1
- package/apps/client-side/site_files/html/require_payments.html +1 -1
- package/apps/client-side/site_files/html/require_permissions.html +1 -1
- package/apps/client-side/site_files/html/words-old.html +1 -1
- package/apps/client-side/site_files/html/words.html +1 -3
- package/apps/client-side/site_files/js/WebShareEditor.js +1 -1
- package/apps/client-side/site_files/js/bootstrap-5-directive.js +4 -4
- package/apps/client-side/site_files/js/bootstrap-5-directive.min.js +1 -1
- package/apps/client-side/site_files/js/site.js +0 -4
- package/apps/client-side/site_files/js/site.min.js +1 -1
- package/apps/client-side/site_files/js/video.min.js +2 -2
- package/apps/security/site_files/html/add_modal.html +1 -1
- package/apps/security/site_files/html/content.html +1 -1
- package/apps/security/site_files/html/index.html +1 -1
- package/apps/security/site_files/html/navbar.html +2 -2
- package/apps/security/site_files/html/view.html +2 -2
- package/apps/security/site_files/js/navbar.js +1 -1
- package/apps/security/site_files/json/permissions.json +6 -6
- package/apps/security/site_files/json/roles.json +8 -8
- package/apps/security/site_files/json/words.json +27 -27
- package/apps/ui-print/site_files/html/content.html +1 -1
- package/apps/ui-print/site_files/html/image.html +1 -1
- package/apps/ui-print/site_files/html/index.html +1 -1
- package/apps/ui-print/site_files/html/svg.html +1 -1
- package/isite_files/css/custom.css +2 -0
- package/isite_files/html/index.html +1 -1
- package/lib/dashboard.js +1 -1
- package/lib/mongodb.js +56 -215
- package/lib/routing.js +27 -25
- package/lib/security.js +7 -7
- package/lib/session.js +1 -1
- package/lib/sessions.js +11 -6
- package/object-options/index.js +1 -1
- package/object-options/plugins/file-manager/site-files/html/index.html +1 -1
- package/package.json +1 -1
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
<i-files category="users" label="##word.files##"ng-model="user.user.profile.files"></i-files>
|
|
32
32
|
<br>
|
|
33
33
|
<br>
|
|
34
|
-
<i-checklist primary="name" label="##word.security_roles##" items="roles" display="
|
|
34
|
+
<i-checklist primary="name" label="##word.security_roles##" items="roles" display="Ar" ng-model="user.roles"></i-checklist>
|
|
35
35
|
|
|
36
36
|
</div>
|
|
37
37
|
</div>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<li x-features="!login" ><a onclick="site.showModal('#loginModal')"> ##word.security_login## </a></li>
|
|
4
4
|
<li x-features="!login" ><a onclick="site.showModal('#registerModal')"> ##word.security_register## </a></li>
|
|
5
5
|
<li x-features="login" ><a onclick="site.showModal('#logoutModal')"> ##word.security_logout## <b class="red"> ##user.name## </b> </a></li>
|
|
6
|
-
<li x-lang="
|
|
7
|
-
<li x-lang="
|
|
6
|
+
<li x-lang="Ar" ><a ng-click="changeLang('en')"> <i class="fa fa-globe"></i> ##word.en_lang## </a></li>
|
|
7
|
+
<li x-lang="En" ><a ng-click="changeLang('ar')"> <i class="fa fa-globe"></i> ##word.ar_lang## </a></li>
|
|
8
8
|
</ul>
|
|
9
9
|
<script x-import="security/navbar.js"></script>
|
|
@@ -14,7 +14,7 @@ app.controller('navbar', ($scope, $http) => {
|
|
|
14
14
|
$scope.changeLang = function (language) {
|
|
15
15
|
if (typeof language == 'string') {
|
|
16
16
|
language = { id: language, dir: 'rtl', text: 'right' };
|
|
17
|
-
if (language.id.like('*
|
|
17
|
+
if (!language.id.like('*ar*')) {
|
|
18
18
|
language.dir = 'ltr';
|
|
19
19
|
language.text = 'left';
|
|
20
20
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
[
|
|
2
|
-
{"name" : "developer" , "
|
|
3
|
-
{"name" : "admin" , "
|
|
4
|
-
{"name" : "owner" , "
|
|
5
|
-
{"name" : "security" , "
|
|
6
|
-
{"name" : "print" , "
|
|
7
|
-
{"name" : "menus" , "
|
|
2
|
+
{"name" : "developer" , "En" : "Developer" , "Ar" : " ديفولوبر" },
|
|
3
|
+
{"name" : "admin" , "En" : "Admin" , "Ar" : " ادمن" },
|
|
4
|
+
{"name" : "owner" , "En" : "Owner" , "Ar" : " صاحب البرنامج" },
|
|
5
|
+
{"name" : "security" , "En" : "Users Management" , "Ar" : "ادارة المستخدمين" },
|
|
6
|
+
{"name" : "print" , "En" : "Print" , "Ar" : "طباعة" },
|
|
7
|
+
{"name" : "menus" , "En" : "Menus View" , "Ar" : "ظهور القوائم العامة" }
|
|
8
8
|
]
|
|
@@ -2,31 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
{
|
|
4
4
|
"name": "user_management",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
5
|
+
"Ar": "ادارة المستخدميين",
|
|
6
|
+
"En": "User Management",
|
|
7
7
|
"permissions": [
|
|
8
8
|
"security"
|
|
9
9
|
]
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
12
|
"name": "menus",
|
|
13
|
-
"
|
|
14
|
-
"
|
|
13
|
+
"Ar": "مشاهدة القوائم",
|
|
14
|
+
"En": "Show Menus",
|
|
15
15
|
"permissions": [
|
|
16
16
|
"menus"
|
|
17
17
|
]
|
|
18
18
|
}, {
|
|
19
19
|
"name": "print",
|
|
20
|
-
"
|
|
21
|
-
"
|
|
20
|
+
"Ar": "امكانية الطباعة",
|
|
21
|
+
"En": "Print",
|
|
22
22
|
"permissions": [
|
|
23
23
|
"Print"
|
|
24
24
|
]
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
"name": "زائر",
|
|
28
|
-
"
|
|
29
|
-
"
|
|
28
|
+
"Ar": "زائر",
|
|
29
|
+
"En": "visitor",
|
|
30
30
|
"permissions": [
|
|
31
31
|
"read"
|
|
32
32
|
]
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
[
|
|
2
|
-
{"name" : "security_app" , "
|
|
3
|
-
{"name" : "security_login" , "
|
|
4
|
-
{"name" : "security_register" , "
|
|
5
|
-
{"name" : "security_logout" , "
|
|
6
|
-
{"name" : "security_user_email" , "
|
|
7
|
-
{"name" : "security_user_password" , "
|
|
8
|
-
{"name" : "security_user_name" , "
|
|
9
|
-
{"name" : "security_user_mobile" , "
|
|
10
|
-
{"name" : "security_logo" , "
|
|
11
|
-
{"name" : "security_role" , "
|
|
12
|
-
{"name" : "security_add_to_roles" , "
|
|
13
|
-
{"name" : "security_roles" , "
|
|
14
|
-
{"name" : "security_permissions" , "
|
|
15
|
-
{"name" : "security_new_user" , "
|
|
16
|
-
{"name" : "security_add_user" , "
|
|
17
|
-
{"name" : "security_user_details" , "
|
|
18
|
-
{"name" : "actions" , "
|
|
19
|
-
{"name" : "edit" , "
|
|
20
|
-
{"name" : "save" , "
|
|
21
|
-
{"name" : "delete" , "
|
|
22
|
-
{"name" : "details" , "
|
|
23
|
-
{"name" : "notes" , "
|
|
24
|
-
{"name" : "files" , "
|
|
25
|
-
{"name" : "file_name" , "
|
|
26
|
-
{"name" : "ar_lang" , "
|
|
27
|
-
{"name" : "en_lang" , "
|
|
28
|
-
{"name" : "close" , "
|
|
2
|
+
{"name" : "security_app" , "En" : "Security App" , "Ar":"نظام الحماية"},
|
|
3
|
+
{"name" : "security_login" , "En" : "Login" , "Ar":"تسجيل الدخول"},
|
|
4
|
+
{"name" : "security_register" , "En" : "Register" , "Ar":"تسجيل الاشتراك"},
|
|
5
|
+
{"name" : "security_logout" , "En" : "Logout" , "Ar":"تسجيل الخروج"},
|
|
6
|
+
{"name" : "security_user_email" , "En" : "Email" , "Ar":" أسم المستحدم / البريد الالكترونى"},
|
|
7
|
+
{"name" : "security_user_password" , "En" : "Password" , "Ar":"كلمة المرور"},
|
|
8
|
+
{"name" : "security_user_name" , "En" : "Name" , "Ar":"الأسم"},
|
|
9
|
+
{"name" : "security_user_mobile" , "En" : "Mobile" , "Ar":"رقم الموبيل"},
|
|
10
|
+
{"name" : "security_logo" , "En" : "Logo" , "Ar":"الشعار"},
|
|
11
|
+
{"name" : "security_role" , "En" : "Role" , "Ar":"الصفة العامة"},
|
|
12
|
+
{"name" : "security_add_to_roles" , "En" : "Add To Roles" , "Ar":"أضف الى الصفات العامة"},
|
|
13
|
+
{"name" : "security_roles" , "En" : "Roles" , "Ar":"الصفات العامة"},
|
|
14
|
+
{"name" : "security_permissions" , "En" : "Permissions" , "Ar":"الصلاحيات"},
|
|
15
|
+
{"name" : "security_new_user" , "En" : "New User" , "Ar":"مستخدم جديد"},
|
|
16
|
+
{"name" : "security_add_user" , "En" : "Add User" , "Ar":"أضف الى المستخدمين"},
|
|
17
|
+
{"name" : "security_user_details" , "En" : "User Details" , "Ar":"تفاصيل المستخدم"},
|
|
18
|
+
{"name" : "actions" , "En" : "Actions" , "Ar":"الاجراءات"},
|
|
19
|
+
{"name" : "edit" , "En" : "Edit" , "Ar":"تعديل"},
|
|
20
|
+
{"name" : "save" , "En" : "Save Changes" , "Ar":"حفظ التغيرات"},
|
|
21
|
+
{"name" : "delete" , "En" : "Delete" , "Ar":"حذف"},
|
|
22
|
+
{"name" : "details" , "En" : "Details" , "Ar":"تفاصيل"},
|
|
23
|
+
{"name" : "notes" , "En" : "Notes" , "Ar":"ملاحظات"},
|
|
24
|
+
{"name" : "files" , "En" : "Files" , "Ar":"ملفات"},
|
|
25
|
+
{"name" : "file_name" , "En" : "File Name" , "Ar":"أسم الملف"},
|
|
26
|
+
{"name" : "ar_lang" , "En" : "اللغة العربية" , "Ar":"اللغة العربية"},
|
|
27
|
+
{"name" : "en_lang" , "En" : "English" , "Ar":"English"},
|
|
28
|
+
{"name" : "close" , "En" : "Close" , "Ar":"أغلاق"}
|
|
29
29
|
]
|
package/lib/dashboard.js
CHANGED
|
@@ -183,7 +183,7 @@ module.exports = function init(____0) {
|
|
|
183
183
|
____0.post('/x-dashboard-Language/Change', function (req, res) {
|
|
184
184
|
let name = req.body.name || 'ar';
|
|
185
185
|
req.session.language = req.body;
|
|
186
|
-
req.session.lang = name;
|
|
186
|
+
req.session.lang = req.session.language.id || name;
|
|
187
187
|
req.session.$save();
|
|
188
188
|
res.ending(0, JSON.stringify({ done: !0 }));
|
|
189
189
|
});
|
package/lib/mongodb.js
CHANGED
|
@@ -66,7 +66,10 @@ module.exports = function init(____0) {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
if (typeof doc === 'object') {
|
|
69
|
-
|
|
69
|
+
if ($badLetter) {
|
|
70
|
+
doc = ____0.removeRefObject(doc);
|
|
71
|
+
}
|
|
72
|
+
|
|
70
73
|
for (let key in doc) {
|
|
71
74
|
if (key === '_id' && typeof doc[key] === 'string') {
|
|
72
75
|
doc[key] = _mongo.ObjectID(doc[key]);
|
|
@@ -77,11 +80,11 @@ module.exports = function init(____0) {
|
|
|
77
80
|
} else if (Array.isArray(doc[key])) {
|
|
78
81
|
doc[key].forEach((v, i) => {
|
|
79
82
|
if (v && typeof v === 'object') {
|
|
80
|
-
doc[key][i] = _mongo.handleDoc(v,
|
|
83
|
+
doc[key][i] = _mongo.handleDoc(v, $badLetter);
|
|
81
84
|
}
|
|
82
85
|
});
|
|
83
|
-
} else if (typeof doc[key] === 'object' && key !== '_id') {
|
|
84
|
-
doc[key] = _mongo.handleDoc(doc[key],
|
|
86
|
+
} else if (typeof doc[key] === 'object' && doc[key] && key !== '_id') {
|
|
87
|
+
doc[key] = _mongo.handleDoc(doc[key], $badLetter);
|
|
85
88
|
}
|
|
86
89
|
}
|
|
87
90
|
}
|
|
@@ -204,13 +207,6 @@ module.exports = function init(____0) {
|
|
|
204
207
|
.createIndex(options.obj, options.option)
|
|
205
208
|
.then((result) => {
|
|
206
209
|
callback(null, result);
|
|
207
|
-
if (____0.options.mongodb.events) {
|
|
208
|
-
____0.call('mongodb after create index', {
|
|
209
|
-
db: options.dbName,
|
|
210
|
-
collection: options.collectionName,
|
|
211
|
-
obj: options.obj,
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
210
|
})
|
|
215
211
|
.catch((err) => {
|
|
216
212
|
callback(err);
|
|
@@ -229,13 +225,6 @@ module.exports = function init(____0) {
|
|
|
229
225
|
.dropIndex(options.obj, options.option)
|
|
230
226
|
.then((result) => {
|
|
231
227
|
callback(null, result);
|
|
232
|
-
if (____0.options.mongodb.events) {
|
|
233
|
-
____0.call('mongodb after drop index', {
|
|
234
|
-
db: options.dbName,
|
|
235
|
-
collection: options.collectionName,
|
|
236
|
-
obj: options.obj,
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
228
|
})
|
|
240
229
|
.catch((err) => {
|
|
241
230
|
callback(err);
|
|
@@ -254,13 +243,6 @@ module.exports = function init(____0) {
|
|
|
254
243
|
.dropIndexes()
|
|
255
244
|
.then((result) => {
|
|
256
245
|
callback(null, result);
|
|
257
|
-
if (____0.options.mongodb.events) {
|
|
258
|
-
____0.call('mongodb after drop index', {
|
|
259
|
-
db: options.dbName,
|
|
260
|
-
collection: options.collectionName,
|
|
261
|
-
obj: options.obj,
|
|
262
|
-
});
|
|
263
|
-
}
|
|
264
246
|
})
|
|
265
247
|
.catch((err) => {
|
|
266
248
|
callback(err);
|
|
@@ -308,33 +290,6 @@ module.exports = function init(____0) {
|
|
|
308
290
|
});
|
|
309
291
|
};
|
|
310
292
|
|
|
311
|
-
_mongo.insertOneAsyncBusy = !1;
|
|
312
|
-
_mongo.insertOneAsyncList = [];
|
|
313
|
-
_mongo.insertOneAsync = function (obj, callback) {
|
|
314
|
-
if (obj) {
|
|
315
|
-
_mongo.insertOneAsyncList.push({
|
|
316
|
-
obj: obj,
|
|
317
|
-
callback: callback,
|
|
318
|
-
});
|
|
319
|
-
_mongo.insertOneAsync(null);
|
|
320
|
-
} else {
|
|
321
|
-
if (_mongo.insertOneAsyncBusy) {
|
|
322
|
-
return;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
var _obj = _mongo.insertOneAsyncList[0];
|
|
326
|
-
if (_obj) {
|
|
327
|
-
_mongo.insertOneAsyncBusy = !0;
|
|
328
|
-
_mongo.insertOne(_obj.obj, function (err, obj) {
|
|
329
|
-
_mongo.insertOneAsyncList.splice(0, 1);
|
|
330
|
-
_obj.callback(err, obj);
|
|
331
|
-
_mongo.insertOneAsyncBusy = !1;
|
|
332
|
-
_mongo.insertOneAsync(null);
|
|
333
|
-
});
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
};
|
|
337
|
-
|
|
338
293
|
_mongo.insertOne = function (obj, callback) {
|
|
339
294
|
callback = callback || _mongo.callback;
|
|
340
295
|
_mongo.connectCollection(obj, function (err, collection) {
|
|
@@ -346,14 +301,6 @@ module.exports = function init(____0) {
|
|
|
346
301
|
.then((result) => {
|
|
347
302
|
obj.doc._id = result.insertedId;
|
|
348
303
|
callback(null, obj.doc, result);
|
|
349
|
-
|
|
350
|
-
if (____0.options.mongodb.events) {
|
|
351
|
-
____0.call('mongodb after insert', {
|
|
352
|
-
db: obj.dbName,
|
|
353
|
-
collection: obj.collectionName,
|
|
354
|
-
doc: result,
|
|
355
|
-
});
|
|
356
|
-
}
|
|
357
304
|
})
|
|
358
305
|
.catch((err) => {
|
|
359
306
|
callback(err);
|
|
@@ -381,21 +328,11 @@ module.exports = function init(____0) {
|
|
|
381
328
|
.insertMany(obj.docs, obj.options)
|
|
382
329
|
.then((result) => {
|
|
383
330
|
callback(null, obj.docs, result);
|
|
384
|
-
|
|
385
|
-
if (____0.options.mongodb.events) {
|
|
386
|
-
____0.call('mongodb after insert many', {
|
|
387
|
-
db: obj.dbName,
|
|
388
|
-
collection: obj.collectionName,
|
|
389
|
-
docs: obj.docs,
|
|
390
|
-
});
|
|
391
|
-
}
|
|
392
331
|
})
|
|
393
332
|
.catch((err) => {
|
|
394
|
-
console.error(' _mongo.insertMany() ', err.message);
|
|
395
333
|
callback(err);
|
|
396
334
|
});
|
|
397
335
|
} else {
|
|
398
|
-
console.error(' _mongo.insertMany() ', err.message);
|
|
399
336
|
callback(err);
|
|
400
337
|
}
|
|
401
338
|
});
|
|
@@ -428,14 +365,11 @@ module.exports = function init(____0) {
|
|
|
428
365
|
collection
|
|
429
366
|
.findOne(obj.where, options)
|
|
430
367
|
.then((doc) => {
|
|
431
|
-
|
|
432
|
-
if (
|
|
433
|
-
|
|
434
|
-
db: obj.dbName,
|
|
435
|
-
collection: obj.collectionName,
|
|
436
|
-
doc: doc,
|
|
437
|
-
});
|
|
368
|
+
let err = null;
|
|
369
|
+
if (!doc) {
|
|
370
|
+
err = { message: 'Not Exists : ' + JSON.stringify(obj.where) };
|
|
438
371
|
}
|
|
372
|
+
callback(err, doc);
|
|
439
373
|
})
|
|
440
374
|
.catch((err) => {
|
|
441
375
|
callback(err);
|
|
@@ -486,13 +420,6 @@ module.exports = function init(____0) {
|
|
|
486
420
|
.toArray()
|
|
487
421
|
.then((docs) => {
|
|
488
422
|
callback(null, docs, count);
|
|
489
|
-
if (____0.options.mongodb.events) {
|
|
490
|
-
____0.call('mongodb after find many', {
|
|
491
|
-
db: obj.dbName,
|
|
492
|
-
collection: obj.collectionName,
|
|
493
|
-
docs: docs,
|
|
494
|
-
});
|
|
495
|
-
}
|
|
496
423
|
})
|
|
497
424
|
.catch((err) => {
|
|
498
425
|
callback(err, [], 0);
|
|
@@ -534,6 +461,7 @@ module.exports = function init(____0) {
|
|
|
534
461
|
_mongo.connectCollection(obj, function (err, collection) {
|
|
535
462
|
if (!err) {
|
|
536
463
|
obj.where = _mongo.handleDoc(obj.where, '');
|
|
464
|
+
|
|
537
465
|
let $update = {};
|
|
538
466
|
|
|
539
467
|
if (obj.set) {
|
|
@@ -549,57 +477,22 @@ module.exports = function init(____0) {
|
|
|
549
477
|
$update.$rename = obj.rename;
|
|
550
478
|
}
|
|
551
479
|
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
},
|
|
569
|
-
(err2, new_doc) => {
|
|
570
|
-
callback(
|
|
571
|
-
null,
|
|
572
|
-
{
|
|
573
|
-
doc: new_doc,
|
|
574
|
-
old_doc: old_doc,
|
|
575
|
-
where: obj.where,
|
|
576
|
-
update: $update,
|
|
577
|
-
db: obj.dbName,
|
|
578
|
-
collection: obj.collectionName,
|
|
579
|
-
},
|
|
580
|
-
result
|
|
581
|
-
);
|
|
582
|
-
if (____0.options.mongodb.events) {
|
|
583
|
-
____0.call('mongodb after update', {
|
|
584
|
-
db: obj.dbName,
|
|
585
|
-
collection: obj.collectionName,
|
|
586
|
-
doc: new_doc,
|
|
587
|
-
old_doc: old_doc,
|
|
588
|
-
where: obj.where,
|
|
589
|
-
update: $update,
|
|
590
|
-
});
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
);
|
|
594
|
-
})
|
|
595
|
-
.catch((err) => {
|
|
596
|
-
callback(err);
|
|
597
|
-
});
|
|
598
|
-
} else {
|
|
599
|
-
callback(err);
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
);
|
|
480
|
+
collection
|
|
481
|
+
.updateOne(obj.where, $update)
|
|
482
|
+
.then((result) => {
|
|
483
|
+
callback(null, {
|
|
484
|
+
...result,
|
|
485
|
+
doc: $update.$set,
|
|
486
|
+
old_doc: {},
|
|
487
|
+
where: obj.where,
|
|
488
|
+
update: $update,
|
|
489
|
+
db: obj.dbName,
|
|
490
|
+
collection: obj.collectionName,
|
|
491
|
+
});
|
|
492
|
+
})
|
|
493
|
+
.catch((err) => {
|
|
494
|
+
callback(err);
|
|
495
|
+
});
|
|
603
496
|
} else {
|
|
604
497
|
callback(err);
|
|
605
498
|
}
|
|
@@ -625,29 +518,14 @@ module.exports = function init(____0) {
|
|
|
625
518
|
collection
|
|
626
519
|
.updateMany(obj.where, $update)
|
|
627
520
|
.then((result) => {
|
|
628
|
-
callback(
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
update: $update,
|
|
637
|
-
},
|
|
638
|
-
result
|
|
639
|
-
);
|
|
640
|
-
if (____0.options.mongodb.events) {
|
|
641
|
-
____0.call('mongodb after update many', {
|
|
642
|
-
db: obj.dbName,
|
|
643
|
-
collection: obj.collectionName,
|
|
644
|
-
exists: result.result?.n,
|
|
645
|
-
count: result.result?.nModified,
|
|
646
|
-
ok: result.result?.ok,
|
|
647
|
-
where: obj.where,
|
|
648
|
-
update: $update,
|
|
649
|
-
});
|
|
650
|
-
}
|
|
521
|
+
callback(null, {
|
|
522
|
+
...result,
|
|
523
|
+
exists: result.result?.n,
|
|
524
|
+
count: result.result?.nModified,
|
|
525
|
+
ok: result.result?.ok,
|
|
526
|
+
where: obj.where,
|
|
527
|
+
update: $update,
|
|
528
|
+
});
|
|
651
529
|
})
|
|
652
530
|
.catch((err) => {
|
|
653
531
|
callback(err);
|
|
@@ -664,46 +542,20 @@ module.exports = function init(____0) {
|
|
|
664
542
|
if (!err) {
|
|
665
543
|
obj.where = _mongo.handleDoc(obj.where, '');
|
|
666
544
|
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
{
|
|
682
|
-
db: obj.dbName,
|
|
683
|
-
collection: obj.collectionName,
|
|
684
|
-
count: result.deletedCount,
|
|
685
|
-
doc: doc,
|
|
686
|
-
},
|
|
687
|
-
result
|
|
688
|
-
);
|
|
689
|
-
if (____0.options.mongodb.events) {
|
|
690
|
-
____0.call('mongodb after delete', {
|
|
691
|
-
db: obj.dbName,
|
|
692
|
-
collection: obj.collectionName,
|
|
693
|
-
doc: doc,
|
|
694
|
-
});
|
|
695
|
-
}
|
|
696
|
-
})
|
|
697
|
-
.catch((err) => {
|
|
698
|
-
callback(err);
|
|
699
|
-
});
|
|
700
|
-
} else {
|
|
701
|
-
callback({
|
|
702
|
-
message: 'Not Exists : ' + JSON.stringify(obj.where),
|
|
703
|
-
});
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
);
|
|
545
|
+
collection
|
|
546
|
+
.deleteOne(obj.where)
|
|
547
|
+
.then((result) => {
|
|
548
|
+
callback(null, {
|
|
549
|
+
...result,
|
|
550
|
+
db: obj.dbName,
|
|
551
|
+
collection: obj.collectionName,
|
|
552
|
+
count: result.deletedCount,
|
|
553
|
+
doc: obj.where,
|
|
554
|
+
});
|
|
555
|
+
})
|
|
556
|
+
.catch((err) => {
|
|
557
|
+
callback(err);
|
|
558
|
+
});
|
|
707
559
|
} else {
|
|
708
560
|
callback(err);
|
|
709
561
|
}
|
|
@@ -736,23 +588,12 @@ module.exports = function init(____0) {
|
|
|
736
588
|
collection
|
|
737
589
|
.deleteMany(obj.where)
|
|
738
590
|
.then((result) => {
|
|
739
|
-
callback(
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
},
|
|
746
|
-
result
|
|
747
|
-
);
|
|
748
|
-
if (____0.options.mongodb.events) {
|
|
749
|
-
____0.call('mongodb after delete many', {
|
|
750
|
-
db: obj.dbName,
|
|
751
|
-
collection: obj.collectionName,
|
|
752
|
-
where: obj.where,
|
|
753
|
-
count: result.deletedCount,
|
|
754
|
-
});
|
|
755
|
-
}
|
|
591
|
+
callback(null, {
|
|
592
|
+
...result,
|
|
593
|
+
db: obj.dbName,
|
|
594
|
+
collection: obj.collectionName,
|
|
595
|
+
count: result.deletedCount,
|
|
596
|
+
});
|
|
756
597
|
})
|
|
757
598
|
.catch((err) => {
|
|
758
599
|
callback(err);
|