isite 2025.12.1 → 2026.1.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.
- package/index.js +1 -1
- package/lib/mongodb.js +7 -3
- package/lib/sessions.js +3 -3
- package/object-options/index.js +2 -0
- package/object-options/lib/fn.js +6 -6
- package/package.json +1 -1
package/index.js
CHANGED
package/lib/mongodb.js
CHANGED
|
@@ -143,9 +143,12 @@ module.exports = function init(____0) {
|
|
|
143
143
|
let db_url = _mongo.connection;
|
|
144
144
|
____0.log('\n ( Connecting DB : ' + db_url + ' ) \n');
|
|
145
145
|
const mongodbClient = new mongodb.MongoClient(db_url, {
|
|
146
|
-
serverSelectionTimeoutMS: 1000 *
|
|
147
|
-
|
|
148
|
-
|
|
146
|
+
serverSelectionTimeoutMS: 1000 * 10,
|
|
147
|
+
timeoutMS: 1000 * 10,
|
|
148
|
+
waitQueueTimeoutMS: 1000 * 10,
|
|
149
|
+
connectTimeoutMS: 1000 * 10,
|
|
150
|
+
socketTimeoutMS: 1000 * 10,
|
|
151
|
+
maxConnecting : 1,
|
|
149
152
|
...____0.options.mongodb.config,
|
|
150
153
|
});
|
|
151
154
|
mongodbClient
|
|
@@ -174,6 +177,7 @@ module.exports = function init(____0) {
|
|
|
174
177
|
})
|
|
175
178
|
.catch((err) => {
|
|
176
179
|
____0.log(err);
|
|
180
|
+
_mongo.connectDBBusy = !1;
|
|
177
181
|
callback(err, null);
|
|
178
182
|
});
|
|
179
183
|
};
|
package/lib/sessions.js
CHANGED
|
@@ -36,7 +36,7 @@ module.exports = function init(____0) {
|
|
|
36
36
|
sessions.list = sessions.list.filter((s) => s && (s.user_id || new Date().getTime() - s.createdTime < 1000 * 60 * ____0.options.session.timeout));
|
|
37
37
|
sessions.list = sessions.list.filter((s) => s && (s.user_id || new Date().getTime() - s.$time < 1000 * 60 * ____0.options.session.memoryTimeout));
|
|
38
38
|
|
|
39
|
-
if (____0.options.session.
|
|
39
|
+
if (____0.options.session.save && ____0.options.session.storage === 'mongodb') {
|
|
40
40
|
sessions.$collection.deleteAll({ createdTime: { $lt: new Date().getTime() - 1000 * 60 * ____0.options.session.timeout } });
|
|
41
41
|
}
|
|
42
42
|
};
|
|
@@ -52,7 +52,7 @@ module.exports = function init(____0) {
|
|
|
52
52
|
|
|
53
53
|
sessions.handleSessions();
|
|
54
54
|
|
|
55
|
-
if (____0.options.session.timeout === 0 || !____0.options.session.
|
|
55
|
+
if (____0.options.session.timeout === 0 || !____0.options.session.save) {
|
|
56
56
|
callback({
|
|
57
57
|
message: 'Timout is Zero or not Enabled , Sessions Will Not Saved',
|
|
58
58
|
});
|
|
@@ -95,7 +95,7 @@ module.exports = function init(____0) {
|
|
|
95
95
|
sessions.list[index].lang = sessions.list[index].language.id;
|
|
96
96
|
callback(sessions.list[index]);
|
|
97
97
|
} else {
|
|
98
|
-
if (____0.options.session.storage == 'mongodb') {
|
|
98
|
+
if (____0.options.session.save && ____0.options.session.storage == 'mongodb') {
|
|
99
99
|
sessions.$collection.find(
|
|
100
100
|
{ accessToken: session.accessToken },
|
|
101
101
|
(err, doc) => {
|
package/object-options/index.js
CHANGED
|
@@ -93,6 +93,7 @@ function setOptions(_options, ____0) {
|
|
|
93
93
|
},
|
|
94
94
|
},
|
|
95
95
|
session: {
|
|
96
|
+
save: true,
|
|
96
97
|
cookieDomain : false,
|
|
97
98
|
timeout: 60 * 24 * 30,
|
|
98
99
|
memoryTimeout : 60,
|
|
@@ -265,6 +266,7 @@ function setOptions(_options, ____0) {
|
|
|
265
266
|
}
|
|
266
267
|
|
|
267
268
|
_x0oo.session = _x0oo.session || template.session;
|
|
269
|
+
_x0oo.session.save = _x0oo.session.save ?? template.session.save;
|
|
268
270
|
_x0oo.session.enabled = _x0oo.session.enabled ?? template.session.enabled;
|
|
269
271
|
_x0oo.session.timeout = _x0oo.session.timeout ?? template.session.timeout;
|
|
270
272
|
_x0oo.session.memoryTimeout = _x0oo.session.memoryTimeout ?? template.session.memoryTimeout;
|
package/object-options/lib/fn.js
CHANGED
|
@@ -342,10 +342,10 @@ exports = module.exports = function init(____0) {
|
|
|
342
342
|
return obj3;
|
|
343
343
|
};
|
|
344
344
|
|
|
345
|
-
fn.fromJson = (data) => {
|
|
345
|
+
fn.fromJson = (data , Default = {}) => {
|
|
346
346
|
try {
|
|
347
347
|
if (!data) {
|
|
348
|
-
return
|
|
348
|
+
return Default;
|
|
349
349
|
}
|
|
350
350
|
|
|
351
351
|
if (data && typeof data === 'string' && data != '') {
|
|
@@ -356,10 +356,10 @@ exports = module.exports = function init(____0) {
|
|
|
356
356
|
return data;
|
|
357
357
|
}
|
|
358
358
|
} catch (e) {
|
|
359
|
-
return
|
|
359
|
+
return Default;
|
|
360
360
|
}
|
|
361
361
|
|
|
362
|
-
return
|
|
362
|
+
return Default;
|
|
363
363
|
};
|
|
364
364
|
|
|
365
365
|
fn.toJson = (obj) => {
|
|
@@ -488,8 +488,8 @@ exports = module.exports = function init(____0) {
|
|
|
488
488
|
return new ____0._0xddxo().getDate();
|
|
489
489
|
};
|
|
490
490
|
|
|
491
|
-
____0.fromJson = fn.fromJson;
|
|
492
|
-
____0.toJson = fn.toJson;
|
|
491
|
+
____0.fromJson = ____0.fromJSON = fn.fromJson;
|
|
492
|
+
____0.toJson = ____0.toJSON = fn.toJson;
|
|
493
493
|
____0.from123 = ____0._x0f1xo = ____0.f1 = fn.from123;
|
|
494
494
|
____0.fromBase64 = fn.fromBase64;
|
|
495
495
|
____0.to123 = fn.to123;
|