From ddbb6f79fd0041247806e1e73ae35b4a289eb5bf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 01:46:59 +0000 Subject: [PATCH 01/70] Bump express-session from 1.18.0 to 1.18.1 Bumps [express-session](https://github.com/expressjs/session) from 1.18.0 to 1.18.1. - [Release notes](https://github.com/expressjs/session/releases) - [Changelog](https://github.com/expressjs/session/blob/master/HISTORY.md) - [Commits](https://github.com/expressjs/session/compare/v1.18.0...v1.18.1) --- updated-dependencies: - dependency-name: express-session dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 20 +++++--------------- package.json | 2 +- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index e6e2992e34f..c553f295c4e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,7 +28,7 @@ "errorhandler": "1.5.1", "express": "4.21.0", "express-rate-limit": "7.4.1", - "express-session": "1.18.0", + "express-session": "1.18.1", "form-data": "^4.0.0", "formidable": "2.1.1", "fs-extra": "11.2.0", @@ -4771,12 +4771,11 @@ } }, "node_modules/express-session": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/express-session/-/express-session-1.18.0.tgz", - "integrity": "sha512-m93QLWr0ju+rOwApSsyso838LQwgfs44QtOP/WBiwtAgPIo/SAh1a5c6nn2BR6mFNZehTpqKDESzP+fRHVbxwQ==", - "license": "MIT", + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/express-session/-/express-session-1.18.1.tgz", + "integrity": "sha512-a5mtTqEaZvBCL9A9aqkrtfz+3SMDhOVUnjafjo+s7A9Txkq+SVX2DLvSp1Zrv4uCXa3lMSK3viWnh9Gg07PBUA==", "dependencies": { - "cookie": "0.6.0", + "cookie": "0.7.2", "cookie-signature": "1.0.7", "debug": "2.6.9", "depd": "~2.0.0", @@ -4789,15 +4788,6 @@ "node": ">= 0.8.0" } }, - "node_modules/express-session/node_modules/cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, "node_modules/express-session/node_modules/cookie-signature": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.7.tgz", diff --git a/package.json b/package.json index fc64d85e593..fd86f9936dc 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "errorhandler": "1.5.1", "express": "4.21.0", "express-rate-limit": "7.4.1", - "express-session": "1.18.0", + "express-session": "1.18.1", "form-data": "^4.0.0", "formidable": "2.1.1", "fs-extra": "11.2.0", From a92bf17f1ad3194a56917682257e4f736512ba1d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 01:47:07 +0000 Subject: [PATCH 02/70] Bump form-data from 4.0.0 to 4.0.1 Bumps [form-data](https://github.com/form-data/form-data) from 4.0.0 to 4.0.1. - [Release notes](https://github.com/form-data/form-data/releases) - [Commits](https://github.com/form-data/form-data/compare/v4.0.0...v4.0.1) --- updated-dependencies: - dependency-name: form-data dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index e6e2992e34f..62a0b6f0d52 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5371,10 +5371,9 @@ } }, "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "license": "MIT", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", + "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", From be895d10ab00e93ddbc95a60279014f023676556 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 01:47:20 +0000 Subject: [PATCH 03/70] Bump express from 4.21.0 to 4.21.1 Bumps [express](https://github.com/expressjs/express) from 4.21.0 to 4.21.1. - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/4.21.1/History.md) - [Commits](https://github.com/expressjs/express/compare/4.21.0...4.21.1) --- updated-dependencies: - dependency-name: express dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 17 ++++++++--------- package.json | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index e6e2992e34f..cf8a4c6580c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,7 @@ "csvtojson": "2.0.10", "ejs": "3.1.10", "errorhandler": "1.5.1", - "express": "4.21.0", + "express": "4.21.1", "express-rate-limit": "7.4.1", "express-session": "1.18.0", "form-data": "^4.0.0", @@ -4716,16 +4716,16 @@ } }, "node_modules/express": { - "version": "4.21.0", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz", - "integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==", + "version": "4.21.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", + "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.6.0", + "cookie": "0.7.1", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", @@ -4825,10 +4825,9 @@ "license": "MIT" }, "node_modules/express/node_modules/cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", - "license": "MIT", + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", "engines": { "node": ">= 0.6" } diff --git a/package.json b/package.json index fc64d85e593..d5575f64415 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "csvtojson": "2.0.10", "ejs": "3.1.10", "errorhandler": "1.5.1", - "express": "4.21.0", + "express": "4.21.1", "express-rate-limit": "7.4.1", "express-session": "1.18.0", "form-data": "^4.0.0", From 5eb696891a300c0dc3a647ba2eb3ac068c07d7ea Mon Sep 17 00:00:00 2001 From: Cihad Tekin Date: Fri, 18 Oct 2024 16:18:10 +0300 Subject: [PATCH 04/70] [core] cache: updated deprecated api of lru-cache, cleaned up mongodb capped collection and change stream related code --- api/api.js | 4 +- api/parts/data/cache.js | 286 ++++------------------------------------ 2 files changed, 28 insertions(+), 262 deletions(-) diff --git a/api/api.js b/api/api.js index 4a0b51eeffc..af5ea02fded 100755 --- a/api/api.js +++ b/api/api.js @@ -265,7 +265,7 @@ plugins.connectToAllDatabases().then(function() { if (cluster.isMaster) { plugins.installMissingPlugins(common.db); common.runners = require('./parts/jobs/runner'); - common.cache = new CacheMaster(common.db); + common.cache = new CacheMaster(); common.cache.start().then(() => { setImmediate(() => { plugins.dispatch('/cache/init', {}); @@ -333,7 +333,7 @@ plugins.connectToAllDatabases().then(function() { console.log("Starting worker", process.pid, "parent:", process.ppid); const taskManager = require('./utils/taskmanager.js'); - common.cache = new CacheWorker(common.db); + common.cache = new CacheWorker(); common.cache.start(); //since process restarted mark running tasks as errored diff --git a/api/parts/data/cache.js b/api/parts/data/cache.js index 181b6f6e121..a2da942aaf1 100644 --- a/api/parts/data/cache.js +++ b/api/parts/data/cache.js @@ -66,7 +66,7 @@ class DataStore { * @return {int} current store size */ get length() { - return this.lru.length; + return this.lru.size; } /** @@ -97,10 +97,10 @@ class DataStore { return data; } else if (!id) { - this.lru.reset(); + this.lru.clear(); } else if (this.read(id) !== null) { - this.lru.del(id.toString()); + this.lru.delete(id.toString()); } } @@ -155,11 +155,9 @@ class CacheWorker { /** * Constructor * - * @param {Mongo} db database instance * @param {Number} size max number of cache groups */ - constructor(db, size = 100) { - this.db = db; + constructor(size = 100) { this.data = new DataStore(size); this.started = false; @@ -317,7 +315,7 @@ class CacheWorker { } /** - * Remove a record from cache and database. + * Remove a record from cache. * * @param {String} group group key * @param {String} id data key @@ -441,7 +439,7 @@ class CacheWorker { /** * Just a handy method which returns an object with partials with given group. - * + * * @param {String} group group name * @return {Object} object with all the {@code CacheWorker} methods without group */ @@ -469,54 +467,18 @@ class CacheWorker { /** * Cache instance for master process: - * - (1) listen for requests from workers; - * - (2) listen for updates from capped collection; - * - send (1) to (2) and vice versa; - * - call group operators to read / write / udpate data from db / whatever. + * - listen for requests from workers; + * - call group operators to read/write/udpate */ class CacheMaster { /** * Constructor * - * @param {Mongo} db database instance * @param {Number} size max number of cache groups */ - constructor(db, size = 100) { + constructor(size = 100) { this.data = new DataStore(size, Number.MAX_SAFE_INTEGER); this.operators = {}; - this.col = new StreamedCollection(db, CENTRAL, doc => { - log.d('collection doc %j', doc); - if (doc.o === OP.READ) { - return; - } - - let store = this.data.read(doc.g); - if (!store) { - log.w(`No store for group ${doc.g}`); - return; - } - if (doc.o === OP.PURGE && !doc.k) { // purgeAll - store.iterate(id => store.write(id, null)); - } - if (doc.o === OP.PURGE || doc.o === OP.REMOVE) { - store.write(doc.k, null); - } - else if (doc.o === OP.WRITE) { - store.write(doc.k, doc.d); - } - else if (doc.o === OP.READ) { - log.w('Reading from collection instruction shouldn\'t happen'); - store.write(doc.k, doc.d); - } - else if (doc.o === OP.UPDATE) { - store.update(doc.k, doc.d); - } - else { - throw new Error('Bad op ' + doc.o + ': ' + JSON.stringify(doc)); - } - this.ipc.send(0, doc); - }); - this.initialized = {}; this.delayed_messages = []; this.ipc = new CentralMaster(CENTRAL, ({o, g, k, d}, reply, from) => { @@ -584,24 +546,19 @@ class CacheMaster { } /** - * Attach to IPC & tailable cursor. + * Attach to IPC * - * @return {Promise} with cursor open result + * @return {Promise} void */ async start() { - log.d('starting master'); this.ipc.attach(); - await this.col.start().then(() => new Promise(res => setTimeout(() => { - log.d('started master'); - res(); - }, 100))); + log.d('started master'); } /** - * Stop cursor. + * Detaches IPC instance */ stop() { - this.col.stop(); this.ipc.detach(); } @@ -652,8 +609,8 @@ class CacheMaster { } /** - * Write data to the cache & db - * + * Write data to the cache + * * @param {String} group group key * @param {String} id data key * @param {Object} data data to store @@ -679,10 +636,8 @@ class CacheMaster { rc = rc.json; } this.data.read(group)[data === null ? 'remove' : 'write'](id, rc); - return this.col.put(OP.WRITE, group, id, rc).then(() => { - this.ipc.send(-from, {o: OP.WRITE, g: group, k: id, d: rc}); - return data === null ? true : rc; - }); + this.ipc.send(-from, {o: OP.WRITE, g: group, k: id, d: rc}); + return data === null ? true : rc; } else { return null; @@ -696,7 +651,7 @@ class CacheMaster { /** * Update data in the cache - * + * * @param {String} group group key * @param {String} id data key * @param {Object} update data to store @@ -715,10 +670,8 @@ class CacheMaster { if (group in this.operators) { return this.operators[group].update(id, update).then(() => { this.data.read(group).update(id, update); - return this.col.put(OP.UPDATE, group, id, update).then(() => { - this.ipc.send(-from, {o: OP.UPDATE, g: group, k: id, d: update}); - return update; - }); + this.ipc.send(-from, {o: OP.UPDATE, g: group, k: id, d: update}); + return update; }); } else { @@ -727,7 +680,7 @@ class CacheMaster { } /** - * Remove a record from cache and database. + * Remove a record from cache. * * @param {String} group group key * @param {String} id data key @@ -747,10 +700,8 @@ class CacheMaster { return this.operators[group].remove(id).then(rc => { if (rc) { this.data.read(group).remove(id); - return this.col.put(OP.WRITE, group, id, null).then(() => { - this.ipc.send(-from, {o: OP.WRITE, g: group, k: id, d: null}); - return true; - }); + this.ipc.send(-from, {o: OP.WRITE, g: group, k: id, d: null}); + return true; } else { return null; @@ -781,9 +732,7 @@ class CacheMaster { this.data.read(group).write(id, null); this.ipc.send(-from, {o: OP.PURGE, g: group, k: id}); - return this.col.put(OP.PURGE, group, id).then(() => { - return true; - }); + return true; } /** @@ -802,9 +751,7 @@ class CacheMaster { let grp = this.data.read(group); grp.iterate(k => grp.write(k, null)); this.ipc.send(-from, {o: OP.PURGE, g: group}); - return this.col.put(OP.PURGE, group).then(() => { - return true; - }); + return true; } /** @@ -869,7 +816,7 @@ class CacheMaster { /** * Just a handy method which returns an object with partials with given group. - * + * * @param {String} group group name * @return {Object} object with all the {@code CacheWorker} methods without group */ @@ -896,187 +843,6 @@ class CacheMaster { } - -/** - * Ensure capped collection exists and return latest document in it to start streaming from. - * - * @param {Mongo} db db object - * @param {String} name collection name - * @param {Number} size collection size - * @return {Promise} resolves to array of [collection, _id of last record] - */ -function createCollection(db, name, size = 1e7) { - return new Promise((resolve, reject) => { - db.createCollection(name, {capped: true, size: size}, (e) => { - if (e && e.codeName !== "NamespaceExists") { - log.e(`Error while creating capped collection ${name}:`, e); - return reject(e); - } - - let col = db.collection(name); - - col.find().sort({_id: -1}).limit(1).toArray((err, arr) => { - if (err) { - log.e(`Error while looking for last record in ${name}:`, err); - return reject(err); - } - if (arr && arr.length) { - log.d('Last change id %s', arr[0]._id); - resolve([col, arr[0]._id]); - } - else { - col.insertOne({first: true}, (error, res) => { - if (error) { - log.e(`Error while looking for last record in ${name}:`, error); - return reject(e); - } - log.d('Inserted first change id %s', res.insertedId); - resolve([col, res.insertedId]); - }); - } - }); - }); - }); -} - -/** - * Class encapsulating a capped collection watching a particular cache modifications. - */ -class StreamedCollection { - /** - * Constructor - * @param {Mongo} db db object - * @param {String} name collection name - * @param {Function} handler a function handling IPC requests - */ - constructor(db, name, handler) { - this.db = db; - this.name = name; - this.handler = handler; - this.inserts = []; - } - - /** - * Start change stream - */ - async start() { - if (this.stream) { - log.w('Stream already started'); - return; - } - - log.i('Starting watcher stream in %d', process.pid); - - try { - let [col, last] = await createCollection(this.db, this.name, 1e7); - - this.col = col; - this.stream = col.find({_id: {$gt: last}}, {tailable: true, awaitData: true, numberOfRetries: -1}).stream(); - - this.stream.on('data', doc => { - if (this.inserts.indexOf(doc._id.toString()) !== -1) { - return this.inserts.splice(this.inserts.indexOf(doc._id.toString()), 1); - } - log.d('new in the collection', doc); - if (doc.d !== undefined && doc.d !== null) { - try { - doc.d = JSON.parse(doc.d); - this.handler(doc); - } - catch (e) { - log.e(e); - } - } - else { - this.handler(doc); - } - }); - - this.stream.on('end', () => { - log.w('Stream ended'); - this.close(); - }); - - this.stream.on('close', () => { - log.d('Stream closed'); - this.stream = undefined; - setImmediate(() => { - if (!this.stopped) { - this.start().catch(e => { - log.e('Cannot start watcher', e); - }); - } - }); - }); - - this.stream.on('error', error => { - log.e('Stream error', error); - this.close(); - }); - - } - catch (e) { - setTimeout(() => { - try { - if (!this.stopped) { - this.start(); - } - } - catch (ignored) { - // ignored - } - }, 1000); - } - } - - /** - * Close change stream - */ - stop() { - this.stopped = true; - this.close(); - } - - /** - * Close change stream - */ - close() { - if (this.stream) { - this.stream.destroy(); - this.stream = undefined; - log.d('Stream closedd'); - } - } - - /** - * Add a record to the collection - * @param {int} o operation type (see OP above) - * @param {String} g group name - * @param {String} k key - document key - * @param {Object} d data - * @return {Promise} resolves to the inserted change document - */ - put(o, g, k, d) { - let doc = { - _id: new this.db.ObjectID(), - o: o, - g: g, - k: k, - d: d ? JSON.stringify(d) : d - }; - log.d('putting to the collection', d); - this.inserts.push(doc._id.toString()); - return new Promise((res, rej) => this.col.insertOne(doc, err => { - if (err) { - this.inserts.splice(this.inserts.indexOf(doc._id.toString()), 1); - rej(err); - } - else { - res(doc); - } - })); - } -} /** * Data class for tests */ From cd2074f77068ca35c487fd946331f3bedbfa0cba Mon Sep 17 00:00:00 2001 From: Cihad Tekin Date: Thu, 24 Oct 2024 16:37:30 +0300 Subject: [PATCH 05/70] [logger] replaced capped collection with periodic clean up job --- plugins/logger/api/api.js | 29 ++++++++--------- plugins/logger/api/jobs/clear.js | 48 +++++++++++++++++++++++++++++ plugins/logger/install.js | 53 -------------------------------- 3 files changed, 60 insertions(+), 70 deletions(-) create mode 100644 plugins/logger/api/jobs/clear.js diff --git a/plugins/logger/api/api.js b/plugins/logger/api/api.js index 9afb2737c79..1b3d862b40f 100644 --- a/plugins/logger/api/api.js +++ b/plugins/logger/api/api.js @@ -4,7 +4,8 @@ var exported = {}, automaticStateManager = require('./helpers/automaticStateManager'), log = require('../../../api/utils/log.js')('logger:api'), { validateRead } = require('../../../api/utils/rights.js'); - +const JOB = require('../../../api/parts/jobs'); +const MAX_NUMBER_OF_LOG_ENTRIES = 1000; const FEATURE_NAME = 'logger'; var RequestLoggerStateEnum = { @@ -20,6 +21,13 @@ plugins.setConfigs("logger", { }); (function() { + plugins.register("/master", function() { + setTimeout(() => { + JOB.job('logger:clear', { max: MAX_NUMBER_OF_LOG_ENTRIES }) + .replace() + .schedule("every 5 minutes"); + }, 10000); + }); plugins.register("/permissions/features", function(ob) { ob.features.push(FEATURE_NAME); @@ -349,22 +357,13 @@ plugins.setConfigs("logger", { if (err) { console.log(err); } - common.returnOutput(parameters, stats && {capped: stats.capped, max: stats.max} || {}); + common.returnOutput(parameters, stats && {size: stats.size, count: stats.count, max: MAX_NUMBER_OF_LOG_ENTRIES} || {}); }); }); return true; } }); - plugins.register("/i/apps/create", function(ob) { - var appId = ob.appId; - common.db.command({"convertToCapped": 'logs' + appId, size: 10000000, max: 1000}, function(err) { - if (err) { - common.db.createCollection('logs' + appId, {capped: true, size: 10000000, max: 1000}, function() {}); - } - }); - }); - plugins.register("/i/apps/delete", function(ob) { var appId = ob.appId; common.db.collection('logs' + appId).drop(function() {}); @@ -372,16 +371,12 @@ plugins.setConfigs("logger", { plugins.register("/i/apps/reset", function(ob) { var appId = ob.appId; - common.db.collection('logs' + appId).drop(function() { - common.db.createCollection('logs' + appId, {capped: true, size: 10000000, max: 1000}, function() {}); - }); + common.db.collection('logs' + appId).drop(function() {}); }); plugins.register("/i/apps/clear_all", function(ob) { var appId = ob.appId; - common.db.collection('logs' + appId).drop(function() { - common.db.createCollection('logs' + appId, {capped: true, size: 10000000, max: 1000}, function() {}); - }); + common.db.collection('logs' + appId).drop(function() {}); }); }(exported)); diff --git a/plugins/logger/api/jobs/clear.js b/plugins/logger/api/jobs/clear.js new file mode 100644 index 00000000000..05575eec510 --- /dev/null +++ b/plugins/logger/api/jobs/clear.js @@ -0,0 +1,48 @@ +/** + * @typedef {import("mongodb").Db} Database + * @typedef {import("mongodb").ObjectId} ObjectId + */ +const JOB = require("../../../../api/parts/jobs/job.js"); +const log = require("../../../../api/utils/log.js")("job:logger:clear"); + +const DEFAULT_MAX_ENTRIES = 1000; + +/** + * clears logs + */ +class ClearJob extends JOB.Job { + /** + * Cleans up the logs{APPID} collection + * @param {Database} db mongodb database instance + */ + async run(db) { + let max = this.data.max; + if (typeof max !== "number") { + log.e( + "Maximum number of log entries required. Falling back to", + DEFAULT_MAX_ENTRIES + ); + max = DEFAULT_MAX_ENTRIES; + } + + log.d("Started: cleaning logs before the last", this.data.max); + const appIds = await db.collection("apps").find().project({ _id: 1 }).toArray(); + const loggerCollections = appIds.map(({_id}) => "logs" + _id.toString()); + + for (const colName of loggerCollections) { + const col = db.collection(colName); + // find the first entry we want to keep + const firstEntry = await col.find({}).project({ _id: 1 }).sort({ _id: -1 }) + .skip(this.data.max - 1).limit(1).toArray(); + if (!firstEntry[0]) { + continue; + } + // delete all previous entries + const result = await col.deleteMany({ _id: { $lt: firstEntry[0]._id } }); + log.d("Cleaned up", result.deletedCount, "entries from", colName); + } + log.d("Finished cleaning logs"); + } +} + +module.exports = ClearJob; \ No newline at end of file diff --git a/plugins/logger/install.js b/plugins/logger/install.js index ad9c9d8f5ca..e69de29bb2d 100644 --- a/plugins/logger/install.js +++ b/plugins/logger/install.js @@ -1,53 +0,0 @@ -var async = require('async'), - pluginManager = require('../pluginManager.js'); - -console.log("Installing logger plugin"); -pluginManager.dbConnection().then((countlyDb) => { - countlyDb.collection('apps').find({}).toArray(function(err, apps) { - - if (!apps || err) { - countlyDb.close(); - return; - } - function upgrade(app, done) { - console.log("Creating logs collection for " + app.name); - function cb() { - done(); - } - - countlyDb.command({ "listCollections": 1, "filter": { "name": "logs" + app._id } }, function(err, res) { - if (err) { - console.log(err); - cb(); - } - else { - //check if collection capped - if (res && res.cursor && res.cursor.firstBatch && res.cursor.firstBatch.length > 0) { - //collection exists - if (!res.cursor.firstBatch[0].options.capped) { - console.log("converting to the capped"); - countlyDb.command({ "convertToCapped": 'logs' + app._id, size: 10000000, max: 1000 }, - function(err) { - if (err) { - console.log(err); - } - cb(); - }); - } - else { - cb(); - } - } - else { //collection does not exist - console.log("collection does not exist"); - countlyDb.createCollection('logs' + app._id, { capped: true, size: 10000000, max: 1000 }, cb); - } - } - }); - } - async.forEach(apps, upgrade, function() { - console.log("Logger plugin installation finished"); - countlyDb.close(); - }); - }); -}); \ No newline at end of file From 6038b26dd7f76119c7de2773bb0849ce4b9e6b50 Mon Sep 17 00:00:00 2001 From: John-Weak Date: Mon, 18 Nov 2024 09:43:30 +0530 Subject: [PATCH 06/70] bump puppeteer to 23.8.0 --- .puppeteerrc.cjs | 13 + package-lock.json | 849 ++++++++++++++++++++++++++++++++++++++-------- package.json | 2 +- 3 files changed, 724 insertions(+), 140 deletions(-) create mode 100644 .puppeteerrc.cjs diff --git a/.puppeteerrc.cjs b/.puppeteerrc.cjs new file mode 100644 index 00000000000..50f2259c143 --- /dev/null +++ b/.puppeteerrc.cjs @@ -0,0 +1,13 @@ +const path = require('path'); +const countlyDir = __dirname; +const puppeteerInstallPath= path.join(countlyDir, '.cache', 'puppeteer') +/** +* @type {import("puppeteer").Configuration} +*/ +module.exports = { + // Download Chrome (default `skipDownload: false`) + chrome: { + skipDownload: false, + }, + cacheDirectory: puppeteerInstallPath, +}; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index e6e2992e34f..749c52028e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -59,7 +59,7 @@ "object-hash": "3.0.0", "offline-geocoder": "git+https://github.com/Countly/offline-geocoder.git", "properties-parser": "0.6.0", - "puppeteer": "17.1.3", + "puppeteer": "^23.8.0", "sass": "1.79.4", "tslib": "^2.6.3", "uglify-js": "3.19.3", @@ -114,7 +114,6 @@ "version": "7.24.7", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", - "dev": true, "license": "MIT", "dependencies": { "@babel/highlight": "^7.24.7", @@ -328,7 +327,6 @@ "version": "7.24.7", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", - "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" @@ -362,7 +360,6 @@ "version": "7.24.7", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", - "dev": true, "license": "MIT", "dependencies": { "@babel/helper-validator-identifier": "^7.24.7", @@ -378,7 +375,6 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^1.9.0" @@ -391,7 +387,6 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^3.2.1", @@ -406,7 +401,6 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, "license": "MIT", "dependencies": { "color-name": "1.1.3" @@ -416,14 +410,12 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true, "license": "MIT" }, "node_modules/@babel/highlight/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, "license": "MIT", "engines": { "node": ">=0.8.0" @@ -433,7 +425,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, "license": "MIT", "engines": { "node": ">=4" @@ -443,7 +434,6 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^3.0.0" @@ -1822,6 +1812,117 @@ "node": ">=10" } }, + "node_modules/@puppeteer/browsers": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.4.1.tgz", + "integrity": "sha512-0kdAbmic3J09I6dT8e9vE2JOCSt13wHCW5x/ly8TSt2bDtuIWe2TgLZZDHdcziw9AVCzflMAXCrVyRIhIs44Ng==", + "license": "Apache-2.0", + "dependencies": { + "debug": "^4.3.7", + "extract-zip": "^2.0.1", + "progress": "^2.0.3", + "proxy-agent": "^6.4.0", + "semver": "^7.6.3", + "tar-fs": "^3.0.6", + "unbzip2-stream": "^1.4.3", + "yargs": "^17.7.2" + }, + "bin": { + "browsers": "lib/cjs/main-cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@puppeteer/browsers/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@puppeteer/browsers/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@puppeteer/browsers/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/@puppeteer/browsers/node_modules/tar-fs": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.6.tgz", + "integrity": "sha512-iokBDQQkUyeXhgPYaZxmczGPhnhXZ0CmrqI+MOb/WFGS9DW5wnfrLgtjUJBvz50vQ3qfRwJ62QVoCFu8mPVu5w==", + "license": "MIT", + "dependencies": { + "pump": "^3.0.0", + "tar-stream": "^3.1.5" + }, + "optionalDependencies": { + "bare-fs": "^2.1.1", + "bare-path": "^2.1.0" + } + }, + "node_modules/@puppeteer/browsers/node_modules/tar-stream": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz", + "integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==", + "license": "MIT", + "dependencies": { + "b4a": "^1.6.4", + "fast-fifo": "^1.2.0", + "streamx": "^2.15.0" + } + }, + "node_modules/@puppeteer/browsers/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@puppeteer/browsers/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, "node_modules/@sindresorhus/is": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", @@ -1862,6 +1963,12 @@ "node": ">= 6" } }, + "node_modules/@tootallnate/quickjs-emscripten": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz", + "integrity": "sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==", + "license": "MIT" + }, "node_modules/@types/cacheable-request": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.3.tgz", @@ -2253,6 +2360,7 @@ "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", "license": "MIT", + "optional": true, "dependencies": { "debug": "4" }, @@ -2265,6 +2373,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", "license": "MIT", + "optional": true, "dependencies": { "ms": "2.1.2" }, @@ -2281,7 +2390,8 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "license": "MIT" + "license": "MIT", + "optional": true }, "node_modules/agentkeepalive": { "version": "4.5.0", @@ -2360,7 +2470,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "devOptional": true, "license": "MIT", "engines": { "node": ">=8" @@ -2617,6 +2726,18 @@ "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", "license": "MIT" }, + "node_modules/ast-types": { + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz", + "integrity": "sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==", + "license": "MIT", + "dependencies": { + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/async": { "version": "3.2.6", "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", @@ -2628,12 +2749,64 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "license": "MIT" }, + "node_modules/b4a": { + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.7.tgz", + "integrity": "sha512-OnAYlL5b7LEkALw87fUVafQw5rVR9RjwGd4KUwNQ6DrrNmaVaUCgLipfVlzrPQ4tWOR9P0IXGNOx50jYCCdSJg==", + "license": "Apache-2.0" + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "license": "MIT" }, + "node_modules/bare-events": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.5.0.tgz", + "integrity": "sha512-/E8dDe9dsbLyh2qrZ64PEPadOQ0F4gbl1sUJOrmph7xOiIxfY8vwab/4bFLh4Y88/Hk/ujKcrQKc+ps0mv873A==", + "license": "Apache-2.0", + "optional": true + }, + "node_modules/bare-fs": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-2.3.5.tgz", + "integrity": "sha512-SlE9eTxifPDJrT6YgemQ1WGFleevzwY+XAP1Xqgl56HtcrisC2CHCZ2tq6dBpcH2TnNxwUEUGhweo+lrQtYuiw==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "bare-events": "^2.0.0", + "bare-path": "^2.0.0", + "bare-stream": "^2.0.0" + } + }, + "node_modules/bare-os": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-2.4.4.tgz", + "integrity": "sha512-z3UiI2yi1mK0sXeRdc4O1Kk8aOa/e+FNWZcTiPB/dfTWyLypuE99LibgRaQki914Jq//yAWylcAt+mknKdixRQ==", + "license": "Apache-2.0", + "optional": true + }, + "node_modules/bare-path": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/bare-path/-/bare-path-2.1.3.tgz", + "integrity": "sha512-lh/eITfU8hrj9Ru5quUp0Io1kJWIk1bTjzo7JH1P5dWmQ2EL4hFUlfI8FonAhSlgIfhn63p84CDY/x+PisgcXA==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "bare-os": "^2.1.0" + } + }, + "node_modules/bare-stream": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.3.2.tgz", + "integrity": "sha512-EFZHSIBkDgSHIwj2l2QZfP4U5OcD4xFAOwhSb/vlr9PIqyGJGvB/nfClJbcnh3EY4jtPE4zsb5ztae96bVF79A==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "streamx": "^2.20.0" + } + }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -2666,6 +2839,15 @@ "node": ">= 0.8" } }, + "node_modules/basic-ftp": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.0.5.tgz", + "integrity": "sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", @@ -3116,7 +3298,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -3251,6 +3432,20 @@ "node": ">=6.0" } }, + "node_modules/chromium-bidi": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.8.0.tgz", + "integrity": "sha512-uJydbGdTw0DEUjhoogGveneJVWX/9YuqkWePzMmkBYwtdAqo5d3J/ovNKFr+/2hWXYmYCr6it8mSSTIj6SS6Ug==", + "license": "Apache-2.0", + "dependencies": { + "mitt": "3.0.1", + "urlpattern-polyfill": "10.0.0", + "zod": "3.23.8" + }, + "peerDependencies": { + "devtools-protocol": "*" + } + }, "node_modules/clean-css": { "version": "5.3.3", "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.3.tgz", @@ -3592,6 +3787,50 @@ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "license": "MIT" }, + "node_modules/cosmiconfig": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.0.tgz", + "integrity": "sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==", + "license": "MIT", + "dependencies": { + "env-paths": "^2.2.1", + "import-fresh": "^3.3.0", + "js-yaml": "^4.1.0", + "parse-json": "^5.2.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" + }, + "peerDependencies": { + "typescript": ">=4.9.5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/cosmiconfig/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "license": "Python-2.0" + }, + "node_modules/cosmiconfig/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/countly-request": { "resolved": "api/utils/countly-request", "link": true @@ -3636,57 +3875,6 @@ "node": ">= 10" } }, - "node_modules/cross-fetch": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", - "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", - "license": "MIT", - "dependencies": { - "node-fetch": "2.6.7" - } - }, - "node_modules/cross-fetch/node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "license": "MIT", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/cross-fetch/node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "license": "MIT" - }, - "node_modules/cross-fetch/node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "license": "BSD-2-Clause" - }, - "node_modules/cross-fetch/node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "license": "MIT", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "node_modules/cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -3826,6 +4014,15 @@ "node": ">=6" } }, + "node_modules/data-uri-to-buffer": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz", + "integrity": "sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==", + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, "node_modules/dateformat": { "version": "4.6.3", "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.6.3.tgz", @@ -3937,6 +4134,20 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/degenerator": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/degenerator/-/degenerator-5.0.1.tgz", + "integrity": "sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ==", + "license": "MIT", + "dependencies": { + "ast-types": "^0.13.4", + "escodegen": "^2.1.0", + "esprima": "^4.0.1" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -4000,9 +4211,9 @@ } }, "node_modules/devtools-protocol": { - "version": "0.0.1036444", - "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1036444.tgz", - "integrity": "sha512-0y4f/T8H9lsESV9kKP1HDUXgHxCdniFeJh6Erq+FbdOEvp/Ydp9t8kcAAM5gOd17pMrTDlFWntoHtzzeTUWKNw==", + "version": "0.0.1367902", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1367902.tgz", + "integrity": "sha512-XxtPuC3PGakY6PD7dG66/o8KwJ/LkH2/EKe19Dcw58w53dv4/vSQEkn/SzuyhHE2q4zPgCkxQBxus3VV4ql+Pg==", "license": "BSD-3-Clause" }, "node_modules/dezalgo": { @@ -4121,7 +4332,6 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "devOptional": true, "license": "MIT" }, "node_modules/emojis-list": { @@ -4198,7 +4408,6 @@ "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", "license": "MIT", - "optional": true, "engines": { "node": ">=6" } @@ -4232,6 +4441,21 @@ "string-template": "~0.2.1" } }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/error-ex/node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "license": "MIT" + }, "node_modules/errorhandler": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/errorhandler/-/errorhandler-1.5.1.tgz", @@ -4343,7 +4567,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -4368,6 +4591,37 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/escodegen": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", + "license": "BSD-2-Clause", + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/escodegen/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "license": "BSD-3-Clause", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/eslint": { "version": "8.57.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", @@ -4624,7 +4878,6 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, "license": "BSD-2-Clause", "engines": { "node": ">=4.0" @@ -4634,7 +4887,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, "license": "BSD-2-Clause", "engines": { "node": ">=0.10.0" @@ -4888,12 +5140,12 @@ } }, "node_modules/extract-zip/node_modules/debug": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", - "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "license": "MIT", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -4905,9 +5157,9 @@ } }, "node_modules/extract-zip/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT" }, "node_modules/fast-deep-equal": { @@ -4917,6 +5169,12 @@ "dev": true, "license": "MIT" }, + "node_modules/fast-fifo": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz", + "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==", + "license": "MIT" + }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -5574,7 +5832,6 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, "license": "ISC", "engines": { "node": "6.* || 8.* || >= 10.*" @@ -5636,6 +5893,44 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-uri": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.3.tgz", + "integrity": "sha512-BzUrJBS9EcUb4cFol8r4W3v1cPsSyajLSthNkz5BxbpDcHN5tIrM10E2eNvfnvBn3DaT3DUgx0OpsBKkaOpanw==", + "license": "MIT", + "dependencies": { + "basic-ftp": "^5.0.2", + "data-uri-to-buffer": "^6.0.2", + "debug": "^4.3.4", + "fs-extra": "^11.2.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/get-uri/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/get-uri/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, "node_modules/getobject": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/getobject/-/getobject-1.0.2.tgz", @@ -6664,6 +6959,7 @@ "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", "license": "MIT", + "optional": true, "dependencies": { "agent-base": "6", "debug": "4" @@ -6677,6 +6973,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", "license": "MIT", + "optional": true, "dependencies": { "ms": "2.1.2" }, @@ -6693,7 +6990,8 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "license": "MIT" + "license": "MIT", + "optional": true }, "node_modules/humanize-ms": { "version": "1.2.1", @@ -6782,7 +7080,6 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, "license": "MIT", "dependencies": { "parent-module": "^1.0.0", @@ -6955,7 +7252,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "devOptional": true, "license": "MIT", "engines": { "node": ">=8" @@ -7452,7 +7748,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true, "license": "MIT" }, "node_modules/js-yaml": { @@ -7629,7 +7924,6 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true, "license": "MIT" }, "node_modules/json-schema-traverse": { @@ -7902,6 +8196,12 @@ "node": ">= 8" } }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "license": "MIT" + }, "node_modules/linkify-it": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz", @@ -8540,6 +8840,12 @@ "node": ">= 8" } }, + "node_modules/mitt": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz", + "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==", + "license": "MIT" + }, "node_modules/mkdirp": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", @@ -8886,6 +9192,15 @@ "dev": true, "license": "MIT" }, + "node_modules/netmask": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz", + "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, "node_modules/nginx-conf": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/nginx-conf/-/nginx-conf-2.1.0.tgz", @@ -9720,6 +10035,113 @@ "node": ">=6" } }, + "node_modules/pac-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.0.2.tgz", + "integrity": "sha512-BFi3vZnO9X5Qt6NRz7ZOaPja3ic0PhlsmCRYLOpN11+mWBCR6XJDqW5RF3j8jm4WGGQZtBA+bTfxYzeKW73eHg==", + "license": "MIT", + "dependencies": { + "@tootallnate/quickjs-emscripten": "^0.23.0", + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "get-uri": "^6.0.1", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.5", + "pac-resolver": "^7.0.1", + "socks-proxy-agent": "^8.0.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/pac-proxy-agent/node_modules/agent-base": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "license": "MIT", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/pac-proxy-agent/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/pac-proxy-agent/node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/pac-proxy-agent/node_modules/https-proxy-agent": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", + "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/pac-proxy-agent/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/pac-proxy-agent/node_modules/socks-proxy-agent": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.4.tgz", + "integrity": "sha512-GNAq/eg8Udq2x0eNiFkr9gRg5bA7PXEWagQdeRX4cPSG+X/8V38v637gim9bjFptMk1QWsCTr0ttrJEiXbNnRw==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.1", + "debug": "^4.3.4", + "socks": "^2.8.3" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/pac-resolver": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-7.0.1.tgz", + "integrity": "sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg==", + "license": "MIT", + "dependencies": { + "degenerator": "^5.0.0", + "netmask": "^2.0.2" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/package-hash": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", @@ -9746,7 +10168,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, "license": "MIT", "dependencies": { "callsites": "^3.0.0" @@ -9797,6 +10218,24 @@ "integrity": "sha512-ft3iAoLOB/MlwbNXgzy43SWGP6sQki2jQvAyBg/zDFAgr9bfNWZIUj42Kw2eJIl8kEi4PbgE6U1Zau/HwI75HA==", "license": "MIT" }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/parse-passwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", @@ -9923,7 +10362,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", - "dev": true, "license": "ISC" }, "node_modules/picomatch": { @@ -10190,6 +10628,100 @@ "node": ">= 0.10" } }, + "node_modules/proxy-agent": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.4.0.tgz", + "integrity": "sha512-u0piLU+nCOHMgGjRbimiXmA9kM/L9EHh3zL81xCdp7m+Y2pHIsnmbdDoEDoAz5geaonNR6q6+yOPQs6n4T6sBQ==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "http-proxy-agent": "^7.0.1", + "https-proxy-agent": "^7.0.3", + "lru-cache": "^7.14.1", + "pac-proxy-agent": "^7.0.1", + "proxy-from-env": "^1.1.0", + "socks-proxy-agent": "^8.0.2" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/agent-base": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "license": "MIT", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/proxy-agent/node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/https-proxy-agent": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", + "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/proxy-agent/node_modules/socks-proxy-agent": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.4.tgz", + "integrity": "sha512-GNAq/eg8Udq2x0eNiFkr9gRg5bA7PXEWagQdeRX4cPSG+X/8V38v637gim9bjFptMk1QWsCTr0ttrJEiXbNnRw==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.1", + "debug": "^4.3.4", + "socks": "^2.8.3" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", @@ -10233,36 +10765,50 @@ } }, "node_modules/puppeteer": { - "version": "17.1.3", - "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-17.1.3.tgz", - "integrity": "sha512-tVtvNSOOqlq75rUgwLeDAEQoLIiBqmRg0/zedpI6fuqIocIkuxG23A7FIl1oVSkuSMMLgcOP5kVhNETmsmjvPw==", - "deprecated": "< 22.8.2 is no longer supported", + "version": "23.8.0", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-23.8.0.tgz", + "integrity": "sha512-MFWDMWoCcOpwNwQIjA9gPKWrEUbj8bLCzkK56w5lZPMUT6wK4FfpgOEPxKffVmXEMYMZzgcjxzqy15b/Q1ibaw==", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "cross-fetch": "3.1.5", - "debug": "4.3.4", - "devtools-protocol": "0.0.1036444", - "extract-zip": "2.0.1", - "https-proxy-agent": "5.0.1", - "progress": "2.0.3", - "proxy-from-env": "1.1.0", - "rimraf": "3.0.2", - "tar-fs": "2.1.1", - "unbzip2-stream": "1.4.3", - "ws": "8.8.1" + "@puppeteer/browsers": "2.4.1", + "chromium-bidi": "0.8.0", + "cosmiconfig": "^9.0.0", + "devtools-protocol": "0.0.1367902", + "puppeteer-core": "23.8.0", + "typed-query-selector": "^2.12.0" + }, + "bin": { + "puppeteer": "lib/cjs/puppeteer/node/cli.js" }, "engines": { - "node": ">=14.1.0" + "node": ">=18" } }, - "node_modules/puppeteer/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "node_modules/puppeteer-core": { + "version": "23.8.0", + "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-23.8.0.tgz", + "integrity": "sha512-c2ymGN2M//We7pC+JhP2dE/g4+qnT89BO+EMSZyJmecN3DN6RNqErA7eH7DrWoNIcU75r2nP4VHa4pswAL6NVg==", + "license": "Apache-2.0", + "dependencies": { + "@puppeteer/browsers": "2.4.1", + "chromium-bidi": "0.8.0", + "debug": "^4.3.7", + "devtools-protocol": "0.0.1367902", + "typed-query-selector": "^2.12.0", + "ws": "^8.18.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/puppeteer-core/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "license": "MIT", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -10273,28 +10819,12 @@ } } }, - "node_modules/puppeteer/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "node_modules/puppeteer-core/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT" }, - "node_modules/puppeteer/node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "deprecated": "Rimraf versions prior to v4 are no longer supported", - "license": "ISC", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/qs": { "version": "6.13.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", @@ -10330,6 +10860,12 @@ ], "license": "MIT" }, + "node_modules/queue-tick": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz", + "integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==", + "license": "MIT" + }, "node_modules/quick-lru": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", @@ -10528,7 +11064,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -10614,7 +11149,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, "license": "MIT", "engines": { "node": ">=4" @@ -11367,6 +11901,20 @@ "node": ">= 0.8" } }, + "node_modules/streamx": { + "version": "2.20.2", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.20.2.tgz", + "integrity": "sha512-aDGDLU+j9tJcUdPGOaHmVF1u/hhI+CsGkT02V3OKlHDV7IukOI+nTWAGkiZEKCO35rWN1wIr4tS7YFr1f4qSvA==", + "license": "MIT", + "dependencies": { + "fast-fifo": "^1.3.2", + "queue-tick": "^1.0.1", + "text-decoder": "^1.1.0" + }, + "optionalDependencies": { + "bare-events": "^2.2.0" + } + }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -11406,7 +11954,6 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "devOptional": true, "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", @@ -11421,7 +11968,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "devOptional": true, "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -11769,6 +12315,12 @@ "node": ">=8" } }, + "node_modules/text-decoder": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.1.tgz", + "integrity": "sha512-x9v3H/lTKIJKQQe7RPQkLfKAnc9lUTkWDypIQgTzPJAq+5/GCDHonmshfvlsNSj58yyshbIJJDLmU15qNERrXQ==", + "license": "Apache-2.0" + }, "node_modules/text-hex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", @@ -11978,6 +12530,12 @@ "node": ">= 0.6" } }, + "node_modules/typed-query-selector": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/typed-query-selector/-/typed-query-selector-2.12.0.tgz", + "integrity": "sha512-SbklCd1F0EiZOyPiW192rrHZzZ5sBijB6xM+cpmrwDqObvdtunOHHIk9fCGsoK5JVIYXoyEp4iEdE3upFH3PAg==", + "license": "MIT" + }, "node_modules/typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", @@ -12151,6 +12709,12 @@ "node": ">= 0.10" } }, + "node_modules/urlpattern-polyfill": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/urlpattern-polyfill/-/urlpattern-polyfill-10.0.0.tgz", + "integrity": "sha512-H/A06tKD7sS1O1X2SshBVeA5FLycRpjqiBeqGKmBwBDBy28EnRjORxTNe269KSSr5un5qyWi1iL61wLxpd+ZOg==", + "license": "MIT" + }, "node_modules/utif2": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/utif2/-/utif2-4.1.0.tgz", @@ -12620,7 +13184,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", @@ -12654,16 +13217,16 @@ } }, "node_modules/ws": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.8.1.tgz", - "integrity": "sha512-bGy2JzvzkPowEJV++hF07hAD6niYSr0JzBNo/J29WsB57A2r7Wlc1UFcTR9IzrPvuNVO4B8LGqF8qcpsVOhJCA==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", "license": "MIT", "engines": { "node": ">=10.0.0" }, "peerDependencies": { "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" + "utf-8-validate": ">=5.0.2" }, "peerDependenciesMeta": { "bufferutil": { @@ -12743,7 +13306,6 @@ "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true, "license": "ISC", "engines": { "node": ">=10" @@ -12883,6 +13445,15 @@ "engines": { "node": ">= 10" } + }, + "node_modules/zod": { + "version": "3.23.8", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", + "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } } } } diff --git a/package.json b/package.json index fc64d85e593..b1ff9c9d76a 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ "object-hash": "3.0.0", "offline-geocoder": "git+https://github.com/Countly/offline-geocoder.git", "properties-parser": "0.6.0", - "puppeteer": "17.1.3", + "puppeteer": "^23.8.0", "sass": "1.79.4", "tslib": "^2.6.3", "uglify-js": "3.19.3", From 1bca58609816d99c57c226d00dea6731c6b3ab65 Mon Sep 17 00:00:00 2001 From: John-Weak Date: Mon, 18 Nov 2024 09:43:55 +0530 Subject: [PATCH 07/70] rhel puppeteer dep fix --- bin/countly.install_rhel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/countly.install_rhel.sh b/bin/countly.install_rhel.sh index 2fbd19bcee8..25e60f03eea 100644 --- a/bin/countly.install_rhel.sh +++ b/bin/countly.install_rhel.sh @@ -55,7 +55,7 @@ else fi #Install dependancies required by the puppeteer -sudo dnf install -y alsa-lib.x86_64 atk.x86_64 cups-libs.x86_64 gtk3.x86_64 libXcomposite.x86_64 libXcursor.x86_64 libXdamage.x86_64 libXext.x86_64 libXi.x86_64 libXrandr.x86_64 GConf2.x86_64 libXScrnSaver.x86_64 libXtst.x86_64 pango.x86_64 xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-fonts-cyrillic xorg-x11-fonts-misc xorg-x11-fonts-Type1 xorg-x11-utils +sudo dnf install -y alsa-lib.x86_64 atk.x86_64 cups-libs.x86_64 gtk3.x86_64 libXcomposite.x86_64 libXcursor.x86_64 libXdamage.x86_64 libXext.x86_64 libXi.x86_64 libXrandr.x86_64 GConf2.x86_64 libXScrnSaver.x86_64 libXtst.x86_64 pango.x86_64 xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-fonts-cyrillic xorg-x11-fonts-misc xorg-x11-fonts-Type1 xorg-x11-utils libdrm libgbm at-spi2-atk libxkbcommon #Install nss after installing above dependencies sudo dnf update -y nss From 8a165c6692a28a7f29eeddd969129cf06c770724 Mon Sep 17 00:00:00 2001 From: John-Weak Date: Mon, 18 Nov 2024 09:44:13 +0530 Subject: [PATCH 08/70] docker puppeteer cannot launch browser fix --- Dockerfile-api | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Dockerfile-api b/Dockerfile-api index 294492c65e3..9f2325b79e0 100644 --- a/Dockerfile-api +++ b/Dockerfile-api @@ -17,8 +17,12 @@ ENV COUNTLY_CONTAINER="api" \ COUNTLY_CONFIG_API_API_WORKERS="1" \ COUNTLY_CONFIG_API_API_HOST="0.0.0.0" \ NODE_OPTIONS="--max-old-space-size=2048" \ - TINI_VERSION="0.18.0" - + TINI_VERSION="0.18.0"\ + PUPPETEER_CACHE_DIR=/opt/countly/.cache/puppeteer\ + #https://github.com/hardkoded/puppeteer-sharp/issues/2633 + XDG_CONFIG_HOME=/tmp/.chromium\ + XDG_CACHE_HOME=/tmp/.chromium + WORKDIR /opt/countly COPY . . @@ -58,7 +62,7 @@ RUN curl -s -L -o /tmp/tini.deb "https://github.com/krallin/tini/releases/downlo # cleanup & chown npm remove -y --no-save mocha nyc should supertest && \ apt-get remove -y git gcc g++ make automake autoconf libtool pkg-config unzip sqlite3 && \ - apt-get install -y libgbm-dev libgbm1 gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils && \ + apt-get install -y libgbm-dev libgbm1 gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils && \ apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ rm -rf test /tmp/* /tmp/.??* /var/tmp/* /var/tmp/.??* /var/log/* /root/.npm && \ \ @@ -75,4 +79,4 @@ USER 1001:0 ENTRYPOINT ["/usr/bin/tini", "-v", "--"] -CMD ["/opt/countly/bin/docker/cmd.sh"] +CMD ["/opt/countly/bin/docker/cmd.sh"] \ No newline at end of file From d38b2f8273a25df983f9da73b979fe83360edbb8 Mon Sep 17 00:00:00 2001 From: John-Weak Date: Mon, 18 Nov 2024 10:30:02 +0530 Subject: [PATCH 09/70] login page check --- api/utils/render.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/api/utils/render.js b/api/utils/render.js index 59c511d2fd7..3654ef9982b 100644 --- a/api/utils/render.js +++ b/api/utils/render.js @@ -118,8 +118,11 @@ exports.renderView = function(options, cb) { }; page.setDefaultNavigationTimeout(updatedTimeout); - - await page.goto(host + '/login/token/' + token + '?ssr=true'); + const resp = await page.goto(host + '/login/token/' + token + '?ssr=true'); + const status = resp?.status(); + if (status !== 200) { + throw new Error(`Failed to open login page. Status: ${status}`); + } await page.waitForSelector('countly', {timeout: updatedTimeout}); From a703ca472e8801ee93c239c170a716aaa5b2920e Mon Sep 17 00:00:00 2001 From: John-Weak Date: Mon, 18 Nov 2024 15:10:47 +0530 Subject: [PATCH 10/70] [fix] use alternate naming convention --- .puppeteerrc.cjs => puppeteer.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .puppeteerrc.cjs => puppeteer.config.js (78%) diff --git a/.puppeteerrc.cjs b/puppeteer.config.js similarity index 78% rename from .puppeteerrc.cjs rename to puppeteer.config.js index 50f2259c143..312612ea509 100644 --- a/.puppeteerrc.cjs +++ b/puppeteer.config.js @@ -1,6 +1,6 @@ const path = require('path'); const countlyDir = __dirname; -const puppeteerInstallPath= path.join(countlyDir, '.cache', 'puppeteer') +const puppeteerInstallPath = path.join(countlyDir, '.cache', 'puppeteer'); /** * @type {import("puppeteer").Configuration} */ From 0323904c5e3482561fbc8261186b87ee3de094f0 Mon Sep 17 00:00:00 2001 From: John-Weak Date: Tue, 19 Nov 2024 18:06:47 +0530 Subject: [PATCH 11/70] [fix] chrome crashpad error for rhel 8 --- Dockerfile-api | 5 +---- api/utils/render.js | 5 +++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile-api b/Dockerfile-api index 9f2325b79e0..bcb05f12885 100644 --- a/Dockerfile-api +++ b/Dockerfile-api @@ -18,10 +18,7 @@ ENV COUNTLY_CONTAINER="api" \ COUNTLY_CONFIG_API_API_HOST="0.0.0.0" \ NODE_OPTIONS="--max-old-space-size=2048" \ TINI_VERSION="0.18.0"\ - PUPPETEER_CACHE_DIR=/opt/countly/.cache/puppeteer\ - #https://github.com/hardkoded/puppeteer-sharp/issues/2633 - XDG_CONFIG_HOME=/tmp/.chromium\ - XDG_CACHE_HOME=/tmp/.chromium + PUPPETEER_CACHE_DIR=/opt/countly/.cache/puppeteer WORKDIR /opt/countly COPY . . diff --git a/api/utils/render.js b/api/utils/render.js index 3654ef9982b..ba65f9d11cc 100644 --- a/api/utils/render.js +++ b/api/utils/render.js @@ -62,6 +62,11 @@ exports.renderView = function(options, cb) { var settings = { headless: true, + env: { + //https://github.com/hardkoded/puppeteer-sharp/issues/2633 + XDG_CONFIG_HOME: pathModule.resolve(__dirname, "../../.cache/chrome/tmp/.chromium"), + XDG_CACHE_HOME: pathModule.resolve(__dirname, "../../.cache/chrome/tmp/.chromium") + }, args: ['--no-sandbox', '--disable-setuid-sandbox'], ignoreHTTPSErrors: true, userDataDir: pathModule.resolve(__dirname, "../../dump/chrome") From db49b0f07215dc99a867f06337861a23340806d1 Mon Sep 17 00:00:00 2001 From: Tushar Bali Date: Thu, 21 Nov 2024 15:45:35 +0530 Subject: [PATCH 12/70] removed duplicate package --- Dockerfile-api | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile-api b/Dockerfile-api index bcb05f12885..50dc31dd29f 100644 --- a/Dockerfile-api +++ b/Dockerfile-api @@ -59,7 +59,7 @@ RUN curl -s -L -o /tmp/tini.deb "https://github.com/krallin/tini/releases/downlo # cleanup & chown npm remove -y --no-save mocha nyc should supertest && \ apt-get remove -y git gcc g++ make automake autoconf libtool pkg-config unzip sqlite3 && \ - apt-get install -y libgbm-dev libgbm1 gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils && \ + apt-get install -y libgbm-dev libgbm1 gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils && \ apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ rm -rf test /tmp/* /tmp/.??* /var/tmp/* /var/tmp/.??* /var/log/* /root/.npm && \ \ From 0764b43e60676b44d8dc36951a6a190527c797c1 Mon Sep 17 00:00:00 2001 From: Cihad Tekin Date: Thu, 21 Nov 2024 18:00:49 +0300 Subject: [PATCH 13/70] [core] taskmanager: removed the ability to stop a mongo operation for singlestore --- api/utils/requestProcessor.js | 11 -- api/utils/taskmanager.js | 123 +----------------- .../javascripts/countly.views.js | 29 ----- 3 files changed, 1 insertion(+), 162 deletions(-) diff --git a/api/utils/requestProcessor.js b/api/utils/requestProcessor.js index a026ff95903..d9d51af3bc0 100755 --- a/api/utils/requestProcessor.js +++ b/api/utils/requestProcessor.js @@ -828,17 +828,6 @@ const processRequest = (params) => { }); }); break; - case 'stop': - validateUserForWrite(params, () => { - taskmanager.stopTask({ - db: common.db, - id: params.qstring.task_id, - op_id: params.qstring.op_id - }, (err, res) => { - common.returnMessage(params, 200, res); - }); - }); - break; case 'delete': validateUserForWrite(params, () => { taskmanager.deleteResult({ diff --git a/api/utils/taskmanager.js b/api/utils/taskmanager.js index 15f05687d25..cfcf1b1f8c0 100644 --- a/api/utils/taskmanager.js +++ b/api/utils/taskmanager.js @@ -58,7 +58,7 @@ const log = require('./log.js')('core:taskmanager'); * }, outputData:function(err, data){ * common.returnOutput(params, data); * } -* })); +* })); */ taskmanager.longtask = function(options) { options.db = options.db || common.db; @@ -66,80 +66,6 @@ taskmanager.longtask = function(options) { var start = new Date().getTime(); var timeout; - var saveOpId = async function(comment_id, retryCount) { - common.db.admin().command({ currentOp: 1 }, async function(error, result) { - if (error) { - log.d(error); - return; - } - else { - if (result && result.inprog) { - for (var i = 0; i < result.inprog.length; i++) { - let op = result.inprog[i]; - if (!('$truncated' in op.command) && (i !== result.inprog.length - 1)) { - continue; - } - if (!('$truncated' in op.command) && (i === result.inprog.length - 1)) { - if (retryCount < 3) { - setTimeout(() => saveOpId(comment_id, (++retryCount)), 500); - return; - } - else { - log.d(`operation not found for task:${options.id} comment: ${comment_id}`); - break; - } - } - - let comment_position = op.command.$truncated.indexOf('$comment'); - if (comment_position === -1) { - continue; - } - - let substr = op.command.$truncated.substring(comment_position, op.command.$truncated.length) || ""; - var comment_val = ""; - substr = substr.match(/"(.*?)"/); - if (substr && Array.isArray(substr)) { - comment_val = substr[1]; - } - - if (comment_val === comment_id) { - var task_id = options.id; - var op_id = op.opid; - await common.db.collection("long_tasks").findOneAndUpdate({ _id: common.db.ObjectID(task_id) }, { $set: { op_id: op_id } }); - log.d(`Operation found task: ${task_id} op:${op_id} comment: ${comment_id}`); - break; - } - else if ((comment_val !== comment_id) && (i === (result.inprog.length - 1))) { - if (retryCount < 3) { - setTimeout(() => saveOpId(comment_id, (++retryCount)), 500); - break; - } - else { - log.d(`operation not found for task:${options.id} comment: ${comment_id}`); - break; - } - } - } - } - } - }); - }; - - if (options.comment_id) { - var retryCount = 0; - try { - saveOpId(options.comment_id, retryCount); - } - catch (err) { - if (retryCount < 3) { - setTimeout(() =>saveOpId(options.comment_id, ++retryCount), 500); - } - else { - console.log(err); - } - } - } - /** switching to long task */ function switchToLongTask() { timeout = null; @@ -298,9 +224,6 @@ taskmanager.createTask = function(options, callback) { update.subtask_key = options.subtask_key || ""; update.taskgroup = options.taskgroup || false; update.linked_to = options.linked_to; - if (options.comment_id) { - update.comment_id = options.comment_id; - } if (options.subtask && options.subtask !== "") { update.subtask = options.subtask; var updateSub = {$set: {}}; @@ -1117,50 +1040,6 @@ taskmanager.rerunTask = function(options, callback) { }); }; -taskmanager.stopTask = function(options, callback) { - options.db = options.db || common.db; - - /** - * Stop task - * @param {object} op_id - operation id for mongo process - * @param {object} options1.db - database connection - * @param {string} options1.id - id of the task result - * @param {object} reqData - request data - * @param {funciton} callback1 - callback for the result - */ - function stopTask(op_id) { - common.db.admin().command({ killOp: 1, op: Number.parseInt(op_id) }, function(error, result) { - if (result.ok === 1) { - callback(null, "Success"); - } - else { - callback(null, "Operation could not be stopped"); - } - }); - } - - options.db.collection("long_tasks").findOne({ _id: options.id }, function(err, res) { - if (res) { - if (res.creator) { - options.db.collection("members").findOne({ _id: common.db.ObjectID(res.creator) }, function(err1, member) { - if (member) { - stopTask(res.op_id); - } - else { - callback(null, "No permission to stop this task"); - } - }); - } - else { - stopTask(res.op_id); - } - } - else { - callback(null, "Task does not exist"); - } - }); -}; - /** * Create a callback for getting result, including checking gridfs * @param {function} callback - callback for the result diff --git a/frontend/express/public/core/report-manager/javascripts/countly.views.js b/frontend/express/public/core/report-manager/javascripts/countly.views.js index e1f5fae8232..0b33ac3874e 100644 --- a/frontend/express/public/core/report-manager/javascripts/countly.views.js +++ b/frontend/express/public/core/report-manager/javascripts/countly.views.js @@ -127,9 +127,6 @@ canDeleteReport: function() { return countlyGlobal.member.global_admin || countlyGlobal.admin_apps[countlyCommon.ACTIVE_APP_ID]; }, - canStopReport: function() { - return countlyGlobal.member.global_admin || countlyGlobal.admin_apps[countlyCommon.ACTIVE_APP_ID]; - }, query: function() { var q = {}; if (this.fixedOrigin) { @@ -316,14 +313,6 @@ isDownloadable: function(row) { return ["views", "dbviewer", "tableExport"].includes(row.type); }, - isStopable: function(row) { - if (row.status === "running" && row.op_id && row.comment_id) { - return true; - } - else { - return false; - } - }, isReadyForView: function(row) { if (row.linked_to) { if (row.have_dashboard_widget) { @@ -342,7 +331,6 @@ }, handleCommand: function(command, row) { var id = row._id, - op_id = row.op_id, self = this; if (id) { @@ -378,23 +366,6 @@ }); }, [CV.i18n("common.no-dont-do-that"), CV.i18n("taskmanager.yes-rerun-task")], {title: CV.i18n("taskmanager.confirm-rerun-title"), image: "rerunning-task"}); } - else if (command === "stop-task") { - CountlyHelpers.confirm(CV.i18n("taskmanager.confirm-stop"), "popStyleGreen", function(result) { - if (!result) { - return true; - } - self.refresh(); - countlyTaskManager.stop(id, op_id, function(res, error) { - if (res.result === "Success") { - countlyTaskManager.monitor(id, true); - self.refresh(); - } - else { - CountlyHelpers.alert(error, "red"); - } - }); - }, [CV.i18n("common.no-dont-do-that"), CV.i18n("taskmanager.yes-stop-task")], {title: CV.i18n("taskmanager.confirm-stop-title"), image: "rerunning-task"}); - } else if (command === "view-task") { self.$emit("view-task", row); if (!this.disableAutoNavigationToTask) { From 44dd24422d54519d76f8fbc5d6ff6eb8129e596f Mon Sep 17 00:00:00 2001 From: Kanwar Ujjaval Singh <4216199+kanwarujjaval@users.noreply.github.com> Date: Thu, 21 Nov 2024 23:36:48 +0530 Subject: [PATCH 14/70] Fixes issue where dashboard widgets go into single column when refresh happens in responsive mobile view --- plugins/dashboards/README.md | 44 +++++++++++++++++++ .../public/javascripts/countly.views.js | 32 +++++++------- 2 files changed, 61 insertions(+), 15 deletions(-) create mode 100644 plugins/dashboards/README.md diff --git a/plugins/dashboards/README.md b/plugins/dashboards/README.md new file mode 100644 index 00000000000..e3e7757b67f --- /dev/null +++ b/plugins/dashboards/README.md @@ -0,0 +1,44 @@ +# Custom Dashboards + +## Dashboard Frontend request & grid interaction flow +```mermaid + +graph TD + A[User Initiates Refresh] --> B{Check Conditions} + B -->|Conditions Met| C[refresh method] + B -->|Conditions Not Met| Z[Skip Refresh] + + C --> D{isRequestSane} + D -->|Yes| E[dateChanged method] + D -->|No| Y[Mark Request Sane] + Y --> Z + + E --> F[dispatch getDashboard action] + F --> G[Server Request] + G --> H{Check isSane} + H -->|Yes| I[Update Vuex Store] + H -->|No| X[Skip Update] + + I --> J[validateWidgets method] + J --> K[Update Grid] + + L[Grid Interaction Starts] --> M[Set gridInteraction true] + M --> N[Mark Request Not Sane] + + O[Grid Interaction Ends] --> P[updateAllWidgetsGeography] + P --> Q[Set gridInteraction false] + Q --> R[Mark Request Sane] + + S[Widget Resize/Move] --> T[grid.on 'change' event] + T --> U[Update Widget in Store] + + V[New Widget Added] --> W[grid.on 'added' event] + W --> X1[Update Widget Size/Position] + X1 --> Y1[Add to Vuex Store] + + style A fill:#f9f,stroke:#333,stroke-width:2px + style L fill:#f9f,stroke:#333,stroke-width:2px + style S fill:#f9f,stroke:#333,stroke-width:2px + style V fill:#f9f,stroke:#333,stroke-width:2px + +``` \ No newline at end of file diff --git a/plugins/dashboards/frontend/public/javascripts/countly.views.js b/plugins/dashboards/frontend/public/javascripts/countly.views.js index 7e309889e39..6f6a15850f8 100644 --- a/plugins/dashboards/frontend/public/javascripts/countly.views.js +++ b/plugins/dashboards/frontend/public/javascripts/countly.views.js @@ -1169,22 +1169,24 @@ }); this.grid.on('change', function(event, items) { - items.forEach(item => { - self.updateWidgetGeography( - item.id, - { - size: [item.w, item.h], - position: [item.x, item.y] - } - ); - }); - _.debounce(function() { - self.$nextTick(function() { - setTimeout(function() { - self.customCompact(self.grid); - }, 10); + if (self.grid.opts && self.grid.opts.column && self.grid.opts.column === 12) { + items.forEach(item => { + self.updateWidgetGeography( + item.id, + { + size: [item.w, item.h], + position: [item.x, item.y] + } + ); }); - }, 400)(); + _.debounce(function() { + self.$nextTick(function() { + setTimeout(function() { + self.customCompact(self.grid); + }, 10); + }); + }, 400)(); + } }); this.grid.on("removed", function() { From f82ed22549ca29af24dc88b1e337b94188e6c160 Mon Sep 17 00:00:00 2001 From: Meghana M R <86944692+mrmeghana@users.noreply.github.com> Date: Fri, 22 Nov 2024 21:08:29 +0530 Subject: [PATCH 15/70] Update compare_drill_aggregated.js to support merged drill collections --- .../data-reports/compare_drill_aggregated.js | 67 +++++++++++++++++-- 1 file changed, 60 insertions(+), 7 deletions(-) diff --git a/bin/scripts/data-reports/compare_drill_aggregated.js b/bin/scripts/data-reports/compare_drill_aggregated.js index 6a16af89c9d..26faf6d79d2 100644 --- a/bin/scripts/data-reports/compare_drill_aggregated.js +++ b/bin/scripts/data-reports/compare_drill_aggregated.js @@ -10,6 +10,9 @@ var period = "7days"; //Chose any of formats: "Xdays" ("7days","100days") or [" var app_list = []; //List with apps //Example var eventMap = {"6075f94b7e5e0d392902520c":["Logout","Login"],"6075f94b7e5e0d392902520d":["Logout","Login","Buy"]}; var eventMap = {}; //If left empty will run for all alls/events. + +var union_with_old_collection = false; //False if all sessions are stored in drill_events collection + var verbose = false; //true to show more output @@ -151,11 +154,39 @@ Promise.all([pluginManager.dbConnection("countly"), pluginManager.dbConnection(" } } if (haveAnything) { - console.log(" " + JSON.stringify(report)); + let aggCount = totals.c || 0; + let drillCount = drillData.totals.c || 0; + let percentageDiff = 0; + if (drillCount !== 0) { + percentageDiff = ((drillCount - aggCount) / drillCount) * 100; + } + else { + if (aggCount !== 0) { + // If drillCount is 0, and aggCount is not 0, show a large difference + percentageDiff = (aggCount > 0 ? 100 : -100); // 100% or -100% depending on the sign of aggCount + } else { + percentageDiff = 0; // Both counts are 0, no difference + } + } + + console.log("----------------------------------------------"); + console.log("- Application name:", app.name); + console.log("- Event name:", event); + console.log("- Counts in Aggregated data:", aggCount); + console.log("- Counts in Drill data:", drillCount); + console.log("- Percentage difference between Drill data and Aggregated data:", percentageDiff.toFixed(2) + "%"); + console.log("----------------------------------------------"); endReport[app._id]["bad"]++; endReport[app._id]["events"] = endReport[app._id]["events"] || {}; - endReport[app._id]["events"][event] = {"e": event, report: report}; + endReport[app._id]["events"][event] = { + "e": event, + "aggregated_count": aggCount, + "drill_count": drillCount, + "percentage_difference": percentageDiff.toFixed(2), + "report": report + }; } + resolve2(); }); } @@ -164,6 +195,26 @@ Promise.all([pluginManager.dbConnection("countly"), pluginManager.dbConnection(" }).then(function() { console.log("Finished processing app: ", app.name); resolve(); + + //Complete CSV after processing the apps + console.log("\nSummary Report (CSV-like):"); + console.log("App,Event,Aggregated,Drill,% Difference"); + var csvRows = ["App,Event,Aggregated,Drill,% Difference"]; + for (var appId in endReport) { + var appData = endReport[appId]; + var appName = appData.name; + if (appData.events) { + for (var event in appData.events) + { + var eventData = appData.events[event]; + var row = `${appName},${event},${eventData.aggregated_count},${eventData.drill_count},${eventData.percentage_difference}`; + console.log(row); + csvRows.push(row); + } + } + } + + }).catch(function(eee) { console.log("Error processing app: ", app.name); console.log(eee); @@ -207,14 +258,16 @@ Promise.all([pluginManager.dbConnection("countly"), pluginManager.dbConnection(" } endDate = endDate.valueOf() - endDate.utcOffset() * 60000; - let collection = "drill_events" + crypto.createHash('sha1').update(options.event + options.app_id).digest('hex'); var query = {"ts": {"$gte": startDate, "$lt": endDate}}; - var pipeline = [ - {"$match": query}, - ]; + var pipeline=[]; + if(union_with_old_collection) + { + let collection = "drill_events" + crypto.createHash('sha1').update(options.event + options.app_id).digest('hex'); + pipeline.push({"$match": query}); + } pipeline.push({"$group": {"_id": "$d", "c": {"$sum": "$c"}, "s": {"$sum": "$s"}, "dur": {"$sum": "$dur"}}}); - options.drillDb.collection(collection).aggregate(pipeline, {"allowDiskUse": true}).toArray(function(err, data) { + options.drillDb.collection("drill_events").aggregate(pipeline, {"allowDiskUse": true}).toArray(function(err, data) { if (err) { console.log(err); } From 408ad93580c2b77e7cc054361c50d5b862ca46a6 Mon Sep 17 00:00:00 2001 From: Meghana M R <86944692+mrmeghana@users.noreply.github.com> Date: Mon, 25 Nov 2024 13:19:31 +0530 Subject: [PATCH 16/70] Update compare_drill_aggregated_new.js --- .../data-reports/compare_drill_aggregated.js | 45 ++++++++++--------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/bin/scripts/data-reports/compare_drill_aggregated.js b/bin/scripts/data-reports/compare_drill_aggregated.js index 26faf6d79d2..210d53feaec 100644 --- a/bin/scripts/data-reports/compare_drill_aggregated.js +++ b/bin/scripts/data-reports/compare_drill_aggregated.js @@ -7,11 +7,11 @@ * node compare_drill_aggregated.js */ var period = "7days"; //Chose any of formats: "Xdays" ("7days","100days") or ["1-1-2024", "1-10-2024"], -var app_list = []; //List with apps +var app_list = ["670cc37eb89933fa76e0f448"]; //List with apps //Example var eventMap = {"6075f94b7e5e0d392902520c":["Logout","Login"],"6075f94b7e5e0d392902520d":["Logout","Login","Buy"]}; var eventMap = {}; //If left empty will run for all alls/events. -var union_with_old_collection = false; //False if all sessions are stored in drill_events collection +var union_with_old_collection = true; //False if all sessions are stored in drill_events collection var verbose = false; //true to show more output @@ -164,11 +164,12 @@ Promise.all([pluginManager.dbConnection("countly"), pluginManager.dbConnection(" if (aggCount !== 0) { // If drillCount is 0, and aggCount is not 0, show a large difference percentageDiff = (aggCount > 0 ? 100 : -100); // 100% or -100% depending on the sign of aggCount - } else { + } + else { percentageDiff = 0; // Both counts are 0, no difference } } - + console.log("----------------------------------------------"); console.log("- Application name:", app.name); console.log("- Event name:", event); @@ -186,7 +187,7 @@ Promise.all([pluginManager.dbConnection("countly"), pluginManager.dbConnection(" "report": report }; } - + resolve2(); }); } @@ -199,20 +200,19 @@ Promise.all([pluginManager.dbConnection("countly"), pluginManager.dbConnection(" //Complete CSV after processing the apps console.log("\nSummary Report (CSV-like):"); console.log("App,Event,Aggregated,Drill,% Difference"); - var csvRows = ["App,Event,Aggregated,Drill,% Difference"]; + // var csvRows = ["App,Event,Aggregated,Drill,% Difference"]; for (var appId in endReport) { - var appData = endReport[appId]; - var appName = appData.name; - if (appData.events) { - for (var event in appData.events) - { - var eventData = appData.events[event]; - var row = `${appName},${event},${eventData.aggregated_count},${eventData.drill_count},${eventData.percentage_difference}`; - console.log(row); - csvRows.push(row); - } + var appData = endReport[appId]; + var appName = appData.name; + if (appData.events) { + for (var event in appData.events) { + var eventData = appData.events[event]; + var row = `${appName},${event},${eventData.aggregated_count},${eventData.drill_count},${eventData.percentage_difference}`; + console.log(row); + //csvRows.push(row); + } + } } - } }).catch(function(eee) { @@ -258,12 +258,13 @@ Promise.all([pluginManager.dbConnection("countly"), pluginManager.dbConnection(" } endDate = endDate.valueOf() - endDate.utcOffset() * 60000; - var query = {"ts": {"$gte": startDate, "$lt": endDate}}; - var pipeline=[]; - if(union_with_old_collection) - { - let collection = "drill_events" + crypto.createHash('sha1').update(options.event + options.app_id).digest('hex'); + var query = {"ts": {"$gte": startDate, "$lt": endDate}, "a": options.app_id, "e": options.event}; + var pipeline = []; pipeline.push({"$match": query}); + if (union_with_old_collection) { + let collection = "drill_events" + crypto.createHash('sha1').update(options.event + options.app_id).digest('hex'); + var query2 = {"ts": {"$gte": startDate, "$lt": endDate}}; + pipeline.push({"$unionWith": { "coll": collection, "pipeline": [{"$match": query2}] }}); } pipeline.push({"$group": {"_id": "$d", "c": {"$sum": "$c"}, "s": {"$sum": "$s"}, "dur": {"$sum": "$dur"}}}); From cce0afd8edaeaba3db994b9916a8e030b0e5fc1d Mon Sep 17 00:00:00 2001 From: Meghana M R <86944692+mrmeghana@users.noreply.github.com> Date: Mon, 25 Nov 2024 13:20:47 +0530 Subject: [PATCH 17/70] Update compare_drill_aggregated_new.js --- bin/scripts/data-reports/compare_drill_aggregated.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/scripts/data-reports/compare_drill_aggregated.js b/bin/scripts/data-reports/compare_drill_aggregated.js index 210d53feaec..c93529488e9 100644 --- a/bin/scripts/data-reports/compare_drill_aggregated.js +++ b/bin/scripts/data-reports/compare_drill_aggregated.js @@ -7,7 +7,7 @@ * node compare_drill_aggregated.js */ var period = "7days"; //Chose any of formats: "Xdays" ("7days","100days") or ["1-1-2024", "1-10-2024"], -var app_list = ["670cc37eb89933fa76e0f448"]; //List with apps +var app_list = []; //List with apps "" //Example var eventMap = {"6075f94b7e5e0d392902520c":["Logout","Login"],"6075f94b7e5e0d392902520d":["Logout","Login","Buy"]}; var eventMap = {}; //If left empty will run for all alls/events. From c549e3d44dd17047df6b7bcd7a3eefd39af52d9d Mon Sep 17 00:00:00 2001 From: Cookiezaurs <> Date: Mon, 25 Nov 2024 15:56:58 +0200 Subject: [PATCH 18/70] [core] Loading configs before processing aggregated data regeneration --- bin/scripts/fix-data/regenerate_aggregated_data.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/scripts/fix-data/regenerate_aggregated_data.js b/bin/scripts/fix-data/regenerate_aggregated_data.js index 2e7aaa1b98c..1a69ee7b644 100644 --- a/bin/scripts/fix-data/regenerate_aggregated_data.js +++ b/bin/scripts/fix-data/regenerate_aggregated_data.js @@ -40,6 +40,12 @@ Promise.all([pluginManager.dbConnection("countly"), pluginManager.dbConnection(" query._id = {$in: appList.map(app_id=>common.db.ObjectID(app_id))}; } const apps = await countlyDb.collection("apps").find(query, {_id: 1, name: 1, timezone: 1}).toArray(); + + await new Promise((resolve)=>{ + common.plugins.loadConfigs(countlyDb, function() { + resolve(); + }); + }); if (!apps || !apps.length) { return close(); } From 7deb6469475f9b25bb4273cd1b8caa1fa79ec6e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Art=C5=ABrs=20Kadi=C4=B7is?= Date: Mon, 25 Nov 2024 17:42:59 +0200 Subject: [PATCH 19/70] changelog --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fe66576f8c..eee3cbac916 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## Version 24.05.XX +Fixes: +- [dashboards] Fixing issue where dashboard widgets go into single column + ## Version 24.05.18 Fixes: - [core] Fixed bug where changing passwords results in the loss of the "Global Admin" role @@ -79,7 +83,7 @@ Enterprise Features: ## Version 24.05.12 Fixes: - [dashboards] Fixes for dashboards grid -- [dasboards] UI fix for dashboard widget action menu +- [dashboards] UI fix for dashboard widget action menu - [push] Refactored fcm API related code - [reports] Use config for encryption key in reports From 98c1f0829e5822d6ac43ed41927c0ca1a406f4f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=B1nar=20Gen=C3=A7?= Date: Mon, 25 Nov 2024 20:40:08 +0300 Subject: [PATCH 20/70] fix: CSS issues on "cly-vue-notification" component --- .../public/javascripts/countly/vue/components/helpers.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/express/public/javascripts/countly/vue/components/helpers.js b/frontend/express/public/javascripts/countly/vue/components/helpers.js index 89ee0b477ad..976ecba4dab 100644 --- a/frontend/express/public/javascripts/countly/vue/components/helpers.js +++ b/frontend/express/public/javascripts/countly/vue/components/helpers.js @@ -985,10 +985,10 @@ class="cly-vue-notification__alert-box" :class="dynamicClasses" > -
+
@@ -1024,7 +1024,7 @@
From e10df0cffeb209d6711ae66e63f417d129abb7c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=B1nar=20Gen=C3=A7?= Date: Mon, 25 Nov 2024 20:41:43 +0300 Subject: [PATCH 21/70] fix: Implemented text truncation for long strings to prevent UI distortion --- .../countly/vue/templates/content/content-header.html | 2 +- frontend/express/public/stylesheets/vue/clyvue.scss | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/express/public/javascripts/countly/vue/templates/content/content-header.html b/frontend/express/public/javascripts/countly/vue/templates/content/content-header.html index ac130e25d76..08e01102c7d 100644 --- a/frontend/express/public/javascripts/countly/vue/templates/content/content-header.html +++ b/frontend/express/public/javascripts/countly/vue/templates/content/content-header.html @@ -16,7 +16,7 @@
-

{{ localTitle }}

+

{{ localTitle }}

Date: Tue, 26 Nov 2024 15:21:29 +0530 Subject: [PATCH 22/70] es2023 for backend and content specific eslint --- .eslintrc.json | 89 ++++++++++++++++++++++++++++++++------------------ package.json | 2 ++ 2 files changed, 60 insertions(+), 31 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index eff3130e53d..5f131bf4f5d 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -121,6 +121,60 @@ ] }, "overrides": [ + { + "files": [ + "plugins/content/frontend/vite.config.js", + "plugins/journey_engine/frontend/vite.config.js", + "plugins/journey_engine/frontend/vite-manifest.js" + ], + "rules": { + "no-console": "off" + }, + "parserOptions": { + "ecmaVersion": 2023, + "sourceType": "module" + }, + "env": { + "node": true, + "es2023": true + } + }, + { + "files": [ + "plugins/content/frontend/content-blocks/**/*.js", + "plugins/journey_engine/frontend/builder/**/*.js" + ], + "extends": [ + "eslint:recommended", + "plugin:vue/vue3-essential", + "plugin:vue/vue3-strongly-recommended", + "plugin:vue/vue3-recommended" + ], + "rules": { + "no-console": ["error"] + }, + "plugins": [ + "vue", + "@stylistic" + ], + "parserOptions": { + "ecmaVersion": 2023, + "sourceType": "module", + "extraFileExtensions": [".vue"] + }, + "env": { + "node": true, + "es2023": true, + "es6": true + }, + "overrides": [ + { + "files": ["*.vue"], + "stylistic/quotes": ["error", "single"], + "stylistic/quote-props": ["error", "as-needed"] + } + ] + }, { "files": [ "frontend/express/public/javascripts/countly/*.js", @@ -130,9 +184,6 @@ "frontend/express/public/core/*/javascripts/countly.*.js", "plugins/*/frontend/public/javascripts/countly.*.js" ], - "parserOptions": { - "ecmaVersion": 2020 - }, "env": { "browser": true, "es2020": true @@ -208,7 +259,7 @@ ], "excludedFiles": "plugins/*/frontend/public/**/*.js", "env": { - "es2020": true, + "es2023": true, "node": true }, "parserOptions": { @@ -285,7 +336,7 @@ ], "excludedFiles": "plugins/*/tests.js", "env": { - "es2020": true, + "es2023": true, "node": true }, "parserOptions": { @@ -302,36 +353,12 @@ "plugins/*/tests.js" ], "env": { - "es2020": true, - "node": true, - "mocha": true - }, - "parserOptions": { - "ecmaVersion": 2020, - "sourceType": "module" - }, - "rules": { - "no-console": "off", - "no-unused-vars": "off", - "no-redeclare": "off" - } - }, - { - "files": [ - "ui-tests/**/*.js" - ], - "env": { - "es2020": true, + "es2023": true, "node": true, "mocha": true }, - "globals": { - "Cypress": "readonly", - "cy": "readonly" - }, "parserOptions": { - "ecmaVersion": 2020, - "sourceType": "module" + "ecmaVersion": 2020 }, "rules": { "no-console": "off", diff --git a/package.json b/package.json index 6a813011cb7..7df25b67628 100644 --- a/package.json +++ b/package.json @@ -14,9 +14,11 @@ "url": "git://github.com/countly/countly-server.git" }, "devDependencies": { + "@stylistic/eslint-plugin": "^2.11.0", "apidoc": "^1.0.1", "apidoc-template": "^0.0.2", "docdash": "^2.0.1", + "eslint-plugin-vue": "^9.31.0", "grunt-contrib-watch": "1.1.0", "grunt-eslint": "24.3.0", "grunt-mocha-nyc": "1.0.3", From 2c7a00d33042d89435dadd3d9f4f4254bda755bb Mon Sep 17 00:00:00 2001 From: Kanwar Ujjaval Singh <4216199+kanwarujjaval@users.noreply.github.com> Date: Tue, 26 Nov 2024 15:35:39 +0530 Subject: [PATCH 23/70] es2023 for backend and content specific eslint --- .eslintrc.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 5f131bf4f5d..58b44f41b63 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -170,8 +170,8 @@ "overrides": [ { "files": ["*.vue"], - "stylistic/quotes": ["error", "single"], - "stylistic/quote-props": ["error", "as-needed"] + "@stylistic/quotes": ["error", "single"], + "@stylistic/quote-props": ["error", "as-needed"] } ] }, From 0fb532c562c828a456695936b5f919bcc2453269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Art=C5=ABrs=20Kadi=C4=B7is?= Date: Tue, 26 Nov 2024 12:06:47 +0200 Subject: [PATCH 24/70] changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index eee3cbac916..53987e29162 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ Fixes: - [dashboards] Fixing issue where dashboard widgets go into single column +Security: +- Bumped puppeteer from "17.1.3" to "23.8.0" + ## Version 24.05.18 Fixes: - [core] Fixed bug where changing passwords results in the loss of the "Global Admin" role From 1f78489613021a53efb27f7cd2db3bd77f1534ea Mon Sep 17 00:00:00 2001 From: Kanwar Ujjaval Singh <4216199+kanwarujjaval@users.noreply.github.com> Date: Tue, 26 Nov 2024 15:39:52 +0530 Subject: [PATCH 25/70] another fix --- .eslintrc.json | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 58b44f41b63..583eb8bcfa5 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -151,7 +151,9 @@ "plugin:vue/vue3-recommended" ], "rules": { - "no-console": ["error"] + "no-console": ["error"], + "@stylistic/quotes": ["error", "single"], + "@stylistic/quote-props": ["error", "as-needed"] }, "plugins": [ "vue", @@ -166,14 +168,7 @@ "node": true, "es2023": true, "es6": true - }, - "overrides": [ - { - "files": ["*.vue"], - "@stylistic/quotes": ["error", "single"], - "@stylistic/quote-props": ["error", "as-needed"] - } - ] + } }, { "files": [ From f5852bfd366923522c27e3a5fa88307759fcee70 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2024 10:12:44 +0000 Subject: [PATCH 26/70] Bump cross-spawn from 7.0.3 to 7.0.6 in /ui-tests Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6. - [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md) - [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6) --- updated-dependencies: - dependency-name: cross-spawn dependency-type: indirect ... Signed-off-by: dependabot[bot] --- ui-tests/package-lock.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ui-tests/package-lock.json b/ui-tests/package-lock.json index 01aeee998b9..942a89b19a6 100644 --- a/ui-tests/package-lock.json +++ b/ui-tests/package-lock.json @@ -511,9 +511,10 @@ "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==" }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", From 004148183b1e1bf64ca43eddb29f443d7a7e6d02 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2024 10:12:49 +0000 Subject: [PATCH 27/70] Bump cross-spawn from 7.0.3 to 7.0.6 in /plugins/hooks Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6. - [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md) - [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6) --- updated-dependencies: - dependency-name: cross-spawn dependency-type: indirect ... Signed-off-by: dependabot[bot] --- plugins/hooks/package-lock.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/hooks/package-lock.json b/plugins/hooks/package-lock.json index bc6a3b378cd..a926bf120b1 100644 --- a/plugins/hooks/package-lock.json +++ b/plugins/hooks/package-lock.json @@ -222,9 +222,10 @@ } }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", From 3efa9f2c65da9dcbb873d7f15438319a852a7226 Mon Sep 17 00:00:00 2001 From: Arturs Sosins Date: Tue, 26 Nov 2024 12:35:54 +0200 Subject: [PATCH 28/70] Updated Changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53987e29162..eaf9a97bda5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,8 @@ Fixes: - [dashboards] Fixing issue where dashboard widgets go into single column Security: -- Bumped puppeteer from "17.1.3" to "23.8.0" +- Bump puppeteer from 17.1.3 to 23.8.0 +- Bump express from 4.21.0 to 4.21.1 ## Version 24.05.18 Fixes: From 3c7b27c3e8d18f5ad35e90005d7d2af4f3ab6863 Mon Sep 17 00:00:00 2001 From: Kanwar Ujjaval Singh <4216199+kanwarujjaval@users.noreply.github.com> Date: Tue, 26 Nov 2024 16:19:46 +0530 Subject: [PATCH 29/70] another fix for ui things --- .eslintrc.json | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 583eb8bcfa5..3ece0622897 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -179,6 +179,9 @@ "frontend/express/public/core/*/javascripts/countly.*.js", "plugins/*/frontend/public/javascripts/countly.*.js" ], + "parserOptions": { + "ecmaVersion": 2020 + }, "env": { "browser": true, "es2020": true @@ -335,7 +338,7 @@ "node": true }, "parserOptions": { - "ecmaVersion": 2020 + "ecmaVersion": 2023 }, "rules": { "no-console": "off" @@ -353,7 +356,30 @@ "mocha": true }, "parserOptions": { - "ecmaVersion": 2020 + "ecmaVersion": 2023 + }, + "rules": { + "no-console": "off", + "no-unused-vars": "off", + "no-redeclare": "off" + } + }, + { + "files": [ + "ui-tests/**/*.js" + ], + "env": { + "es2023": true, + "node": true, + "mocha": true + }, + "globals": { + "Cypress": "readonly", + "cy": "readonly" + }, + "parserOptions": { + "ecmaVersion": 2023, + "sourceType": "module" }, "rules": { "no-console": "off", From 70f33a9dc5fb18ca2e5e59cb8c378f445a7bfcce Mon Sep 17 00:00:00 2001 From: Cihad Tekin Date: Tue, 26 Nov 2024 14:01:39 +0300 Subject: [PATCH 30/70] [logger] hotfix: to use the defined default_max_entries --- plugins/logger/api/jobs/clear.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/logger/api/jobs/clear.js b/plugins/logger/api/jobs/clear.js index 05575eec510..ddf9376c217 100644 --- a/plugins/logger/api/jobs/clear.js +++ b/plugins/logger/api/jobs/clear.js @@ -19,13 +19,13 @@ class ClearJob extends JOB.Job { let max = this.data.max; if (typeof max !== "number") { log.e( - "Maximum number of log entries required. Falling back to", + "Maximum number of log entries required. Falling back to default value:", DEFAULT_MAX_ENTRIES ); max = DEFAULT_MAX_ENTRIES; } - log.d("Started: cleaning logs before the last", this.data.max); + log.d("Started: cleaning logs before the last", max); const appIds = await db.collection("apps").find().project({ _id: 1 }).toArray(); const loggerCollections = appIds.map(({_id}) => "logs" + _id.toString()); @@ -33,7 +33,7 @@ class ClearJob extends JOB.Job { const col = db.collection(colName); // find the first entry we want to keep const firstEntry = await col.find({}).project({ _id: 1 }).sort({ _id: -1 }) - .skip(this.data.max - 1).limit(1).toArray(); + .skip(max - 1).limit(1).toArray(); if (!firstEntry[0]) { continue; } From 5e9818fe615f0a41ab32cb5dfbc4173a3f247322 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2024 11:36:20 +0000 Subject: [PATCH 31/70] Bump sass from 1.79.4 to 1.81.0 Bumps [sass](https://github.com/sass/dart-sass) from 1.79.4 to 1.81.0. - [Release notes](https://github.com/sass/dart-sass/releases) - [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md) - [Commits](https://github.com/sass/dart-sass/compare/1.79.4...1.81.0) --- updated-dependencies: - dependency-name: sass dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 336 ++++++++++++++++++++++++++++++++++++++++++++-- package.json | 2 +- 2 files changed, 329 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 97896db9c3a..4989560992a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -60,7 +60,7 @@ "offline-geocoder": "git+https://github.com/Countly/offline-geocoder.git", "properties-parser": "0.6.0", "puppeteer": "^23.8.0", - "sass": "1.79.4", + "sass": "1.81.0", "tslib": "^2.6.3", "uglify-js": "3.19.3", "underscore": "1.13.7", @@ -1803,6 +1803,322 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/@parcel/watcher": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.0.tgz", + "integrity": "sha512-i0GV1yJnm2n3Yq1qw6QrUrd/LI9bE8WEBOTtOkpCXHHdyN3TAGgqAK/DAT05z4fq2x04cARXt2pDmjWjL92iTQ==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "dependencies": { + "detect-libc": "^1.0.3", + "is-glob": "^4.0.3", + "micromatch": "^4.0.5", + "node-addon-api": "^7.0.0" + }, + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "@parcel/watcher-android-arm64": "2.5.0", + "@parcel/watcher-darwin-arm64": "2.5.0", + "@parcel/watcher-darwin-x64": "2.5.0", + "@parcel/watcher-freebsd-x64": "2.5.0", + "@parcel/watcher-linux-arm-glibc": "2.5.0", + "@parcel/watcher-linux-arm-musl": "2.5.0", + "@parcel/watcher-linux-arm64-glibc": "2.5.0", + "@parcel/watcher-linux-arm64-musl": "2.5.0", + "@parcel/watcher-linux-x64-glibc": "2.5.0", + "@parcel/watcher-linux-x64-musl": "2.5.0", + "@parcel/watcher-win32-arm64": "2.5.0", + "@parcel/watcher-win32-ia32": "2.5.0", + "@parcel/watcher-win32-x64": "2.5.0" + } + }, + "node_modules/@parcel/watcher-android-arm64": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.5.0.tgz", + "integrity": "sha512-qlX4eS28bUcQCdribHkg/herLe+0A9RyYC+mm2PXpncit8z5b3nSqGVzMNR3CmtAOgRutiZ02eIJJgP/b1iEFQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-darwin-arm64": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.5.0.tgz", + "integrity": "sha512-hyZ3TANnzGfLpRA2s/4U1kbw2ZI4qGxaRJbBH2DCSREFfubMswheh8TeiC1sGZ3z2jUf3s37P0BBlrD3sjVTUw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-darwin-x64": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.5.0.tgz", + "integrity": "sha512-9rhlwd78saKf18fT869/poydQK8YqlU26TMiNg7AIu7eBp9adqbJZqmdFOsbZ5cnLp5XvRo9wcFmNHgHdWaGYA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-freebsd-x64": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.5.0.tgz", + "integrity": "sha512-syvfhZzyM8kErg3VF0xpV8dixJ+RzbUaaGaeb7uDuz0D3FK97/mZ5AJQ3XNnDsXX7KkFNtyQyFrXZzQIcN49Tw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm-glibc": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.5.0.tgz", + "integrity": "sha512-0VQY1K35DQET3dVYWpOaPFecqOT9dbuCfzjxoQyif1Wc574t3kOSkKevULddcR9znz1TcklCE7Ht6NIxjvTqLA==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm-musl": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-musl/-/watcher-linux-arm-musl-2.5.0.tgz", + "integrity": "sha512-6uHywSIzz8+vi2lAzFeltnYbdHsDm3iIB57d4g5oaB9vKwjb6N6dRIgZMujw4nm5r6v9/BQH0noq6DzHrqr2pA==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm64-glibc": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.5.0.tgz", + "integrity": "sha512-BfNjXwZKxBy4WibDb/LDCriWSKLz+jJRL3cM/DllnHH5QUyoiUNEp3GmL80ZqxeumoADfCCP19+qiYiC8gUBjA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm64-musl": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.5.0.tgz", + "integrity": "sha512-S1qARKOphxfiBEkwLUbHjCY9BWPdWnW9j7f7Hb2jPplu8UZ3nes7zpPOW9bkLbHRvWM0WDTsjdOTUgW0xLBN1Q==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-x64-glibc": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.5.0.tgz", + "integrity": "sha512-d9AOkusyXARkFD66S6zlGXyzx5RvY+chTP9Jp0ypSTC9d4lzyRs9ovGf/80VCxjKddcUvnsGwCHWuF2EoPgWjw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-x64-musl": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.5.0.tgz", + "integrity": "sha512-iqOC+GoTDoFyk/VYSFHwjHhYrk8bljW6zOhPuhi5t9ulqiYq1togGJB5e3PwYVFFfeVgc6pbz3JdQyDoBszVaA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-arm64": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.5.0.tgz", + "integrity": "sha512-twtft1d+JRNkM5YbmexfcH/N4znDtjgysFaV9zvZmmJezQsKpkfLYJ+JFV3uygugK6AtIM2oADPkB2AdhBrNig==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-ia32": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.5.0.tgz", + "integrity": "sha512-+rgpsNRKwo8A53elqbbHXdOMtY/tAtTzManTWShB5Kk54N8Q9mzNWV7tV+IbGueCbcj826MfWGU3mprWtuf1TA==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-x64": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.5.0.tgz", + "integrity": "sha512-lPrxve92zEHdgeff3aiu4gDOIt4u7sJYha6wbdEZDCDUhtjTsOMiaJzG5lMY4GkWH8p0fMmO2Ppq5G5XXG+DQw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher/node_modules/detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", + "license": "Apache-2.0", + "optional": true, + "bin": { + "detect-libc": "bin/detect-libc.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/@parcel/watcher/node_modules/node-addon-api": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", + "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", + "license": "MIT", + "optional": true + }, "node_modules/@phc/format": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@phc/format/-/format-1.0.0.tgz", @@ -7070,9 +7386,9 @@ } }, "node_modules/immutable": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.7.tgz", - "integrity": "sha512-1hqclzwYwjRDFLjcFxOM5AYkkG0rpFPpr1RLPMEuGczoS7YA8gLhy8SWXYRAA/XwfEHpfo3cw5JGioS32fnMRw==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-5.0.3.tgz", + "integrity": "sha512-P8IdPQHq3lA1xVeBRi5VPqUm5HDgKnx0Ru51wZz5mjxHr5n3RWhjIpOFU7ybkUxfB+5IToy+OLaHYDBIWsv+uw==", "license": "MIT" }, "node_modules/import-fresh": { @@ -11287,12 +11603,13 @@ } }, "node_modules/sass": { - "version": "1.79.4", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.79.4.tgz", - "integrity": "sha512-K0QDSNPXgyqO4GZq2HO5Q70TLxTH6cIT59RdoCHMivrC8rqzaTw5ab9prjz9KUN1El4FLXrBXJhik61JR4HcGg==", + "version": "1.81.0", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.81.0.tgz", + "integrity": "sha512-Q4fOxRfhmv3sqCLoGfvrC9pRV8btc0UtqL9mN6Yrv6Qi9ScL55CVH1vlPP863ISLEEMNLLuu9P+enCeGHlnzhA==", + "license": "MIT", "dependencies": { "chokidar": "^4.0.0", - "immutable": "^4.0.0", + "immutable": "^5.0.2", "source-map-js": ">=0.6.2 <2.0.0" }, "bin": { @@ -11300,6 +11617,9 @@ }, "engines": { "node": ">=14.0.0" + }, + "optionalDependencies": { + "@parcel/watcher": "^2.4.1" } }, "node_modules/sass/node_modules/chokidar": { diff --git a/package.json b/package.json index b1b61f223ed..592d9327cb4 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,7 @@ "offline-geocoder": "git+https://github.com/Countly/offline-geocoder.git", "properties-parser": "0.6.0", "puppeteer": "^23.8.0", - "sass": "1.79.4", + "sass": "1.81.0", "tslib": "^2.6.3", "uglify-js": "3.19.3", "underscore": "1.13.7", From a4ffa45182e10d72c64527b4d7c14d064dc82173 Mon Sep 17 00:00:00 2001 From: Cihad Tekin Date: Tue, 26 Nov 2024 14:52:22 +0300 Subject: [PATCH 32/70] [core] changed the deprecated "feature request" url with "discord ideas channel" url --- frontend/express/app.js | 2 +- .../javascripts/countly/vue/templates/sidebar/users-menu.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/express/app.js b/frontend/express/app.js index 110daa7830a..e8a393af8cc 100644 --- a/frontend/express/app.js +++ b/frontend/express/app.js @@ -661,7 +661,7 @@ Promise.all([plugins.dbConnection(countlyConfig), plugins.dbConnection("countly_ favicon: "images/favicon.png", documentationLink: convertLink(versionInfo.documentationLink, "https://support.count.ly/hc/en-us/categories/360002373332-Knowledge-Base"), helpCenterLink: convertLink(versionInfo.helpCenterLink, "https://support.count.ly/hc/en-us"), - featureRequestLink: convertLink(versionInfo.featureRequestLink, "https://support.count.ly/hc/en-us/community/topics/360001464272-Feature-Requests"), + featureRequestLink: convertLink(versionInfo.featureRequestLink, "https://discord.com/channels/1088398296789299280/1088721958218248243"), feedbackLink: convertLink(versionInfo.feedbackLink, "https://count.ly/legal/privacy-policy"), }; plugins.loadConfigs(countlyDb, function() { diff --git a/frontend/express/public/javascripts/countly/vue/templates/sidebar/users-menu.html b/frontend/express/public/javascripts/countly/vue/templates/sidebar/users-menu.html index 87a9d76d83a..c235db2575d 100644 --- a/frontend/express/public/javascripts/countly/vue/templates/sidebar/users-menu.html +++ b/frontend/express/public/javascripts/countly/vue/templates/sidebar/users-menu.html @@ -157,7 +157,7 @@
From 7769e96e4f4eccc934bf3e1d11e9c3114ea271a1 Mon Sep 17 00:00:00 2001 From: Arturs Sosins Date: Tue, 26 Nov 2024 13:53:41 +0200 Subject: [PATCH 33/70] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index eaf9a97bda5..3b2281daff2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Fixes: Security: - Bump puppeteer from 17.1.3 to 23.8.0 - Bump express from 4.21.0 to 4.21.1 +- Bump express-session from 1.18.0 to 1.18.1 ## Version 24.05.18 Fixes: From 8d527db9322a3248cd1d03a6b6ec3f02d6f6fbe7 Mon Sep 17 00:00:00 2001 From: Arturs Sosins Date: Tue, 26 Nov 2024 13:57:17 +0200 Subject: [PATCH 34/70] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index eaf9a97bda5..c269b4b5b74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Fixes: Security: - Bump puppeteer from 17.1.3 to 23.8.0 - Bump express from 4.21.0 to 4.21.1 +- Bump sass from 1.79.4 to 1.81.0 ## Version 24.05.18 Fixes: From cf03b2b23f5f028767cf98e7e86a3bc8eecfd755 Mon Sep 17 00:00:00 2001 From: Kanwar Ujjaval Singh <4216199+kanwarujjaval@users.noreply.github.com> Date: Tue, 26 Nov 2024 17:53:40 +0530 Subject: [PATCH 35/70] install eslint dependencies --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2f3e5fee7d4..613658e1512 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -105,7 +105,7 @@ jobs: - name: ESLint shell: bash run: | - npm install eslint@8.57.0 + npm install eslint@8.57.0 eslint-plugin-vue@9.31.0 @stylistic/eslint-plugin@2.11.0 npx eslint . - name: NPM install From 9c2057175106e9bec1c2bec6b0dd5f1b042c6320 Mon Sep 17 00:00:00 2001 From: Arturs Sosins Date: Tue, 26 Nov 2024 16:26:50 +0200 Subject: [PATCH 36/70] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6b1b17eee8..03720c1483c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Security: - Bump express from 4.21.0 to 4.21.1 - Bump sass from 1.79.4 to 1.81.0 - Bump express-session from 1.18.0 to 1.18.1 +- Bump cross-spawn from 7.0.3 to 7.0.6 in /ui-tests ## Version 24.05.18 Fixes: From 93ea5ac7bb54d83f93966ff5bd40ec481db9fc81 Mon Sep 17 00:00:00 2001 From: Arturs Sosins Date: Tue, 26 Nov 2024 16:38:01 +0200 Subject: [PATCH 37/70] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03720c1483c..6a50884df3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ Security: - Bump sass from 1.79.4 to 1.81.0 - Bump express-session from 1.18.0 to 1.18.1 - Bump cross-spawn from 7.0.3 to 7.0.6 in /ui-tests +- Bump cross-spawn from 7.0.3 to 7.0.6 in /plugins/hooks ## Version 24.05.18 Fixes: From 4c3ee68aa08984187862ed2ae31326f8637b5aae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Art=C5=ABrs=20Kadi=C4=B7is?= Date: Tue, 26 Nov 2024 19:03:54 +0200 Subject: [PATCH 38/70] Update CHANGELOG.md for 24.05.19 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a50884df3c..f44a11cce52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## Version 24.05.XX +## Version 24.05.19 Fixes: - [dashboards] Fixing issue where dashboard widgets go into single column From 18a802105fc89d98293b58bd6646ee61e611e836 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Nov 2024 01:04:12 +0000 Subject: [PATCH 39/70] Bump countly-sdk-web from 24.4.1 to 24.11.0 Bumps [countly-sdk-web](https://github.com/Countly/countly-sdk-web) from 24.4.1 to 24.11.0. - [Release notes](https://github.com/Countly/countly-sdk-web/releases) - [Changelog](https://github.com/Countly/countly-sdk-web/blob/master/CHANGELOG.md) - [Commits](https://github.com/Countly/countly-sdk-web/compare/24.4.1...24.11.0) --- updated-dependencies: - dependency-name: countly-sdk-web dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2db3264c36f..7aa8060b331 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4162,9 +4162,10 @@ "license": "MIT" }, "node_modules/countly-sdk-web": { - "version": "24.4.1", - "resolved": "https://registry.npmjs.org/countly-sdk-web/-/countly-sdk-web-24.4.1.tgz", - "integrity": "sha512-p3yu+idBDNQgKgSLGYzwVur4t48gnDzX4aRELO4uzKoLwxLuxZFINg9oQUntKwDHN3wzwTAqVSfDj1Uv8p8uCQ==" + "version": "24.11.0", + "resolved": "https://registry.npmjs.org/countly-sdk-web/-/countly-sdk-web-24.11.0.tgz", + "integrity": "sha512-q068gBAAvwDvuDLTwy8xEyjyIbbSg4EHcI0PdlyCbTqL8y7oD3b2ze0m1OOGCPBhnwVssNHoX6CiNhXRhihD1w==", + "license": "MIT" }, "node_modules/crc-32": { "version": "1.2.2", From c1901d605dccd2e6f0fe0c92d03912db30948949 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Nov 2024 01:04:22 +0000 Subject: [PATCH 40/70] Bump nodemailer from 6.9.15 to 6.9.16 Bumps [nodemailer](https://github.com/nodemailer/nodemailer) from 6.9.15 to 6.9.16. - [Release notes](https://github.com/nodemailer/nodemailer/releases) - [Changelog](https://github.com/nodemailer/nodemailer/blob/master/CHANGELOG.md) - [Commits](https://github.com/nodemailer/nodemailer/compare/v6.9.15...v6.9.16) --- updated-dependencies: - dependency-name: nodemailer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 9 +++++---- package.json | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2db3264c36f..ed184cc3f8d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -55,7 +55,7 @@ "moment-timezone": "0.5.46", "mongodb": "4.9.1", "nginx-conf": "2.1.0", - "nodemailer": "6.9.15", + "nodemailer": "6.9.16", "object-hash": "3.0.0", "offline-geocoder": "git+https://github.com/Countly/offline-geocoder.git", "properties-parser": "0.6.0", @@ -9687,9 +9687,10 @@ "license": "MIT" }, "node_modules/nodemailer": { - "version": "6.9.15", - "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.15.tgz", - "integrity": "sha512-AHf04ySLC6CIfuRtRiEYtGEXgRfa6INgWGluDhnxTZhHSKvrBu7lc1VVchQ0d8nPc4cFaZoPq8vkyNoZr0TpGQ==", + "version": "6.9.16", + "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.16.tgz", + "integrity": "sha512-psAuZdTIRN08HKVd/E8ObdV6NO7NTBY3KsC30F7M4H1OnmLCUNaS56FpYxyb26zWLSyYF9Ozch9KYHhHegsiOQ==", + "license": "MIT-0", "engines": { "node": ">=6.0.0" } diff --git a/package.json b/package.json index e7f906ddc50..f00927fa538 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "moment-timezone": "0.5.46", "mongodb": "4.9.1", "nginx-conf": "2.1.0", - "nodemailer": "6.9.15", + "nodemailer": "6.9.16", "object-hash": "3.0.0", "offline-geocoder": "git+https://github.com/Countly/offline-geocoder.git", "properties-parser": "0.6.0", From 3c20440aa10e6bef954dc8b4e72e302080e2287b Mon Sep 17 00:00:00 2001 From: Kanwar Ujjaval Singh <4216199+kanwarujjaval@users.noreply.github.com> Date: Wed, 27 Nov 2024 11:35:37 +0530 Subject: [PATCH 41/70] update eslint config for contentV1 --- .eslintrc.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 3ece0622897..2aa835fc55a 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -142,7 +142,9 @@ { "files": [ "plugins/content/frontend/content-blocks/**/*.js", - "plugins/journey_engine/frontend/builder/**/*.js" + "plugins/journey_engine/frontend/builder/**/*.js", + "plugins/content/frontend/content-blocks/**/*.vue", + "plugins/journey_engine/frontend/builder/**/*.vue" ], "extends": [ "eslint:recommended", @@ -151,9 +153,11 @@ "plugin:vue/vue3-recommended" ], "rules": { + // override these post initial content release, to make them fit with countly convention "no-console": ["error"], "@stylistic/quotes": ["error", "single"], - "@stylistic/quote-props": ["error", "as-needed"] + "@stylistic/quote-props": ["error", "as-needed"], + "require-jsdoc": "off" // temporary addition }, "plugins": [ "vue", From a3a5a544912bb1e8a68d11d919ce3f867cb44054 Mon Sep 17 00:00:00 2001 From: Kanwar Ujjaval Singh <4216199+kanwarujjaval@users.noreply.github.com> Date: Wed, 27 Nov 2024 13:11:09 +0530 Subject: [PATCH 42/70] temporary config --- .eslintrc.json | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 2aa835fc55a..feb3caaa982 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -156,8 +156,7 @@ // override these post initial content release, to make them fit with countly convention "no-console": ["error"], "@stylistic/quotes": ["error", "single"], - "@stylistic/quote-props": ["error", "as-needed"], - "require-jsdoc": "off" // temporary addition + "@stylistic/quote-props": ["error", "as-needed"] }, "plugins": [ "vue", @@ -259,7 +258,13 @@ "plugins/*/frontend/**/*.js", "plugins/*/extend/**/*.js" ], - "excludedFiles": "plugins/*/frontend/public/**/*.js", + "excludedFiles": [ + "plugins/*/frontend/public/**/*.js", + "plugins/content/frontend/content-blocks/**/*.js", + "plugins/journey_engine/frontend/builder/**/*.js", + "plugins/content/frontend/content-blocks/**/*.vue", + "plugins/journey_engine/frontend/builder/**/*.vue" + ], "env": { "es2023": true, "node": true From caf6c9db89edf732da7fa7ec8a4ccd24bf9025a4 Mon Sep 17 00:00:00 2001 From: Arturs Sosins Date: Wed, 27 Nov 2024 10:47:17 +0200 Subject: [PATCH 43/70] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f44a11cce52..dfb2826fd7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ Security: - Bump express-session from 1.18.0 to 1.18.1 - Bump cross-spawn from 7.0.3 to 7.0.6 in /ui-tests - Bump cross-spawn from 7.0.3 to 7.0.6 in /plugins/hooks +- Bump nodemailer from 6.9.15 to 6.9.16 ## Version 24.05.18 Fixes: From 895e7772a21b9cc8913c61e3f057a60b8723f523 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Nov 2024 09:17:50 +0000 Subject: [PATCH 44/70] Bump tslib from 2.7.0 to 2.8.1 Bumps [tslib](https://github.com/Microsoft/tslib) from 2.7.0 to 2.8.1. - [Release notes](https://github.com/Microsoft/tslib/releases) - [Commits](https://github.com/Microsoft/tslib/compare/v2.7.0...v2.8.1) --- updated-dependencies: - dependency-name: tslib dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index ed184cc3f8d..86f74e6b6cd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12776,9 +12776,10 @@ } }, "node_modules/tslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" }, "node_modules/tsscmp": { "version": "1.0.6", From 94f6fac30b052006b306b5c6c4409df194a5d85e Mon Sep 17 00:00:00 2001 From: Arturs Sosins Date: Wed, 27 Nov 2024 11:18:27 +0200 Subject: [PATCH 45/70] Update Changelog --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dfb2826fd7c..ec791426b73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## Version 24.05.x + +Dependencies: +- Bump nodemailer from 6.9.15 to 6.9.16 +- Bump countly-sdk-web from 24.4.1 to 24.11.0 + ## Version 24.05.19 Fixes: - [dashboards] Fixing issue where dashboard widgets go into single column @@ -9,7 +15,6 @@ Security: - Bump express-session from 1.18.0 to 1.18.1 - Bump cross-spawn from 7.0.3 to 7.0.6 in /ui-tests - Bump cross-spawn from 7.0.3 to 7.0.6 in /plugins/hooks -- Bump nodemailer from 6.9.15 to 6.9.16 ## Version 24.05.18 Fixes: From 71bf9ac7bc0ab4cfc328c36fa9000246616da590 Mon Sep 17 00:00:00 2001 From: Arturs Sosins Date: Wed, 27 Nov 2024 11:31:06 +0200 Subject: [PATCH 46/70] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec791426b73..0dba1c0a65e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ Dependencies: - Bump nodemailer from 6.9.15 to 6.9.16 - Bump countly-sdk-web from 24.4.1 to 24.11.0 +- Bump tslib from 2.7.0 to 2.8.1 ## Version 24.05.19 Fixes: From aba99657e321ada2d4a316c7ee973638c21f0060 Mon Sep 17 00:00:00 2001 From: Kanwar Ujjaval Singh <4216199+kanwarujjaval@users.noreply.github.com> Date: Wed, 27 Nov 2024 15:02:11 +0530 Subject: [PATCH 47/70] convention for vue files --- .editorconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index 6744aa1e32e..ea4cd631fe7 100644 --- a/.editorconfig +++ b/.editorconfig @@ -4,6 +4,6 @@ root = true end_of_line = lf insert_final_newline = false -[*.{js,html,scss,json}] +[*.{js,html,scss,json,vue}] indent_style = space indent_size = 4 From 20933cbc363a054fa5ffd33d557035a913ccd471 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Nov 2024 09:43:10 +0000 Subject: [PATCH 48/70] Bump puppeteer from 17.1.3 to 23.9.0 Bumps [puppeteer](https://github.com/puppeteer/puppeteer) from 17.1.3 to 23.9.0. - [Release notes](https://github.com/puppeteer/puppeteer/releases) - [Changelog](https://github.com/puppeteer/puppeteer/blob/main/release-please-config.json) - [Commits](https://github.com/puppeteer/puppeteer/compare/v17.1.3...puppeteer-v23.9.0) --- updated-dependencies: - dependency-name: puppeteer dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 25834f60935..f7405ec7c64 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3114,9 +3114,9 @@ } }, "node_modules/bare-stream": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.3.2.tgz", - "integrity": "sha512-EFZHSIBkDgSHIwj2l2QZfP4U5OcD4xFAOwhSb/vlr9PIqyGJGvB/nfClJbcnh3EY4jtPE4zsb5ztae96bVF79A==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.4.2.tgz", + "integrity": "sha512-XZ4ln/KV4KT+PXdIWTKjsLY+quqCaEtqqtgGJVPw9AoM73By03ij64YjepK0aQvHSWDb6AfAZwqKaFu68qkrdA==", "license": "Apache-2.0", "optional": true, "dependencies": { @@ -11072,9 +11072,9 @@ } }, "node_modules/puppeteer": { - "version": "23.8.0", - "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-23.8.0.tgz", - "integrity": "sha512-MFWDMWoCcOpwNwQIjA9gPKWrEUbj8bLCzkK56w5lZPMUT6wK4FfpgOEPxKffVmXEMYMZzgcjxzqy15b/Q1ibaw==", + "version": "23.9.0", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-23.9.0.tgz", + "integrity": "sha512-WfB8jGwFV+qrD9dcJJVvWPFJBU6kxeu2wxJz9WooDGfM3vIiKLgzImEDBxUQnCBK/2cXB3d4dV6gs/LLpgfLDg==", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { @@ -11082,7 +11082,7 @@ "chromium-bidi": "0.8.0", "cosmiconfig": "^9.0.0", "devtools-protocol": "0.0.1367902", - "puppeteer-core": "23.8.0", + "puppeteer-core": "23.9.0", "typed-query-selector": "^2.12.0" }, "bin": { @@ -11093,9 +11093,9 @@ } }, "node_modules/puppeteer-core": { - "version": "23.8.0", - "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-23.8.0.tgz", - "integrity": "sha512-c2ymGN2M//We7pC+JhP2dE/g4+qnT89BO+EMSZyJmecN3DN6RNqErA7eH7DrWoNIcU75r2nP4VHa4pswAL6NVg==", + "version": "23.9.0", + "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-23.9.0.tgz", + "integrity": "sha512-hLVrav2HYMVdK0YILtfJwtnkBAwNOztUdR4aJ5YKDvgsbtagNr6urUJk9HyjRA9e+PaLI3jzJ0wM7A4jSZ7Qxw==", "license": "Apache-2.0", "dependencies": { "@puppeteer/browsers": "2.4.1", From a412bf2d7b87bb6715d669ec158bd94b90e75f5c Mon Sep 17 00:00:00 2001 From: Cookiezaurs <> Date: Wed, 27 Nov 2024 12:04:37 +0200 Subject: [PATCH 49/70] [core] Changes to countly_multi_app_expire_script --- .../countly_multi_app_expireData.js | 34 +++++++++++++------ 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/bin/scripts/expire-data/countly_multi_app_expireData.js b/bin/scripts/expire-data/countly_multi_app_expireData.js index 4a696396e24..d89ca450178 100644 --- a/bin/scripts/expire-data/countly_multi_app_expireData.js +++ b/bin/scripts/expire-data/countly_multi_app_expireData.js @@ -1,5 +1,5 @@ /** - * Setup TTL indexes to delete older data for one specific app. This script should be run periodically, to create TTL indexes on new collections too, like new events, etc for specific app + * Sets index on cd field if it does not exists and stores retention period in database. Nightly job will clear data based on set retention period. * Server: countly * Path: countly dir/bin/scripts/expire-data * Command: node countly_multi_app_expireData.js @@ -27,7 +27,7 @@ Promise.all([plugins.dbConnection("countly"), plugins.dbConnection("countly_dril var dropIndex = false; for (var i = 0; i < indexes.length; i++) { if (indexes[i].name == INDEX_NAME) { - if (indexes[i].expireAfterSeconds == EXPIRE_AFTER) { + if (!indexes[i].expireAfterSeconds || indexes[i].expireAfterSeconds <= EXPIRE_AFTER) { //print("skipping", c) hasIndex = true; } @@ -44,7 +44,6 @@ Promise.all([plugins.dbConnection("countly"), plugins.dbConnection("countly_dril "collMod": collection, "index": { "keyPattern": {"cd": 1}, - expireAfterSeconds: EXPIRE_AFTER } }, function(err) { if (err) { @@ -56,12 +55,13 @@ Promise.all([plugins.dbConnection("countly"), plugins.dbConnection("countly_dril } else if (!hasIndex) { console.log("creating index", collection); - db_drill.collection(collection).createIndex({"cd": 1}, {expireAfterSeconds: EXPIRE_AFTER, "background": true}, function() { - done(); + db_drill.collection(collection).createIndex({"cd": 1}, function() { + done(true); }); } else { - done(); + console.log("Appropriate index already set for", collection); + done(true); } } else { @@ -70,9 +70,23 @@ Promise.all([plugins.dbConnection("countly"), plugins.dbConnection("countly_dril }); - function done() { - db.close(); - db_drill.close(); - } + function done(index_set) { + if (index_set) { + db.collection("plugins").updateOne({"_id": "retention"}, {"$set": {"retention": EXPIRE_AFTER}}, {"upsert": true}, function(err) { + if (err) { + console.log("Error setting retention period", err); + } + else { + console.log("Retention period set: " + EXPIRE_AFTER); + } + db.close(); + db_drill.close(); + }); + } + else { + db.close(); + db_drill.close(); + } + } }); \ No newline at end of file From 7beab9d13ae452178fa65cd8e024fa407e0dc68a Mon Sep 17 00:00:00 2001 From: Kanwar Ujjaval Singh <4216199+kanwarujjaval@users.noreply.github.com> Date: Wed, 27 Nov 2024 16:45:44 +0530 Subject: [PATCH 50/70] more vue specific lint fixes --- .eslintrc.json | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index feb3caaa982..ce496cb3e45 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -146,6 +146,10 @@ "plugins/content/frontend/content-blocks/**/*.vue", "plugins/journey_engine/frontend/builder/**/*.vue" ], + "plugins": [ + "vue", + "@stylistic" + ], "extends": [ "eslint:recommended", "plugin:vue/vue3-essential", @@ -156,12 +160,12 @@ // override these post initial content release, to make them fit with countly convention "no-console": ["error"], "@stylistic/quotes": ["error", "single"], - "@stylistic/quote-props": ["error", "as-needed"] + "@stylistic/quote-props": ["error", "as-needed"], + "no-unused-vars": "off", + "vue/no-unused-vars": ["error", { + "ignorePattern": "^_" + }] }, - "plugins": [ - "vue", - "@stylistic" - ], "parserOptions": { "ecmaVersion": 2023, "sourceType": "module", From 6894e2a0fdbfdb3f0625ab9605bec8f227f06c1f Mon Sep 17 00:00:00 2001 From: Kanwar Ujjaval Singh <4216199+kanwarujjaval@users.noreply.github.com> Date: Wed, 27 Nov 2024 17:54:48 +0530 Subject: [PATCH 51/70] add gitgnore for chrome --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 117de747049..a6b3e862aa7 100644 --- a/.gitignore +++ b/.gitignore @@ -43,4 +43,5 @@ frontend/express/public/stylesheets/vue/clyvue.css.map log/ log/supervisord/ plugins/plugins.json.* -.sdk \ No newline at end of file +.sdk +dump \ No newline at end of file From abb08d5f6551767b206b8e526778131b2228e549 Mon Sep 17 00:00:00 2001 From: Arturs Sosins Date: Wed, 27 Nov 2024 16:51:35 +0200 Subject: [PATCH 52/70] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dba1c0a65e..5d305a03d24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## Version 24.05.x Dependencies: +- Bump puppeteer from 23.8.0 to 23.9.0 - Bump nodemailer from 6.9.15 to 6.9.16 - Bump countly-sdk-web from 24.4.1 to 24.11.0 - Bump tslib from 2.7.0 to 2.8.1 From bf41abecb281accd34d95999493505045e9b2f79 Mon Sep 17 00:00:00 2001 From: Cookiezaurs <> Date: Wed, 27 Nov 2024 17:00:20 +0200 Subject: [PATCH 53/70] fixes --- .../countly_multi_app_expireData.js | 26 ++----------------- 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/bin/scripts/expire-data/countly_multi_app_expireData.js b/bin/scripts/expire-data/countly_multi_app_expireData.js index d89ca450178..b8675ad61eb 100644 --- a/bin/scripts/expire-data/countly_multi_app_expireData.js +++ b/bin/scripts/expire-data/countly_multi_app_expireData.js @@ -27,33 +27,11 @@ Promise.all([plugins.dbConnection("countly"), plugins.dbConnection("countly_dril var dropIndex = false; for (var i = 0; i < indexes.length; i++) { if (indexes[i].name == INDEX_NAME) { - if (!indexes[i].expireAfterSeconds || indexes[i].expireAfterSeconds <= EXPIRE_AFTER) { - //print("skipping", c) - hasIndex = true; - } - //has index but incorrect expire time, need to be reindexed - else { - dropIndex = true; - } + hasIndex=true; break; } } - if (dropIndex) { - console.log("modifying index", collection); - db_drill.command({ - "collMod": collection, - "index": { - "keyPattern": {"cd": 1}, - } - }, function(err) { - if (err) { - console.log(err); - } - done(); - }); - - } - else if (!hasIndex) { + if (!hasIndex) { console.log("creating index", collection); db_drill.collection(collection).createIndex({"cd": 1}, function() { done(true); From 8546cd205ef96b6c1a53c81b57f261c97a2abc27 Mon Sep 17 00:00:00 2001 From: Cookiezaurs <> Date: Wed, 27 Nov 2024 17:05:08 +0200 Subject: [PATCH 54/70] lint --- bin/scripts/expire-data/countly_multi_app_expireData.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/scripts/expire-data/countly_multi_app_expireData.js b/bin/scripts/expire-data/countly_multi_app_expireData.js index b8675ad61eb..03b109f5ede 100644 --- a/bin/scripts/expire-data/countly_multi_app_expireData.js +++ b/bin/scripts/expire-data/countly_multi_app_expireData.js @@ -24,10 +24,9 @@ Promise.all([plugins.dbConnection("countly"), plugins.dbConnection("countly_dril } if (!err && indexes) { var hasIndex = false; - var dropIndex = false; for (var i = 0; i < indexes.length; i++) { if (indexes[i].name == INDEX_NAME) { - hasIndex=true; + hasIndex = true; break; } } From 5a71c4fca613b18b61ab0def1d202ab3ac888b88 Mon Sep 17 00:00:00 2001 From: Cookiezaurs <> Date: Wed, 27 Nov 2024 17:11:26 +0200 Subject: [PATCH 55/70] [core] on findAndModify+remove transform object to return in expected format --- plugins/pluginManager.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/pluginManager.js b/plugins/pluginManager.js index 8df7214face..388dbc538bc 100644 --- a/plugins/pluginManager.js +++ b/plugins/pluginManager.js @@ -2344,6 +2344,9 @@ var pluginManager = function pluginManager() { } return function(err, res) { if (res) { + if (!res.value && data.name === "findAndModify" && data && data.args && data.args[3] && data.args[3].remove) { + res = {"value": res}; + } if (!res.result) { res.result = {}; } From 8401935a13ffde4610f3c886d19e8116834ad0d7 Mon Sep 17 00:00:00 2001 From: Arturs Sosins Date: Wed, 27 Nov 2024 17:29:54 +0200 Subject: [PATCH 56/70] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d305a03d24..7b0ef97a599 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Dependencies: - Bump nodemailer from 6.9.15 to 6.9.16 - Bump countly-sdk-web from 24.4.1 to 24.11.0 - Bump tslib from 2.7.0 to 2.8.1 +- Bump form-data from 4.0.0 to 4.0.1 ## Version 24.05.19 Fixes: From 98bbaab8e8ddc9393de40582bbf275b53b0dc604 Mon Sep 17 00:00:00 2001 From: Cookiezaurs <> Date: Wed, 27 Nov 2024 18:13:45 +0200 Subject: [PATCH 57/70] fixed tests --- test/unit-tests/db.tests.js | 39 ++++++++++--------------------------- 1 file changed, 10 insertions(+), 29 deletions(-) diff --git a/test/unit-tests/db.tests.js b/test/unit-tests/db.tests.js index 05928ad0a24..631e1ee9c01 100644 --- a/test/unit-tests/db.tests.js +++ b/test/unit-tests/db.tests.js @@ -27,40 +27,21 @@ function runTest(options) { db.collection("testCommands").findAndModify(options.query, options.sort || {}, options.update, options.options, function(err, res) { should.not.exist(err); console.log(JSON.stringify(res)); - - - if (options.options.remove) { - res = res || {}; - if (options.query._id) { - res.should.have.property("_id", options.query._id); - } - else { - res.should.have.property("_id"); - } - - if (options.query.name) { - res.should.have.property("name", options.query.name); - } - else { - res.should.have.property("name"); + res.should.have.property("value"); + if (options.options.new) { + if (options.update.$set.name) { + res.value.should.have.property("name", options.update.$set.name); } } else { - res.should.have.property("value"); - if (options.options.new) { - if (options.update.$set.name) { - res.value.should.have.property("name", options.update.$set.name); - } - } - else { - if (options.query.name) { - res.value.should.have.property("name", options.query.name); - } - } - if (options.query._id) { - res.value.should.have.property("_id", options.query._id); + if (options.query.name) { + res.value.should.have.property("name", options.query.name); } } + if (options.query._id) { + res.value.should.have.property("_id", options.query._id); + } + done(); }); } From 8f0b494298d296017dd967726046df24df5e2ea1 Mon Sep 17 00:00:00 2001 From: Arturs Sosins Date: Wed, 27 Nov 2024 18:24:01 +0200 Subject: [PATCH 58/70] [dbviewer] use bson from MongoDB driver --- plugins/dbviewer/package-lock.json | 77 +----------------------------- plugins/dbviewer/package.json | 1 - 2 files changed, 1 insertion(+), 77 deletions(-) diff --git a/plugins/dbviewer/package-lock.json b/plugins/dbviewer/package-lock.json index eb5b36333ea..05cd09d6660 100644 --- a/plugins/dbviewer/package-lock.json +++ b/plugins/dbviewer/package-lock.json @@ -6,82 +6,7 @@ "packages": { "": { "name": "countly-dbviewer", - "version": "0.1.0", - "dependencies": { - "bson": "^4.7.2" - } - }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/bson": { - "version": "4.7.2", - "resolved": "https://registry.npmjs.org/bson/-/bson-4.7.2.tgz", - "integrity": "sha512-Ry9wCtIZ5kGqkJoi6aD8KjxFZEx78guTQDnpXWiNthsxzrxAK/i8E6pCHAIZTbaEFWcOCvbecMukfK7XUvyLpQ==", - "dependencies": { - "buffer": "^5.6.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] + "version": "0.1.0" } } } diff --git a/plugins/dbviewer/package.json b/plugins/dbviewer/package.json index 403b2d9b3d7..60bcdd651e6 100644 --- a/plugins/dbviewer/package.json +++ b/plugins/dbviewer/package.json @@ -20,7 +20,6 @@ "database" ], "dependencies": { - "bson": "^4.7.2" }, "private": true } From 45fb36b7b84e9b97fe98dadb62967334310c1331 Mon Sep 17 00:00:00 2001 From: Anna Sosina Date: Wed, 27 Nov 2024 18:26:18 +0200 Subject: [PATCH 59/70] code quality --- plugins/pluginManager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/pluginManager.js b/plugins/pluginManager.js index 388dbc538bc..7211fa3d847 100644 --- a/plugins/pluginManager.js +++ b/plugins/pluginManager.js @@ -2344,7 +2344,7 @@ var pluginManager = function pluginManager() { } return function(err, res) { if (res) { - if (!res.value && data.name === "findAndModify" && data && data.args && data.args[3] && data.args[3].remove) { + if (!res.value && data && data.name === "findAndModify" && data.args && data.args[3] && data.args[3].remove) { res = {"value": res}; } if (!res.result) { From 94525ffc034d0b1efd2e8936d0e329aeabf616e2 Mon Sep 17 00:00:00 2001 From: Arturs Sosins Date: Wed, 27 Nov 2024 19:14:15 +0200 Subject: [PATCH 60/70] Bump mongodb from 6.9.0 to 6.11.0 --- package-lock.json | 12 ++++++------ package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5f9e83d624a..b001807fa0e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -53,7 +53,7 @@ "method-override": "3.0.0", "moment": "2.30.1", "moment-timezone": "0.5.46", - "mongodb": "6.9.0", + "mongodb": "6.11.0", "nginx-conf": "2.1.0", "nodemailer": "6.9.16", "object-hash": "3.0.0", @@ -9337,13 +9337,13 @@ } }, "node_modules/mongodb": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.9.0.tgz", - "integrity": "sha512-UMopBVx1LmEUbW/QE0Hw18u583PEDVQmUmVzzBRH0o/xtE9DBRA5ZYLOjpLIa03i8FXjzvQECJcqoMvCXftTUA==", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.11.0.tgz", + "integrity": "sha512-yVbPw0qT268YKhG241vAMLaDQAPbRyTgo++odSgGc9kXnzOujQI60Iyj23B9sQQFPSvmNPvMZ3dsFz0aN55KgA==", "license": "Apache-2.0", "dependencies": { - "@mongodb-js/saslprep": "^1.1.5", - "bson": "^6.7.0", + "@mongodb-js/saslprep": "^1.1.9", + "bson": "^6.10.0", "mongodb-connection-string-url": "^3.0.0" }, "engines": { diff --git a/package.json b/package.json index 13de1a54dbd..3be9b0fdf39 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "method-override": "3.0.0", "moment": "2.30.1", "moment-timezone": "0.5.46", - "mongodb": "6.9.0", + "mongodb": "6.11.0", "nginx-conf": "2.1.0", "nodemailer": "6.9.16", "object-hash": "3.0.0", From bcc4f900923837cb29586cf9885fd0741ab4063e Mon Sep 17 00:00:00 2001 From: Gabriel Oliveira Date: Wed, 27 Nov 2024 18:42:35 +0000 Subject: [PATCH 61/70] feat: add tooltip format prop --- .../express/public/javascripts/countly/vue/components/content.js | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/express/public/javascripts/countly/vue/components/content.js b/frontend/express/public/javascripts/countly/vue/components/content.js index cbcdd9d32f8..2ebd538aa26 100644 --- a/frontend/express/public/javascripts/countly/vue/components/content.js +++ b/frontend/express/public/javascripts/countly/vue/components/content.js @@ -425,6 +425,7 @@ v-bind="inputProps" :value="localValue" @input="updateValue" + :format-tooltip="inputProps && inputProps.formatTooltip" :min="inputProps && inputProps.min" :max="inputProps && inputProps.max" class="cly-vue-content-builder__layout-step__component" From e1b4fd0165c29cf26b943069bdc100f2e01ce6ad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Nov 2024 19:01:16 +0000 Subject: [PATCH 62/70] Bump jimp from 0.22.12 to 1.6.0 Bumps [jimp](https://github.com/jimp-dev/jimp) from 0.22.12 to 1.6.0. - [Release notes](https://github.com/jimp-dev/jimp/releases) - [Changelog](https://github.com/jimp-dev/jimp/blob/main/CHANGELOG.md) - [Commits](https://github.com/jimp-dev/jimp/compare/v0.22.12...v1.6.0) --- updated-dependencies: - dependency-name: jimp dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 822 ++++++++++++++++++++-------------------------- package.json | 2 +- 2 files changed, 352 insertions(+), 472 deletions(-) diff --git a/package-lock.json b/package-lock.json index 87cc1f7ad36..908c264dc43 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,7 @@ "grunt-contrib-uglify": "5.2.2", "hpagent": "^1.2.0", "icanhazip": "^1.0.3", - "jimp": "0.22.12", + "jimp": "1.6.0", "json2csv": "5.0.7", "jsonwebtoken": "^9.0.1", "later": "1.2.0", @@ -1213,423 +1213,428 @@ "node": ">=8" } }, - "node_modules/@jimp/bmp": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/@jimp/bmp/-/bmp-0.22.12.tgz", - "integrity": "sha512-aeI64HD0npropd+AR76MCcvvRaa+Qck6loCOS03CkkxGHN5/r336qTM5HPUdHKMDOGzqknuVPA8+kK1t03z12g==", - "license": "MIT", - "dependencies": { - "@jimp/utils": "^0.22.12", - "bmp-js": "^0.1.0" - }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5" - } - }, "node_modules/@jimp/core": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/@jimp/core/-/core-0.22.12.tgz", - "integrity": "sha512-l0RR0dOPyzMKfjUW1uebzueFEDtCOj9fN6pyTYWWOM/VS4BciXQ1VVrJs8pO3kycGYZxncRKhCoygbNr8eEZQA==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jimp/core/-/core-1.6.0.tgz", + "integrity": "sha512-EQQlKU3s9QfdJqiSrZWNTxBs3rKXgO2W+GxNXDtwchF3a4IqxDheFX1ti+Env9hdJXDiYLp2jTRjlxhPthsk8w==", "license": "MIT", "dependencies": { - "@jimp/utils": "^0.22.12", - "any-base": "^1.1.0", - "buffer": "^5.2.0", + "@jimp/file-ops": "1.6.0", + "@jimp/types": "1.6.0", + "@jimp/utils": "1.6.0", + "await-to-js": "^3.0.0", "exif-parser": "^0.1.12", - "file-type": "^16.5.4", - "isomorphic-fetch": "^3.0.0", - "pixelmatch": "^4.0.2", - "tinycolor2": "^1.6.0" + "file-type": "^16.0.0", + "mime": "3" + }, + "engines": { + "node": ">=18" } }, - "node_modules/@jimp/custom": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/@jimp/custom/-/custom-0.22.12.tgz", - "integrity": "sha512-xcmww1O/JFP2MrlGUMd3Q78S3Qu6W3mYTXYuIqFq33EorgYHV/HqymHfXy9GjiCJ7OI+7lWx6nYFOzU7M4rd1Q==", + "node_modules/@jimp/core/node_modules/mime": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", "license": "MIT", - "dependencies": { - "@jimp/core": "^0.22.12" + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=10.0.0" } }, - "node_modules/@jimp/gif": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/@jimp/gif/-/gif-0.22.12.tgz", - "integrity": "sha512-y6BFTJgch9mbor2H234VSjd9iwAhaNf/t3US5qpYIs0TSbAvM02Fbc28IaDETj9+4YB4676sz4RcN/zwhfu1pg==", + "node_modules/@jimp/diff": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jimp/diff/-/diff-1.6.0.tgz", + "integrity": "sha512-+yUAQ5gvRC5D1WHYxjBHZI7JBRusGGSLf8AmPRPCenTzh4PA+wZ1xv2+cYqQwTfQHU5tXYOhA0xDytfHUf1Zyw==", "license": "MIT", "dependencies": { - "@jimp/utils": "^0.22.12", - "gifwrap": "^0.10.1", - "omggif": "^1.0.9" + "@jimp/plugin-resize": "1.6.0", + "@jimp/types": "1.6.0", + "@jimp/utils": "1.6.0", + "pixelmatch": "^5.3.0" }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5" + "engines": { + "node": ">=18" } }, - "node_modules/@jimp/jpeg": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/@jimp/jpeg/-/jpeg-0.22.12.tgz", - "integrity": "sha512-Rq26XC/uQWaQKyb/5lksCTCxXhtY01NJeBN+dQv5yNYedN0i7iYu+fXEoRsfaJ8xZzjoANH8sns7rVP4GE7d/Q==", + "node_modules/@jimp/file-ops": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jimp/file-ops/-/file-ops-1.6.0.tgz", + "integrity": "sha512-Dx/bVDmgnRe1AlniRpCKrGRm5YvGmUwbDzt+MAkgmLGf+jvBT75hmMEZ003n9HQI/aPnm/YKnXjg/hOpzNCpHQ==", "license": "MIT", - "dependencies": { - "@jimp/utils": "^0.22.12", - "jpeg-js": "^0.4.4" - }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5" + "engines": { + "node": ">=18" } }, - "node_modules/@jimp/plugin-blit": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/@jimp/plugin-blit/-/plugin-blit-0.22.12.tgz", - "integrity": "sha512-xslz2ZoFZOPLY8EZ4dC29m168BtDx95D6K80TzgUi8gqT7LY6CsajWO0FAxDwHz6h0eomHMfyGX0stspBrTKnQ==", + "node_modules/@jimp/js-bmp": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jimp/js-bmp/-/js-bmp-1.6.0.tgz", + "integrity": "sha512-FU6Q5PC/e3yzLyBDXupR3SnL3htU7S3KEs4e6rjDP6gNEOXRFsWs6YD3hXuXd50jd8ummy+q2WSwuGkr8wi+Gw==", "license": "MIT", "dependencies": { - "@jimp/utils": "^0.22.12" + "@jimp/core": "1.6.0", + "@jimp/types": "1.6.0", + "@jimp/utils": "1.6.0", + "bmp-ts": "^1.0.9" }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5" + "engines": { + "node": ">=18" } }, - "node_modules/@jimp/plugin-blur": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/@jimp/plugin-blur/-/plugin-blur-0.22.12.tgz", - "integrity": "sha512-S0vJADTuh1Q9F+cXAwFPlrKWzDj2F9t/9JAbUvaaDuivpyWuImEKXVz5PUZw2NbpuSHjwssbTpOZ8F13iJX4uw==", + "node_modules/@jimp/js-gif": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jimp/js-gif/-/js-gif-1.6.0.tgz", + "integrity": "sha512-N9CZPHOrJTsAUoWkWZstLPpwT5AwJ0wge+47+ix3++SdSL/H2QzyMqxbcDYNFe4MoI5MIhATfb0/dl/wmX221g==", "license": "MIT", "dependencies": { - "@jimp/utils": "^0.22.12" + "@jimp/core": "1.6.0", + "@jimp/types": "1.6.0", + "gifwrap": "^0.10.1", + "omggif": "^1.0.10" }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5" + "engines": { + "node": ">=18" } }, - "node_modules/@jimp/plugin-circle": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/@jimp/plugin-circle/-/plugin-circle-0.22.12.tgz", - "integrity": "sha512-SWVXx1yiuj5jZtMijqUfvVOJBwOifFn0918ou4ftoHgegc5aHWW5dZbYPjvC9fLpvz7oSlptNl2Sxr1zwofjTg==", + "node_modules/@jimp/js-jpeg": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jimp/js-jpeg/-/js-jpeg-1.6.0.tgz", + "integrity": "sha512-6vgFDqeusblf5Pok6B2DUiMXplH8RhIKAryj1yn+007SIAQ0khM1Uptxmpku/0MfbClx2r7pnJv9gWpAEJdMVA==", "license": "MIT", "dependencies": { - "@jimp/utils": "^0.22.12" + "@jimp/core": "1.6.0", + "@jimp/types": "1.6.0", + "jpeg-js": "^0.4.4" }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5" + "engines": { + "node": ">=18" } }, - "node_modules/@jimp/plugin-color": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/@jimp/plugin-color/-/plugin-color-0.22.12.tgz", - "integrity": "sha512-xImhTE5BpS8xa+mAN6j4sMRWaUgUDLoaGHhJhpC+r7SKKErYDR0WQV4yCE4gP+N0gozD0F3Ka1LUSaMXrn7ZIA==", + "node_modules/@jimp/js-png": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jimp/js-png/-/js-png-1.6.0.tgz", + "integrity": "sha512-AbQHScy3hDDgMRNfG0tPjL88AV6qKAILGReIa3ATpW5QFjBKpisvUaOqhzJ7Reic1oawx3Riyv152gaPfqsBVg==", "license": "MIT", "dependencies": { - "@jimp/utils": "^0.22.12", - "tinycolor2": "^1.6.0" + "@jimp/core": "1.6.0", + "@jimp/types": "1.6.0", + "pngjs": "^7.0.0" }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5" + "engines": { + "node": ">=18" } }, - "node_modules/@jimp/plugin-contain": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/@jimp/plugin-contain/-/plugin-contain-0.22.12.tgz", - "integrity": "sha512-Eo3DmfixJw3N79lWk8q/0SDYbqmKt1xSTJ69yy8XLYQj9svoBbyRpSnHR+n9hOw5pKXytHwUW6nU4u1wegHNoQ==", + "node_modules/@jimp/js-tiff": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jimp/js-tiff/-/js-tiff-1.6.0.tgz", + "integrity": "sha512-zhReR8/7KO+adijj3h0ZQUOiun3mXUv79zYEAKvE0O+rP7EhgtKvWJOZfRzdZSNv0Pu1rKtgM72qgtwe2tFvyw==", "license": "MIT", "dependencies": { - "@jimp/utils": "^0.22.12" + "@jimp/core": "1.6.0", + "@jimp/types": "1.6.0", + "utif2": "^4.1.0" }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5", - "@jimp/plugin-blit": ">=0.3.5", - "@jimp/plugin-resize": ">=0.3.5", - "@jimp/plugin-scale": ">=0.3.5" + "engines": { + "node": ">=18" } }, - "node_modules/@jimp/plugin-cover": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/@jimp/plugin-cover/-/plugin-cover-0.22.12.tgz", - "integrity": "sha512-z0w/1xH/v/knZkpTNx+E8a7fnasQ2wHG5ze6y5oL2dhH1UufNua8gLQXlv8/W56+4nJ1brhSd233HBJCo01BXA==", + "node_modules/@jimp/plugin-blit": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-blit/-/plugin-blit-1.6.0.tgz", + "integrity": "sha512-M+uRWl1csi7qilnSK8uxK4RJMSuVeBiO1AY0+7APnfUbQNZm6hCe0CCFv1Iyw1D/Dhb8ph8fQgm5mwM0eSxgVA==", "license": "MIT", "dependencies": { - "@jimp/utils": "^0.22.12" + "@jimp/types": "1.6.0", + "@jimp/utils": "1.6.0", + "zod": "^3.23.8" }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5", - "@jimp/plugin-crop": ">=0.3.5", - "@jimp/plugin-resize": ">=0.3.5", - "@jimp/plugin-scale": ">=0.3.5" + "engines": { + "node": ">=18" } }, - "node_modules/@jimp/plugin-crop": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/@jimp/plugin-crop/-/plugin-crop-0.22.12.tgz", - "integrity": "sha512-FNuUN0OVzRCozx8XSgP9MyLGMxNHHJMFt+LJuFjn1mu3k0VQxrzqbN06yIl46TVejhyAhcq5gLzqmSCHvlcBVw==", + "node_modules/@jimp/plugin-blur": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-blur/-/plugin-blur-1.6.0.tgz", + "integrity": "sha512-zrM7iic1OTwUCb0g/rN5y+UnmdEsT3IfuCXCJJNs8SZzP0MkZ1eTvuwK9ZidCuMo4+J3xkzCidRwYXB5CyGZTw==", "license": "MIT", "dependencies": { - "@jimp/utils": "^0.22.12" + "@jimp/core": "1.6.0", + "@jimp/utils": "1.6.0" }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5" + "engines": { + "node": ">=18" } }, - "node_modules/@jimp/plugin-displace": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/@jimp/plugin-displace/-/plugin-displace-0.22.12.tgz", - "integrity": "sha512-qpRM8JRicxfK6aPPqKZA6+GzBwUIitiHaZw0QrJ64Ygd3+AsTc7BXr+37k2x7QcyCvmKXY4haUrSIsBug4S3CA==", + "node_modules/@jimp/plugin-circle": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-circle/-/plugin-circle-1.6.0.tgz", + "integrity": "sha512-xt1Gp+LtdMKAXfDp3HNaG30SPZW6AQ7dtAtTnoRKorRi+5yCJjKqXRgkewS5bvj8DEh87Ko1ydJfzqS3P2tdWw==", "license": "MIT", "dependencies": { - "@jimp/utils": "^0.22.12" + "@jimp/types": "1.6.0", + "zod": "^3.23.8" }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5" + "engines": { + "node": ">=18" } }, - "node_modules/@jimp/plugin-dither": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/@jimp/plugin-dither/-/plugin-dither-0.22.12.tgz", - "integrity": "sha512-jYgGdSdSKl1UUEanX8A85v4+QUm+PE8vHFwlamaKk89s+PXQe7eVE3eNeSZX4inCq63EHL7cX580dMqkoC3ZLw==", + "node_modules/@jimp/plugin-color": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-color/-/plugin-color-1.6.0.tgz", + "integrity": "sha512-J5q8IVCpkBsxIXM+45XOXTrsyfblyMZg3a9eAo0P7VPH4+CrvyNQwaYatbAIamSIN1YzxmO3DkIZXzRjFSz1SA==", "license": "MIT", "dependencies": { - "@jimp/utils": "^0.22.12" + "@jimp/core": "1.6.0", + "@jimp/types": "1.6.0", + "@jimp/utils": "1.6.0", + "tinycolor2": "^1.6.0", + "zod": "^3.23.8" }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5" + "engines": { + "node": ">=18" } }, - "node_modules/@jimp/plugin-fisheye": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/@jimp/plugin-fisheye/-/plugin-fisheye-0.22.12.tgz", - "integrity": "sha512-LGuUTsFg+fOp6KBKrmLkX4LfyCy8IIsROwoUvsUPKzutSqMJnsm3JGDW2eOmWIS/jJpPaeaishjlxvczjgII+Q==", + "node_modules/@jimp/plugin-contain": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-contain/-/plugin-contain-1.6.0.tgz", + "integrity": "sha512-oN/n+Vdq/Qg9bB4yOBOxtY9IPAtEfES8J1n9Ddx+XhGBYT1/QTU/JYkGaAkIGoPnyYvmLEDqMz2SGihqlpqfzQ==", "license": "MIT", "dependencies": { - "@jimp/utils": "^0.22.12" + "@jimp/core": "1.6.0", + "@jimp/plugin-blit": "1.6.0", + "@jimp/plugin-resize": "1.6.0", + "@jimp/types": "1.6.0", + "@jimp/utils": "1.6.0", + "zod": "^3.23.8" }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5" + "engines": { + "node": ">=18" } }, - "node_modules/@jimp/plugin-flip": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/@jimp/plugin-flip/-/plugin-flip-0.22.12.tgz", - "integrity": "sha512-m251Rop7GN8W0Yo/rF9LWk6kNclngyjIJs/VXHToGQ6EGveOSTSQaX2Isi9f9lCDLxt+inBIb7nlaLLxnvHX8Q==", + "node_modules/@jimp/plugin-cover": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-cover/-/plugin-cover-1.6.0.tgz", + "integrity": "sha512-Iow0h6yqSC269YUJ8HC3Q/MpCi2V55sMlbkkTTx4zPvd8mWZlC0ykrNDeAy9IJegrQ7v5E99rJwmQu25lygKLA==", "license": "MIT", "dependencies": { - "@jimp/utils": "^0.22.12" + "@jimp/core": "1.6.0", + "@jimp/plugin-crop": "1.6.0", + "@jimp/plugin-resize": "1.6.0", + "@jimp/types": "1.6.0", + "zod": "^3.23.8" }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5", - "@jimp/plugin-rotate": ">=0.3.5" + "engines": { + "node": ">=18" } }, - "node_modules/@jimp/plugin-gaussian": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/@jimp/plugin-gaussian/-/plugin-gaussian-0.22.12.tgz", - "integrity": "sha512-sBfbzoOmJ6FczfG2PquiK84NtVGeScw97JsCC3rpQv1PHVWyW+uqWFF53+n3c8Y0P2HWlUjflEla2h/vWShvhg==", + "node_modules/@jimp/plugin-crop": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-crop/-/plugin-crop-1.6.0.tgz", + "integrity": "sha512-KqZkEhvs+21USdySCUDI+GFa393eDIzbi1smBqkUPTE+pRwSWMAf01D5OC3ZWB+xZsNla93BDS9iCkLHA8wang==", "license": "MIT", "dependencies": { - "@jimp/utils": "^0.22.12" + "@jimp/core": "1.6.0", + "@jimp/types": "1.6.0", + "@jimp/utils": "1.6.0", + "zod": "^3.23.8" }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5" + "engines": { + "node": ">=18" } }, - "node_modules/@jimp/plugin-invert": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/@jimp/plugin-invert/-/plugin-invert-0.22.12.tgz", - "integrity": "sha512-N+6rwxdB+7OCR6PYijaA/iizXXodpxOGvT/smd/lxeXsZ/empHmFFFJ/FaXcYh19Tm04dGDaXcNF/dN5nm6+xQ==", + "node_modules/@jimp/plugin-displace": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-displace/-/plugin-displace-1.6.0.tgz", + "integrity": "sha512-4Y10X9qwr5F+Bo5ME356XSACEF55485j5nGdiyJ9hYzjQP9nGgxNJaZ4SAOqpd+k5sFaIeD7SQ0Occ26uIng5Q==", "license": "MIT", "dependencies": { - "@jimp/utils": "^0.22.12" + "@jimp/types": "1.6.0", + "@jimp/utils": "1.6.0", + "zod": "^3.23.8" }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5" + "engines": { + "node": ">=18" } }, - "node_modules/@jimp/plugin-mask": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/@jimp/plugin-mask/-/plugin-mask-0.22.12.tgz", - "integrity": "sha512-4AWZg+DomtpUA099jRV8IEZUfn1wLv6+nem4NRJC7L/82vxzLCgXKTxvNvBcNmJjT9yS1LAAmiJGdWKXG63/NA==", + "node_modules/@jimp/plugin-dither": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-dither/-/plugin-dither-1.6.0.tgz", + "integrity": "sha512-600d1RxY0pKwgyU0tgMahLNKsqEcxGdbgXadCiVCoGd6V6glyCvkNrnnwC0n5aJ56Htkj88PToSdF88tNVZEEQ==", "license": "MIT", "dependencies": { - "@jimp/utils": "^0.22.12" + "@jimp/types": "1.6.0" }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5" + "engines": { + "node": ">=18" } }, - "node_modules/@jimp/plugin-normalize": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/@jimp/plugin-normalize/-/plugin-normalize-0.22.12.tgz", - "integrity": "sha512-0So0rexQivnWgnhacX4cfkM2223YdExnJTTy6d06WbkfZk5alHUx8MM3yEzwoCN0ErO7oyqEWRnEkGC+As1FtA==", + "node_modules/@jimp/plugin-fisheye": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-fisheye/-/plugin-fisheye-1.6.0.tgz", + "integrity": "sha512-E5QHKWSCBFtpgZarlmN3Q6+rTQxjirFqo44ohoTjzYVrDI6B6beXNnPIThJgPr0Y9GwfzgyarKvQuQuqCnnfbA==", "license": "MIT", "dependencies": { - "@jimp/utils": "^0.22.12" + "@jimp/types": "1.6.0", + "@jimp/utils": "1.6.0", + "zod": "^3.23.8" }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5" + "engines": { + "node": ">=18" } }, - "node_modules/@jimp/plugin-print": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/@jimp/plugin-print/-/plugin-print-0.22.12.tgz", - "integrity": "sha512-c7TnhHlxm87DJeSnwr/XOLjJU/whoiKYY7r21SbuJ5nuH+7a78EW1teOaj5gEr2wYEd7QtkFqGlmyGXY/YclyQ==", + "node_modules/@jimp/plugin-flip": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-flip/-/plugin-flip-1.6.0.tgz", + "integrity": "sha512-/+rJVDuBIVOgwoyVkBjUFHtP+wmW0r+r5OQ2GpatQofToPVbJw1DdYWXlwviSx7hvixTWLKVgRWQ5Dw862emDg==", "license": "MIT", "dependencies": { - "@jimp/utils": "^0.22.12", - "load-bmfont": "^1.4.1" + "@jimp/types": "1.6.0", + "zod": "^3.23.8" }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5", - "@jimp/plugin-blit": ">=0.3.5" + "engines": { + "node": ">=18" } }, - "node_modules/@jimp/plugin-resize": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/@jimp/plugin-resize/-/plugin-resize-0.22.12.tgz", - "integrity": "sha512-3NyTPlPbTnGKDIbaBgQ3HbE6wXbAlFfxHVERmrbqAi8R3r6fQPxpCauA8UVDnieg5eo04D0T8nnnNIX//i/sXg==", + "node_modules/@jimp/plugin-hash": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-hash/-/plugin-hash-1.6.0.tgz", + "integrity": "sha512-wWzl0kTpDJgYVbZdajTf+4NBSKvmI3bRI8q6EH9CVeIHps9VWVsUvEyb7rpbcwVLWYuzDtP2R0lTT6WeBNQH9Q==", "license": "MIT", "dependencies": { - "@jimp/utils": "^0.22.12" + "@jimp/core": "1.6.0", + "@jimp/js-bmp": "1.6.0", + "@jimp/js-jpeg": "1.6.0", + "@jimp/js-png": "1.6.0", + "@jimp/js-tiff": "1.6.0", + "@jimp/plugin-color": "1.6.0", + "@jimp/plugin-resize": "1.6.0", + "@jimp/types": "1.6.0", + "@jimp/utils": "1.6.0", + "any-base": "^1.1.0" }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5" + "engines": { + "node": ">=18" } }, - "node_modules/@jimp/plugin-rotate": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/@jimp/plugin-rotate/-/plugin-rotate-0.22.12.tgz", - "integrity": "sha512-9YNEt7BPAFfTls2FGfKBVgwwLUuKqy+E8bDGGEsOqHtbuhbshVGxN2WMZaD4gh5IDWvR+emmmPPWGgaYNYt1gA==", + "node_modules/@jimp/plugin-mask": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-mask/-/plugin-mask-1.6.0.tgz", + "integrity": "sha512-Cwy7ExSJMZszvkad8NV8o/Z92X2kFUFM8mcDAhNVxU0Q6tA0op2UKRJY51eoK8r6eds/qak3FQkXakvNabdLnA==", "license": "MIT", "dependencies": { - "@jimp/utils": "^0.22.12" + "@jimp/types": "1.6.0", + "zod": "^3.23.8" }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5", - "@jimp/plugin-blit": ">=0.3.5", - "@jimp/plugin-crop": ">=0.3.5", - "@jimp/plugin-resize": ">=0.3.5" + "engines": { + "node": ">=18" } }, - "node_modules/@jimp/plugin-scale": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/@jimp/plugin-scale/-/plugin-scale-0.22.12.tgz", - "integrity": "sha512-dghs92qM6MhHj0HrV2qAwKPMklQtjNpoYgAB94ysYpsXslhRTiPisueSIELRwZGEr0J0VUxpUY7HgJwlSIgGZw==", + "node_modules/@jimp/plugin-print": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-print/-/plugin-print-1.6.0.tgz", + "integrity": "sha512-zarTIJi8fjoGMSI/M3Xh5yY9T65p03XJmPsuNet19K/Q7mwRU6EV2pfj+28++2PV2NJ+htDF5uecAlnGyxFN2A==", "license": "MIT", "dependencies": { - "@jimp/utils": "^0.22.12" + "@jimp/core": "1.6.0", + "@jimp/js-jpeg": "1.6.0", + "@jimp/js-png": "1.6.0", + "@jimp/plugin-blit": "1.6.0", + "@jimp/types": "1.6.0", + "parse-bmfont-ascii": "^1.0.6", + "parse-bmfont-binary": "^1.0.6", + "parse-bmfont-xml": "^1.1.6", + "simple-xml-to-json": "^1.2.2", + "zod": "^3.23.8" }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5", - "@jimp/plugin-resize": ">=0.3.5" + "engines": { + "node": ">=18" } }, - "node_modules/@jimp/plugin-shadow": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/@jimp/plugin-shadow/-/plugin-shadow-0.22.12.tgz", - "integrity": "sha512-FX8mTJuCt7/3zXVoeD/qHlm4YH2bVqBuWQHXSuBK054e7wFRnRnbSLPUqAwSeYP3lWqpuQzJtgiiBxV3+WWwTg==", + "node_modules/@jimp/plugin-quantize": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-quantize/-/plugin-quantize-1.6.0.tgz", + "integrity": "sha512-EmzZ/s9StYQwbpG6rUGBCisc3f64JIhSH+ncTJd+iFGtGo0YvSeMdAd+zqgiHpfZoOL54dNavZNjF4otK+mvlg==", "license": "MIT", "dependencies": { - "@jimp/utils": "^0.22.12" + "image-q": "^4.0.0", + "zod": "^3.23.8" }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5", - "@jimp/plugin-blur": ">=0.3.5", - "@jimp/plugin-resize": ">=0.3.5" + "engines": { + "node": ">=18" } }, - "node_modules/@jimp/plugin-threshold": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/@jimp/plugin-threshold/-/plugin-threshold-0.22.12.tgz", - "integrity": "sha512-4x5GrQr1a/9L0paBC/MZZJjjgjxLYrqSmWd+e+QfAEPvmRxdRoQ5uKEuNgXnm9/weHQBTnQBQsOY2iFja+XGAw==", + "node_modules/@jimp/plugin-resize": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-resize/-/plugin-resize-1.6.0.tgz", + "integrity": "sha512-uSUD1mqXN9i1SGSz5ov3keRZ7S9L32/mAQG08wUwZiEi5FpbV0K8A8l1zkazAIZi9IJzLlTauRNU41Mi8IF9fA==", "license": "MIT", "dependencies": { - "@jimp/utils": "^0.22.12" + "@jimp/core": "1.6.0", + "@jimp/types": "1.6.0", + "zod": "^3.23.8" }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5", - "@jimp/plugin-color": ">=0.8.0", - "@jimp/plugin-resize": ">=0.8.0" - } - }, - "node_modules/@jimp/plugins": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/@jimp/plugins/-/plugins-0.22.12.tgz", - "integrity": "sha512-yBJ8vQrDkBbTgQZLty9k4+KtUQdRjsIDJSPjuI21YdVeqZxYywifHl4/XWILoTZsjTUASQcGoH0TuC0N7xm3ww==", - "license": "MIT", - "dependencies": { - "@jimp/plugin-blit": "^0.22.12", - "@jimp/plugin-blur": "^0.22.12", - "@jimp/plugin-circle": "^0.22.12", - "@jimp/plugin-color": "^0.22.12", - "@jimp/plugin-contain": "^0.22.12", - "@jimp/plugin-cover": "^0.22.12", - "@jimp/plugin-crop": "^0.22.12", - "@jimp/plugin-displace": "^0.22.12", - "@jimp/plugin-dither": "^0.22.12", - "@jimp/plugin-fisheye": "^0.22.12", - "@jimp/plugin-flip": "^0.22.12", - "@jimp/plugin-gaussian": "^0.22.12", - "@jimp/plugin-invert": "^0.22.12", - "@jimp/plugin-mask": "^0.22.12", - "@jimp/plugin-normalize": "^0.22.12", - "@jimp/plugin-print": "^0.22.12", - "@jimp/plugin-resize": "^0.22.12", - "@jimp/plugin-rotate": "^0.22.12", - "@jimp/plugin-scale": "^0.22.12", - "@jimp/plugin-shadow": "^0.22.12", - "@jimp/plugin-threshold": "^0.22.12", - "timm": "^1.6.1" - }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5" + "engines": { + "node": ">=18" } }, - "node_modules/@jimp/png": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/@jimp/png/-/png-0.22.12.tgz", - "integrity": "sha512-Mrp6dr3UTn+aLK8ty/dSKELz+Otdz1v4aAXzV5q53UDD2rbB5joKVJ/ChY310B+eRzNxIovbUF1KVrUsYdE8Hg==", + "node_modules/@jimp/plugin-rotate": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-rotate/-/plugin-rotate-1.6.0.tgz", + "integrity": "sha512-JagdjBLnUZGSG4xjCLkIpQOZZ3Mjbg8aGCCi4G69qR+OjNpOeGI7N2EQlfK/WE8BEHOW5vdjSyglNqcYbQBWRw==", "license": "MIT", "dependencies": { - "@jimp/utils": "^0.22.12", - "pngjs": "^6.0.0" + "@jimp/core": "1.6.0", + "@jimp/plugin-crop": "1.6.0", + "@jimp/plugin-resize": "1.6.0", + "@jimp/types": "1.6.0", + "@jimp/utils": "1.6.0", + "zod": "^3.23.8" }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5" + "engines": { + "node": ">=18" } }, - "node_modules/@jimp/tiff": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/@jimp/tiff/-/tiff-0.22.12.tgz", - "integrity": "sha512-E1LtMh4RyJsoCAfAkBRVSYyZDTtLq9p9LUiiYP0vPtXyxX4BiYBUYihTLSBlCQg5nF2e4OpQg7SPrLdJ66u7jg==", + "node_modules/@jimp/plugin-threshold": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-threshold/-/plugin-threshold-1.6.0.tgz", + "integrity": "sha512-M59m5dzLoHOVWdM41O8z9SyySzcDn43xHseOH0HavjsfQsT56GGCC4QzU1banJidbUrePhzoEdS42uFE8Fei8w==", "license": "MIT", "dependencies": { - "utif2": "^4.0.1" + "@jimp/core": "1.6.0", + "@jimp/plugin-color": "1.6.0", + "@jimp/plugin-hash": "1.6.0", + "@jimp/types": "1.6.0", + "@jimp/utils": "1.6.0", + "zod": "^3.23.8" }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5" + "engines": { + "node": ">=18" } }, "node_modules/@jimp/types": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/@jimp/types/-/types-0.22.12.tgz", - "integrity": "sha512-wwKYzRdElE1MBXFREvCto5s699izFHNVvALUv79GXNbsOVqlwlOxlWJ8DuyOGIXoLP4JW/m30YyuTtfUJgMRMA==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jimp/types/-/types-1.6.0.tgz", + "integrity": "sha512-7UfRsiKo5GZTAATxm2qQ7jqmUXP0DxTArztllTcYdyw6Xi5oT4RaoXynVtCD4UyLK5gJgkZJcwonoijrhYFKfg==", "license": "MIT", "dependencies": { - "@jimp/bmp": "^0.22.12", - "@jimp/gif": "^0.22.12", - "@jimp/jpeg": "^0.22.12", - "@jimp/png": "^0.22.12", - "@jimp/tiff": "^0.22.12", - "timm": "^1.6.1" + "zod": "^3.23.8" }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5" + "engines": { + "node": ">=18" } }, "node_modules/@jimp/utils": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/@jimp/utils/-/utils-0.22.12.tgz", - "integrity": "sha512-yJ5cWUknGnilBq97ZXOyOS0HhsHOyAyjHwYfHxGbSyMTohgQI6sVyE8KPgDwH8HHW/nMKXk8TrSwAE71zt716Q==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jimp/utils/-/utils-1.6.0.tgz", + "integrity": "sha512-gqFTGEosKbOkYF/WFj26jMHOI5OH2jeP1MmC/zbK6BF6VJBf8rIC5898dPfSzZEbSA0wbbV5slbntWVc5PKLFA==", "license": "MIT", "dependencies": { - "regenerator-runtime": "^0.13.3" + "@jimp/types": "1.6.0", + "tinycolor2": "^1.6.0" + }, + "engines": { + "node": ">=18" } }, "node_modules/@jridgewell/gen-mapping": { @@ -3065,6 +3070,15 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "license": "MIT" }, + "node_modules/await-to-js": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/await-to-js/-/await-to-js-3.0.0.tgz", + "integrity": "sha512-zJAaP9zxTcvTHRlejau3ZOY4V7SRpiByf3/dxx2uyKxxor19tpmpV2QRsTKikckwhaPmr2dVpxxMr7jOCYVp5g==", + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/b4a": { "version": "1.6.7", "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.7.tgz", @@ -3213,10 +3227,10 @@ "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", "license": "MIT" }, - "node_modules/bmp-js": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/bmp-js/-/bmp-js-0.1.0.tgz", - "integrity": "sha512-vHdS19CnY3hwiNdkaqk93DvjVLfbEcI8mys4UjuWrlX1haDmroo8o4xCzh4wD6DGV6HxRCyauwhHRqMTfERtjw==", + "node_modules/bmp-ts": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/bmp-ts/-/bmp-ts-1.0.9.tgz", + "integrity": "sha512-cTEHk2jLrPyi+12M3dhpEbnnPOsaZuq7C45ylbbQIiWgDFZq4UVYPEY5mlqjvsj/6gJv9qX5sa+ebDzLXT28Vw==", "license": "MIT" }, "node_modules/body": { @@ -3410,15 +3424,6 @@ "node": "*" } }, - "node_modules/buffer-equal": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-0.0.1.tgz", - "integrity": "sha512-RgSV6InVQ9ODPdLWJ5UAqBqJBOg370Nz6ZQtRzpt6nUjc8v0St97uJ4PYC6NztqIScrAXafKM3mZPMygSe1ggA==", - "license": "MIT", - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/buffer-equal-constant-time": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", @@ -3663,15 +3668,6 @@ "node": ">= 10" } }, - "node_modules/centra": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/centra/-/centra-2.7.0.tgz", - "integrity": "sha512-PbFMgMSrmgx6uxCdm57RUos9Tc3fclMvhLSATYN39XsDV29B89zZ3KA89jmY0vwSGazyU+uerqwa6t+KaodPcg==", - "license": "MIT", - "dependencies": { - "follow-redirects": "^1.15.6" - } - }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -5815,26 +5811,6 @@ "dev": true, "license": "MIT" }, - "node_modules/follow-redirects": { - "version": "1.15.6", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", - "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "license": "MIT", - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, "node_modules/for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -7562,12 +7538,6 @@ "node": ">=8" } }, - "node_modules/is-function": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.2.tgz", - "integrity": "sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ==", - "license": "MIT" - }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -7721,16 +7691,6 @@ "node": ">=0.10.0" } }, - "node_modules/isomorphic-fetch": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-3.0.0.tgz", - "integrity": "sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA==", - "license": "MIT", - "dependencies": { - "node-fetch": "^2.6.1", - "whatwg-fetch": "^3.4.1" - } - }, "node_modules/istanbul-lib-coverage": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", @@ -8015,15 +7975,41 @@ } }, "node_modules/jimp": { - "version": "0.22.12", - "resolved": "https://registry.npmjs.org/jimp/-/jimp-0.22.12.tgz", - "integrity": "sha512-R5jZaYDnfkxKJy1dwLpj/7cvyjxiclxU3F4TrI/J4j2rS0niq6YDUMoPn5hs8GDpO+OZGo7Ky057CRtWesyhfg==", - "license": "MIT", - "dependencies": { - "@jimp/custom": "^0.22.12", - "@jimp/plugins": "^0.22.12", - "@jimp/types": "^0.22.12", - "regenerator-runtime": "^0.13.3" + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/jimp/-/jimp-1.6.0.tgz", + "integrity": "sha512-YcwCHw1kiqEeI5xRpDlPPBGL2EOpBKLwO4yIBJcXWHPj5PnA5urGq0jbyhM5KoNpypQ6VboSoxc9D8HyfvngSg==", + "license": "MIT", + "dependencies": { + "@jimp/core": "1.6.0", + "@jimp/diff": "1.6.0", + "@jimp/js-bmp": "1.6.0", + "@jimp/js-gif": "1.6.0", + "@jimp/js-jpeg": "1.6.0", + "@jimp/js-png": "1.6.0", + "@jimp/js-tiff": "1.6.0", + "@jimp/plugin-blit": "1.6.0", + "@jimp/plugin-blur": "1.6.0", + "@jimp/plugin-circle": "1.6.0", + "@jimp/plugin-color": "1.6.0", + "@jimp/plugin-contain": "1.6.0", + "@jimp/plugin-cover": "1.6.0", + "@jimp/plugin-crop": "1.6.0", + "@jimp/plugin-displace": "1.6.0", + "@jimp/plugin-dither": "1.6.0", + "@jimp/plugin-fisheye": "1.6.0", + "@jimp/plugin-flip": "1.6.0", + "@jimp/plugin-hash": "1.6.0", + "@jimp/plugin-mask": "1.6.0", + "@jimp/plugin-print": "1.6.0", + "@jimp/plugin-quantize": "1.6.0", + "@jimp/plugin-resize": "1.6.0", + "@jimp/plugin-rotate": "1.6.0", + "@jimp/plugin-threshold": "1.6.0", + "@jimp/types": "1.6.0", + "@jimp/utils": "1.6.0" + }, + "engines": { + "node": ">=18" } }, "node_modules/joycon": { @@ -8524,22 +8510,6 @@ "dev": true, "license": "MIT" }, - "node_modules/load-bmfont": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/load-bmfont/-/load-bmfont-1.4.2.tgz", - "integrity": "sha512-qElWkmjW9Oq1F9EI5Gt7aD9zcdHb9spJCW1L/dmPf7KzCCEJxq8nhHz5eCgI9aMf7vrG/wyaCqdsI+Iy9ZTlog==", - "license": "MIT", - "dependencies": { - "buffer-equal": "0.0.1", - "mime": "^1.3.4", - "parse-bmfont-ascii": "^1.0.3", - "parse-bmfont-binary": "^1.0.5", - "parse-bmfont-xml": "^1.1.4", - "phin": "^3.7.1", - "xhr": "^2.0.1", - "xtend": "^4.0.0" - } - }, "node_modules/loader-runner": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", @@ -9539,48 +9509,6 @@ "node": "^18 || ^20 || >= 21" } }, - "node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "license": "MIT", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/node-fetch/node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "license": "MIT" - }, - "node_modules/node-fetch/node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "license": "BSD-2-Clause" - }, - "node_modules/node-fetch/node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "license": "MIT", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "node_modules/node-gyp": { "version": "8.4.1", "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz", @@ -10518,12 +10446,6 @@ "node": ">=0.8" } }, - "node_modules/parse-headers": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.5.tgz", - "integrity": "sha512-ft3iAoLOB/MlwbNXgzy43SWGP6sQki2jQvAyBg/zDFAgr9bfNWZIUj42Kw2eJIl8kEi4PbgE6U1Zau/HwI75HA==", - "license": "MIT" - }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -10652,18 +10574,6 @@ "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", "license": "MIT" }, - "node_modules/phin": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/phin/-/phin-3.7.1.tgz", - "integrity": "sha512-GEazpTWwTZaEQ9RhL7Nyz0WwqilbqgLahDM3D0hxWwmVDI52nXEybHqiN6/elwpkJBhcuj+WbBu+QfT0uhPGfQ==", - "license": "MIT", - "dependencies": { - "centra": "^2.7.0" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/picocolors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", @@ -10692,24 +10602,24 @@ } }, "node_modules/pixelmatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/pixelmatch/-/pixelmatch-4.0.2.tgz", - "integrity": "sha512-J8B6xqiO37sU/gkcMglv6h5Jbd9xNER7aHzpfRdNmV4IbQBzBpe4l9XmbG+xPF/znacgu2jfEw+wHffaq/YkXA==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/pixelmatch/-/pixelmatch-5.3.0.tgz", + "integrity": "sha512-o8mkY4E/+LNUf6LzX96ht6k6CEDi65k9G2rjMtBe9Oo+VPKSvl+0GKHuH/AlG+GA5LPG/i5hrekkxUc3s2HU+Q==", "license": "ISC", "dependencies": { - "pngjs": "^3.0.0" + "pngjs": "^6.0.0" }, "bin": { "pixelmatch": "bin/pixelmatch" } }, "node_modules/pixelmatch/node_modules/pngjs": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-3.4.0.tgz", - "integrity": "sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-6.0.0.tgz", + "integrity": "sha512-TRzzuFRRmEoSW/p1KVAmiOgPco2Irlah+bGFCeNfJXxxYGwSw7YwAOAcd7X28K/m5bjBWKsC29KyoMfHbypayg==", "license": "MIT", "engines": { - "node": ">=4.0.0" + "node": ">=12.13.0" } }, "node_modules/pkg-dir": { @@ -10782,12 +10692,12 @@ } }, "node_modules/pngjs": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-6.0.0.tgz", - "integrity": "sha512-TRzzuFRRmEoSW/p1KVAmiOgPco2Irlah+bGFCeNfJXxxYGwSw7YwAOAcd7X28K/m5bjBWKsC29KyoMfHbypayg==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-7.0.0.tgz", + "integrity": "sha512-LKWqWJRhstyYo9pGvgor/ivk2w94eSjE3RGVuzLGlr3NmD8bf7RcYGze1mNdEHRP6TRP6rMuDHk5t44hnTRyow==", "license": "MIT", "engines": { - "node": ">=12.13.0" + "node": ">=14.19.0" } }, "node_modules/prebuild-install": { @@ -11347,12 +11257,6 @@ "node": ">= 0.10" } }, - "node_modules/regenerator-runtime": { - "version": "0.13.11", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", - "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", - "license": "MIT" - }, "node_modules/release-zalgo": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", @@ -11953,6 +11857,15 @@ "node": ">=10" } }, + "node_modules/simple-xml-to-json": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/simple-xml-to-json/-/simple-xml-to-json-1.2.3.tgz", + "integrity": "sha512-kWJDCr9EWtZ+/EYYM5MareWj2cRnZGF93YDNpH4jQiHB+hBIZnfPFSQiVMzZOdk+zXWqTZ/9fTeQNu2DqeiudA==", + "license": "MIT", + "engines": { + "node": ">=20.12.2" + } + }, "node_modules/smart-buffer": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", @@ -12651,12 +12564,6 @@ "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", "license": "MIT" }, - "node_modules/timm": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/timm/-/timm-1.7.1.tgz", - "integrity": "sha512-IjZc9KIotudix8bMaBW6QvMuq64BrJWFs1+4V0lXwWGQZwH+LnX87doAYhem4caOEusRP9/g6jVDQmZ8XOk1nw==", - "license": "MIT" - }, "node_modules/tiny-lr": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/tiny-lr/-/tiny-lr-1.1.1.tgz", @@ -13374,12 +13281,6 @@ "node": ">=0.8.0" } }, - "node_modules/whatwg-fetch": { - "version": "3.6.20", - "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.20.tgz", - "integrity": "sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg==", - "license": "MIT" - }, "node_modules/whatwg-url": { "version": "11.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", @@ -13548,18 +13449,6 @@ } } }, - "node_modules/xhr": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.6.0.tgz", - "integrity": "sha512-/eCGLb5rxjx5e3mF1A7s+pLlR6CGyqWN91fv1JgER5mVWg1MZmlhBvy9kjcsOdRk8RrIujotWyJamfyrp+WIcA==", - "license": "MIT", - "dependencies": { - "global": "~4.4.0", - "is-function": "^1.0.1", - "parse-headers": "^2.0.0", - "xtend": "^4.0.0" - } - }, "node_modules/xlsx-write-stream": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/xlsx-write-stream/-/xlsx-write-stream-1.0.3.tgz", @@ -13604,15 +13493,6 @@ "dev": true, "license": "Apache-2.0" }, - "node_modules/xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "license": "MIT", - "engines": { - "node": ">=0.4" - } - }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", diff --git a/package.json b/package.json index f00927fa538..cf3fb0c3422 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "grunt-contrib-uglify": "5.2.2", "hpagent": "^1.2.0", "icanhazip": "^1.0.3", - "jimp": "0.22.12", + "jimp": "1.6.0", "json2csv": "5.0.7", "jsonwebtoken": "^9.0.1", "later": "1.2.0", From bb331d1db4d19f50d7795468c62322d380451943 Mon Sep 17 00:00:00 2001 From: Arturs Sosins Date: Wed, 27 Nov 2024 21:04:29 +0200 Subject: [PATCH 63/70] Fix jimp usage --- api/parts/mgmt/apps.js | 23 +++++++------------- frontend/express/app.js | 47 ++++++++++++++++------------------------- 2 files changed, 26 insertions(+), 44 deletions(-) diff --git a/api/parts/mgmt/apps.js b/api/parts/mgmt/apps.js index ff476ea9c4b..a7f22af49e9 100644 --- a/api/parts/mgmt/apps.js +++ b/api/parts/mgmt/apps.js @@ -170,7 +170,7 @@ appsApi.getAppsDetails = function(params) { * @param {params} params - params object with args to create app * @return {object} return promise object; **/ -const iconUpload = function(params) { +const iconUpload = async function(params) { const appId = params.app_id || common.sanitizeFilename(params.qstring.args.app_id); if (params.files && params.files.app_image) { const tmp_path = params.files.app_image.path, @@ -183,25 +183,18 @@ const iconUpload = function(params) { return Promise.reject(); } try { - return jimp.read(tmp_path, function(err, icon) { - if (err) { - log.e(err, err.stack); - fs.unlink(tmp_path, function() {}); - return true; + const icon = await jimp.Jimp.read(tmp_path); + const buffer = await icon.cover({h: 72, w: 72}).getBuffer(jimp.JimpMime.png); + countlyFs.saveData("appimages", target_path, buffer, {id: appId + ".png", writeMode: "overwrite"}, function(err3) { + if (err3) { + log.e(err3, err3.stack); } - icon.cover(72, 72).getBuffer(jimp.MIME_PNG, function(err2, buffer) { - countlyFs.saveData("appimages", target_path, buffer, {id: appId + ".png", writeMode: "overwrite"}, function(err3) { - if (err3) { - log.e(err3, err3.stack); - } - fs.unlink(tmp_path, function() {}); - }); - }); }); } catch (e) { - log.e(e.stack); + console.log("Problem uploading app icon", e); } + fs.unlink(tmp_path, function() {}); } }; diff --git a/frontend/express/app.js b/frontend/express/app.js index e8a393af8cc..e706eb21fe5 100644 --- a/frontend/express/app.js +++ b/frontend/express/app.js @@ -1610,7 +1610,7 @@ Promise.all([plugins.dbConnection(countlyConfig), plugins.dbConnection("countly_ req.body.app_id = req.body.app_image_id; } var params = paramsGenerator({req, res}); - validateCreate(params, 'global_upload', function() { + validateCreate(params, 'global_upload', async function() { if (!req.session.uid && !req.body.app_image_id) { res.end(); return false; @@ -1634,25 +1634,18 @@ Promise.all([plugins.dbConnection(countlyConfig), plugins.dbConnection("countly_ } plugins.callMethod("iconUpload", {req: req, res: res, next: next, data: req.body}); try { - jimp.read(tmp_path, function(err, icon) { - if (err) { - console.log(err, err.stack); - fs.unlink(tmp_path, function() {}); - res.status(400).send(false); - return true; - } - icon.cover(72, 72).getBuffer(jimp.MIME_PNG, function(err2, buffer) { - countlyFs.saveData("appimages", target_path, buffer, {id: req.body.app_image_id + ".png", writeMode: "overwrite"}, function() { - fs.unlink(tmp_path, function() {}); - res.send("appimages/" + req.body.app_image_id + ".png"); - countlyDb.collection('apps').updateOne({_id: countlyDb.ObjectID(req.body.app_image_id)}, {'$set': {'has_image': true}}, function() {}); - }); - }); // save + const icon = await jimp.Jimp.read(tmp_path); + const buffer = await icon.cover({h: 72, w: 72}).getBuffer(jimp.JimpMime.png); + countlyFs.saveData("appimages", target_path, buffer, {id: req.body.app_image_id + ".png", writeMode: "overwrite"}, function() { + res.send("appimages/" + req.body.app_image_id + ".png"); + countlyDb.collection('apps').updateOne({_id: countlyDb.ObjectID(req.body.app_image_id)}, {'$set': {'has_image': true}}, function() {}); }); } catch (e) { - console.log(e.stack); + console.log("Problem uploading app icon", e); + res.status(400).send(false); } + fs.unlink(tmp_path, function() {}); }); }); @@ -1694,23 +1687,19 @@ Promise.all([plugins.dbConnection(countlyConfig), plugins.dbConnection("countly_ } plugins.callMethod("iconUpload", {req: req, res: res, next: next, data: req.body}); try { - jimp.read(tmp_path, function(err, icon) { - if (err) { - console.log(err, err.stack); - } - icon.cover(72, 72).getBuffer(jimp.MIME_PNG, function(err2, buffer) { - countlyFs.saveData("memberimages", target_path, buffer, {id: req.body.member_image_id + ".png", writeMode: "overwrite"}, function() { - fs.unlink(tmp_path, function() {}); - countlyDb.collection('members').updateOne({_id: countlyDb.ObjectID(req.body.member_image_id + "")}, {'$set': {'member_image': "memberimages/" + req.body.member_image_id + ".png"}}, function() { - res.send("memberimages/" + req.body.member_image_id + ".png"); - }); - }); - }); // save + const icon = await jimp.Jimp.read(tmp_path); + const buffer = await icon.cover({h: 72, w: 72}).getBuffer(jimp.JimpMime.png); + countlyFs.saveData("memberimages", target_path, buffer, {id: req.body.member_image_id + ".png", writeMode: "overwrite"}, function() { + countlyDb.collection('members').updateOne({_id: countlyDb.ObjectID(req.body.member_image_id + "")}, {'$set': {'member_image': "memberimages/" + req.body.member_image_id + ".png"}}, function() { + res.send("memberimages/" + req.body.member_image_id + ".png"); + }); }); } catch (e) { - console.log(e.stack); + console.log("Problem uploading member icon", e); + res.status(400).send(false); } + fs.unlink(tmp_path, function() {}); }); }); From c4bea9defeb41d129f8d30e495d6cf381d24ed28 Mon Sep 17 00:00:00 2001 From: Cihad Tekin Date: Thu, 28 Nov 2024 12:43:48 +0300 Subject: [PATCH 64/70] [logger] reverted some of the overwritten changes for collection_info --- plugins/logger/api/api.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/plugins/logger/api/api.js b/plugins/logger/api/api.js index 5a16b9c82dd..ebfae4117d0 100644 --- a/plugins/logger/api/api.js +++ b/plugins/logger/api/api.js @@ -353,14 +353,15 @@ plugins.setConfigs("logger", { return true; } if (params.qstring.method === 'collection_info') { - validateRead(params, FEATURE_NAME, function(parameters) { - common.db.collection('logs' + parameters.app_id).stats(function(err, stats) { - if (err) { - console.log("Failed fetching logs collection info", err); - return common.returnMessage(parameters, 400, 'Error fetching collection info'); - } - common.returnOutput(parameters, stats && {size: stats.size, count: stats.count, max: MAX_NUMBER_OF_LOG_ENTRIES} || {}); - }); + validateRead(params, FEATURE_NAME, async function(parameters) { + try { + var stats = await common.db.collection('logs' + parameters.app_id).aggregate([ { $collStats: { storageStats: { } } } ]).toArray(); + common.returnOutput(parameters, {capped: MAX_NUMBER_OF_LOG_ENTRIES, count: stats?.[0]?.storageStats?.count, max: MAX_NUMBER_OF_LOG_ENTRIES}); + } + catch (ex) { + console.log("Failed fetching logs collection info: ", ex); + common.returnMessage(parameters, 400, 'Error fetching collection info'); + } }); return true; } From 8eb7c0e0e07e16e766fbd0a805b8c562a4c7ce47 Mon Sep 17 00:00:00 2001 From: Arturs Sosins Date: Thu, 28 Nov 2024 13:08:10 +0200 Subject: [PATCH 65/70] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b0ef97a599..b0937eabe5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Dependencies: - Bump countly-sdk-web from 24.4.1 to 24.11.0 - Bump tslib from 2.7.0 to 2.8.1 - Bump form-data from 4.0.0 to 4.0.1 +- Bump jimp from 0.22.12 to 1.6.0 ## Version 24.05.19 Fixes: From 5c0ee6e26e1842e2882627a1e7440814efcb4147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=B1nar=20Gen=C3=A7?= Date: Thu, 28 Nov 2024 14:49:21 +0300 Subject: [PATCH 66/70] fix: prevent clicking on disabled tabs --- .../public/javascripts/countly/vue/components/nav.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/express/public/javascripts/countly/vue/components/nav.js b/frontend/express/public/javascripts/countly/vue/components/nav.js index c14eca07023..64632192f5b 100644 --- a/frontend/express/public/javascripts/countly/vue/components/nav.js +++ b/frontend/express/public/javascripts/countly/vue/components/nav.js @@ -144,7 +144,10 @@ } }, methods: { - setTab: function(name) { + setTab: function(name, isDisabled) { + if (isDisabled) { + return; + } var tab = this.tabs.filter(function(t) { return t.name === name; }); @@ -197,7 +200,7 @@ :style="{cursor: tab.disabled ? \'not-allowed\' : \'pointer\', opacity: tab.disabled ? 0.5 : 1}"\ v-bind:key="tab.name"\ v-bind:class="[tabClasses, activeClasses(tab.name)]"\ - v-on:click="setTab(tab.name)"\ + v-on:click="setTab(tab.name, tab.disabled)"\ v-if="(!tab.type) || (tab.type === \'mobile\' && !apps[app_id].type) || (apps[app_id].type === tab.type)"\ >\ \ From 49d8a75d6d8f882ac59da3c6ec06ffca843b6c38 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Nov 2024 12:34:32 +0000 Subject: [PATCH 67/70] Bump jsdoc from 4.0.3 to 4.0.4 Bumps [jsdoc](https://github.com/jsdoc/jsdoc) from 4.0.3 to 4.0.4. - [Release notes](https://github.com/jsdoc/jsdoc/releases) - [Changelog](https://github.com/jsdoc/jsdoc/blob/4.0.4/CHANGES.md) - [Commits](https://github.com/jsdoc/jsdoc/compare/4.0.3...4.0.4) --- updated-dependencies: - dependency-name: jsdoc dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 908c264dc43..ab674056165 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8071,9 +8071,9 @@ "license": "MIT" }, "node_modules/jsdoc": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-4.0.3.tgz", - "integrity": "sha512-Nu7Sf35kXJ1MWDZIMAuATRQTg1iIPdzh7tqJ6jjvaU/GfDf+qi5UV8zJR3Mo+/pYFvm8mzay4+6O5EWigaQBQw==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-4.0.4.tgz", + "integrity": "sha512-zeFezwyXeG4syyYHbvh1A967IAqq/67yXtXvuL5wnqCkFZe8I0vKfm+EO+YEvLguo6w9CDUbrAXVtJSHh2E8rw==", "dev": true, "license": "Apache-2.0", "dependencies": { From 38d32761205cce5195c964bd8b9c9735299c0788 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Nov 2024 12:34:40 +0000 Subject: [PATCH 68/70] Bump countly-sdk-nodejs from 22.6.0 to 24.10.0 Bumps [countly-sdk-nodejs](https://github.com/Countly/countly-sdk-nodejs) from 22.6.0 to 24.10.0. - [Release notes](https://github.com/Countly/countly-sdk-nodejs/releases) - [Changelog](https://github.com/Countly/countly-sdk-nodejs/blob/master/CHANGELOG.md) - [Commits](https://github.com/Countly/countly-sdk-nodejs/compare/22.06.0...24.10.0) --- updated-dependencies: - dependency-name: countly-sdk-nodejs dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 908c264dc43..00dce03d868 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4152,9 +4152,9 @@ "link": true }, "node_modules/countly-sdk-nodejs": { - "version": "22.6.0", - "resolved": "https://registry.npmjs.org/countly-sdk-nodejs/-/countly-sdk-nodejs-22.6.0.tgz", - "integrity": "sha512-vw6YRGJJu6sq9oZEz00SyAL7oyru+w1ct3P6TS0avMPRSZ/mqEXYq3l+Wtl89L/HwXcDymh8gY7JOOAPnI7vEg==", + "version": "24.10.0", + "resolved": "https://registry.npmjs.org/countly-sdk-nodejs/-/countly-sdk-nodejs-24.10.0.tgz", + "integrity": "sha512-Ub3hy3LfF1kV6jLEiUTGAlkMaMhFMOCnLzhQYjpkWCUL/XK/veO+TtDokCYuRYp1D3QM+gkSy+QVPwBUZKVYSA==", "license": "MIT" }, "node_modules/countly-sdk-web": { From 0a3e9be142629acc2547b18f9c75fb79b220f8f9 Mon Sep 17 00:00:00 2001 From: Arturs Sosins Date: Thu, 28 Nov 2024 14:37:17 +0200 Subject: [PATCH 69/70] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0937eabe5c..f9504c447b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Dependencies: - Bump tslib from 2.7.0 to 2.8.1 - Bump form-data from 4.0.0 to 4.0.1 - Bump jimp from 0.22.12 to 1.6.0 +- Bump jsdoc from 4.0.3 to 4.0.4 ## Version 24.05.19 Fixes: From 30532699cb9b5e19327293bc8192afea2e439559 Mon Sep 17 00:00:00 2001 From: Arturs Sosins Date: Thu, 28 Nov 2024 14:49:48 +0200 Subject: [PATCH 70/70] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9504c447b0..d741bec390e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ Dependencies: - Bump form-data from 4.0.0 to 4.0.1 - Bump jimp from 0.22.12 to 1.6.0 - Bump jsdoc from 4.0.3 to 4.0.4 +- Bump countly-sdk-nodejs from 22.6.0 to 24.10.0 ## Version 24.05.19 Fixes: