From 1e8c8991ad489d7c120ec79fd70b0c08afc52620 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Mon, 4 Oct 2021 10:56:54 +1100 Subject: [PATCH] more cleanup --- .aptly.conf | 12 - .prettierignore | 3 +- Gruntfile.js | 30 +- _locales/en/messages.json | 3 +- background.html | 3 - background_test.html | 3 - better-sqlite3@7.1.4 | 0 bower.json | 41 - .../backbone-indexeddb.js | 662 -- components/protobuf/dist/ProtoBuf.js | 4335 ------------- index.html | 44 +- js/background.js | 14 - js/chromium.js | 15 - js/curve/curve25519_compiled.js | 413 -- js/database.js | 122 - js/legacy_storage.js | 89 - js/libloki.js | 0 js/logging.js | 4 +- js/modules/database.js | 65 - js/modules/job_queue.js | 24 - js/modules/signal.js | 2 - js/modules/sleep.js | 3 - js/session_ui_manager.js | 0 js/views/app_view.js | 1 - libtextsecure/event_target.js | 82 - libtextsecure/libsignal-protocol.js | 331 +- libtextsecure/protobufs.js | 37 - libtextsecure/stringview.js | 100 - main.js | 23 - node-gyp | 0 package.json | 1 - preload.js | 33 +- stylesheets/_global.scss | 11 - stylesheets/_theme_dark.scss | 5 - .../dialog/OnionStatusPathDialog.tsx | 3 +- ts/components/session/menu/Menu.tsx | 46 +- ts/data/data.ts | 3 +- ts/session/seed_node_api/SeedNodeAPI.ts | 3 +- ts/session/snode_api/SNodeAPI.ts | 16 +- ts/session/snode_api/lokiRpc.ts | 6 +- ts/session/snode_api/onions.ts | 7 +- ts/session/snode_api/swarmPolling.ts | 2 +- ts/session/utils/JobQueue.ts | 1 - ts/session/utils/Protobuf.ts | 35 - ts/session/utils/index.ts | 2 - ts/util/lint/analyze_exceptions.ts | 29 - ts/util/lint/exceptions.json | 5621 ----------------- ts/util/lint/linter.ts | 266 - ts/util/lint/rules.json | 135 - ts/util/lint/sort_exceptions.ts | 14 - ts/util/lint/types.ts | 63 - ts/util/lint/util.ts | 24 - ts/window.d.ts | 2 - yarn.lock | 5 - 54 files changed, 102 insertions(+), 12692 deletions(-) delete mode 100644 .aptly.conf delete mode 100644 better-sqlite3@7.1.4 delete mode 100644 bower.json delete mode 100644 components/indexeddb-backbonejs-adapter/backbone-indexeddb.js delete mode 100644 components/protobuf/dist/ProtoBuf.js delete mode 100644 js/chromium.js delete mode 100644 js/database.js delete mode 100644 js/legacy_storage.js delete mode 100644 js/libloki.js delete mode 100644 js/modules/database.js delete mode 100644 js/modules/job_queue.js delete mode 100644 js/modules/sleep.js delete mode 100644 js/session_ui_manager.js delete mode 100644 libtextsecure/event_target.js delete mode 100644 libtextsecure/protobufs.js delete mode 100644 libtextsecure/stringview.js delete mode 100644 node-gyp delete mode 100644 ts/session/utils/Protobuf.ts delete mode 100644 ts/util/lint/analyze_exceptions.ts delete mode 100644 ts/util/lint/exceptions.json delete mode 100644 ts/util/lint/linter.ts delete mode 100644 ts/util/lint/rules.json delete mode 100644 ts/util/lint/sort_exceptions.ts delete mode 100644 ts/util/lint/types.ts delete mode 100644 ts/util/lint/util.ts diff --git a/.aptly.conf b/.aptly.conf deleted file mode 100644 index 672d616d3..000000000 --- a/.aptly.conf +++ /dev/null @@ -1,12 +0,0 @@ -{ - "S3PublishEndpoints": { - "signal-desktop-apt": { - "region": "us-east-1", - "bucket": "updates.signal.org", - "prefix": "desktop/apt", - "acl": "public-read", - "plusWorkaround": false, - "disableMultiDel": false - } - } -} diff --git a/.prettierignore b/.prettierignore index fbbd36871..9cbb9d55f 100644 --- a/.prettierignore +++ b/.prettierignore @@ -32,8 +32,7 @@ js/util_worker.js libtextsecure/test/blanket_mocha.js mnemonic_languages/** -# Managed by package manager (`bower` and `yarn`/`npm`): -/bower.json +# Managed by package manager (`yarn`/`npm`): /package.json # Symlink into third-party `components`: diff --git a/Gruntfile.js b/Gruntfile.js index b421552bf..3e93ae5d1 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -5,18 +5,32 @@ const sass = require('node-sass'); /* eslint-disable more/no-then, no-console */ +const toConcatForApp = [ + 'node_modules/jquery/dist/jquery.js', + 'node_modules/bytebuffer/dist/bytebuffer.min.js', + 'node_modules/long/dist/long.js', + 'components/protobuf/**/*.js', + 'node_modules/mustache/mustache.js', + 'node_modules/underscore/underscore.js', + 'node_modules/backbone/backbone.js', +]; + +const toConcatForComponentTextsecure = [ + 'node_modules/long/dist/long.js', + 'components/protobuf/**/*.js', +]; + module.exports = grunt => { - const bower = grunt.file.readJSON('bower.json'); const components = []; // eslint-disable-next-line guard-for-in, no-restricted-syntax - for (const i in bower.concat.app) { - components.push(bower.concat.app[i]); + for (const i in toConcatForApp) { + components.push(toConcatForApp[i]); } const libtextsecurecomponents = []; // eslint-disable-next-line guard-for-in, no-restricted-syntax - for (const i in bower.concat.libtextsecure) { - libtextsecurecomponents.push(bower.concat.libtextsecure[i]); + for (const i in toConcatForComponentTextsecure) { + libtextsecurecomponents.push(toConcatForComponentTextsecure[i]); } const utilWorkerComponents = [ @@ -58,13 +72,7 @@ module.exports = grunt => { 'libtextsecure/crypto.js', 'libtextsecure/storage.js', 'libtextsecure/storage/user.js', - 'libtextsecure/storage/groups.js', - 'libtextsecure/protobufs.js', 'libtextsecure/helpers.js', - 'libtextsecure/stringview.js', - 'libtextsecure/event_target.js', - 'libtextsecure/http-resources.js', - 'libtextsecure/message_receiver.js', ], dest: 'js/libtextsecure.js', }, diff --git a/_locales/en/messages.json b/_locales/en/messages.json index ecb4b57b0..cf1836256 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -453,5 +453,6 @@ "unableToCall": "cancel your ongoing call first", "unableToCallTitle": "Cannot start new call", "callMissed": "Missed call from $name$", - "callMissedTitle": "Call missed" + "callMissedTitle": "Call missed", + "startVideoCall": "Start Video Call" } diff --git a/background.html b/background.html index 7f8ae5237..6d9188870 100644 --- a/background.html +++ b/background.html @@ -32,9 +32,7 @@ --> - - @@ -43,7 +41,6 @@ - diff --git a/background_test.html b/background_test.html index cf21b58a0..73d4fa1ec 100644 --- a/background_test.html +++ b/background_test.html @@ -32,9 +32,7 @@ --> - - @@ -43,7 +41,6 @@ - diff --git a/better-sqlite3@7.1.4 b/better-sqlite3@7.1.4 deleted file mode 100644 index e69de29bb..000000000 diff --git a/bower.json b/bower.json deleted file mode 100644 index 08a87c072..000000000 --- a/bower.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "session-desktop", - "version": "0.0.0", - "homepage": "https://github.com/loki-project/session-desktop", - "license": "GPLV3", - "private": true, - "dependencies": { - "indexeddb-backbonejs-adapter": "*", - "protobuf": "~3.8.0" - }, - "devDependencies": { - "mock-socket": "~0.3.2" - }, - "preen": { - "indexeddb-backbonejs-adapter": [ - "backbone-indexeddb.js" - ], - "mock-socket": [ - "dist/mock-socket.js" - ], - "protobuf": [ - "dist/ProtoBuf.js" - ] - }, - "concat": { - "app": [ - "node_modules/jquery/dist/jquery.js", - "node_modules/bytebuffer/dist/bytebuffer.min.js", - "node_modules/long/dist/long.js", - "components/protobuf/**/*.js", - "node_modules/mustache/mustache.js", - "node_modules/underscore/underscore.js", - "node_modules/backbone/backbone.js", - "components/indexeddb-backbonejs-adapter/**/*.js" - ], - "libtextsecure": [ - "node_modules/long/dist/long.js", - "components/protobuf/**/*.js" - ] - } -} \ No newline at end of file diff --git a/components/indexeddb-backbonejs-adapter/backbone-indexeddb.js b/components/indexeddb-backbonejs-adapter/backbone-indexeddb.js deleted file mode 100644 index 2ae8ad1ef..000000000 --- a/components/indexeddb-backbonejs-adapter/backbone-indexeddb.js +++ /dev/null @@ -1,662 +0,0 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['backbone', 'underscore'], factory); - } else if (typeof exports === 'object') { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require('backbone'), require('underscore')); - } else { - // Browser globals (root is window) - root.returnExports = factory(root.Backbone, root._); - } -}(this, function (Backbone, _) { - - // Generate four random hex digits. - function S4() { - return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); - } - - // Generate a pseudo-GUID by concatenating random hexadecimal. - function guid() { - return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4()); - } - - if ( _(indexedDB).isUndefined() ) { return; } - - // Driver object - // That's the interesting part. - // There is a driver for each schema provided. The schema is a te combination of name (for the database), a version as well as migrations to reach that - // version of the database. - function Driver(schema, ready, nolog, onerror) { - this.schema = schema; - this.ready = ready; - this.error = null; - this.transactions = []; // Used to list all transactions and keep track of active ones. - this.db = null; - this.nolog = nolog; - this.onerror = onerror; - var lastMigrationPathVersion = _.last(this.schema.migrations).version; - if (!this.nolog) debugLog("opening database " + this.schema.id + " in version #" + lastMigrationPathVersion); - this.dbRequest = indexedDB.open(this.schema.id,lastMigrationPathVersion); //schema version need to be an unsigned long - - this.launchMigrationPath = function(dbVersion) { - var transaction = this.dbRequest.transaction; - var clonedMigrations = _.clone(schema.migrations); - this.migrate(transaction, clonedMigrations, dbVersion, { - error: function (event) { - this.error = "Database not up to date. " + dbVersion + " expected was " + lastMigrationPathVersion; - }.bind(this) - }); - }; - - this.dbRequest.onblocked = function(event){ - if (!this.nolog) debugLog("connection to database blocked"); - } - - this.dbRequest.onsuccess = function (e) { - this.db = e.target.result; // Attach the connection ot the queue. - var currentIntDBVersion = (parseInt(this.db.version) || 0); // we need convert beacuse chrome store in integer and ie10 DP4+ in int; - var lastMigrationInt = (parseInt(lastMigrationPathVersion) || 0); // And make sure we compare numbers with numbers. - - if (currentIntDBVersion === lastMigrationInt) { //if support new event onupgradeneeded will trigger the ready function - // No migration to perform! - this.ready(); - } else if (currentIntDBVersion < lastMigrationInt ) { - // We need to migrate up to the current migration defined in the database - this.launchMigrationPath(currentIntDBVersion); - } else { - // Looks like the IndexedDB is at a higher version than the current driver schema. - this.error = "Database version is greater than current code " + currentIntDBVersion + " expected was " + lastMigrationInt; - } - }.bind(this); - - - - this.dbRequest.onerror = function (e) { - // Failed to open the database - this.error = "Couldn't not connect to the database" - if (!this.nolog) debugLog("Couldn't not connect to the database"); - this.onerror(); - }.bind(this); - - this.dbRequest.onabort = function (e) { - // Failed to open the database - this.error = "Connection to the database aborted" - if (!this.nolog) debugLog("Connection to the database aborted"); - this.onerror(); - }.bind(this); - - - - this.dbRequest.onupgradeneeded = function(iDBVersionChangeEvent){ - this.db =iDBVersionChangeEvent.target.result; - - var newVersion = iDBVersionChangeEvent.newVersion; - var oldVersion = iDBVersionChangeEvent.oldVersion; - - // Fix Safari 8 and iOS 8 bug - // at the first connection oldVersion is equal to 9223372036854776000 - // but the real value is 0 - if (oldVersion > 99999999999) - oldVersion = 0; - - if (!this.nolog) debugLog("onupgradeneeded = " + oldVersion + " => " + newVersion); - this.launchMigrationPath(oldVersion); - }.bind(this); - } - - function debugLog(str) { - if (typeof window !== "undefined" && typeof window.console !== "undefined" && typeof window.console.log !== "undefined") { - window.console.log(str); - } - else if(console.log !== "undefined") { - console.log(str) - } - } - - // Driver Prototype - Driver.prototype = { - - // Tracks transactions. Mostly for debugging purposes. TO-IMPROVE - _track_transaction: function(transaction) { - this.transactions.push(transaction); - function removeIt() { - var idx = this.transactions.indexOf(transaction); - if (idx !== -1) {this.transactions.splice(idx); } - }; - transaction.oncomplete = removeIt.bind(this); - transaction.onabort = removeIt.bind(this); - transaction.onerror = removeIt.bind(this); - }, - - // Performs all the migrations to reach the right version of the database. - migrate: function (transaction, migrations, version, options) { - transaction.onerror = options.error; - transaction.onabort = options.error; - - if (!this.nolog) debugLog("migrate begin version from #" + version); - var that = this; - var migration = migrations.shift(); - if (migration) { - if (!version || version < migration.version) { - // We need to apply this migration- - if (typeof migration.before == "undefined") { - migration.before = function (next) { - next(); - }; - } - if (typeof migration.after == "undefined") { - migration.after = function (next) { - next(); - }; - } - // First, let's run the before script - if (!this.nolog) debugLog("migrate begin before version #" + migration.version); - migration.before(function () { - if (!this.nolog) debugLog("migrate done before version #" + migration.version); - - if (!this.nolog) debugLog("migrate begin migrate version #" + migration.version); - - migration.migrate(transaction, function () { - if (!this.nolog) debugLog("migrate done migrate version #" + migration.version); - // Migration successfully appliedn let's go to the next one! - if (!this.nolog) debugLog("migrate begin after version #" + migration.version); - migration.after(function () { - if (!this.nolog) debugLog("migrate done after version #" + migration.version); - if (!this.nolog) debugLog("Migrated to " + migration.version); - - //last modification occurred, need finish - if(migrations.length ==0) { - if (!this.nolog) { - debugLog("migrate setting transaction.oncomplete to finish version #" + migration.version); - transaction.oncomplete = function() { - debugLog("migrate done transaction.oncomplete version #" + migration.version); - debugLog("Done migrating"); - } - } - } - else - { - if (!this.nolog) debugLog("migrate end from version #" + version + " to " + migration.version); - that.migrate(transaction, migrations, version, options); - } - - }.bind(this)); - }.bind(this)); - }.bind(this)); - } else { - // No need to apply this migration - if (!this.nolog) debugLog("Skipping migration " + migration.version); - this.migrate(transaction, migrations, version, options); - } - } - }, - - // This is the main method, called by the ExecutionQueue when the driver is ready (database open and migration performed) - execute: function (storeName, method, object, options) { - if (!this.nolog) debugLog("execute : " + method + " on " + storeName + " for " + object.id); - switch (method) { - case "create": - this.create(storeName, object, options); - break; - case "read": - if (object.id || object.cid) { - this.read(storeName, object, options); // It's a model - } else { - this.query(storeName, object, options); // It's a collection - } - break; - case "update": - this.update(storeName, object, options); // We may want to check that this is not a collection. TOFIX - break; - case "delete": - if (object.id || object.cid) { - this.delete(storeName, object, options); - } else { - this.clear(storeName, object, options); - } - break; - default: - // Hum what? - } - }, - - // Writes the json to the storeName in db. It is a create operations, which means it will fail if the key already exists - // options are just success and error callbacks. - create: function (storeName, object, options) { - var writeTransaction = this.db.transaction([storeName], 'readwrite'); - //this._track_transaction(writeTransaction); - var store = writeTransaction.objectStore(storeName); - var json = object.toJSON(); - var idAttribute = _.result(object, 'idAttribute'); - var writeRequest; - - if (json[idAttribute] === undefined && !store.autoIncrement) json[idAttribute] = guid(); - - writeTransaction.onerror = function (e) { - options.error(e); - }; - writeTransaction.oncomplete = function (e) { - options.success(json); - }; - - if (!store.keyPath) - writeRequest = store.add(json, json[idAttribute]); - else - writeRequest = store.add(json); - }, - - // Writes the json to the storeName in db. It is an update operation, which means it will overwrite the value if the key already exist - // options are just success and error callbacks. - update: function (storeName, object, options) { - var writeTransaction = this.db.transaction([storeName], 'readwrite'); - //this._track_transaction(writeTransaction); - var store = writeTransaction.objectStore(storeName); - var json = object.toJSON(); - var idAttribute = _.result(object, 'idAttribute'); - var writeRequest; - - if (!json[idAttribute]) json[idAttribute] = guid(); - - if (!store.keyPath) - writeRequest = store.put(json, json[idAttribute]); - else - writeRequest = store.put(json); - - writeRequest.onerror = function (e) { - options.error(e); - }; - writeTransaction.oncomplete = function (e) { - options.success(json); - }; - }, - - // Reads from storeName in db with json.id if it's there of with any json.xxxx as long as xxx is an index in storeName - read: function (storeName, object, options) { - var readTransaction = this.db.transaction([storeName], "readonly"); - this._track_transaction(readTransaction); - - var store = readTransaction.objectStore(storeName); - var json = object.toJSON(); - var idAttribute = _.result(object, 'idAttribute'); - - var getRequest = null; - if (json[idAttribute]) { - getRequest = store.get(json[idAttribute]); - } else if(options.index) { - var index = store.index(options.index.name); - getRequest = index.get(options.index.value); - } else { - // We need to find which index we have - var cardinality = 0; // try to fit the index with most matches - _.each(store.indexNames, function (key, index) { - index = store.index(key); - if(typeof index.keyPath === 'string' && 1 > cardinality) { - // simple index - if (json[index.keyPath] !== undefined) { - getRequest = index.get(json[index.keyPath]); - cardinality = 1; - } - } else if(typeof index.keyPath === 'object' && index.keyPath.length > cardinality) { - // compound index - var valid = true; - var keyValue = _.map(index.keyPath, function(keyPart) { - valid = valid && json[keyPart] !== undefined; - return json[keyPart]; - }); - if(valid) { - getRequest = index.get(keyValue); - cardinality = index.keyPath.length; - } - } - }); - } - if (getRequest) { - getRequest.onsuccess = function (event) { - if (event.target.result) { - options.success(event.target.result); - } else { - options.error("Not Found"); - } - }; - getRequest.onerror = function () { - options.error("Not Found"); // We couldn't find the record. - } - } else { - options.error("Not Found"); // We couldn't even look for it, as we don't have enough data. - } - }, - - // Deletes the json.id key and value in storeName from db. - delete: function (storeName, object, options) { - var deleteTransaction = this.db.transaction([storeName], 'readwrite'); - //this._track_transaction(deleteTransaction); - - var store = deleteTransaction.objectStore(storeName); - var json = object.toJSON(); - var idAttribute = _.result(object, 'idAttribute'); - - var deleteRequest = store.delete(json[idAttribute]); - - deleteTransaction.oncomplete = function (event) { - options.success(null); - }; - deleteRequest.onerror = function (event) { - options.error("Not Deleted"); - }; - }, - - // Clears all records for storeName from db. - clear: function (storeName, object, options) { - var deleteTransaction = this.db.transaction([storeName], "readwrite"); - //this._track_transaction(deleteTransaction); - - var store = deleteTransaction.objectStore(storeName); - - var deleteRequest = store.clear(); - deleteRequest.onsuccess = function (event) { - options.success(null); - }; - deleteRequest.onerror = function (event) { - options.error("Not Cleared"); - }; - }, - - // Performs a query on storeName in db. - // options may include : - // - conditions : value of an index, or range for an index - // - range : range for the primary key - // - limit : max number of elements to be yielded - // - offset : skipped items. - query: function (storeName, collection, options) { - var elements = []; - var skipped = 0, processed = 0; - var queryTransaction = this.db.transaction([storeName], "readonly"); - //this._track_transaction(queryTransaction); - - var idAttribute = _.result(collection.model.prototype, 'idAttribute'); - var readCursor = null; - var store = queryTransaction.objectStore(storeName); - var index = null, - lower = null, - upper = null, - bounds = null; - - if (options.conditions) { - // We have a condition, we need to use it for the cursor - _.each(store.indexNames, function (key) { - if (!readCursor) { - index = store.index(key); - if (options.conditions[index.keyPath] instanceof Array) { - lower = options.conditions[index.keyPath][0] > options.conditions[index.keyPath][1] ? options.conditions[index.keyPath][1] : options.conditions[index.keyPath][0]; - upper = options.conditions[index.keyPath][0] > options.conditions[index.keyPath][1] ? options.conditions[index.keyPath][0] : options.conditions[index.keyPath][1]; - bounds = IDBKeyRange.bound(lower, upper, true, true); - - if (options.conditions[index.keyPath][0] > options.conditions[index.keyPath][1]) { - // Looks like we want the DESC order - readCursor = index.openCursor(bounds, window.IDBCursor.PREV || "prev"); - } else { - // We want ASC order - readCursor = index.openCursor(bounds, window.IDBCursor.NEXT || "next"); - } - } else if (typeof options.conditions[index.keyPath] === 'object' && ('$gt' in options.conditions[index.keyPath] || '$gte' in options.conditions[index.keyPath])) { - if('$gt' in options.conditions[index.keyPath]) - bounds = IDBKeyRange.lowerBound(options.conditions[index.keyPath]['$gt'], true); - else - bounds = IDBKeyRange.lowerBound(options.conditions[index.keyPath]['$gte']); - readCursor = index.openCursor(bounds, window.IDBCursor.NEXT || "next"); - } else if (typeof options.conditions[index.keyPath] === 'object' && ('$lt' in options.conditions[index.keyPath] || '$lte' in options.conditions[index.keyPath])) { - if('$lt' in options.conditions[index.keyPath]) - bounds = IDBKeyRange.upperBound(options.conditions[index.keyPath]['$lt'], true); - else - bounds = IDBKeyRange.upperBound(options.conditions[index.keyPath]['$lte']); - readCursor = index.openCursor(bounds, window.IDBCursor.NEXT || "next"); - } else if (options.conditions[index.keyPath] != undefined) { - bounds = IDBKeyRange.only(options.conditions[index.keyPath]); - readCursor = index.openCursor(bounds); - } - } - }); - } else if (options.index) { - index = store.index(options.index.name); - var excludeLower = !!options.index.excludeLower; - var excludeUpper = !!options.index.excludeUpper; - if (index) { - if (options.index.lower && options.index.upper) { - bounds = IDBKeyRange.bound(options.index.lower, options.index.upper, excludeLower, excludeUpper); - } else if (options.index.lower) { - bounds = IDBKeyRange.lowerBound(options.index.lower, excludeLower); - } else if (options.index.upper) { - bounds = IDBKeyRange.upperBound(options.index.upper, excludeUpper); - } else if (options.index.only) { - bounds = IDBKeyRange.only(options.index.only); - } - - if (typeof options.index.order === 'string' && options.index.order.toLowerCase() === 'desc') { - readCursor = index.openCursor(bounds, window.IDBCursor.PREV || "prev"); - } else { - readCursor = index.openCursor(bounds, window.IDBCursor.NEXT || "next"); - } - } - } else { - // No conditions, use the index - if (options.range) { - lower = options.range[0] > options.range[1] ? options.range[1] : options.range[0]; - upper = options.range[0] > options.range[1] ? options.range[0] : options.range[1]; - bounds = IDBKeyRange.bound(lower, upper); - if (options.range[0] > options.range[1]) { - readCursor = store.openCursor(bounds, window.IDBCursor.PREV || "prev"); - } else { - readCursor = store.openCursor(bounds, window.IDBCursor.NEXT || "next"); - } - } else { - readCursor = store.openCursor(); - } - } - - if (typeof (readCursor) == "undefined" || !readCursor) { - options.error("No Cursor"); - } else { - readCursor.onerror = function(e){ - options.error("readCursor error", e); - }; - // Setup a handler for the cursor’s `success` event: - readCursor.onsuccess = function (e) { - var cursor = e.target.result; - if (!cursor) { - if (options.addIndividually || options.clear) { - // nothing! - // We need to indicate that we're done. But, how? - collection.trigger("reset"); - } else { - options.success(elements); // We're done. No more elements. - } - } - else { - // Cursor is not over yet. - if (options.limit && processed >= options.limit) { - // Yet, we have processed enough elements. So, let's just skip. - if (bounds) { - if (options.conditions && options.conditions[index.keyPath]) { - cursor.continue(options.conditions[index.keyPath][1] + 1); /* We need to 'terminate' the cursor cleany, by moving to the end */ - } else if (options.index && (options.index.upper || options.index.lower)) { - if (typeof options.index.order === 'string' && options.index.order.toLowerCase() === 'desc') { - cursor.continue(options.index.lower); - } else { - cursor.continue(options.index.upper); - } - } - } else { - cursor.continue(); /* We need to 'terminate' the cursor cleany, by moving to the end */ - } - } - else if (options.offset && options.offset > skipped) { - skipped++; - cursor.continue(); /* We need to Moving the cursor forward */ - } else { - // This time, it looks like it's good! - if (options.addIndividually) { - collection.add(cursor.value); - } else if (options.clear) { - var deleteRequest = store.delete(cursor.value[idAttribute]); - deleteRequest.onsuccess = function (event) { - elements.push(cursor.value); - }; - deleteRequest.onerror = function (event) { - elements.push(cursor.value); - }; - - } else { - elements.push(cursor.value); - } - processed++; - cursor.continue(); - } - } - }; - } - }, - close :function(){ - if(this.db){ - this.db.close(); - } - } - }; - - // ExecutionQueue object - // The execution queue is an abstraction to buffer up requests to the database. - // It holds a "driver". When the driver is ready, it just fires up the queue and executes in sync. - function ExecutionQueue(schema,next,nolog) { - this.driver = new Driver(schema, this.ready.bind(this), nolog, this.error.bind(this)); - this.started = false; - this.failed = false; - this.stack = []; - this.version = _.last(schema.migrations).version; - this.next = next; - } - - // ExecutionQueue Prototype - ExecutionQueue.prototype = { - // Called when the driver is ready - // It just loops over the elements in the queue and executes them. - ready: function () { - this.started = true; - _.each(this.stack, function (message) { - this.execute(message); - }.bind(this)); - this.stack = []; // fix memory leak - this.next(); - }, - - error: function() { - this.failed = true; - _.each(this.stack, function (message) { - this.execute(message); - }.bind(this)); - this.stack = []; - this.next(); - }, - - // Executes a given command on the driver. If not started, just stacks up one more element. - execute: function (message) { - if (this.started) { - try { - this.driver.execute(message[2].storeName || message[1].storeName, message[0], message[1], message[2]); // Upon messages, we execute the query - } catch (e) { - if (e.name === 'InvalidStateError') { - var f = window.onInvalidStateError; - if (f) f(e); - } - throw e; - } - } else if (this.failed) { - message[2].error(); - } else { - this.stack.push(message); - } - }, - - close : function(){ - this.driver.close(); - } - }; - - // Method used by Backbone for sync of data with data store. It was initially designed to work with "server side" APIs, This wrapper makes - // it work with the local indexedDB stuff. It uses the schema attribute provided by the object. - // The wrapper keeps an active Executuon Queue for each "schema", and executes querues agains it, based on the object type (collection or - // single model), but also the method... etc. - // Keeps track of the connections - var Databases = {}; - - function sync(method, object, options) { - - if(method == "closeall"){ - _.each(Databases,function(database){ - database.close(); - }); - // Clean up active databases object. - Databases = {}; - return Backbone.$.Deferred().resolve(); - } - - // If a model or a collection does not define a database, fall back on ajaxSync - if (!object || !_.isObject(object.database)) { - return Backbone.ajaxSync(method, object, options); - } - - var schema = object.database; - if (Databases[schema.id]) { - if(Databases[schema.id].version != _.last(schema.migrations).version){ - Databases[schema.id].close(); - delete Databases[schema.id]; - } - } - - var promise; - - if (typeof Backbone.$ === 'undefined' || typeof Backbone.$.Deferred === 'undefined') { - var noop = function() {}; - var resolve = noop; - var reject = noop; - } else { - var dfd = Backbone.$.Deferred(); - var resolve = dfd.resolve; - var reject = dfd.reject; - - promise = dfd.promise(); - } - - var success = options.success; - options.success = function(resp) { - if (success) success(resp); - resolve(); - object.trigger('sync', object, resp, options); - }; - - var error = options.error; - options.error = function(resp) { - if (error) error(resp); - reject(); - object.trigger('error', object, resp, options); - }; - - var next = function(){ - Databases[schema.id].execute([method, object, options]); - }; - - if (!Databases[schema.id]) { - Databases[schema.id] = new ExecutionQueue(schema,next,schema.nolog); - } else { - next(); - } - - return promise; - }; - - Backbone.ajaxSync = Backbone.sync; - Backbone.sync = sync; - - return { sync: sync, debugLog: debugLog}; -})); diff --git a/components/protobuf/dist/ProtoBuf.js b/components/protobuf/dist/ProtoBuf.js deleted file mode 100644 index 0e12340a7..000000000 --- a/components/protobuf/dist/ProtoBuf.js +++ /dev/null @@ -1,4335 +0,0 @@ -/* - Copyright 2013 Daniel Wirtz - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - * @license ProtoBuf.js (c) 2013 Daniel Wirtz - * Released under the Apache License, Version 2.0 - * see: https://github.com/dcodeIO/ProtoBuf.js for details - */ -(function(global) { - "use strict"; - - function init(ByteBuffer) { - - /** - * The ProtoBuf namespace. - * @exports ProtoBuf - * @namespace - * @expose - */ - var ProtoBuf = {}; - - /** - * ProtoBuf.js version. - * @type {string} - * @const - * @expose - */ - ProtoBuf.VERSION = "3.8.2"; - - /** - * Wire types. - * @type {Object.} - * @const - * @expose - */ - ProtoBuf.WIRE_TYPES = {}; - - /** - * Varint wire type. - * @type {number} - * @expose - */ - ProtoBuf.WIRE_TYPES.VARINT = 0; - - /** - * Fixed 64 bits wire type. - * @type {number} - * @const - * @expose - */ - ProtoBuf.WIRE_TYPES.BITS64 = 1; - - /** - * Length delimited wire type. - * @type {number} - * @const - * @expose - */ - ProtoBuf.WIRE_TYPES.LDELIM = 2; - - /** - * Start group wire type. - * @type {number} - * @const - * @expose - */ - ProtoBuf.WIRE_TYPES.STARTGROUP = 3; - - /** - * End group wire type. - * @type {number} - * @const - * @expose - */ - ProtoBuf.WIRE_TYPES.ENDGROUP = 4; - - /** - * Fixed 32 bits wire type. - * @type {number} - * @const - * @expose - */ - ProtoBuf.WIRE_TYPES.BITS32 = 5; - - /** - * Packable wire types. - * @type {!Array.} - * @const - * @expose - */ - ProtoBuf.PACKABLE_WIRE_TYPES = [ - ProtoBuf.WIRE_TYPES.VARINT, - ProtoBuf.WIRE_TYPES.BITS64, - ProtoBuf.WIRE_TYPES.BITS32 - ]; - - /** - * Types. - * @dict - * @type {Object.} - * @const - * @expose - */ - ProtoBuf.TYPES = { - // According to the protobuf spec. - "int32": { - name: "int32", - wireType: ProtoBuf.WIRE_TYPES.VARINT - }, - "uint32": { - name: "uint32", - wireType: ProtoBuf.WIRE_TYPES.VARINT - }, - "sint32": { - name: "sint32", - wireType: ProtoBuf.WIRE_TYPES.VARINT - }, - "int64": { - name: "int64", - wireType: ProtoBuf.WIRE_TYPES.VARINT - }, - "uint64": { - name: "uint64", - wireType: ProtoBuf.WIRE_TYPES.VARINT - }, - "sint64": { - name: "sint64", - wireType: ProtoBuf.WIRE_TYPES.VARINT - }, - "bool": { - name: "bool", - wireType: ProtoBuf.WIRE_TYPES.VARINT - }, - "double": { - name: "double", - wireType: ProtoBuf.WIRE_TYPES.BITS64 - }, - "string": { - name: "string", - wireType: ProtoBuf.WIRE_TYPES.LDELIM - }, - "bytes": { - name: "bytes", - wireType: ProtoBuf.WIRE_TYPES.LDELIM - }, - "fixed32": { - name: "fixed32", - wireType: ProtoBuf.WIRE_TYPES.BITS32 - }, - "sfixed32": { - name: "sfixed32", - wireType: ProtoBuf.WIRE_TYPES.BITS32 - }, - "fixed64": { - name: "fixed64", - wireType: ProtoBuf.WIRE_TYPES.BITS64 - }, - "sfixed64": { - name: "sfixed64", - wireType: ProtoBuf.WIRE_TYPES.BITS64 - }, - "float": { - name: "float", - wireType: ProtoBuf.WIRE_TYPES.BITS32 - }, - "enum": { - name: "enum", - wireType: ProtoBuf.WIRE_TYPES.VARINT - }, - "message": { - name: "message", - wireType: ProtoBuf.WIRE_TYPES.LDELIM - }, - "group": { - name: "group", - wireType: ProtoBuf.WIRE_TYPES.STARTGROUP - } - }; - - /** - * Minimum field id. - * @type {number} - * @const - * @expose - */ - ProtoBuf.ID_MIN = 1; - - /** - * Maximum field id. - * @type {number} - * @const - * @expose - */ - ProtoBuf.ID_MAX = 0x1FFFFFFF; - - /** - * @type {!function(new: ByteBuffer, ...[*])} - * @expose - */ - ProtoBuf.ByteBuffer = ByteBuffer; - - /** - * @type {?function(new: Long, ...[*])} - * @expose - */ - ProtoBuf.Long = ByteBuffer.Long || null; - - /** - * If set to `true`, field names will be converted from underscore notation to camel case. Defaults to `false`. - * Must be set prior to parsing. - * @type {boolean} - * @expose - */ - ProtoBuf.convertFieldsToCamelCase = false; - - /** - * By default, messages are populated with (setX, set_x) accessors for each field. This can be disabled by - * setting this to `false` prior to building messages. - * @type {boolean} - * @expose - */ - ProtoBuf.populateAccessors = true; - - /** - * @alias ProtoBuf.Util - * @expose - */ - ProtoBuf.Util = (function() { - "use strict"; - - // Object.create polyfill - // ref: https://developer.mozilla.org/de/docs/JavaScript/Reference/Global_Objects/Object/create - if (!Object.create) - /** @expose */ - Object.create = function (o) { - if (arguments.length > 1) - throw Error('Object.create polyfill only accepts the first parameter.'); - function F() {} - F.prototype = o; - return new F(); - }; - - /** - * ProtoBuf utilities. - * @exports ProtoBuf.Util - * @namespace - */ - var Util = {}; - - /** - * Flag if running in node (fs is available) or not. - * @type {boolean} - * @const - * @expose - */ - Util.IS_NODE = false; - try { - // There is no reliable way to detect node.js as an environment, so our - // best bet is to feature-detect what we actually need. - Util.IS_NODE = - typeof require === 'function' && - typeof require("fs").readFileSync === 'function' && - typeof require("path").resolve === 'function'; - } catch (e) {} - - /** - * Constructs a XMLHttpRequest object. - * @return {XMLHttpRequest} - * @throws {Error} If XMLHttpRequest is not supported - * @expose - */ - Util.XHR = function() { - // No dependencies please, ref: http://www.quirksmode.org/js/xmlhttp.html - var XMLHttpFactories = [ - function () {return new XMLHttpRequest()}, - function () {return new ActiveXObject("Msxml2.XMLHTTP")}, - function () {return new ActiveXObject("Msxml3.XMLHTTP")}, - function () {return new ActiveXObject("Microsoft.XMLHTTP")} - ]; - /** @type {?XMLHttpRequest} */ - var xhr = null; - for (var i=0;i} - * @expose - */ - ProtoBuf.Lang = { - OPEN: "{", - CLOSE: "}", - OPTOPEN: "[", - OPTCLOSE: "]", - OPTEND: ",", - EQUAL: "=", - END: ";", - STRINGOPEN: '"', - STRINGCLOSE: '"', - STRINGOPEN_SQ: "'", - STRINGCLOSE_SQ: "'", - COPTOPEN: '(', - COPTCLOSE: ')', - DELIM: /[\s\{\}=;\[\],'"\(\)]/g, - // KEYWORD: /^(?:package|option|import|message|enum|extend|service|syntax|extensions|group)$/, - RULE: /^(?:required|optional|repeated)$/, - TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/, - NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/, - TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/, - TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/, - FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/, - NUMBER: /^-?(?:[1-9][0-9]*|0|0x[0-9a-fA-F]+|0[0-7]+|([0-9]*\.[0-9]+([Ee][+-]?[0-9]+)?))$/, - NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/, - NUMBER_HEX: /^0x[0-9a-fA-F]+$/, - NUMBER_OCT: /^0[0-7]+$/, - NUMBER_FLT: /^[0-9]*\.[0-9]+([Ee][+-]?[0-9]+)?$/, - ID: /^(?:[1-9][0-9]*|0|0x[0-9a-fA-F]+|0[0-7]+)$/, - NEGID: /^\-?(?:[1-9][0-9]*|0|0x[0-9a-fA-F]+|0[0-7]+)$/, - WHITESPACE: /\s/, - STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g, - BOOL: /^(?:true|false)$/i - }; - - /** - * @alias ProtoBuf.DotProto - * @expose - */ - ProtoBuf.DotProto = (function(ProtoBuf, Lang) { - "use strict"; - - /** - * Utilities to parse .proto files. - * @exports ProtoBuf.DotProto - * @namespace - */ - var DotProto = {}; - - /** - * Constructs a new Tokenizer. - * @exports ProtoBuf.DotProto.Tokenizer - * @class prototype tokenizer - * @param {string} proto Proto to tokenize - * @constructor - */ - var Tokenizer = function(proto) { - - /** - * Source to parse. - * @type {string} - * @expose - */ - this.source = ""+proto; // In case it's a buffer - - /** - * Current index. - * @type {number} - * @expose - */ - this.index = 0; - - /** - * Current line. - * @type {number} - * @expose - */ - this.line = 1; - - /** - * Stacked values. - * @type {Array} - * @expose - */ - this.stack = []; - - /** - * Whether currently reading a string or not. - * @type {boolean} - * @expose - */ - this.readingString = false; - - /** - * Whatever character ends the string. Either a single or double quote character. - * @type {string} - * @expose - */ - this.stringEndsWith = Lang.STRINGCLOSE; - }; - - /** - * @alias ProtoBuf.DotProto.Tokenizer.prototype - * @inner - */ - var TokenizerPrototype = Tokenizer.prototype; - - /** - * Reads a string beginning at the current index. - * @return {string} The string - * @throws {Error} If it's not a valid string - * @private - */ - TokenizerPrototype._readString = function() { - Lang.STRING.lastIndex = this.index-1; // Include the open quote - var match; - if ((match = Lang.STRING.exec(this.source)) !== null) { - var s = typeof match[1] !== 'undefined' ? match[1] : match[2]; - this.index = Lang.STRING.lastIndex; - this.stack.push(this.stringEndsWith); - return s; - } - throw Error("Unterminated string at line "+this.line+", index "+this.index); - }; - - /** - * Gets the next token and advances by one. - * @return {?string} Token or `null` on EOF - * @throws {Error} If it's not a valid proto file - * @expose - */ - TokenizerPrototype.next = function() { - if (this.stack.length > 0) - return this.stack.shift(); - if (this.index >= this.source.length) - return null; // No more tokens - if (this.readingString) { - this.readingString = false; - return this._readString(); - } - var repeat, last; - do { - repeat = false; - // Strip white spaces - while (Lang.WHITESPACE.test(last = this.source.charAt(this.index))) { - this.index++; - if (last === "\n") - this.line++; - if (this.index === this.source.length) - return null; - } - // Strip comments - if (this.source.charAt(this.index) === '/') { - if (this.source.charAt(++this.index) === '/') { // Single line - while (this.source.charAt(this.index) !== "\n") { - this.index++; - if (this.index == this.source.length) - return null; - } - this.index++; - this.line++; - repeat = true; - } else if (this.source.charAt(this.index) === '*') { /* Block */ - last = ''; - while (last+(last=this.source.charAt(this.index)) !== '*/') { - this.index++; - if (last === "\n") - this.line++; - if (this.index === this.source.length) - return null; - } - this.index++; - repeat = true; - } else - throw Error("Unterminated comment at line "+this.line+": /"+this.source.charAt(this.index)); - } - } while (repeat); - if (this.index === this.source.length) return null; - - // Read the next token - var end = this.index; - Lang.DELIM.lastIndex = 0; - var delim = Lang.DELIM.test(this.source.charAt(end)); - if (!delim) { - ++end; - while(end < this.source.length && !Lang.DELIM.test(this.source.charAt(end))) - end++; - } else - ++end; - var token = this.source.substring(this.index, this.index = end); - if (token === Lang.STRINGOPEN) - this.readingString = true, - this.stringEndsWith = Lang.STRINGCLOSE; - else if (token === Lang.STRINGOPEN_SQ) - this.readingString = true, - this.stringEndsWith = Lang.STRINGCLOSE_SQ; - return token; - }; - - /** - * Peeks for the next token. - * @return {?string} Token or `null` on EOF - * @throws {Error} If it's not a valid proto file - * @expose - */ - TokenizerPrototype.peek = function() { - if (this.stack.length === 0) { - var token = this.next(); - if (token === null) - return null; - this.stack.push(token); - } - return this.stack[0]; - }; - - /** - * Returns a string representation of this object. - * @return {string} String representation as of "Tokenizer(index/length)" - * @expose - */ - TokenizerPrototype.toString = function() { - return "Tokenizer("+this.index+"/"+this.source.length+" at line "+this.line+")"; - }; - - /** - * @alias ProtoBuf.DotProto.Tokenizer - * @expose - */ - DotProto.Tokenizer = Tokenizer; - - /** - * Constructs a new Parser. - * @exports ProtoBuf.DotProto.Parser - * @class prototype parser - * @param {string} proto Protocol source - * @constructor - */ - var Parser = function(proto) { - - /** - * Tokenizer. - * @type {ProtoBuf.DotProto.Tokenizer} - * @expose - */ - this.tn = new Tokenizer(proto); - }; - - /** - * @alias ProtoBuf.DotProto.Parser.prototype - * @inner - */ - var ParserPrototype = Parser.prototype; - - /** - * Runs the parser. - * @return {{package: string|null, messages: Array., enums: Array., imports: Array., options: object}} - * @throws {Error} If the source cannot be parsed - * @expose - */ - ParserPrototype.parse = function() { - var topLevel = { - "name": "[ROOT]", // temporary - "package": null, - "messages": [], - "enums": [], - "imports": [], - "options": {}, - "services": [] - }; - var token, head = true; - while(token = this.tn.next()) { - switch (token) { - case 'package': - if (!head || topLevel["package"] !== null) - throw Error("Unexpected package at line "+this.tn.line); - topLevel["package"] = this._parsePackage(token); - break; - case 'import': - if (!head) - throw Error("Unexpected import at line "+this.tn.line); - topLevel.imports.push(this._parseImport(token)); - break; - case 'message': - this._parseMessage(topLevel, null, token); - head = false; - break; - case 'enum': - this._parseEnum(topLevel, token); - head = false; - break; - case 'option': - if (!head) - throw Error("Unexpected option at line "+this.tn.line); - this._parseOption(topLevel, token); - break; - case 'service': - this._parseService(topLevel, token); - break; - case 'extend': - this._parseExtend(topLevel, token); - break; - case 'syntax': - this._parseIgnoredStatement(topLevel, token); - break; - default: - throw Error("Unexpected token at line "+this.tn.line+": "+token); - } - } - delete topLevel["name"]; - return topLevel; - }; - - /** - * Parses a number value. - * @param {string} val Number value to parse - * @return {number} Number - * @throws {Error} If the number value is invalid - * @private - */ - ParserPrototype._parseNumber = function(val) { - var sign = 1; - if (val.charAt(0) == '-') - sign = -1, - val = val.substring(1); - if (Lang.NUMBER_DEC.test(val)) - return sign*parseInt(val, 10); - else if (Lang.NUMBER_HEX.test(val)) - return sign*parseInt(val.substring(2), 16); - else if (Lang.NUMBER_OCT.test(val)) - return sign*parseInt(val.substring(1), 8); - else if (Lang.NUMBER_FLT.test(val)) - return sign*parseFloat(val); - throw Error("Illegal number at line "+this.tn.line+": "+(sign < 0 ? '-' : '')+val); - }; - - /** - * Parses a (possibly multiline) string. - * @returns {string} - * @private - */ - ParserPrototype._parseString = function() { - var value = "", token; - do { - token = this.tn.next(); // Known to be = this.tn.stringEndsWith - value += this.tn.next(); - token = this.tn.next(); - if (token !== this.tn.stringEndsWith) - throw Error("Illegal end of string at line "+this.tn.line+": "+token); - token = this.tn.peek(); - } while (token === Lang.STRINGOPEN || token === Lang.STRINGOPEN_SQ); - return value; - }; - - /** - * Parses an ID value. - * @param {string} val ID value to parse - * @param {boolean=} neg Whether the ID may be negative, defaults to `false` - * @returns {number} ID - * @throws {Error} If the ID value is invalid - * @private - */ - ParserPrototype._parseId = function(val, neg) { - var id = -1; - var sign = 1; - if (val.charAt(0) == '-') - sign = -1, - val = val.substring(1); - if (Lang.NUMBER_DEC.test(val)) - id = parseInt(val); - else if (Lang.NUMBER_HEX.test(val)) - id = parseInt(val.substring(2), 16); - else if (Lang.NUMBER_OCT.test(val)) - id = parseInt(val.substring(1), 8); - else - throw Error("Illegal id at line "+this.tn.line+": "+(sign < 0 ? '-' : '')+val); - id = (sign*id)|0; // Force to 32bit - if (!neg && id < 0) - throw Error("Illegal id at line "+this.tn.line+": "+(sign < 0 ? '-' : '')+val); - return id; - }; - - /** - * Parses the package definition. - * @param {string} token Initial token - * @return {string} Package name - * @throws {Error} If the package definition cannot be parsed - * @private - */ - ParserPrototype._parsePackage = function(token) { - token = this.tn.next(); - if (!Lang.TYPEREF.test(token)) - throw Error("Illegal package name at line "+this.tn.line+": "+token); - var pkg = token; - token = this.tn.next(); - if (token != Lang.END) - throw Error("Illegal end of package at line "+this.tn.line+": "+token); - return pkg; - }; - - /** - * Parses an import definition. - * @param {string} token Initial token - * @return {string} Import file name - * @throws {Error} If the import definition cannot be parsed - * @private - */ - ParserPrototype._parseImport = function(token) { - token = this.tn.peek(); - if (token === "public") - this.tn.next(), - token = this.tn.peek(); - if (token !== Lang.STRINGOPEN && token !== Lang.STRINGOPEN_SQ) - throw Error("Illegal start of import at line "+this.tn.line+": "+token); - var imported = this._parseString(); - token = this.tn.next(); - if (token !== Lang.END) - throw Error("Illegal end of import at line "+this.tn.line+": "+token); - return imported; - }; - - /** - * Parses a namespace option. - * @param {Object} parent Parent definition - * @param {string} token Initial token - * @throws {Error} If the option cannot be parsed - * @private - */ - ParserPrototype._parseOption = function(parent, token) { - token = this.tn.next(); - var custom = false; - if (token == Lang.COPTOPEN) - custom = true, - token = this.tn.next(); - if (!Lang.TYPEREF.test(token)) - // we can allow options of the form google.protobuf.* since they will just get ignored anyways - if (!/google\.protobuf\./.test(token)) - throw Error("Illegal option name in message "+parent.name+" at line "+this.tn.line+": "+token); - var name = token; - token = this.tn.next(); - if (custom) { // (my_method_option).foo, (my_method_option), some_method_option, (foo.my_option).bar - if (token !== Lang.COPTCLOSE) - throw Error("Illegal end in message "+parent.name+", option "+name+" at line "+this.tn.line+": "+token); - name = '('+name+')'; - token = this.tn.next(); - if (Lang.FQTYPEREF.test(token)) - name += token, - token = this.tn.next(); - } - if (token !== Lang.EQUAL) - throw Error("Illegal operator in message "+parent.name+", option "+name+" at line "+this.tn.line+": "+token); - var value; - token = this.tn.peek(); - if (token === Lang.STRINGOPEN || token === Lang.STRINGOPEN_SQ) - value = this._parseString(); - else { - this.tn.next(); - if (Lang.NUMBER.test(token)) - value = this._parseNumber(token, true); - else if (Lang.BOOL.test(token)) - value = token === 'true'; - else if (Lang.TYPEREF.test(token)) - value = token; - else - throw Error("Illegal option value in message "+parent.name+", option "+name+" at line "+this.tn.line+": "+token); - } - token = this.tn.next(); - if (token !== Lang.END) - throw Error("Illegal end of option in message "+parent.name+", option "+name+" at line "+this.tn.line+": "+token); - parent["options"][name] = value; - }; - - /** - * Parses an ignored statement of the form ['keyword', ..., ';']. - * @param {Object} parent Parent definition - * @param {string} keyword Initial token - * @throws {Error} If the directive cannot be parsed - * @private - */ - ParserPrototype._parseIgnoredStatement = function(parent, keyword) { - var token; - do { - token = this.tn.next(); - if (token === null) - throw Error("Unexpected EOF in "+parent.name+", "+keyword+" at line "+this.tn.line); - if (token === Lang.END) - break; - } while (true); - }; - - /** - * Parses a service definition. - * @param {Object} parent Parent definition - * @param {string} token Initial token - * @throws {Error} If the service cannot be parsed - * @private - */ - ParserPrototype._parseService = function(parent, token) { - token = this.tn.next(); - if (!Lang.NAME.test(token)) - throw Error("Illegal service name at line "+this.tn.line+": "+token); - var name = token; - var svc = { - "name": name, - "rpc": {}, - "options": {} - }; - token = this.tn.next(); - if (token !== Lang.OPEN) - throw Error("Illegal start of service "+name+" at line "+this.tn.line+": "+token); - do { - token = this.tn.next(); - if (token === "option") - this._parseOption(svc, token); - else if (token === 'rpc') - this._parseServiceRPC(svc, token); - else if (token !== Lang.CLOSE) - throw Error("Illegal type of service "+name+" at line "+this.tn.line+": "+token); - } while (token !== Lang.CLOSE); - parent["services"].push(svc); - }; - - /** - * Parses a RPC service definition of the form ['rpc', name, (request), 'returns', (response)]. - * @param {Object} svc Parent definition - * @param {string} token Initial token - * @private - */ - ParserPrototype._parseServiceRPC = function(svc, token) { - var type = token; - token = this.tn.next(); - if (!Lang.NAME.test(token)) - throw Error("Illegal method name in service "+svc["name"]+" at line "+this.tn.line+": "+token); - var name = token; - var method = { - "request": null, - "response": null, - "options": {} - }; - token = this.tn.next(); - if (token !== Lang.COPTOPEN) - throw Error("Illegal start of request type in service "+svc["name"]+"#"+name+" at line "+this.tn.line+": "+token); - token = this.tn.next(); - if (!Lang.TYPEREF.test(token)) - throw Error("Illegal request type in service "+svc["name"]+"#"+name+" at line "+this.tn.line+": "+token); - method["request"] = token; - token = this.tn.next(); - if (token != Lang.COPTCLOSE) - throw Error("Illegal end of request type in service "+svc["name"]+"#"+name+" at line "+this.tn.line+": "+token); - token = this.tn.next(); - if (token.toLowerCase() !== "returns") - throw Error("Illegal delimiter in service "+svc["name"]+"#"+name+" at line "+this.tn.line+": "+token); - token = this.tn.next(); - if (token != Lang.COPTOPEN) - throw Error("Illegal start of response type in service "+svc["name"]+"#"+name+" at line "+this.tn.line+": "+token); - token = this.tn.next(); - method["response"] = token; - token = this.tn.next(); - if (token !== Lang.COPTCLOSE) - throw Error("Illegal end of response type in service "+svc["name"]+"#"+name+" at line "+this.tn.line+": "+token); - token = this.tn.next(); - if (token === Lang.OPEN) { - do { - token = this.tn.next(); - if (token === 'option') - this._parseOption(method, token); // <- will fail for the custom-options example - else if (token !== Lang.CLOSE) - throw Error("Illegal start of option inservice "+svc["name"]+"#"+name+" at line "+this.tn.line+": "+token); - } while (token !== Lang.CLOSE); - if (this.tn.peek() === Lang.END) - this.tn.next(); - } else if (token !== Lang.END) - throw Error("Illegal delimiter in service "+svc["name"]+"#"+name+" at line "+this.tn.line+": "+token); - if (typeof svc[type] === 'undefined') - svc[type] = {}; - svc[type][name] = method; - }; - - /** - * Parses a message definition. - * @param {Object} parent Parent definition - * @param {Object} fld Field definition if this is a group, otherwise `null` - * @param {string} token First token - * @return {Object} - * @throws {Error} If the message cannot be parsed - * @private - */ - ParserPrototype._parseMessage = function(parent, fld, token) { - /** @dict */ - var msg = {}; // Note: At some point we might want to exclude the parser, so we need a dict. - var isGroup = token === "group"; - token = this.tn.next(); - if (!Lang.NAME.test(token)) - throw Error("Illegal "+(isGroup ? "group" : "message")+" name"+(parent ? " in message "+parent["name"] : "")+" at line "+this.tn.line+": "+token); - msg["name"] = token; - if (isGroup) { - token = this.tn.next(); - if (token !== Lang.EQUAL) - throw Error("Illegal id assignment after group "+msg.name+" at line "+this.tn.line+": "+token); - token = this.tn.next(); - try { - fld["id"] = this._parseId(token); - } catch (e) { - throw Error("Illegal field id value for group "+msg.name+"#"+fld.name+" at line "+this.tn.line+": "+token); - } - msg["isGroup"] = true; - } - msg["fields"] = []; // Note: Using arrays to support also browser that cannot preserve order of object keys. - msg["enums"] = []; - msg["messages"] = []; - msg["options"] = {}; - msg["oneofs"] = {}; - token = this.tn.next(); - if (token === Lang.OPTOPEN && fld) - this._parseFieldOptions(msg, fld, token), - token = this.tn.next(); - if (token !== Lang.OPEN) - throw Error("Illegal start of "+(isGroup ? "group" : "message")+" "+msg.name+" at line "+this.tn.line+": "+token); - // msg["extensions"] = undefined - do { - token = this.tn.next(); - if (token === Lang.CLOSE) { - token = this.tn.peek(); - if (token === Lang.END) - this.tn.next(); - break; - } else if (Lang.RULE.test(token)) - this._parseMessageField(msg, token); - else if (token === "oneof") - this._parseMessageOneOf(msg, token); - else if (token === "enum") - this._parseEnum(msg, token); - else if (token === "message") - this._parseMessage(msg, null, token); - else if (token === "option") - this._parseOption(msg, token); - else if (token === "extensions") - msg["extensions"] = this._parseExtensions(msg, token); - else if (token === "extend") - this._parseExtend(msg, token); - else - throw Error("Illegal token in message "+msg.name+" at line "+this.tn.line+": "+token); - } while (true); - parent["messages"].push(msg); - return msg; - }; - - /** - * Parses a message field. - * @param {Object} msg Message definition - * @param {string} token Initial token - * @returns {!Object} Field descriptor - * @throws {Error} If the message field cannot be parsed - * @private - */ - ParserPrototype._parseMessageField = function(msg, token) { - /** @dict */ - var fld = {}, grp = null; - fld["rule"] = token; - /** @dict */ - fld["options"] = {}; - token = this.tn.next(); - if (token === "group") { - // "A [legacy] group simply combines a nested message type and a field into a single declaration. In your - // code, you can treat this message just as if it had a Result type field called result (the latter name is - // converted to lower-case so that it does not conflict with the former)." - grp = this._parseMessage(msg, fld, token); - if (!/^[A-Z]/.test(grp["name"])) - throw Error('Group names must start with a capital letter'); - fld["type"] = grp["name"]; - fld["name"] = grp["name"].toLowerCase(); - token = this.tn.peek(); - if (token === Lang.END) - this.tn.next(); - } else { - if (!Lang.TYPE.test(token) && !Lang.TYPEREF.test(token)) - throw Error("Illegal field type in message "+msg.name+" at line "+this.tn.line+": "+token); - fld["type"] = token; - token = this.tn.next(); - if (!Lang.NAME.test(token)) - throw Error("Illegal field name in message "+msg.name+" at line "+this.tn.line+": "+token); - fld["name"] = token; - token = this.tn.next(); - if (token !== Lang.EQUAL) - throw Error("Illegal token in field "+msg.name+"#"+fld.name+" at line "+this.tn.line+": "+token); - token = this.tn.next(); - try { - fld["id"] = this._parseId(token); - } catch (e) { - throw Error("Illegal field id in message "+msg.name+"#"+fld.name+" at line "+this.tn.line+": "+token); - } - token = this.tn.next(); - if (token === Lang.OPTOPEN) - this._parseFieldOptions(msg, fld, token), - token = this.tn.next(); - if (token !== Lang.END) - throw Error("Illegal delimiter in message "+msg.name+"#"+fld.name+" at line "+this.tn.line+": "+token); - } - msg["fields"].push(fld); - return fld; - }; - - /** - * Parses a message oneof. - * @param {Object} msg Message definition - * @param {string} token Initial token - * @throws {Error} If the message oneof cannot be parsed - * @private - */ - ParserPrototype._parseMessageOneOf = function(msg, token) { - token = this.tn.next(); - if (!Lang.NAME.test(token)) - throw Error("Illegal oneof name in message "+msg.name+" at line "+this.tn.line+": "+token); - var name = token, - fld; - var fields = []; - token = this.tn.next(); - if (token !== Lang.OPEN) - throw Error("Illegal start of oneof "+name+" at line "+this.tn.line+": "+token); - while (this.tn.peek() !== Lang.CLOSE) { - fld = this._parseMessageField(msg, "optional"); - fld["oneof"] = name; - fields.push(fld["id"]); - } - this.tn.next(); - msg["oneofs"][name] = fields; - }; - - /** - * Parses a set of field option definitions. - * @param {Object} msg Message definition - * @param {Object} fld Field definition - * @param {string} token Initial token - * @throws {Error} If the message field options cannot be parsed - * @private - */ - ParserPrototype._parseFieldOptions = function(msg, fld, token) { - var first = true; - do { - token = this.tn.next(); - if (token === Lang.OPTCLOSE) - break; - else if (token === Lang.OPTEND) { - if (first) - throw Error("Illegal start of options in message "+msg.name+"#"+fld.name+" at line "+this.tn.line+": "+token); - token = this.tn.next(); - } - this._parseFieldOption(msg, fld, token); - first = false; - } while (true); - }; - - /** - * Parses a single field option. - * @param {Object} msg Message definition - * @param {Object} fld Field definition - * @param {string} token Initial token - * @throws {Error} If the mesage field option cannot be parsed - * @private - */ - ParserPrototype._parseFieldOption = function(msg, fld, token) { - var custom = false; - if (token === Lang.COPTOPEN) - token = this.tn.next(), - custom = true; - if (!Lang.TYPEREF.test(token)) - throw Error("Illegal field option in "+msg.name+"#"+fld.name+" at line "+this.tn.line+": "+token); - var name = token; - token = this.tn.next(); - if (custom) { - if (token !== Lang.COPTCLOSE) - throw Error("Illegal delimiter in "+msg.name+"#"+fld.name+" at line "+this.tn.line+": "+token); - name = '('+name+')'; - token = this.tn.next(); - if (Lang.FQTYPEREF.test(token)) - name += token, - token = this.tn.next(); - } - if (token !== Lang.EQUAL) - throw Error("Illegal token in "+msg.name+"#"+fld.name+" at line "+this.tn.line+": "+token); - var value; - token = this.tn.peek(); - if (token === Lang.STRINGOPEN || token === Lang.STRINGOPEN_SQ) { - value = this._parseString(); - } else if (Lang.NUMBER.test(token, true)) - value = this._parseNumber(this.tn.next(), true); - else if (Lang.BOOL.test(token)) - value = this.tn.next().toLowerCase() === 'true'; - else if (Lang.TYPEREF.test(token)) - value = this.tn.next(); // TODO: Resolve? - else - throw Error("Illegal value in message "+msg.name+"#"+fld.name+", option "+name+" at line "+this.tn.line+": "+token); - fld["options"][name] = value; - }; - - /** - * Parses an enum. - * @param {Object} msg Message definition - * @param {string} token Initial token - * @throws {Error} If the enum cannot be parsed - * @private - */ - ParserPrototype._parseEnum = function(msg, token) { - /** @dict */ - var enm = {}; - token = this.tn.next(); - if (!Lang.NAME.test(token)) - throw Error("Illegal enum name in message "+msg.name+" at line "+this.tn.line+": "+token); - enm["name"] = token; - token = this.tn.next(); - if (token !== Lang.OPEN) - throw Error("Illegal start of enum "+enm.name+" at line "+this.tn.line+": "+token); - enm["values"] = []; - enm["options"] = {}; - do { - token = this.tn.next(); - if (token === Lang.CLOSE) { - token = this.tn.peek(); - if (token === Lang.END) - this.tn.next(); - break; - } - if (token == 'option') - this._parseOption(enm, token); - else { - if (!Lang.NAME.test(token)) - throw Error("Illegal name in enum "+enm.name+" at line "+this.tn.line+": "+token); - this._parseEnumValue(enm, token); - } - } while (true); - msg["enums"].push(enm); - }; - - /** - * Parses an enum value. - * @param {Object} enm Enum definition - * @param {string} token Initial token - * @throws {Error} If the enum value cannot be parsed - * @private - */ - ParserPrototype._parseEnumValue = function(enm, token) { - /** @dict */ - var val = {}; - val["name"] = token; - token = this.tn.next(); - if (token !== Lang.EQUAL) - throw Error("Illegal token in enum "+enm.name+" at line "+this.tn.line+": "+token); - token = this.tn.next(); - try { - val["id"] = this._parseId(token, true); - } catch (e) { - throw Error("Illegal id in enum "+enm.name+" at line "+this.tn.line+": "+token); - } - enm["values"].push(val); - token = this.tn.next(); - if (token === Lang.OPTOPEN) { - var opt = { 'options' : {} }; // TODO: Actually expose them somehow. - this._parseFieldOptions(enm, opt, token); - token = this.tn.next(); - } - if (token !== Lang.END) - throw Error("Illegal delimiter in enum "+enm.name+" at line "+this.tn.line+": "+token); - }; - - /** - * Parses an extensions statement. - * @param {Object} msg Message object - * @param {string} token Initial token - * @throws {Error} If the extensions statement cannot be parsed - * @private - */ - ParserPrototype._parseExtensions = function(msg, token) { - /** @type {Array.} */ - var range = []; - token = this.tn.next(); - if (token === "min") // FIXME: Does the official implementation support this? - range.push(ProtoBuf.ID_MIN); - else if (token === "max") - range.push(ProtoBuf.ID_MAX); - else - range.push(this._parseNumber(token)); - token = this.tn.next(); - if (token !== 'to') - throw Error("Illegal extensions delimiter in message "+msg.name+" at line "+this.tn.line+": "+token); - token = this.tn.next(); - if (token === "min") - range.push(ProtoBuf.ID_MIN); - else if (token === "max") - range.push(ProtoBuf.ID_MAX); - else - range.push(this._parseNumber(token)); - token = this.tn.next(); - if (token !== Lang.END) - throw Error("Illegal extensions delimiter in message "+msg.name+" at line "+this.tn.line+": "+token); - return range; - }; - - /** - * Parses an extend block. - * @param {Object} parent Parent object - * @param {string} token Initial token - * @throws {Error} If the extend block cannot be parsed - * @private - */ - ParserPrototype._parseExtend = function(parent, token) { - token = this.tn.next(); - if (!Lang.TYPEREF.test(token)) - throw Error("Illegal message name at line "+this.tn.line+": "+token); - /** @dict */ - var ext = {}; - ext["ref"] = token; - ext["fields"] = []; - token = this.tn.next(); - if (token !== Lang.OPEN) - throw Error("Illegal start of extend "+ext.name+" at line "+this.tn.line+": "+token); - do { - token = this.tn.next(); - if (token === Lang.CLOSE) { - token = this.tn.peek(); - if (token == Lang.END) - this.tn.next(); - break; - } else if (Lang.RULE.test(token)) - this._parseMessageField(ext, token); - else - throw Error("Illegal token in extend "+ext.name+" at line "+this.tn.line+": "+token); - } while (true); - parent["messages"].push(ext); - return ext; - }; - - /** - * Returns a string representation of this object. - * @returns {string} String representation as of "Parser" - */ - ParserPrototype.toString = function() { - return "Parser"; - }; - - /** - * @alias ProtoBuf.DotProto.Parser - * @expose - */ - DotProto.Parser = Parser; - - return DotProto; - - })(ProtoBuf, ProtoBuf.Lang); - - /** - * @alias ProtoBuf.Reflect - * @expose - */ - ProtoBuf.Reflect = (function(ProtoBuf) { - "use strict"; - - /** - * Reflection types. - * @exports ProtoBuf.Reflect - * @namespace - */ - var Reflect = {}; - - /** - * Constructs a Reflect base class. - * @exports ProtoBuf.Reflect.T - * @constructor - * @abstract - * @param {!ProtoBuf.Builder} builder Builder reference - * @param {?ProtoBuf.Reflect.T} parent Parent object - * @param {string} name Object name - */ - var T = function(builder, parent, name) { - - /** - * Builder reference. - * @type {!ProtoBuf.Builder} - * @expose - */ - this.builder = builder; - - /** - * Parent object. - * @type {?ProtoBuf.Reflect.T} - * @expose - */ - this.parent = parent; - - /** - * Object name in namespace. - * @type {string} - * @expose - */ - this.name = name; - - /** - * Fully qualified class name - * @type {string} - * @expose - */ - this.className; - }; - - /** - * @alias ProtoBuf.Reflect.T.prototype - * @inner - */ - var TPrototype = T.prototype; - - /** - * Returns the fully qualified name of this object. - * @returns {string} Fully qualified name as of ".PATH.TO.THIS" - * @expose - */ - TPrototype.fqn = function() { - var name = this.name, - ptr = this; - do { - ptr = ptr.parent; - if (ptr == null) - break; - name = ptr.name+"."+name; - } while (true); - return name; - }; - - /** - * Returns a string representation of this Reflect object (its fully qualified name). - * @param {boolean=} includeClass Set to true to include the class name. Defaults to false. - * @return String representation - * @expose - */ - TPrototype.toString = function(includeClass) { - return (includeClass ? this.className + " " : "") + this.fqn(); - }; - - /** - * Builds this type. - * @throws {Error} If this type cannot be built directly - * @expose - */ - TPrototype.build = function() { - throw Error(this.toString(true)+" cannot be built directly"); - }; - - /** - * @alias ProtoBuf.Reflect.T - * @expose - */ - Reflect.T = T; - - /** - * Constructs a new Namespace. - * @exports ProtoBuf.Reflect.Namespace - * @param {!ProtoBuf.Builder} builder Builder reference - * @param {?ProtoBuf.Reflect.Namespace} parent Namespace parent - * @param {string} name Namespace name - * @param {Object.=} options Namespace options - * @constructor - * @extends ProtoBuf.Reflect.T - */ - var Namespace = function(builder, parent, name, options) { - T.call(this, builder, parent, name); - - /** - * @override - */ - this.className = "Namespace"; - - /** - * Children inside the namespace. - * @type {!Array.} - */ - this.children = []; - - /** - * Options. - * @type {!Object.} - */ - this.options = options || {}; - }; - - /** - * @alias ProtoBuf.Reflect.Namespace.prototype - * @inner - */ - var NamespacePrototype = Namespace.prototype = Object.create(T.prototype); - - /** - * Returns an array of the namespace's children. - * @param {ProtoBuf.Reflect.T=} type Filter type (returns instances of this type only). Defaults to null (all children). - * @return {Array.} - * @expose - */ - NamespacePrototype.getChildren = function(type) { - type = type || null; - if (type == null) - return this.children.slice(); - var children = []; - for (var i=0, k=this.children.length; i} Runtime namespace - * @expose - */ - NamespacePrototype.build = function() { - /** @dict */ - var ns = {}; - var children = this.children; - for (var i=0, k=children.length, child; i} - */ - NamespacePrototype.buildOpt = function() { - var opt = {}, - keys = Object.keys(this.options); - for (var i=0, k=keys.length; i}null} Option value or NULL if there is no such option - */ - NamespacePrototype.getOption = function(name) { - if (typeof name === 'undefined') - return this.options; - return typeof this.options[name] !== 'undefined' ? this.options[name] : null; - }; - - /** - * @alias ProtoBuf.Reflect.Namespace - * @expose - */ - Reflect.Namespace = Namespace; - - /** - * Constructs a new Message. - * @exports ProtoBuf.Reflect.Message - * @param {!ProtoBuf.Builder} builder Builder reference - * @param {!ProtoBuf.Reflect.Namespace} parent Parent message or namespace - * @param {string} name Message name - * @param {Object.=} options Message options - * @param {boolean=} isGroup `true` if this is a legacy group - * @constructor - * @extends ProtoBuf.Reflect.Namespace - */ - var Message = function(builder, parent, name, options, isGroup) { - Namespace.call(this, builder, parent, name, options); - - /** - * @override - */ - this.className = "Message"; - - /** - * Extensions range. - * @type {!Array.} - * @expose - */ - this.extensions = [ProtoBuf.ID_MIN, ProtoBuf.ID_MAX]; - - /** - * Runtime message class. - * @type {?function(new:ProtoBuf.Builder.Message)} - * @expose - */ - this.clazz = null; - - /** - * Whether this is a legacy group or not. - * @type {boolean} - * @expose - */ - this.isGroup = !!isGroup; - - // The following cached collections are used to efficiently iterate over or look up fields when decoding. - - /** - * Cached fields. - * @type {?Array.} - * @private - */ - this._fields = null; - - /** - * Cached fields by id. - * @type {?Object.} - * @private - */ - this._fieldsById = null; - - /** - * Cached fields by name. - * @type {?Object.} - * @private - */ - this._fieldsByName = null; - }; - - /** - * @alias ProtoBuf.Reflect.Message.prototype - * @inner - */ - var MessagePrototype = Message.prototype = Object.create(Namespace.prototype); - - /** - * Builds the message and returns the runtime counterpart, which is a fully functional class. - * @see ProtoBuf.Builder.Message - * @param {boolean=} rebuild Whether to rebuild or not, defaults to false - * @return {ProtoBuf.Reflect.Message} Message class - * @throws {Error} If the message cannot be built - * @expose - */ - MessagePrototype.build = function(rebuild) { - if (this.clazz && !rebuild) - return this.clazz; - - // Create the runtime Message class in its own scope - var clazz = (function(ProtoBuf, T) { - - var fields = T.getChildren(ProtoBuf.Reflect.Message.Field), - oneofs = T.getChildren(ProtoBuf.Reflect.Message.OneOf); - - /** - * Constructs a new runtime Message. - * @name ProtoBuf.Builder.Message - * @class Barebone of all runtime messages. - * @param {!Object.|string} values Preset values - * @param {...string} var_args - * @constructor - * @throws {Error} If the message cannot be created - */ - var Message = function(values, var_args) { - ProtoBuf.Builder.Message.call(this); - - // Create virtual oneof properties - for (var i=0, k=oneofs.length; i 0) { - // Set field values from a values object - if (arguments.length === 1 && typeof values === 'object' && - /* not another Message */ typeof values.encode !== 'function' && - /* not a repeated field */ !ProtoBuf.Util.isArray(values) && - /* not a ByteBuffer */ !(values instanceof ByteBuffer) && - /* not an ArrayBuffer */ !(values instanceof ArrayBuffer) && - /* not a Long */ !(ProtoBuf.Long && values instanceof ProtoBuf.Long)) { - var keys = Object.keys(values); - for (i=0, k=keys.length; i} Raw payload - * @expose - */ - MessagePrototype.toRaw = function(includeBinaryAsBase64) { - return cloneRaw(this, !!includeBinaryAsBase64); - }; - - /** - * Decodes a message from the specified buffer or string. - * @name ProtoBuf.Builder.Message.decode - * @function - * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer Buffer to decode from - * @param {string=} enc Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64 - * @return {!ProtoBuf.Builder.Message} Decoded message - * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still - * returns the decoded message with missing fields in the `decoded` property on the error. - * @expose - * @see ProtoBuf.Builder.Message.decode64 - * @see ProtoBuf.Builder.Message.decodeHex - */ - Message.decode = function(buffer, enc) { - if (typeof buffer === 'string') - buffer = ByteBuffer.wrap(buffer, enc ? enc : "base64"); - buffer = buffer instanceof ByteBuffer ? buffer : ByteBuffer.wrap(buffer); // May throw - var le = buffer.littleEndian; - try { - var msg = T.decode(buffer.LE()); - buffer.LE(le); - return msg; - } catch (e) { - buffer.LE(le); - throw(e); - } - }; - - /** - * Decodes a varint32 length-delimited message from the specified buffer or string. - * @name ProtoBuf.Builder.Message.decodeDelimited - * @function - * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer Buffer to decode from - * @param {string=} enc Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64 - * @return {ProtoBuf.Builder.Message} Decoded message or `null` if not enough bytes are available yet - * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still - * returns the decoded message with missing fields in the `decoded` property on the error. - * @expose - */ - Message.decodeDelimited = function(buffer, enc) { - if (typeof buffer === 'string') - buffer = ByteBuffer.wrap(buffer, enc ? enc : "base64"); - buffer = buffer instanceof ByteBuffer ? buffer : ByteBuffer.wrap(buffer); // May throw - if (buffer.remaining() < 1) - return null; - var off = buffer.offset, - len = buffer.readVarint32(); - if (buffer.remaining() < len) { - buffer.offset = off; - return null; - } - try { - var msg = T.decode(buffer.slice(buffer.offset, buffer.offset + len).LE()); - buffer.offset += len; - return msg; - } catch (err) { - buffer.offset += len; - throw err; - } - }; - - /** - * Decodes the message from the specified base64 encoded string. - * @name ProtoBuf.Builder.Message.decode64 - * @function - * @param {string} str String to decode from - * @return {!ProtoBuf.Builder.Message} Decoded message - * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still - * returns the decoded message with missing fields in the `decoded` property on the error. - * @expose - */ - Message.decode64 = function(str) { - return Message.decode(str, "base64"); - }; - - /** - * Decodes the message from the specified hex encoded string. - * @name ProtoBuf.Builder.Message.decodeHex - * @function - * @param {string} str String to decode from - * @return {!ProtoBuf.Builder.Message} Decoded message - * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still - * returns the decoded message with missing fields in the `decoded` property on the error. - * @expose - */ - Message.decodeHex = function(str) { - return Message.decode(str, "hex"); - }; - - // Utility - - /** - * Returns a string representation of this Message. - * @name ProtoBuf.Builder.Message#toString - * @function - * @return {string} String representation as of ".Fully.Qualified.MessageName" - * @expose - */ - MessagePrototype.toString = function() { - return T.toString(); - }; - - // Properties - - /** - * Options. - * @name ProtoBuf.Builder.Message.$options - * @type {Object.} - * @expose - */ - var $options; // cc - - /** - * Reflection type. - * @name ProtoBuf.Builder.Message#$type - * @type {!ProtoBuf.Reflect.Message} - * @expose - */ - var $type; // cc - - if (Object.defineProperty) - Object.defineProperty(Message, '$options', { "value": T.buildOpt() }), - Object.defineProperty(MessagePrototype, "$type", { - get: function() { return T; } - }); - - return Message; - - })(ProtoBuf, this); - - // Static enums and prototyped sub-messages / cached collections - this._fields = []; - this._fieldsById = {}; - this._fieldsByName = {}; - for (var i=0, k=this.children.length, child; i> 3; - switch (wireType) { - case ProtoBuf.WIRE_TYPES.VARINT: - do tag = buf.readUint8(); - while ((tag & 0x80) === 0x80); - break; - case ProtoBuf.WIRE_TYPES.BITS64: - buf.offset += 8; - break; - case ProtoBuf.WIRE_TYPES.LDELIM: - tag = buf.readVarint32(); // reads the varint - buf.offset += tag; // skips n bytes - break; - case ProtoBuf.WIRE_TYPES.STARTGROUP: - skipTillGroupEnd(id, buf); - break; - case ProtoBuf.WIRE_TYPES.ENDGROUP: - if (id === expectedId) - return false; - else - throw Error("Illegal GROUPEND after unknown group: "+id+" ("+expectedId+" expected)"); - case ProtoBuf.WIRE_TYPES.BITS32: - buf.offset += 4; - break; - default: - throw Error("Illegal wire type in unknown group "+expectedId+": "+wireType); - } - return true; - } - - /** - * Decodes an encoded message and returns the decoded message. - * @param {ByteBuffer} buffer ByteBuffer to decode from - * @param {number=} length Message length. Defaults to decode all the available data. - * @param {number=} expectedGroupEndId Expected GROUPEND id if this is a legacy group - * @return {ProtoBuf.Builder.Message} Decoded message - * @throws {Error} If the message cannot be decoded - * @expose - */ - MessagePrototype.decode = function(buffer, length, expectedGroupEndId) { - length = typeof length === 'number' ? length : -1; - var start = buffer.offset, - msg = new (this.clazz)(), - tag, wireType, id, field; - while (buffer.offset < start+length || (length === -1 && buffer.remaining() > 0)) { - tag = buffer.readVarint32(); - wireType = tag & 0x07; - id = tag >> 3; - if (wireType === ProtoBuf.WIRE_TYPES.ENDGROUP) { - if (id !== expectedGroupEndId) - throw Error("Illegal group end indicator for "+this.toString(true)+": "+id+" ("+(expectedGroupEndId ? expectedGroupEndId+" expected" : "not a group")+")"); - break; - } - if (!(field = this._fieldsById[id])) { - // "messages created by your new code can be parsed by your old code: old binaries simply ignore the new field when parsing." - switch (wireType) { - case ProtoBuf.WIRE_TYPES.VARINT: - buffer.readVarint32(); - break; - case ProtoBuf.WIRE_TYPES.BITS32: - buffer.offset += 4; - break; - case ProtoBuf.WIRE_TYPES.BITS64: - buffer.offset += 8; - break; - case ProtoBuf.WIRE_TYPES.LDELIM: - var len = buffer.readVarint32(); - buffer.offset += len; - break; - case ProtoBuf.WIRE_TYPES.STARTGROUP: - while (skipTillGroupEnd(id, buffer)) {} - break; - default: - throw Error("Illegal wire type for unknown field "+id+" in "+this.toString(true)+"#decode: "+wireType); - } - continue; - } - if (field.repeated && !field.options["packed"]) - msg[field.name].push(field.decode(wireType, buffer)); - else { - msg[field.name] = field.decode(wireType, buffer); - if (field.oneof) { - if (this[field.oneof.name] !== null) - this[this[field.oneof.name]] = null; - msg[field.oneof.name] = field.name; - } - } - } - - // Check if all required fields are present and set default values for optional fields that are not - for (var i=0, k=this._fields.length; i=} options Options - * @param {!ProtoBuf.Reflect.Message.OneOf=} oneof Enclosing OneOf - * @constructor - * @extends ProtoBuf.Reflect.T - */ - var Field = function(builder, message, rule, type, name, id, options, oneof) { - T.call(this, builder, message, name); - - /** - * @override - */ - this.className = "Message.Field"; - - /** - * Message field required flag. - * @type {boolean} - * @expose - */ - this.required = rule === "required"; - - /** - * Message field repeated flag. - * @type {boolean} - * @expose - */ - this.repeated = rule === "repeated"; - - /** - * Message field type. Type reference string if unresolved, protobuf type if resolved. - * @type {string|{name: string, wireType: number}} - * @expose - */ - this.type = type; - - /** - * Resolved type reference inside the global namespace. - * @type {ProtoBuf.Reflect.T|null} - * @expose - */ - this.resolvedType = null; - - /** - * Unique message field id. - * @type {number} - * @expose - */ - this.id = id; - - /** - * Message field options. - * @type {!Object.} - * @dict - * @expose - */ - this.options = options || {}; - - /** - * Default value. - * @type {*} - * @expose - */ - this.defaultValue = null; - - /** - * Enclosing OneOf. - * @type {?ProtoBuf.Reflect.Message.OneOf} - * @expose - */ - this.oneof = oneof || null; - - /** - * Original field name. - * @type {string} - * @expose - */ - this.originalName = this.name; // Used to revert camelcase transformation on naming collisions - - // Convert field names to camel case notation if the override is set - if (this.builder.options['convertFieldsToCamelCase'] && !(this instanceof Message.ExtensionField)) - this.name = Field._toCamelCase(this.name); - }; - - /** - * Converts a field name to camel case. - * @param {string} name Likely underscore notated name - * @returns {string} Camel case notated name - * @private - */ - Field._toCamelCase = function(name) { - return name.replace(/_([a-zA-Z])/g, function($0, $1) { - return $1.toUpperCase(); - }); - }; - - /** - * @alias ProtoBuf.Reflect.Message.Field.prototype - * @inner - */ - var FieldPrototype = Field.prototype = Object.create(T.prototype); - - /** - * Builds the field. - * @override - * @expose - */ - FieldPrototype.build = function() { - this.defaultValue = typeof this.options['default'] !== 'undefined' - ? this.verifyValue(this.options['default']) : null; - }; - - /** - * Makes a Long from a value. - * @param {{low: number, high: number, unsigned: boolean}|string|number} value Value - * @param {boolean=} unsigned Whether unsigned or not, defaults to reuse it from Long-like objects or to signed for - * strings and numbers - * @returns {!Long} - * @throws {Error} If the value cannot be converted to a Long - * @inner - */ - function mkLong(value, unsigned) { - if (value && typeof value.low === 'number' && typeof value.high === 'number' && typeof value.unsigned === 'boolean' - && value.low === value.low && value.high === value.high) - return new ProtoBuf.Long(value.low, value.high, typeof unsigned === 'undefined' ? value.unsigned : unsigned); - if (typeof value === 'string') - return ProtoBuf.Long.fromString(value, unsigned || false, 10); - if (typeof value === 'number') - return ProtoBuf.Long.fromNumber(value, unsigned || false); - throw Error("not convertible to Long"); - } - - /** - * Checks if the given value can be set for this field. - * @param {*} value Value to check - * @param {boolean=} skipRepeated Whether to skip the repeated value check or not. Defaults to false. - * @return {*} Verified, maybe adjusted, value - * @throws {Error} If the value cannot be set for this field - * @expose - */ - FieldPrototype.verifyValue = function(value, skipRepeated) { - skipRepeated = skipRepeated || false; - var fail = function(val, msg) { - throw Error("Illegal value for "+this.toString(true)+" of type "+this.type.name+": "+val+" ("+msg+")"); - }.bind(this); - if (value === null) { // NULL values for optional fields - if (this.required) - fail(typeof value, "required"); - return null; - } - var i; - if (this.repeated && !skipRepeated) { // Repeated values as arrays - if (!ProtoBuf.Util.isArray(value)) - value = [value]; - var res = []; - for (i=0; i 4294967295 ? value | 0 : value; - - // Unsigned 32bit - case ProtoBuf.TYPES["uint32"]: - case ProtoBuf.TYPES["fixed32"]: - if (typeof value !== 'number' || (value === value && value % 1 !== 0)) - fail(typeof value, "not an integer"); - return value < 0 ? value >>> 0 : value; - - // Signed 64bit - case ProtoBuf.TYPES["int64"]: - case ProtoBuf.TYPES["sint64"]: - case ProtoBuf.TYPES["sfixed64"]: { - if (ProtoBuf.Long) - try { - return mkLong(value, false); - } catch (e) { - fail(typeof value, e.message); - } - else - fail(typeof value, "requires Long.js"); - } - - // Unsigned 64bit - case ProtoBuf.TYPES["uint64"]: - case ProtoBuf.TYPES["fixed64"]: { - if (ProtoBuf.Long) - try { - return mkLong(value, true); - } catch (e) { - fail(typeof value, e.message); - } - else - fail(typeof value, "requires Long.js"); - } - - // Bool - case ProtoBuf.TYPES["bool"]: - if (typeof value !== 'boolean') - fail(typeof value, "not a boolean"); - return value; - - // Float - case ProtoBuf.TYPES["float"]: - case ProtoBuf.TYPES["double"]: - if (typeof value !== 'number') - fail(typeof value, "not a number"); - return value; - - // Length-delimited string - case ProtoBuf.TYPES["string"]: - if (typeof value !== 'string' && !(value && value instanceof String)) - fail(typeof value, "not a string"); - return ""+value; // Convert String object to string - - // Length-delimited bytes - case ProtoBuf.TYPES["bytes"]: - if (ByteBuffer.isByteBuffer(value)) - return value; - return ByteBuffer.wrap(value, "base64"); - - // Constant enum value - case ProtoBuf.TYPES["enum"]: { - var values = this.resolvedType.getChildren(Enum.Value); - for (i=0; i= 0) { - // "All of the elements of the field are packed into a single key-value pair with wire type 2 - // (length-delimited). Each element is encoded the same way it would be normally, except without a - // tag preceding it." - buffer.writeVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM); - buffer.ensureCapacity(buffer.offset += 1); // We do not know the length yet, so let's assume a varint of length 1 - var start = buffer.offset; // Remember where the contents begin - for (i=0; i 1) { // We need to move the contents - var contents = buffer.slice(start, buffer.offset); - start += varintLen-1; - buffer.offset = start; - buffer.append(contents); - } - buffer.writeVarint32(len, start-varintLen); - } else { - // "If your message definition has repeated elements (without the [packed=true] option), the encoded - // message has zero or more key-value pairs with the same tag number" - for (i=0; i= 0) { - n += ByteBuffer.calculateVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM); - ni = 0; - for (i=0; i= 0) { - if (!skipRepeated) { - nBytes = buffer.readVarint32(); - nBytes = buffer.offset + nBytes; // Limit - var values = []; - while (buffer.offset < nBytes) - values.push(this.decode(this.type.wireType, buffer, true)); - return values; - } - // Read the next value otherwise... - } - switch (this.type) { - // 32bit signed varint - case ProtoBuf.TYPES["int32"]: - return buffer.readVarint32() | 0; - - // 32bit unsigned varint - case ProtoBuf.TYPES["uint32"]: - return buffer.readVarint32() >>> 0; - - // 32bit signed varint zig-zag - case ProtoBuf.TYPES["sint32"]: - return buffer.readVarint32ZigZag() | 0; - - // Fixed 32bit unsigned - case ProtoBuf.TYPES["fixed32"]: - return buffer.readUint32() >>> 0; - - case ProtoBuf.TYPES["sfixed32"]: - return buffer.readInt32() | 0; - - // 64bit signed varint - case ProtoBuf.TYPES["int64"]: - return buffer.readVarint64(); - - // 64bit unsigned varint - case ProtoBuf.TYPES["uint64"]: - return buffer.readVarint64().toUnsigned(); - - // 64bit signed varint zig-zag - case ProtoBuf.TYPES["sint64"]: - return buffer.readVarint64ZigZag(); - - // Fixed 64bit unsigned - case ProtoBuf.TYPES["fixed64"]: - return buffer.readUint64(); - - // Fixed 64bit signed - case ProtoBuf.TYPES["sfixed64"]: - return buffer.readInt64(); - - // Bool varint - case ProtoBuf.TYPES["bool"]: - return !!buffer.readVarint32(); - - // Constant enum value (varint) - case ProtoBuf.TYPES["enum"]: - // The following Builder.Message#set will already throw - return buffer.readVarint32(); - - // 32bit float - case ProtoBuf.TYPES["float"]: - return buffer.readFloat(); - - // 64bit float - case ProtoBuf.TYPES["double"]: - return buffer.readDouble(); - - // Length-delimited string - case ProtoBuf.TYPES["string"]: - return buffer.readVString(); - - // Length-delimited bytes - case ProtoBuf.TYPES["bytes"]: { - nBytes = buffer.readVarint32(); - if (buffer.remaining() < nBytes) - throw Error("Illegal number of bytes for "+this.toString(true)+": "+nBytes+" required but got only "+buffer.remaining()); - value = buffer.clone(); // Offset already set - value.limit = value.offset+nBytes; - buffer.offset += nBytes; - return value; - } - - // Length-delimited embedded message - case ProtoBuf.TYPES["message"]: { - nBytes = buffer.readVarint32(); - return this.resolvedType.decode(buffer, nBytes); - } - - // Legacy group - case ProtoBuf.TYPES["group"]: - return this.resolvedType.decode(buffer, -1, this.id); - } - - // We should never end here - throw Error("[INTERNAL] Illegal wire type for "+this.toString(true)+": "+wireType); - }; - - /** - * @alias ProtoBuf.Reflect.Message.Field - * @expose - */ - Reflect.Message.Field = Field; - - /** - * Constructs a new Message ExtensionField. - * @exports ProtoBuf.Reflect.Message.ExtensionField - * @param {!ProtoBuf.Builder} builder Builder reference - * @param {!ProtoBuf.Reflect.Message} message Message reference - * @param {string} rule Rule, one of requried, optional, repeated - * @param {string} type Data type, e.g. int32 - * @param {string} name Field name - * @param {number} id Unique field id - * @param {Object.=} options Options - * @constructor - * @extends ProtoBuf.Reflect.Message.Field - */ - var ExtensionField = function(builder, message, rule, type, name, id, options) { - Field.call(this, builder, message, rule, type, name, id, options); - - /** - * Extension reference. - * @type {!ProtoBuf.Reflect.Extension} - * @expose - */ - this.extension; - }; - - // Extends Field - ExtensionField.prototype = Object.create(Field.prototype); - - /** - * @alias ProtoBuf.Reflect.Message.ExtensionField - * @expose - */ - Reflect.Message.ExtensionField = ExtensionField; - - /** - * Constructs a new Message OneOf. - * @exports ProtoBuf.Reflect.Message.OneOf - * @param {!ProtoBuf.Builder} builder Builder reference - * @param {!ProtoBuf.Reflect.Message} message Message reference - * @param {string} name OneOf name - * @constructor - * @extends ProtoBuf.Reflect.T - */ - var OneOf = function(builder, message, name) { - T.call(this, builder, message, name); - - /** - * Enclosed fields. - * @type {!Array.} - * @expose - */ - this.fields = []; - }; - - /** - * @alias ProtoBuf.Reflect.Message.OneOf - * @expose - */ - Reflect.Message.OneOf = OneOf; - - /** - * Constructs a new Enum. - * @exports ProtoBuf.Reflect.Enum - * @param {!ProtoBuf.Builder} builder Builder reference - * @param {!ProtoBuf.Reflect.T} parent Parent Reflect object - * @param {string} name Enum name - * @param {Object.=} options Enum options - * @constructor - * @extends ProtoBuf.Reflect.Namespace - */ - var Enum = function(builder, parent, name, options) { - Namespace.call(this, builder, parent, name, options); - - /** - * @override - */ - this.className = "Enum"; - - /** - * Runtime enum object. - * @type {Object.|null} - * @expose - */ - this.object = null; - }; - - /** - * @alias ProtoBuf.Reflect.Enum.prototype - * @inner - */ - var EnumPrototype = Enum.prototype = Object.create(Namespace.prototype); - - /** - * Builds this enum and returns the runtime counterpart. - * @return {Object} - * @expose - */ - EnumPrototype.build = function() { - var enm = {}, - values = this.getChildren(Enum.Value); - for (var i=0, k=values.length; i=} options Options - * @constructor - * @extends ProtoBuf.Reflect.Namespace - */ - var Service = function(builder, root, name, options) { - Namespace.call(this, builder, root, name, options); - - /** - * @override - */ - this.className = "Service"; - - /** - * Built runtime service class. - * @type {?function(new:ProtoBuf.Builder.Service)} - */ - this.clazz = null; - }; - - /** - * @alias ProtoBuf.Reflect.Service.prototype - * @inner - */ - var ServicePrototype = Service.prototype = Object.create(Namespace.prototype); - - /** - * Builds the service and returns the runtime counterpart, which is a fully functional class. - * @see ProtoBuf.Builder.Service - * @param {boolean=} rebuild Whether to rebuild or not - * @return {Function} Service class - * @throws {Error} If the message cannot be built - * @expose - */ - ServicePrototype.build = function(rebuild) { - if (this.clazz && !rebuild) - return this.clazz; - - // Create the runtime Service class in its own scope - return this.clazz = (function(ProtoBuf, T) { - - /** - * Constructs a new runtime Service. - * @name ProtoBuf.Builder.Service - * @param {function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))=} rpcImpl RPC implementation receiving the method name and the message - * @class Barebone of all runtime services. - * @constructor - * @throws {Error} If the service cannot be created - */ - var Service = function(rpcImpl) { - ProtoBuf.Builder.Service.call(this); - - /** - * Service implementation. - * @name ProtoBuf.Builder.Service#rpcImpl - * @type {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))} - * @expose - */ - this.rpcImpl = rpcImpl || function(name, msg, callback) { - // This is what a user has to implement: A function receiving the method name, the actual message to - // send (type checked) and the callback that's either provided with the error as its first - // argument or null and the actual response message. - setTimeout(callback.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0); // Must be async! - }; - }; - - /** - * @alias ProtoBuf.Builder.Service.prototype - * @inner - */ - var ServicePrototype = Service.prototype = Object.create(ProtoBuf.Builder.Service.prototype); - - if (Object.defineProperty) - Object.defineProperty(Service, "$options", { "value": T.buildOpt() }), - Object.defineProperty(ServicePrototype, "$options", { "value": Service["$options"] }); - - /** - * Asynchronously performs an RPC call using the given RPC implementation. - * @name ProtoBuf.Builder.Service.[Method] - * @function - * @param {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))} rpcImpl RPC implementation - * @param {ProtoBuf.Builder.Message} req Request - * @param {function(Error, (ProtoBuf.Builder.Message|ByteBuffer|Buffer|string)=)} callback Callback receiving - * the error if any and the response either as a pre-parsed message or as its raw bytes - * @abstract - */ - - /** - * Asynchronously performs an RPC call using the instance's RPC implementation. - * @name ProtoBuf.Builder.Service#[Method] - * @function - * @param {ProtoBuf.Builder.Message} req Request - * @param {function(Error, (ProtoBuf.Builder.Message|ByteBuffer|Buffer|string)=)} callback Callback receiving - * the error if any and the response either as a pre-parsed message or as its raw bytes - * @abstract - */ - - var rpc = T.getChildren(ProtoBuf.Reflect.Service.RPCMethod); - for (var i=0; i=} options Options - * @constructor - * @extends ProtoBuf.Reflect.T - */ - var Method = function(builder, svc, name, options) { - T.call(this, builder, svc, name); - - /** - * @override - */ - this.className = "Service.Method"; - - /** - * Options. - * @type {Object.} - * @expose - */ - this.options = options || {}; - }; - - /** - * @alias ProtoBuf.Reflect.Service.Method.prototype - * @inner - */ - var MethodPrototype = Method.prototype = Object.create(T.prototype); - - /** - * Builds the method's '$options' property. - * @name ProtoBuf.Reflect.Service.Method#buildOpt - * @function - * @return {Object.} - */ - MethodPrototype.buildOpt = NamespacePrototype.buildOpt; - - /** - * @alias ProtoBuf.Reflect.Service.Method - * @expose - */ - Reflect.Service.Method = Method; - - /** - * RPC service method. - * @exports ProtoBuf.Reflect.Service.RPCMethod - * @param {!ProtoBuf.Builder} builder Builder reference - * @param {!ProtoBuf.Reflect.Service} svc Service - * @param {string} name Method name - * @param {string} request Request message name - * @param {string} response Response message name - * @param {Object.=} options Options - * @constructor - * @extends ProtoBuf.Reflect.Service.Method - */ - var RPCMethod = function(builder, svc, name, request, response, options) { - Method.call(this, builder, svc, name, options); - - /** - * @override - */ - this.className = "Service.RPCMethod"; - - /** - * Request message name. - * @type {string} - * @expose - */ - this.requestName = request; - - /** - * Response message name. - * @type {string} - * @expose - */ - this.responseName = response; - - /** - * Resolved request message type. - * @type {ProtoBuf.Reflect.Message} - * @expose - */ - this.resolvedRequestType = null; - - /** - * Resolved response message type. - * @type {ProtoBuf.Reflect.Message} - * @expose - */ - this.resolvedResponseType = null; - }; - - // Extends Method - RPCMethod.prototype = Object.create(Method.prototype); - - /** - * @alias ProtoBuf.Reflect.Service.RPCMethod - * @expose - */ - Reflect.Service.RPCMethod = RPCMethod; - - return Reflect; - - })(ProtoBuf); - - /** - * @alias ProtoBuf.Builder - * @expose - */ - ProtoBuf.Builder = (function(ProtoBuf, Lang, Reflect) { - "use strict"; - - /** - * Constructs a new Builder. - * @exports ProtoBuf.Builder - * @class Provides the functionality to build protocol messages. - * @param {Object.=} options Options - * @constructor - */ - var Builder = function(options) { - - /** - * Namespace. - * @type {ProtoBuf.Reflect.Namespace} - * @expose - */ - this.ns = new Reflect.Namespace(this, null, ""); // Global namespace - - /** - * Namespace pointer. - * @type {ProtoBuf.Reflect.T} - * @expose - */ - this.ptr = this.ns; - - /** - * Resolved flag. - * @type {boolean} - * @expose - */ - this.resolved = false; - - /** - * The current building result. - * @type {Object.|null} - * @expose - */ - this.result = null; - - /** - * Imported files. - * @type {Array.} - * @expose - */ - this.files = {}; - - /** - * Import root override. - * @type {?string} - * @expose - */ - this.importRoot = null; - - /** - * Options. - * @type {!Object.} - * @expose - */ - this.options = options || {}; - }; - - /** - * @alias ProtoBuf.Builder.prototype - * @inner - */ - var BuilderPrototype = Builder.prototype; - - /** - * Resets the pointer to the root namespace. - * @expose - */ - BuilderPrototype.reset = function() { - this.ptr = this.ns; - }; - - /** - * Defines a package on top of the current pointer position and places the pointer on it. - * @param {string} pkg - * @param {Object.=} options - * @return {ProtoBuf.Builder} this - * @throws {Error} If the package name is invalid - * @expose - */ - BuilderPrototype.define = function(pkg, options) { - if (typeof pkg !== 'string' || !Lang.TYPEREF.test(pkg)) - throw Error("Illegal package: "+pkg); - var part = pkg.split("."), i; - for (i=0; i} def Definition - * @return {boolean} true if valid, else false - * @expose - */ - Builder.isValidMessage = function(def) { - // Messages require a string name - if (typeof def["name"] !== 'string' || !Lang.NAME.test(def["name"])) - return false; - // Messages must not contain values (that'd be an enum) or methods (that'd be a service) - if (typeof def["values"] !== 'undefined' || typeof def["rpc"] !== 'undefined') - return false; - // Fields, enums and messages are arrays if provided - var i; - if (typeof def["fields"] !== 'undefined') { - if (!ProtoBuf.Util.isArray(def["fields"])) - return false; - var ids = [], id; // IDs must be unique - for (i=0; i= 0) - return false; - ids.push(id); - } - ids = null; - } - if (typeof def["enums"] !== 'undefined') { - if (!ProtoBuf.Util.isArray(def["enums"])) - return false; - for (i=0; i - var keys = Object.keys(def["options"]); - for (var i=0, key; i>} defs Messages, enums or services to create - * @return {ProtoBuf.Builder} this - * @throws {Error} If a message definition is invalid - * @expose - */ - BuilderPrototype.create = function(defs) { - if (!defs) - return this; // Nothing to create - if (!ProtoBuf.Util.isArray(defs)) - defs = [defs]; - if (defs.length == 0) - return this; - - // It's quite hard to keep track of scopes and memory here, so let's do this iteratively. - var stack = []; - stack.push(defs); // One level [a, b, c] - while (stack.length > 0) { - defs = stack.pop(); - if (ProtoBuf.Util.isArray(defs)) { // Stack always contains entire namespaces - while (defs.length > 0) { - var def = defs.shift(); // Namespace always contains an array of messages, enums and services - if (Builder.isValidMessage(def)) { - var obj = new Reflect.Message(this, this.ptr, def["name"], def["options"], def["isGroup"]); - // Create OneOfs - var oneofs = {}; - if (def["oneofs"]) { - var keys = Object.keys(def["oneofs"]); - for (var i=0, k=keys.length; i 0) { - for (i=0, k=def["fields"].length; i 0) - for (i=0; i 0) - for (i=0; i ProtoBuf.ID_MAX) - obj.extensions[1] = ProtoBuf.ID_MAX; - } - this.ptr.addChild(obj); // Add to current namespace - if (subObj.length > 0) { - stack.push(defs); // Push the current level back - defs = subObj; // Continue processing sub level - subObj = null; - this.ptr = obj; // And move the pointer to this namespace - obj = null; - continue; - } - subObj = null; - obj = null; - } else if (Builder.isValidEnum(def)) { - obj = new Reflect.Enum(this, this.ptr, def["name"], def["options"]); - for (i=0; i obj.extensions[1]) - throw Error("Illegal extended field id in message "+obj.name+": "+def['fields'][i]['id']+" ("+obj.extensions.join(' to ')+" expected)"); - // Convert extension field names to camel case notation if the override is set - var name = def["fields"][i]["name"]; - if (this.options['convertFieldsToCamelCase']) - name = Reflect.Message.Field._toCamelCase(def["fields"][i]["name"]); - // see #161: Extensions use their fully qualified name as their runtime key and... - fld = new Reflect.Message.ExtensionField(this, obj, def["fields"][i]["rule"], def["fields"][i]["type"], this.ptr.fqn()+'.'+name, def["fields"][i]["id"], def["fields"][i]["options"]); - // ...are added on top of the current namespace as an extension which is used for - // resolving their type later on (the extension always keeps the original name to - // prevent naming collisions) - var ext = new Reflect.Extension(this, this.ptr, def["fields"][i]["name"], fld); - fld.extension = ext; - this.ptr.addChild(ext); - obj.addChild(fld); - } - } else if (!/\.?google\.protobuf\./.test(def["ref"])) // Silently skip internal extensions - throw Error("Extended message "+def["ref"]+" is not defined"); - } else - throw Error("Not a valid definition: "+JSON.stringify(def)); - def = null; - } - // Break goes here - } else - throw Error("Not a valid namespace: "+JSON.stringify(defs)); - defs = null; - this.ptr = this.ptr.parent; // This namespace is s done - } - this.resolved = false; // Require re-resolve - this.result = null; // Require re-build - return this; - }; - - /** - * Imports another definition into this builder. - * @param {Object.} json Parsed import - * @param {(string|{root: string, file: string})=} filename Imported file name - * @return {ProtoBuf.Builder} this - * @throws {Error} If the definition or file cannot be imported - * @expose - */ - BuilderPrototype["import"] = function(json, filename) { - if (typeof filename === 'string') { - if (ProtoBuf.Util.IS_NODE) - filename = require("path")['resolve'](filename); - if (this.files[filename] === true) { - this.reset(); - return this; // Skip duplicate imports - } - this.files[filename] = true; - } - if (!!json['imports'] && json['imports'].length > 0) { - var importRoot, delim = '/', resetRoot = false; - if (typeof filename === 'object') { // If an import root is specified, override - this.importRoot = filename["root"]; resetRoot = true; // ... and reset afterwards - importRoot = this.importRoot; - filename = filename["file"]; - if (importRoot.indexOf("\\") >= 0 || filename.indexOf("\\") >= 0) delim = '\\'; - } else if (typeof filename === 'string') { - if (this.importRoot) // If import root is overridden, use it - importRoot = this.importRoot; - else { // Otherwise compute from filename - if (filename.indexOf("/") >= 0) { // Unix - importRoot = filename.replace(/\/[^\/]*$/, ""); - if (/* /file.proto */ importRoot === "") - importRoot = "/"; - } else if (filename.indexOf("\\") >= 0) { // Windows - importRoot = filename.replace(/\\[^\\]*$/, ""); - delim = '\\'; - } else - importRoot = "."; - } - } else - importRoot = null; - - for (var i=0; i= 0) - return false; - ids.push(id); - } - ids = null; - } - return true; - }; - - /** - * Resolves all namespace objects. - * @throws {Error} If a type cannot be resolved - * @expose - */ - BuilderPrototype.resolveAll = function() { - // Resolve all reflected objects - var res; - if (this.ptr == null || typeof this.ptr.type === 'object') - return; // Done (already resolved) - if (this.ptr instanceof Reflect.Namespace) { - // Build all children - var children = this.ptr.children; - for (var i= 0, k=children.length; i} - * @throws {Error} If a type could not be resolved - * @expose - */ - BuilderPrototype.build = function(path) { - this.reset(); - if (!this.resolved) - this.resolveAll(), - this.resolved = true, - this.result = null; // Require re-build - if (this.result == null) // (Re-)Build - this.result = this.ns.build(); - if (!path) - return this.result; - else { - var part = path.split("."); - var ptr = this.result; // Build namespace pointer (no hasChild etc.) - for (var i=0; i=} options Builder options, defaults to global options set on ProtoBuf - * @return {!ProtoBuf.Builder} Builder - * @expose - */ - ProtoBuf.newBuilder = function(options) { - options = options || {}; - if (typeof options['convertFieldsToCamelCase'] === 'undefined') - options['convertFieldsToCamelCase'] = ProtoBuf.convertFieldsToCamelCase; - if (typeof options['populateAccessors'] === 'undefined') - options['populateAccessors'] = ProtoBuf.populateAccessors; - return new ProtoBuf.Builder(options); - }; - - /** - * Loads a .json definition and returns the Builder. - * @param {!*|string} json JSON definition - * @param {(ProtoBuf.Builder|string|{root: string, file: string})=} builder Builder to append to. Will create a new one if omitted. - * @param {(string|{root: string, file: string})=} filename The corresponding file name if known. Must be specified for imports. - * @return {ProtoBuf.Builder} Builder to create new messages - * @throws {Error} If the definition cannot be parsed or built - * @expose - */ - ProtoBuf.loadJson = function(json, builder, filename) { - if (typeof builder === 'string' || (builder && typeof builder["file"] === 'string' && typeof builder["root"] === 'string')) - filename = builder, - builder = null; - if (!builder || typeof builder !== 'object') - builder = ProtoBuf.newBuilder(); - if (typeof json === 'string') - json = JSON.parse(json); - builder["import"](json, filename); - builder.resolveAll(); - return builder; - }; - - /** - * Loads a .json file and returns the Builder. - * @param {string|!{root: string, file: string}} filename Path to json file or an object specifying 'file' with - * an overridden 'root' path for all imported files. - * @param {function(?Error, !ProtoBuf.Builder=)=} callback Callback that will receive `null` as the first and - * the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the - * file will be read synchronously and this function will return the Builder. - * @param {ProtoBuf.Builder=} builder Builder to append to. Will create a new one if omitted. - * @return {?ProtoBuf.Builder|undefined} The Builder if synchronous (no callback specified, will be NULL if the - * request has failed), else undefined - * @expose - */ - ProtoBuf.loadJsonFile = function(filename, callback, builder) { - if (callback && typeof callback === 'object') - builder = callback, - callback = null; - else if (!callback || typeof callback !== 'function') - callback = null; - if (callback) - return ProtoBuf.Util.fetch(typeof filename === 'string' ? filename : filename["root"]+"/"+filename["file"], function(contents) { - if (contents === null) { - callback(Error("Failed to fetch file")); - return; - } - try { - callback(null, ProtoBuf.loadJson(JSON.parse(contents), builder, filename)); - } catch (e) { - callback(e); - } - }); - var contents = ProtoBuf.Util.fetch(typeof filename === 'object' ? filename["root"]+"/"+filename["file"] : filename); - return contents === null ? null : ProtoBuf.loadJson(JSON.parse(contents), builder, filename); - }; - - return ProtoBuf; - } - - /* CommonJS */ if (typeof require === 'function' && typeof module === 'object' && module && typeof exports === 'object' && exports) - module['exports'] = init(require("bytebuffer")); - /* AMD */ else if (typeof define === 'function' && define["amd"]) - define(["ByteBuffer"], init); - /* Global */ else - (global["dcodeIO"] = global["dcodeIO"] || {})["ProtoBuf"] = init(global["dcodeIO"]["ByteBuffer"]); - -})(this); diff --git a/index.html b/index.html index f7b16118d..4d92ba0cc 100644 --- a/index.html +++ b/index.html @@ -1,23 +1,25 @@ - - - - - - Session - - - - - - - -
- -
- - + + + + + + Session + + + + + + +
+ +
+ + diff --git a/js/background.js b/js/background.js index 3eb7fc600..f7250e14d 100644 --- a/js/background.js +++ b/js/background.js @@ -66,11 +66,6 @@ window.getGlobalOnlineStatus = () => window.globalOnlineStatus; const { Views } = window.Signal; - // Implicitly used in `indexeddb-backbonejs-adapter`: - // https://github.com/signalapp/Signal-Desktop/blob/4033a9f8137e62ed286170ed5d4941982b1d3a64/components/indexeddb-backbonejs-adapter/backbone-indexeddb.js#L569 - window.onInvalidStateError = error => - window.log.error(error && error.stack ? error.stack : error); - window.log.info('background page reloaded'); window.log.info('environment:', window.getEnvironment()); const restartReason = localStorage.getItem('restart-reason'); @@ -149,15 +144,6 @@ storage.put('spell-check', value); }, - addDarkOverlay: () => { - if ($('.dark-overlay').length) { - return; - } - $(document.body).prepend('
'); - $('.dark-overlay').on('click', () => $('.dark-overlay').remove()); - }, - removeDarkOverlay: () => $('.dark-overlay').remove(), - shutdown: async () => { // Stop background processing window.libsession.Utils.AttachmentDownloads.stop(); diff --git a/js/chromium.js b/js/chromium.js deleted file mode 100644 index 4e1567be4..000000000 --- a/js/chromium.js +++ /dev/null @@ -1,15 +0,0 @@ -/* global extension: false */ - -// eslint-disable-next-line func-names -(function() { - 'use strict'; - - // Browser specific functions for Chrom* - window.extension = window.extension || {}; - - extension.windows = { - onClosed(callback) { - window.addEventListener('beforeunload', callback); - }, - }; -})(); diff --git a/js/curve/curve25519_compiled.js b/js/curve/curve25519_compiled.js index b6e8348cc..dd126295c 100644 --- a/js/curve/curve25519_compiled.js +++ b/js/curve/curve25519_compiled.js @@ -35584,315 +35584,7 @@ var MEMFS = { }, }; -var IDBFS = { - dbs: {}, - indexedDB: function() { - if (typeof indexedDB !== 'undefined') return indexedDB; - var ret = null; - if (typeof window === 'object') - ret = - window.indexedDB || - window.mozIndexedDB || - window.webkitIndexedDB || - window.msIndexedDB; - assert(ret, 'IDBFS used, but indexedDB not supported'); - return ret; - }, - DB_VERSION: 21, - DB_STORE_NAME: 'FILE_DATA', - mount: function(mount) { - // reuse all of the core MEMFS functionality - return MEMFS.mount.apply(null, arguments); - }, - syncfs: function(mount, populate, callback) { - IDBFS.getLocalSet(mount, function(err, local) { - if (err) return callback(err); - IDBFS.getRemoteSet(mount, function(err, remote) { - if (err) return callback(err); - - var src = populate ? remote : local; - var dst = populate ? local : remote; - - IDBFS.reconcile(src, dst, callback); - }); - }); - }, - getDB: function(name, callback) { - // check the cache first - var db = IDBFS.dbs[name]; - if (db) { - return callback(null, db); - } - - var req; - try { - req = IDBFS.indexedDB().open(name, IDBFS.DB_VERSION); - } catch (e) { - return callback(e); - } - req.onupgradeneeded = function(e) { - var db = e.target.result; - var transaction = e.target.transaction; - - var fileStore; - - if (db.objectStoreNames.contains(IDBFS.DB_STORE_NAME)) { - fileStore = transaction.objectStore(IDBFS.DB_STORE_NAME); - } else { - fileStore = db.createObjectStore(IDBFS.DB_STORE_NAME); - } - - fileStore.createIndex('timestamp', 'timestamp', { unique: false }); - }; - req.onsuccess = function() { - db = req.result; - - // add to the cache - IDBFS.dbs[name] = db; - callback(null, db); - }; - req.onerror = function() { - callback(this.error); - }; - }, - getLocalSet: function(mount, callback) { - var entries = {}; - - function isRealDir(p) { - return p !== '.' && p !== '..'; - } - function toAbsolute(root) { - return function(p) { - return PATH.join2(root, p); - }; - } - - var check = FS.readdir(mount.mountpoint) - .filter(isRealDir) - .map(toAbsolute(mount.mountpoint)); - - while (check.length) { - var path = check.pop(); - var stat; - - try { - stat = FS.stat(path); - } catch (e) { - return callback(e); - } - - if (FS.isDir(stat.mode)) { - check.push.apply( - check, - FS.readdir(path) - .filter(isRealDir) - .map(toAbsolute(path)) - ); - } - - entries[path] = { timestamp: stat.mtime }; - } - - return callback(null, { type: 'local', entries: entries }); - }, - getRemoteSet: function(mount, callback) { - var entries = {}; - - IDBFS.getDB(mount.mountpoint, function(err, db) { - if (err) return callback(err); - - var transaction = db.transaction([IDBFS.DB_STORE_NAME], 'readonly'); - transaction.onerror = function() { - callback(this.error); - }; - - var store = transaction.objectStore(IDBFS.DB_STORE_NAME); - var index = store.index('timestamp'); - - index.openKeyCursor().onsuccess = function(event) { - var cursor = event.target.result; - - if (!cursor) { - return callback(null, { type: 'remote', db: db, entries: entries }); - } - - entries[cursor.primaryKey] = { timestamp: cursor.key }; - - cursor.continue(); - }; - }); - }, - loadLocalEntry: function(path, callback) { - var stat, node; - - try { - var lookup = FS.lookupPath(path); - node = lookup.node; - stat = FS.stat(path); - } catch (e) { - return callback(e); - } - - if (FS.isDir(stat.mode)) { - return callback(null, { timestamp: stat.mtime, mode: stat.mode }); - } else if (FS.isFile(stat.mode)) { - // Performance consideration: storing a normal JavaScript array to a IndexedDB is much slower than storing a typed array. - // Therefore always convert the file contents to a typed array first before writing the data to IndexedDB. - node.contents = MEMFS.getFileDataAsTypedArray(node); - return callback(null, { - timestamp: stat.mtime, - mode: stat.mode, - contents: node.contents, - }); - } else { - return callback(new Error('node type not supported')); - } - }, - storeLocalEntry: function(path, entry, callback) { - try { - if (FS.isDir(entry.mode)) { - FS.mkdir(path, entry.mode); - } else if (FS.isFile(entry.mode)) { - FS.writeFile(path, entry.contents, { - encoding: 'binary', - canOwn: true, - }); - } else { - return callback(new Error('node type not supported')); - } - - FS.chmod(path, entry.mode); - FS.utime(path, entry.timestamp, entry.timestamp); - } catch (e) { - return callback(e); - } - - callback(null); - }, - removeLocalEntry: function(path, callback) { - try { - var lookup = FS.lookupPath(path); - var stat = FS.stat(path); - - if (FS.isDir(stat.mode)) { - FS.rmdir(path); - } else if (FS.isFile(stat.mode)) { - FS.unlink(path); - } - } catch (e) { - return callback(e); - } - - callback(null); - }, - loadRemoteEntry: function(store, path, callback) { - var req = store.get(path); - req.onsuccess = function(event) { - callback(null, event.target.result); - }; - req.onerror = function() { - callback(this.error); - }; - }, - storeRemoteEntry: function(store, path, entry, callback) { - var req = store.put(entry, path); - req.onsuccess = function() { - callback(null); - }; - req.onerror = function() { - callback(this.error); - }; - }, - removeRemoteEntry: function(store, path, callback) { - var req = store.delete(path); - req.onsuccess = function() { - callback(null); - }; - req.onerror = function() { - callback(this.error); - }; - }, - reconcile: function(src, dst, callback) { - var total = 0; - - var create = []; - Object.keys(src.entries).forEach(function(key) { - var e = src.entries[key]; - var e2 = dst.entries[key]; - if (!e2 || e.timestamp > e2.timestamp) { - create.push(key); - total++; - } - }); - - var remove = []; - Object.keys(dst.entries).forEach(function(key) { - var e = dst.entries[key]; - var e2 = src.entries[key]; - if (!e2) { - remove.push(key); - total++; - } - }); - - if (!total) { - return callback(null); - } - - var errored = false; - var completed = 0; - var db = src.type === 'remote' ? src.db : dst.db; - var transaction = db.transaction([IDBFS.DB_STORE_NAME], 'readwrite'); - var store = transaction.objectStore(IDBFS.DB_STORE_NAME); - - function done(err) { - if (err) { - if (!done.errored) { - done.errored = true; - return callback(err); - } - return; - } - if (++completed >= total) { - return callback(null); - } - } - - transaction.onerror = function() { - done(this.error); - }; - - // sort paths in ascending order so directory entries are created - // before the files inside them - create.sort().forEach(function(path) { - if (dst.type === 'local') { - IDBFS.loadRemoteEntry(store, path, function(err, entry) { - if (err) return done(err); - IDBFS.storeLocalEntry(path, entry, done); - }); - } else { - IDBFS.loadLocalEntry(path, function(err, entry) { - if (err) return done(err); - IDBFS.storeRemoteEntry(store, path, entry, done); - }); - } - }); - - // sort paths in descending order so files are deleted before their - // parent directories - remove - .sort() - .reverse() - .forEach(function(path) { - if (dst.type === 'local') { - IDBFS.removeLocalEntry(path, done); - } else { - IDBFS.removeRemoteEntry(store, path, done); - } - }); - }, -}; var NODEFS = { isWindows: false, @@ -38010,111 +37702,6 @@ var FS = { processData(url); } }, - indexedDB: function() { - return ( - window.indexedDB || - window.mozIndexedDB || - window.webkitIndexedDB || - window.msIndexedDB - ); - }, - DB_NAME: function() { - return 'EM_FS_' + window.location.pathname; - }, - DB_VERSION: 20, - DB_STORE_NAME: 'FILE_DATA', - saveFilesToDB: function(paths, onload, onerror) { - onload = onload || function() {}; - onerror = onerror || function() {}; - var indexedDB = FS.indexedDB(); - try { - var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION); - } catch (e) { - return onerror(e); - } - openRequest.onupgradeneeded = function openRequest_onupgradeneeded() { - console.log('creating db'); - var db = openRequest.result; - db.createObjectStore(FS.DB_STORE_NAME); - }; - openRequest.onsuccess = function openRequest_onsuccess() { - var db = openRequest.result; - var transaction = db.transaction([FS.DB_STORE_NAME], 'readwrite'); - var files = transaction.objectStore(FS.DB_STORE_NAME); - var ok = 0, - fail = 0, - total = paths.length; - function finish() { - if (fail == 0) onload(); - else onerror(); - } - paths.forEach(function(path) { - var putRequest = files.put(FS.analyzePath(path).object.contents, path); - putRequest.onsuccess = function putRequest_onsuccess() { - ok++; - if (ok + fail == total) finish(); - }; - putRequest.onerror = function putRequest_onerror() { - fail++; - if (ok + fail == total) finish(); - }; - }); - transaction.onerror = onerror; - }; - openRequest.onerror = onerror; - }, - loadFilesFromDB: function(paths, onload, onerror) { - onload = onload || function() {}; - onerror = onerror || function() {}; - var indexedDB = FS.indexedDB(); - try { - var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION); - } catch (e) { - return onerror(e); - } - openRequest.onupgradeneeded = onerror; // no database to load from - openRequest.onsuccess = function openRequest_onsuccess() { - var db = openRequest.result; - try { - var transaction = db.transaction([FS.DB_STORE_NAME], 'readonly'); - } catch (e) { - onerror(e); - return; - } - var files = transaction.objectStore(FS.DB_STORE_NAME); - var ok = 0, - fail = 0, - total = paths.length; - function finish() { - if (fail == 0) onload(); - else onerror(); - } - paths.forEach(function(path) { - var getRequest = files.get(path); - getRequest.onsuccess = function getRequest_onsuccess() { - if (FS.analyzePath(path).exists) { - FS.unlink(path); - } - FS.createDataFile( - PATH.dirname(path), - PATH.basename(path), - getRequest.result, - true, - true, - true - ); - ok++; - if (ok + fail == total) finish(); - }; - getRequest.onerror = function getRequest_onerror() { - fail++; - if (ok + fail == total) finish(); - }; - }); - transaction.onerror = onerror; - }; - openRequest.onerror = onerror; - }, }; var PATH = { splitPath: function(filename) { diff --git a/js/database.js b/js/database.js deleted file mode 100644 index d88b4d904..000000000 --- a/js/database.js +++ /dev/null @@ -1,122 +0,0 @@ -/* global _: false */ -/* global Backbone: false */ - -/* global Whisper: false */ - -// eslint-disable-next-line func-names -(function() { - 'use strict'; - - window.Whisper = window.Whisper || {}; - window.Whisper.Database = window.Whisper.Database || {}; - window.Whisper.Database.id = window.Whisper.Database.id || 'loki-messenger'; - window.Whisper.Database.nolog = true; - - Whisper.Database.handleDOMException = (prefix, error, reject) => { - window.log.error( - `${prefix}:`, - error && error.name, - error && error.message, - error && error.code - ); - reject(error || new Error(prefix)); - }; - - function clearStores(db, names) { - return new Promise((resolve, reject) => { - const storeNames = names || db.objectStoreNames; - window.log.info('Clearing these indexeddb stores:', storeNames); - const transaction = db.transaction(storeNames, 'readwrite'); - - let finished = false; - const finish = via => { - window.log.info('clearing all stores done via', via); - if (finished) { - resolve(); - } - finished = true; - }; - - transaction.oncomplete = finish.bind(null, 'transaction complete'); - transaction.onerror = () => { - Whisper.Database.handleDOMException( - 'clearStores transaction error', - transaction.error, - reject - ); - }; - - let count = 0; - - // can't use built-in .forEach because db.objectStoreNames is not a plain array - _.forEach(storeNames, storeName => { - const store = transaction.objectStore(storeName); - const request = store.clear(); - - request.onsuccess = () => { - count += 1; - window.log.info('Done clearing store', storeName); - - if (count >= storeNames.length) { - window.log.info('Done clearing indexeddb stores'); - finish('clears complete'); - } - }; - - request.onerror = () => { - Whisper.Database.handleDOMException('clearStores request error', request.error, reject); - }; - }); - }); - } - - Whisper.Database.open = () => { - const { migrations } = Whisper.Database; - const { version } = migrations[migrations.length - 1]; - const DBOpenRequest = window.indexedDB.open(Whisper.Database.id, version); - - return new Promise((resolve, reject) => { - // these two event handlers act on the IDBDatabase object, - // when the database is opened successfully, or not - DBOpenRequest.onerror = reject; - DBOpenRequest.onsuccess = () => resolve(DBOpenRequest.result); - - // This event handles the event whereby a new version of - // the database needs to be created Either one has not - // been created before, or a new version number has been - // submitted via the window.indexedDB.open line above - DBOpenRequest.onupgradeneeded = reject; - }); - }; - - Whisper.Database.clear = async () => { - const db = await Whisper.Database.open(); - await clearStores(db); - db.close(); - }; - - Whisper.Database.clearStores = async storeNames => { - const db = await Whisper.Database.open(); - await clearStores(db, storeNames); - db.close(); - }; - - Whisper.Database.close = () => window.wrapDeferred(Backbone.sync('closeall')); - - Whisper.Database.drop = () => - new Promise((resolve, reject) => { - const request = window.indexedDB.deleteDatabase(Whisper.Database.id); - - request.onblocked = () => { - reject(new Error('Error deleting database: Blocked.')); - }; - request.onupgradeneeded = () => { - reject(new Error('Error deleting database: Upgrade needed.')); - }; - request.onerror = () => { - reject(new Error('Error deleting database.')); - }; - - request.onsuccess = resolve; - }); -})(); diff --git a/js/legacy_storage.js b/js/legacy_storage.js deleted file mode 100644 index c454ea590..000000000 --- a/js/legacy_storage.js +++ /dev/null @@ -1,89 +0,0 @@ -/* global Backbone, Whisper */ - -/* eslint-disable more/no-then */ - -// eslint-disable-next-line func-names -(function() { - 'use strict'; - - window.Whisper = window.Whisper || {}; - const Item = Backbone.Model.extend({ - database: Whisper.Database, - storeName: 'items', - }); - const ItemCollection = Backbone.Collection.extend({ - model: Item, - storeName: 'items', - database: Whisper.Database, - }); - - let ready = false; - const items = new ItemCollection(); - items.on('reset', () => { - ready = true; - }); - window.legacyStorage = { - /** *************************** - *** Base Storage Routines *** - **************************** */ - put(key, value) { - if (value === undefined) { - throw new Error('Tried to store undefined'); - } - if (!ready) { - window.log.warn('Called storage.put before storage is ready. key:', key); - } - const item = items.add({ id: key, value }, { merge: true }); - return new Promise((resolve, reject) => { - item.save().then(resolve, reject); - }); - }, - - get(key, defaultValue) { - const item = items.get(`${key}`); - if (!item) { - return defaultValue; - } - return item.get('value'); - }, - - remove(key) { - const item = items.get(`${key}`); - if (item) { - items.remove(item); - return new Promise((resolve, reject) => { - item.destroy().then(resolve, reject); - }); - } - return Promise.resolve(); - }, - - onready(callback) { - if (ready) { - callback(); - } else { - items.on('reset', callback); - } - }, - - fetch() { - return new Promise((resolve, reject) => { - items - .fetch({ reset: true }) - .fail(() => - reject( - new Error( - 'Failed to fetch from storage.' + - ' This may be due to an unexpected database version.' - ) - ) - ) - .always(resolve); - }); - }, - - reset() { - items.reset(); - }, - }; -})(); diff --git a/js/libloki.js b/js/libloki.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/js/logging.js b/js/logging.js index 0c7cb1186..96b1f632e 100644 --- a/js/logging.js +++ b/js/logging.js @@ -3,13 +3,13 @@ /* eslint strict: ['error', 'never'] */ /* eslint-disable no-console */ -const electron = require('electron'); +const { ipcRenderer } = require('electron'); const _ = require('lodash'); const debuglogs = require('./modules/debuglogs'); const Privacy = require('./modules/privacy'); -const ipc = electron.ipcRenderer; +const ipc = ipcRenderer; // Default Bunyan levels: https://github.com/trentm/node-bunyan#levels // To make it easier to visually scan logs, we make all levels the same length diff --git a/js/modules/database.js b/js/modules/database.js deleted file mode 100644 index 448fd856d..000000000 --- a/js/modules/database.js +++ /dev/null @@ -1,65 +0,0 @@ -/* global indexedDB */ - -// Module for interacting with IndexedDB without Backbone IndexedDB adapter -// and using promises. Revisit use of `idb` dependency as it might cover -// this functionality. - -const { isObject, isNumber } = require('lodash'); - -exports.open = (name, version, { onUpgradeNeeded } = {}) => { - const request = indexedDB.open(name, version); - return new Promise((resolve, reject) => { - request.onblocked = () => reject(new Error('Database blocked')); - - request.onupgradeneeded = event => { - const hasRequestedSpecificVersion = isNumber(version); - if (!hasRequestedSpecificVersion) { - return; - } - - const { newVersion, oldVersion } = event; - if (onUpgradeNeeded) { - const { transaction } = event.target; - onUpgradeNeeded({ oldVersion, transaction }); - return; - } - - reject( - new Error(`Database upgrade required: oldVersion: ${oldVersion}, newVersion: ${newVersion}`) - ); - }; - - request.onerror = event => reject(event.target.error); - - request.onsuccess = event => { - const connection = event.target.result; - resolve(connection); - }; - }); -}; - -exports.completeTransaction = transaction => - new Promise((resolve, reject) => { - transaction.addEventListener('abort', event => reject(event.target.error)); - transaction.addEventListener('error', event => reject(event.target.error)); - transaction.addEventListener('complete', () => resolve()); - }); - -exports.getVersion = async name => { - const connection = await exports.open(name); - const { version } = connection; - connection.close(); - return version; -}; - -exports.getCount = async ({ store } = {}) => { - if (!isObject(store)) { - throw new TypeError("'store' is required"); - } - - const request = store.count(); - return new Promise((resolve, reject) => { - request.onerror = event => reject(event.target.error); - request.onsuccess = event => resolve(event.target.result); - }); -}; diff --git a/js/modules/job_queue.js b/js/modules/job_queue.js deleted file mode 100644 index fa0ca6038..000000000 --- a/js/modules/job_queue.js +++ /dev/null @@ -1,24 +0,0 @@ -/* eslint-disable more/no-then */ -class JobQueue { - constructor() { - this.pending = Promise.resolve(); - } - - add(job) { - const previous = this.pending || Promise.resolve(); - this.pending = previous.then(job, job); - const current = this.pending; - - current.then(() => { - if (this.pending === current) { - delete this.pending; - } - }); - - return current; - } -} - -module.exports = { - JobQueue, -}; diff --git a/js/modules/signal.js b/js/modules/signal.js index b73151c58..282e18487 100644 --- a/js/modules/signal.js +++ b/js/modules/signal.js @@ -2,7 +2,6 @@ const Crypto = require('./crypto'); const Data = require('../../ts/data/data'); -const Database = require('./database'); const Emoji = require('../../ts/util/emoji'); const Notifications = require('../../ts/notifications'); const OS = require('../../ts/OS'); @@ -143,7 +142,6 @@ exports.setup = (options = {}) => { Components, Crypto, Data, - Database, Emoji, LinkPreviews, Migrations, diff --git a/js/modules/sleep.js b/js/modules/sleep.js deleted file mode 100644 index 3ace89d62..000000000 --- a/js/modules/sleep.js +++ /dev/null @@ -1,3 +0,0 @@ -/* global setTimeout */ - -exports.sleep = ms => new Promise(resolve => setTimeout(resolve, ms)); diff --git a/js/session_ui_manager.js b/js/session_ui_manager.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/js/views/app_view.js b/js/views/app_view.js index f9e22b20f..f49efac2c 100644 --- a/js/views/app_view.js +++ b/js/views/app_view.js @@ -48,7 +48,6 @@ } }, openStandalone() { - window.addSetupMenuItems(); this.resetViews(); this.standaloneView = new Whisper.SessionRegistrationView(); this.openView(this.standaloneView); diff --git a/libtextsecure/event_target.js b/libtextsecure/event_target.js deleted file mode 100644 index 0bfaa31c9..000000000 --- a/libtextsecure/event_target.js +++ /dev/null @@ -1,82 +0,0 @@ -/* global window, Event, textsecure */ - -/* - * Implements EventTarget - * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget - */ -// eslint-disable-next-line func-names -(function() { - window.textsecure = window.textsecure || {}; - - function EventTarget() {} - - EventTarget.prototype = { - constructor: EventTarget, - dispatchEvent(ev) { - if (!(ev instanceof Event)) { - throw new Error('Expects an event'); - } - if (this.listeners === null || typeof this.listeners !== 'object') { - this.listeners = {}; - } - const listeners = this.listeners[ev.type]; - const results = []; - if (typeof listeners === 'object') { - for (let i = 0, max = listeners.length; i < max; i += 1) { - const listener = listeners[i]; - if (typeof listener === 'function') { - results.push(listener.call(null, ev)); - } - } - } - return results; - }, - addEventListener(eventName, callback) { - if (typeof eventName !== 'string') { - throw new Error('First argument expects a string'); - } - if (typeof callback !== 'function') { - throw new Error('Second argument expects a function'); - } - if (this.listeners === null || typeof this.listeners !== 'object') { - this.listeners = {}; - } - let listeners = this.listeners[eventName]; - if (typeof listeners !== 'object') { - listeners = []; - } - listeners.push(callback); - this.listeners[eventName] = listeners; - }, - removeEventListener(eventName, callback) { - if (typeof eventName !== 'string') { - throw new Error('First argument expects a string'); - } - if (typeof callback !== 'function') { - throw new Error('Second argument expects a function'); - } - if (this.listeners === null || typeof this.listeners !== 'object') { - this.listeners = {}; - } - const listeners = this.listeners[eventName]; - if (typeof listeners === 'object') { - for (let i = 0; i < listeners.length; i += 1) { - if (listeners[i] === callback) { - listeners.splice(i, 1); - return; - } - } - } - this.listeners[eventName] = listeners; - }, - extend(obj) { - // eslint-disable-next-line no-restricted-syntax, guard-for-in - for (const prop in obj) { - this[prop] = obj[prop]; - } - return this; - }, - }; - - textsecure.EventTarget = EventTarget; -})(); diff --git a/libtextsecure/libsignal-protocol.js b/libtextsecure/libsignal-protocol.js index aeb8f1b84..bf81fe225 100644 --- a/libtextsecure/libsignal-protocol.js +++ b/libtextsecure/libsignal-protocol.js @@ -2038,263 +2038,6 @@ var libsignal } }; - var IDBFS = { - dbs: {}, indexedDB: function () { - if (typeof indexedDB !== 'undefined') return indexedDB; - var ret = null; - if (typeof window === 'object') ret = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB; - assert(ret, 'IDBFS used, but indexedDB not supported'); - return ret; - }, DB_VERSION: 21, DB_STORE_NAME: "FILE_DATA", mount: function (mount) { - // reuse all of the core MEMFS functionality - return MEMFS.mount.apply(null, arguments); - }, syncfs: function (mount, populate, callback) { - IDBFS.getLocalSet(mount, function (err, local) { - if (err) return callback(err); - - IDBFS.getRemoteSet(mount, function (err, remote) { - if (err) return callback(err); - - var src = populate ? remote : local; - var dst = populate ? local : remote; - - IDBFS.reconcile(src, dst, callback); - }); - }); - }, getDB: function (name, callback) { - // check the cache first - var db = IDBFS.dbs[name]; - if (db) { - return callback(null, db); - } - - var req; - try { - req = IDBFS.indexedDB().open(name, IDBFS.DB_VERSION); - } catch (e) { - return callback(e); - } - req.onupgradeneeded = function (e) { - var db = e.target.result; - var transaction = e.target.transaction; - - var fileStore; - - if (db.objectStoreNames.contains(IDBFS.DB_STORE_NAME)) { - fileStore = transaction.objectStore(IDBFS.DB_STORE_NAME); - } else { - fileStore = db.createObjectStore(IDBFS.DB_STORE_NAME); - } - - fileStore.createIndex('timestamp', 'timestamp', { unique: false }); - }; - req.onsuccess = function () { - db = req.result; - - // add to the cache - IDBFS.dbs[name] = db; - callback(null, db); - }; - req.onerror = function () { - callback(this.error); - }; - }, getLocalSet: function (mount, callback) { - var entries = {}; - - function isRealDir(p) { - return p !== '.' && p !== '..'; - }; - function toAbsolute(root) { - return function (p) { - return PATH.join2(root, p); - } - }; - - var check = FS.readdir(mount.mountpoint).filter(isRealDir).map(toAbsolute(mount.mountpoint)); - - while (check.length) { - var path = check.pop(); - var stat; - - try { - stat = FS.stat(path); - } catch (e) { - return callback(e); - } - - if (FS.isDir(stat.mode)) { - check.push.apply(check, FS.readdir(path).filter(isRealDir).map(toAbsolute(path))); - } - - entries[path] = { timestamp: stat.mtime }; - } - - return callback(null, { type: 'local', entries: entries }); - }, getRemoteSet: function (mount, callback) { - var entries = {}; - - IDBFS.getDB(mount.mountpoint, function (err, db) { - if (err) return callback(err); - - var transaction = db.transaction([IDBFS.DB_STORE_NAME], 'readonly'); - transaction.onerror = function () { callback(this.error); }; - - var store = transaction.objectStore(IDBFS.DB_STORE_NAME); - var index = store.index('timestamp'); - - index.openKeyCursor().onsuccess = function (event) { - var cursor = event.target.result; - - if (!cursor) { - return callback(null, { type: 'remote', db: db, entries: entries }); - } - - entries[cursor.primaryKey] = { timestamp: cursor.key }; - - cursor.continue(); - }; - }); - }, loadLocalEntry: function (path, callback) { - var stat, node; - - try { - var lookup = FS.lookupPath(path); - node = lookup.node; - stat = FS.stat(path); - } catch (e) { - return callback(e); - } - - if (FS.isDir(stat.mode)) { - return callback(null, { timestamp: stat.mtime, mode: stat.mode }); - } else if (FS.isFile(stat.mode)) { - // Performance consideration: storing a normal JavaScript array to a IndexedDB is much slower than storing a typed array. - // Therefore always convert the file contents to a typed array first before writing the data to IndexedDB. - node.contents = MEMFS.getFileDataAsTypedArray(node); - return callback(null, { timestamp: stat.mtime, mode: stat.mode, contents: node.contents }); - } else { - return callback(new Error('node type not supported')); - } - }, storeLocalEntry: function (path, entry, callback) { - try { - if (FS.isDir(entry.mode)) { - FS.mkdir(path, entry.mode); - } else if (FS.isFile(entry.mode)) { - FS.writeFile(path, entry.contents, { encoding: 'binary', canOwn: true }); - } else { - return callback(new Error('node type not supported')); - } - - FS.chmod(path, entry.mode); - FS.utime(path, entry.timestamp, entry.timestamp); - } catch (e) { - return callback(e); - } - - callback(null); - }, removeLocalEntry: function (path, callback) { - try { - var lookup = FS.lookupPath(path); - var stat = FS.stat(path); - - if (FS.isDir(stat.mode)) { - FS.rmdir(path); - } else if (FS.isFile(stat.mode)) { - FS.unlink(path); - } - } catch (e) { - return callback(e); - } - - callback(null); - }, loadRemoteEntry: function (store, path, callback) { - var req = store.get(path); - req.onsuccess = function (event) { callback(null, event.target.result); }; - req.onerror = function () { callback(this.error); }; - }, storeRemoteEntry: function (store, path, entry, callback) { - var req = store.put(entry, path); - req.onsuccess = function () { callback(null); }; - req.onerror = function () { callback(this.error); }; - }, removeRemoteEntry: function (store, path, callback) { - var req = store.delete(path); - req.onsuccess = function () { callback(null); }; - req.onerror = function () { callback(this.error); }; - }, reconcile: function (src, dst, callback) { - var total = 0; - - var create = []; - Object.keys(src.entries).forEach(function (key) { - var e = src.entries[key]; - var e2 = dst.entries[key]; - if (!e2 || e.timestamp > e2.timestamp) { - create.push(key); - total++; - } - }); - - var remove = []; - Object.keys(dst.entries).forEach(function (key) { - var e = dst.entries[key]; - var e2 = src.entries[key]; - if (!e2) { - remove.push(key); - total++; - } - }); - - if (!total) { - return callback(null); - } - - var errored = false; - var completed = 0; - var db = src.type === 'remote' ? src.db : dst.db; - var transaction = db.transaction([IDBFS.DB_STORE_NAME], 'readwrite'); - var store = transaction.objectStore(IDBFS.DB_STORE_NAME); - - function done(err) { - if (err) { - if (!done.errored) { - done.errored = true; - return callback(err); - } - return; - } - if (++completed >= total) { - return callback(null); - } - }; - - transaction.onerror = function () { done(this.error); }; - - // sort paths in ascending order so directory entries are created - // before the files inside them - create.sort().forEach(function (path) { - if (dst.type === 'local') { - IDBFS.loadRemoteEntry(store, path, function (err, entry) { - if (err) return done(err); - IDBFS.storeLocalEntry(path, entry, done); - }); - } else { - IDBFS.loadLocalEntry(path, function (err, entry) { - if (err) return done(err); - IDBFS.storeRemoteEntry(store, path, entry, done); - }); - } - }); - - // sort paths in descending order so files are deleted before their - // parent directories - remove.sort().reverse().forEach(function (path) { - if (dst.type === 'local') { - IDBFS.removeLocalEntry(path, done); - } else { - IDBFS.removeRemoteEntry(store, path, done); - } - }); - } - }; - var NODEFS = { isWindows: false, staticInit: function () { NODEFS.isWindows = !!process.platform.match(/^win/); @@ -4049,79 +3792,7 @@ var libsignal } else { processData(url); } - }, indexedDB: function () { - return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB; - }, DB_NAME: function () { - return 'EM_FS_' + window.location.pathname; - }, DB_VERSION: 20, DB_STORE_NAME: "FILE_DATA", saveFilesToDB: function (paths, onload, onerror) { - onload = onload || function () { }; - onerror = onerror || function () { }; - var indexedDB = FS.indexedDB(); - try { - var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION); - } catch (e) { - return onerror(e); - } - openRequest.onupgradeneeded = function openRequest_onupgradeneeded() { - console.log('creating db'); - var db = openRequest.result; - db.createObjectStore(FS.DB_STORE_NAME); - }; - openRequest.onsuccess = function openRequest_onsuccess() { - var db = openRequest.result; - var transaction = db.transaction([FS.DB_STORE_NAME], 'readwrite'); - var files = transaction.objectStore(FS.DB_STORE_NAME); - var ok = 0, fail = 0, total = paths.length; - function finish() { - if (fail == 0) onload(); else onerror(); - } - paths.forEach(function (path) { - var putRequest = files.put(FS.analyzePath(path).object.contents, path); - putRequest.onsuccess = function putRequest_onsuccess() { ok++; if (ok + fail == total) finish() }; - putRequest.onerror = function putRequest_onerror() { fail++; if (ok + fail == total) finish() }; - }); - transaction.onerror = onerror; - }; - openRequest.onerror = onerror; - }, loadFilesFromDB: function (paths, onload, onerror) { - onload = onload || function () { }; - onerror = onerror || function () { }; - var indexedDB = FS.indexedDB(); - try { - var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION); - } catch (e) { - return onerror(e); - } - openRequest.onupgradeneeded = onerror; // no database to load from - openRequest.onsuccess = function openRequest_onsuccess() { - var db = openRequest.result; - try { - var transaction = db.transaction([FS.DB_STORE_NAME], 'readonly'); - } catch (e) { - onerror(e); - return; - } - var files = transaction.objectStore(FS.DB_STORE_NAME); - var ok = 0, fail = 0, total = paths.length; - function finish() { - if (fail == 0) onload(); else onerror(); - } - paths.forEach(function (path) { - var getRequest = files.get(path); - getRequest.onsuccess = function getRequest_onsuccess() { - if (FS.analyzePath(path).exists) { - FS.unlink(path); - } - FS.createDataFile(PATH.dirname(path), PATH.basename(path), getRequest.result, true, true, true); - ok++; - if (ok + fail == total) finish(); - }; - getRequest.onerror = function getRequest_onerror() { fail++; if (ok + fail == total) finish() }; - }); - transaction.onerror = onerror; - }; - openRequest.onerror = onerror; - } + }, }; var PATH = { splitPath: function (filename) { var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; diff --git a/libtextsecure/protobufs.js b/libtextsecure/protobufs.js deleted file mode 100644 index 8315278d4..000000000 --- a/libtextsecure/protobufs.js +++ /dev/null @@ -1,37 +0,0 @@ -/* global window, dcodeIO, textsecure */ - -// eslint-disable-next-line func-names -(function() { - window.textsecure = window.textsecure || {}; - window.textsecure.protobuf = {}; - - function loadProtoBufs(filename) { - return dcodeIO.ProtoBuf.loadProtoFile( - { root: window.PROTO_ROOT, file: filename }, - (error, result) => { - if (error) { - const text = `Error loading protos from ${filename} (root: ${window.PROTO_ROOT}) ${ - error && error.stack ? error.stack : error - }`; - window.log.error(text); - throw error; - } - const protos = result.build('signalservice'); - if (!protos) { - const text = `Error loading protos from ${filename} (root: ${window.PROTO_ROOT})`; - window.log.error(text); - throw new Error(text); - } - // eslint-disable-next-line no-restricted-syntax, guard-for-in - for (const protoName in protos) { - textsecure.protobuf[protoName] = protos[protoName]; - } - } - ); - } - - // this is all the Session Protocols - loadProtoBufs('SignalService.proto'); - // this is for websocket wrapping of messages - loadProtoBufs('SubProtocol.proto'); -})(); diff --git a/libtextsecure/stringview.js b/libtextsecure/stringview.js deleted file mode 100644 index 6b8a304ff..000000000 --- a/libtextsecure/stringview.js +++ /dev/null @@ -1,100 +0,0 @@ -/* global window, StringView */ - -/* eslint-disable no-bitwise, no-nested-ternary, */ - -// eslint-disable-next-line func-names -(function() { - window.StringView = { - /* - * These functions from the Mozilla Developer Network - * and have been placed in the public domain. - * https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding - * https://developer.mozilla.org/en-US/docs/MDN/About#Copyrights_and_licenses - */ - - b64ToUint6(nChr) { - return nChr > 64 && nChr < 91 - ? nChr - 65 - : nChr > 96 && nChr < 123 - ? nChr - 71 - : nChr > 47 && nChr < 58 - ? nChr + 4 - : nChr === 43 - ? 62 - : nChr === 47 - ? 63 - : 0; - }, - - // This is not a "standard" base64, do not use! - base64ToBytes(sBase64, nBlocksSize) { - const sB64Enc = sBase64.replace(/[^A-Za-z0-9+/]/g, ''); - const nInLen = sB64Enc.length; - const nOutLen = nBlocksSize - ? Math.ceil(((nInLen * 3 + 1) >> 2) / nBlocksSize) * nBlocksSize - : (nInLen * 3 + 1) >> 2; - const aBBytes = new ArrayBuffer(nOutLen); - const taBytes = new Uint8Array(aBBytes); - - let nMod3; - let nMod4; - for (let nUint24 = 0, nOutIdx = 0, nInIdx = 0; nInIdx < nInLen; nInIdx += 1) { - nMod4 = nInIdx & 3; - nUint24 |= StringView.b64ToUint6(sB64Enc.charCodeAt(nInIdx)) << (18 - 6 * nMod4); - if (nMod4 === 3 || nInLen - nInIdx === 1) { - for (nMod3 = 0; nMod3 < 3 && nOutIdx < nOutLen; nMod3 += 1, nOutIdx += 1) { - taBytes[nOutIdx] = (nUint24 >>> ((16 >>> nMod3) & 24)) & 255; - } - nUint24 = 0; - } - } - return aBBytes; - }, - - uint6ToB64(nUint6) { - return nUint6 < 26 - ? nUint6 + 65 - : nUint6 < 52 - ? nUint6 + 71 - : nUint6 < 62 - ? nUint6 - 4 - : nUint6 === 62 - ? 43 - : nUint6 === 63 - ? 47 - : 65; - }, - - bytesToBase64(aBytes) { - let nMod3; - let sB64Enc = ''; - for (let nLen = aBytes.length, nUint24 = 0, nIdx = 0; nIdx < nLen; nIdx += 1) { - nMod3 = nIdx % 3; - if (nIdx > 0 && ((nIdx * 4) / 3) % 76 === 0) { - sB64Enc += '\r\n'; - } - nUint24 |= aBytes[nIdx] << ((16 >>> nMod3) & 24); - if (nMod3 === 2 || aBytes.length - nIdx === 1) { - sB64Enc += String.fromCharCode( - StringView.uint6ToB64((nUint24 >>> 18) & 63), - StringView.uint6ToB64((nUint24 >>> 12) & 63), - StringView.uint6ToB64((nUint24 >>> 6) & 63), - StringView.uint6ToB64(nUint24 & 63) - ); - nUint24 = 0; - } - } - return sB64Enc.replace(/A(?=A$|$)/g, '='); - }, - - arrayBufferToHex(aArrayBuffer) { - return Array.prototype.map - .call(new Uint8Array(aArrayBuffer), x => `00${x.toString(16)}`.slice(-2)) - .join(''); - }, - - hexToArrayBuffer(aString) { - return new Uint8Array(aString.match(/[\da-f]{2}/gi).map(h => parseInt(h, 16))).buffer; - }, - }; -})(); diff --git a/main.js b/main.js index 5267211b7..e6c44f877 100644 --- a/main.js +++ b/main.js @@ -597,12 +597,10 @@ async function showDebugLogWindow() { debugLogWindow.loadURL(prepareURL([__dirname, 'debug_log.html'], { theme })); debugLogWindow.on('closed', () => { - removeDarkOverlay(); debugLogWindow = null; }); debugLogWindow.once('ready-to-show', () => { - addDarkOverlay(); debugLogWindow.show(); }); } @@ -820,14 +818,6 @@ ipc.on('locale-data', event => { event.returnValue = locale.messages; }); -ipc.on('set-badge-count', (event, count) => { - app.setBadgeCount(count); -}); - -ipc.on('remove-setup-menu-items', () => { - setupMenu(); -}); - ipc.on('add-setup-menu-items', () => { setupMenu({ includeSetup: false, @@ -957,19 +947,6 @@ ipc.on('close-debug-log', () => { } }); -// Settings-related IPC calls - -function addDarkOverlay() { - if (mainWindow && mainWindow.webContents) { - mainWindow.webContents.send('add-dark-overlay'); - } -} -function removeDarkOverlay() { - if (mainWindow && mainWindow.webContents) { - mainWindow.webContents.send('remove-dark-overlay'); - } -} - // This should be called with an ipc sendSync ipc.on('get-media-permissions', event => { // eslint-disable-next-line no-param-reassign diff --git a/node-gyp b/node-gyp deleted file mode 100644 index e69de29bb..000000000 diff --git a/package.json b/package.json index 2a7359247..71aff5e2e 100644 --- a/package.json +++ b/package.json @@ -175,7 +175,6 @@ "@types/webpack": "^5.28.0", "arraybuffer-loader": "1.0.3", "asar": "0.14.0", - "bower": "1.8.2", "chai": "4.3.4", "chai-as-promised": "^7.1.1", "chai-bytes": "^0.1.2", diff --git a/preload.js b/preload.js index 050116a71..bc8263d5e 100644 --- a/preload.js +++ b/preload.js @@ -2,18 +2,12 @@ /* global Whisper: false */ /* global window: false */ const path = require('path'); -const electron = require('electron'); - -const { webFrame } = electron; +const { webFrame, remote, clipboard, ipcRenderer } = require('electron'); const semver = require('semver'); const { deferredToPromise } = require('./js/modules/deferred_to_promise'); -const { JobQueue } = require('./js/modules/job_queue'); -const { app } = electron.remote; -const { clipboard } = electron; - -window.PROTO_ROOT = 'protos'; +const { app } = remote; const config = require('url').parse(window.location.toString(), true).query; @@ -43,7 +37,6 @@ window.getCommitHash = () => config.commitHash; window.getNodeVersion = () => config.node_version; window.getHostName = () => config.hostname; window.getServerTrustRoot = () => config.serverTrustRoot; -window.JobQueue = JobQueue; window.isBehindProxy = () => Boolean(config.proxyUrl); window.lokiFeatureFlags = { @@ -83,7 +76,7 @@ window.versionInfo = { window.wrapDeferred = deferredToPromise; -const ipc = electron.ipcRenderer; +const ipc = ipcRenderer; const localeMessages = ipc.sendSync('locale-data'); window.updateZoomFactor = () => { @@ -99,8 +92,6 @@ window.getZoomFactor = () => { webFrame.getZoomFactor(); }; -window.setBadgeCount = count => ipc.send('set-badge-count', count); - // Set the password for the database window.setPassword = (passPhrase, oldPhrase) => new Promise((resolve, reject) => { @@ -170,21 +161,6 @@ ipc.on('get-theme-setting', () => { ipc.send('get-success-theme-setting', theme); }); -// Settings-related events - -ipc.on('add-dark-overlay', () => { - const { addDarkOverlay } = window.Events; - if (addDarkOverlay) { - addDarkOverlay(); - } -}); -ipc.on('remove-dark-overlay', () => { - const { removeDarkOverlay } = window.Events; - if (removeDarkOverlay) { - removeDarkOverlay(); - } -}); - window.getSettingValue = (settingID, comparisonValue = null) => { // Comparison value allows you to pull boolean values from any type. // Eg. window.getSettingValue('theme', 'light') @@ -242,9 +218,6 @@ ipc.on('get-ready-for-shutdown', async () => { } }); -window.addSetupMenuItems = () => ipc.send('add-setup-menu-items'); -window.removeSetupMenuItems = () => ipc.send('remove-setup-menu-items'); - // We pull these dependencies in now, from here, because they have Node.js dependencies require('./js/logging'); diff --git a/stylesheets/_global.scss b/stylesheets/_global.scss index a07a267ac..06d10b1a5 100644 --- a/stylesheets/_global.scss +++ b/stylesheets/_global.scss @@ -37,17 +37,6 @@ audio { max-width: 100%; } -.dark-overlay { - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - background-color: $color-black; - opacity: 0.25; - z-index: 200; -} - .clearfix:before, .clearfix:after { display: table; diff --git a/stylesheets/_theme_dark.scss b/stylesheets/_theme_dark.scss index 919123a12..93ffc3116 100644 --- a/stylesheets/_theme_dark.scss +++ b/stylesheets/_theme_dark.scss @@ -33,11 +33,6 @@ } // _global - - .dark-overlay { - background-color: $color-gray-95; - } - .title-bar { color: $color-dark-05; } diff --git a/ts/components/dialog/OnionStatusPathDialog.tsx b/ts/components/dialog/OnionStatusPathDialog.tsx index 9a84f5589..0112bf41b 100644 --- a/ts/components/dialog/OnionStatusPathDialog.tsx +++ b/ts/components/dialog/OnionStatusPathDialog.tsx @@ -1,7 +1,6 @@ import React from 'react'; -import Electron from 'electron'; -const { shell } = Electron; +import { shell } from 'electron'; import { useDispatch, useSelector } from 'react-redux'; diff --git a/ts/components/session/menu/Menu.tsx b/ts/components/session/menu/Menu.tsx index 04cc7825c..14ea628e4 100644 --- a/ts/components/session/menu/Menu.tsx +++ b/ts/components/session/menu/Menu.tsx @@ -323,29 +323,33 @@ export function getMarkAllReadMenuItem(conversationId: string): JSX.Element | nu } export function getStartCallMenuItem(conversationId: string): JSX.Element | null { - const canCall = !(useSelector(getHasIncomingCall) || useSelector(getHasOngoingCall)); - return ( - { - // TODO: either pass param to callRecipient or call different call methods based on item selected. - // TODO: one time redux-persisted permission modal? - const convo = getConversationController().get(conversationId); + if (window?.lokiFeatureFlags.useCallMessage) { + const canCall = !(useSelector(getHasIncomingCall) || useSelector(getHasOngoingCall)); + return ( + { + // TODO: either pass param to callRecipient or call different call methods based on item selected. + // TODO: one time redux-persisted permission modal? + const convo = getConversationController().get(conversationId); - if (!canCall) { - ToastUtils.pushUnableToCall(); - return; - } + if (!canCall) { + ToastUtils.pushUnableToCall(); + return; + } - if (convo) { - convo.callState = 'connecting'; - await convo.commit(); - await CallManager.USER_callRecipient(convo.id); - } - }} - > - {'Video Call'} - - ); + if (convo) { + convo.callState = 'connecting'; + await convo.commit(); + await CallManager.USER_callRecipient(convo.id); + } + }} + > + {'Video Call'} + + ); + } + + return null; } export function getDisappearingMenuItem( diff --git a/ts/data/data.ts b/ts/data/data.ts index 1a78167ea..c8c912086 100644 --- a/ts/data/data.ts +++ b/ts/data/data.ts @@ -1,6 +1,5 @@ -import Electron from 'electron'; +import { ipcRenderer } from 'electron'; -const { ipcRenderer } = Electron; // tslint:disable: no-require-imports no-var-requires one-variable-per-declaration no-void-expression import _ from 'lodash'; diff --git a/ts/session/seed_node_api/SeedNodeAPI.ts b/ts/session/seed_node_api/SeedNodeAPI.ts index cae1cf369..4b38d7a5c 100644 --- a/ts/session/seed_node_api/SeedNodeAPI.ts +++ b/ts/session/seed_node_api/SeedNodeAPI.ts @@ -6,13 +6,12 @@ import _ from 'lodash'; import fs from 'fs'; import path from 'path'; import tls from 'tls'; -import Electron from 'electron'; +import { remote } from 'electron'; import { sha256 } from '../crypto'; import * as Data from '../../../ts/data/data'; import pRetry from 'p-retry'; import { SeedNodeAPI } from '.'; -const { remote } = Electron; // tslint:disable: function-name export type SeedNode = { diff --git a/ts/session/snode_api/SNodeAPI.ts b/ts/session/snode_api/SNodeAPI.ts index e1e52ed9c..cad1cc906 100644 --- a/ts/session/snode_api/SNodeAPI.ts +++ b/ts/session/snode_api/SNodeAPI.ts @@ -465,7 +465,13 @@ export async function retrieveNextMessages( // let exceptions bubble up // no retry for this one as this a call we do every few seconds while polling for messages - const result = await snodeRpc({ method: 'retrieve', params, targetNode, associatedWith }); + const result = await snodeRpc({ + method: 'retrieve', + params, + targetNode, + associatedWith, + timeout: 4000, + }); if (!result) { window?.log?.warn( @@ -662,7 +668,7 @@ export const forceNetworkDeletion = async (): Promise | null> => { minTimeout: exports.TEST_getMinTimeout(), onFailedAttempt: e => { window?.log?.warn( - `delete_all OUTER request attempt #${e.attemptNumber} failed. ${e.retriesLeft} retries left...` + `delete_all OUTER request attempt #${e.attemptNumber} failed. ${e.retriesLeft} retries left... ${e.message}` ); }, } @@ -770,6 +776,12 @@ export const networkDeleteMessages = async (hashes: Array): Promise snodeToMakeRequestTo.pubkey_ed25519 )} due to error: ${reason}: ${statusCode}` ); + // if we tried to make the delete on a snode not in our swarm, just trigger a pRetry error so the outer block here finds new snodes to make the request to. + if (statusCode === 421) { + throw new pRetry.AbortError( + '421 error on network delete_all. Retrying with a new snode' + ); + } } else { window?.log?.warn( `Could not delete data from ${ed25519Str( diff --git a/ts/session/snode_api/lokiRpc.ts b/ts/session/snode_api/lokiRpc.ts index da13ad2c3..c5a2e5445 100644 --- a/ts/session/snode_api/lokiRpc.ts +++ b/ts/session/snode_api/lokiRpc.ts @@ -19,13 +19,14 @@ async function lokiFetch({ url, associatedWith, targetNode, + timeout, }: { url: string; options: FetchOptions; targetNode?: Snode; associatedWith?: string; + timeout: number; }): Promise { - const timeout = 10000; const method = options.method || 'GET'; const fetchOptions = { @@ -97,11 +98,13 @@ export async function snodeRpc( params, targetNode, associatedWith, + timeout = 10000, }: { method: string; params: any; targetNode: Snode; associatedWith?: string; + timeout?: number; } //the user pubkey this call is for. if the onion request fails, this is used to handle the error for this user swarm for instance ): Promise { const url = `https://${targetNode.ip}:${targetNode.port}/storage_rpc/v1`; @@ -135,5 +138,6 @@ export async function snodeRpc( options: fetchOptions, targetNode, associatedWith, + timeout, }); } diff --git a/ts/session/snode_api/onions.ts b/ts/session/snode_api/onions.ts index 6be32565d..f4a4c1e04 100644 --- a/ts/session/snode_api/onions.ts +++ b/ts/session/snode_api/onions.ts @@ -530,9 +530,8 @@ async function handle421InvalidSwarm({ // this does not make much sense to have a 421 without a publicKey set. throw new Error('status 421 without a final destination or no associatedWith makes no sense'); } - window?.log?.info(`Invalidating swarm for ${associatedWith}`); + window?.log?.info(`Invalidating swarm for ${ed25519Str(associatedWith)}`); - const exceptionMessage = '421 handled. Retry this request with a new targetNode'; try { const parsedBody = JSON.parse(body); @@ -545,12 +544,12 @@ async function handle421InvalidSwarm({ ); await updateSwarmFor(associatedWith, parsedBody.snodes); - throw new pRetry.AbortError(exceptionMessage); + throw new pRetry.AbortError(ERROR_421_HANDLED_RETRY_REQUEST); } // remove this node from the swarm of this pubkey await dropSnodeFromSwarmIfNeeded(associatedWith, snodeEd25519); } catch (e) { - if (e.message !== exceptionMessage) { + if (e.message !== ERROR_421_HANDLED_RETRY_REQUEST) { window?.log?.warn( 'Got error while parsing 421 result. Dropping this snode from the swarm of this pubkey', e diff --git a/ts/session/snode_api/swarmPolling.ts b/ts/session/snode_api/swarmPolling.ts index a05a48bdf..56f8eab1a 100644 --- a/ts/session/snode_api/swarmPolling.ts +++ b/ts/session/snode_api/swarmPolling.ts @@ -289,7 +289,7 @@ export class SwarmPolling { retries: 1, onFailedAttempt: e => { window?.log?.warn( - `retrieveNextMessages attempt #${e.attemptNumber} failed. ${e.retriesLeft} retries left...` + `retrieveNextMessages attempt #${e.attemptNumber} failed. ${e.retriesLeft} retries left... ${e.name}` ); }, } diff --git a/ts/session/utils/JobQueue.ts b/ts/session/utils/JobQueue.ts index 6ac05223a..e466a1a06 100644 --- a/ts/session/utils/JobQueue.ts +++ b/ts/session/utils/JobQueue.ts @@ -2,7 +2,6 @@ import { v4 as uuid } from 'uuid'; type Job = (() => PromiseLike) | (() => ResultType); -// TODO: This needs to replace js/modules/job_queue.js export class JobQueue { private pending?: Promise = Promise.resolve(); private readonly jobs: Map> = new Map(); diff --git a/ts/session/utils/Protobuf.ts b/ts/session/utils/Protobuf.ts deleted file mode 100644 index a800ee2dd..000000000 --- a/ts/session/utils/Protobuf.ts +++ /dev/null @@ -1,35 +0,0 @@ -import ByteBuffer from 'bytebuffer'; - -/** - * Converts any object to a valid ts protobuf object. - * - * This is needed because there's a very jarring difference between `protobufjs` and `protobufts`. - * `protobufjs` returns all `bytes` as `ByteBuffer` where as `protobufts` returns all `bytes` as `Uint8Array`. - */ -export function convertToTS(object: any): any { - // No idea why js `ByteBuffer` and ts `ByteBuffer` differ ... - if (object instanceof Uint8Array) { - return object; - } else if (object && object.constructor && object.constructor.name === 'ByteBuffer') { - return new Uint8Array(object.toArrayBuffer()); - } else if ( - object instanceof ByteBuffer || - object instanceof Buffer || - object instanceof ArrayBuffer || - object instanceof SharedArrayBuffer - ) { - const arrayBuffer = ByteBuffer.wrap(object).toArrayBuffer(); - return new Uint8Array(arrayBuffer); - } else if (Array.isArray(object)) { - return object.map(convertToTS); - } else if (object && typeof object === 'object') { - const keys = Object.keys(object); - const values: { [key: string]: any } = {}; - for (const key of keys) { - values[key] = convertToTS(object[key]); - } - return values; - } - - return object; -} diff --git a/ts/session/utils/index.ts b/ts/session/utils/index.ts index 2329b8836..6bc07f0dc 100644 --- a/ts/session/utils/index.ts +++ b/ts/session/utils/index.ts @@ -2,7 +2,6 @@ import * as MessageUtils from './Messages'; import * as GroupUtils from './Groups'; import * as StringUtils from './String'; import * as PromiseUtils from './Promise'; -import * as ProtobufUtils from './Protobuf'; import * as MenuUtils from '../../components/session/menu/Menu'; import * as ToastUtils from './Toast'; import * as UserUtils from './User'; @@ -20,7 +19,6 @@ export { GroupUtils, StringUtils, PromiseUtils, - ProtobufUtils, MenuUtils, ToastUtils, UserUtils, diff --git a/ts/util/lint/analyze_exceptions.ts b/ts/util/lint/analyze_exceptions.ts deleted file mode 100644 index 4ee1b73cc..000000000 --- a/ts/util/lint/analyze_exceptions.ts +++ /dev/null @@ -1,29 +0,0 @@ -// tslint:disable no-console - -import { join } from 'path'; - -import { fromPairs, groupBy, map } from 'lodash'; - -import { ExceptionType } from './types'; -import { loadJSON } from './util'; - -const exceptionsPath = join(__dirname, 'exceptions.json'); -const exceptions: Array = loadJSON(exceptionsPath); -const byRule = groupBy(exceptions, 'rule'); - -const byRuleThenByCategory = fromPairs( - map(byRule, (list, ruleName) => { - const byCategory = groupBy(list, 'reasonCategory'); - - return [ - ruleName, - fromPairs( - map(byCategory, (innerList, categoryName) => { - return [categoryName, innerList.length]; - }) - ), - ]; - }) -); - -console.log(JSON.stringify(byRuleThenByCategory, null, ' ')); diff --git a/ts/util/lint/exceptions.json b/ts/util/lint/exceptions.json deleted file mode 100644 index 56cb3a4fd..000000000 --- a/ts/util/lint/exceptions.json +++ /dev/null @@ -1,5621 +0,0 @@ -[ - { - "rule": "jQuery-load(", - "path": "app/locale.js", - "line": "function load({ appLocale, logger } = {}) {", - "lineNumber": 27, - "reasonCategory": "falseMatch", - "updated": "2018-09-13T21:20:44.234Z" - }, - { - "rule": "jQuery-before(", - "path": "components/indexeddb-backbonejs-adapter/backbone-indexeddb.js", - "lineNumber": 157, - "reasonCategory": "falseMatch", - "updated": "2018-09-13T21:24:40.667Z" - }, - { - "rule": "jQuery-after(", - "path": "components/indexeddb-backbonejs-adapter/backbone-indexeddb.js", - "lineNumber": 166, - "reasonCategory": "falseMatch", - "updated": "2018-09-13T21:24:40.667Z" - }, - { - "rule": "jQuery-$(", - "path": "js/about_start.js", - "line": "$('.version').text(`v${window.getVersion()}`);", - "lineNumber": 4, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/about_start.js", - "line": "$('.environment').text(states.join(' - '));", - "lineNumber": 16, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/about_start.js", - "line": "$(document).on('keyup', e => {", - "lineNumber": 19, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/about_start.js", - "line": "$('.privacy').text(window.i18n('privacyPolicy'));", - "lineNumber": 28, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/debug_log_start.js", - "line": "$(document).on('keyup', e => {", - "lineNumber": 4, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/debug_log_start.js", - "line": "const $body = $(document.body);", - "lineNumber": 12, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-appendTo(", - "path": "js/debug_log_start.js", - "line": "window.view.$el.appendTo($body);", - "lineNumber": 19, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM nodes" - }, - { - "rule": "jQuery-wrap(", - "path": "js/modules/crypto.js", - "line": " return dcodeIO.ByteBuffer.wrap(arrayBuffer).toString('base64');", - "lineNumber": 38, - "reasonCategory": "falseMatch", - "updated": "2018-10-05T23:12:28.961Z" - }, - { - "rule": "jQuery-wrap(", - "path": "js/modules/crypto.js", - "line": " return dcodeIO.ByteBuffer.wrap(base64string, 'base64').toArrayBuffer();", - "lineNumber": 41, - "reasonCategory": "falseMatch", - "updated": "2018-10-05T23:12:28.961Z" - }, - { - "rule": "jQuery-wrap(", - "path": "js/modules/crypto.js", - "line": " return dcodeIO.ByteBuffer.wrap(key, 'binary').toArrayBuffer();", - "lineNumber": 45, - "reasonCategory": "falseMatch", - "updated": "2018-10-05T23:12:28.961Z" - }, - { - "rule": "jQuery-wrap(", - "path": "js/modules/crypto.js", - "line": " return dcodeIO.ByteBuffer.wrap(string, 'utf8').toArrayBuffer();", - "lineNumber": 49, - "reasonCategory": "falseMatch", - "updated": "2018-10-05T23:12:28.961Z" - }, - { - "rule": "jQuery-wrap(", - "path": "js/modules/crypto.js", - "line": " return dcodeIO.ByteBuffer.wrap(buffer).toString('utf8');", - "lineNumber": 52, - "reasonCategory": "falseMatch", - "updated": "2018-10-05T23:12:28.961Z" - }, - { - "rule": "jQuery-append(", - "path": "js/modules/debuglogs.js", - "line": " form.append('key', fields.key);", - "lineNumber": 48, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-append(", - "path": "js/modules/debuglogs.js", - "line": " form.append(key, value);", - "lineNumber": 52, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-append(", - "path": "js/modules/debuglogs.js", - "line": " form.append('Content-Type', contentType);", - "lineNumber": 57, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-$(", - "path": "js/settings_start.js", - "line": "$(document).on('keyup', e => {", - "lineNumber": 3, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/settings_start.js", - "line": "const $body = $(document.body);", - "lineNumber": 11, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-appendTo(", - "path": "js/settings_start.js", - "line": " window.view.$el.appendTo($body);", - "lineNumber": 41, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM nodes" - }, - { - "rule": "jQuery-wrap(", - "path": "js/util_worker_tasks.js", - "line": " return dcodeIO.ByteBuffer.wrap(string, 'base64').toArrayBuffer();", - "lineNumber": 40, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "js/util_worker_tasks.js", - "line": " return dcodeIO.ByteBuffer.wrap(arrayBuffer).toString('base64');", - "lineNumber": 43, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "DOM-innerHTML", - "path": "js/views/app_view.js", - "line": " this.el.innerHTML = '';", - "lineNumber": 43, - "reasonCategory": "usageTrusted", - "updated": "2018-09-15T00:38:04.183Z", - "reasonDetail": "Hard-coded string" - }, - { - "rule": "jQuery-append(", - "path": "js/views/app_view.js", - "line": " this.el.append(view.el);", - "lineNumber": 44, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM nodes" - }, - { - "rule": "jQuery-appendTo(", - "path": "js/views/app_view.js", - "line": " this.debugLogView.$el.appendTo(this.el);", - "lineNumber": 50, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM nodes" - }, - { - "rule": "jQuery-$(", - "path": "js/views/debug_log_view.js", - "line": " this.$('textarea').val(i18n('loading'));", - "lineNumber": 27, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/debug_log_view.js", - "line": " this.$('textarea').val(text);", - "lineNumber": 31, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/debug_log_view.js", - "line": " const text = this.$('textarea').val();", - "lineNumber": 50, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/debug_log_view.js", - "line": " this.$('.buttons, textarea').remove();", - "lineNumber": 55, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/debug_log_view.js", - "line": " el: this.$('.result'),", - "lineNumber": 62, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/debug_log_view.js", - "line": " this.$('.loading').removeClass('loading');", - "lineNumber": 64, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/debug_log_view.js", - "line": " this.$('.link')", - "lineNumber": 66, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/debug_log_view.js", - "line": " this.$('.loading').removeClass('loading');", - "lineNumber": 74, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/inbox_view.js", - "line": " let $el = this.$(`#${id}`);", - "lineNumber": 30, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-prependTo(", - "path": "js/views/inbox_view.js", - "line": " $el.prependTo(this.el);", - "lineNumber": 39, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM nodes" - }, - { - "rule": "jQuery-$(", - "path": "js/views/inbox_view.js", - "line": " this.$('.message').text(message);", - "lineNumber": 51, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/inbox_view.js", - "line": " el: this.$('.conversation-stack'),", - "lineNumber": 68, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-prependTo(", - "path": "js/views/inbox_view.js", - "line": " this.appLoadingScreen.$el.prependTo(this.el);", - "lineNumber": 75, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM nodes" - }, - { - "rule": "jQuery-append(", - "path": "js/views/inbox_view.js", - "line": " .append(this.networkStatusView.render().el);", - "lineNumber": 90, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM nodes" - }, - { - "rule": "jQuery-prependTo(", - "path": "js/views/inbox_view.js", - "line": " banner.$el.prependTo(this.$el);", - "lineNumber": 94, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM nodes" - }, - { - "rule": "jQuery-$(", - "path": "js/views/inbox_view.js", - "line": " // $(document).on('keydown', event => {", - "lineNumber": 153, - "reasonCategory": "usageTrusted", - "updated": "2019-04-03T00:43:09.315Z", - "reasonDetail": "Interacting with already-existing DOM nodes" - }, - { - "rule": "jQuery-$(", - "path": "js/views/inbox_view.js", - "line": " this.$('.left-pane-placeholder').append(this.leftPaneView.el);", - "lineNumber": 189, - "reasonCategory": "usageTrusted", - "updated": "2019-03-08T23:49:08.796Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-append(", - "path": "js/views/inbox_view.js", - "line": " this.$('.left-pane-placeholder').append(this.leftPaneView.el);", - "lineNumber": 189, - "reasonCategory": "usageTrusted", - "updated": "2019-03-08T23:49:08.796Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/inbox_view.js", - "line": " if (e && this.$(e.target).closest('.placeholder').length) {", - "lineNumber": 230, - "reasonCategory": "usageTrusted", - "updated": "2019-03-08T23:49:08.796Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/inbox_view.js", - "line": " this.$('#header, .gutter').addClass('inactive');", - "lineNumber": 234, - "reasonCategory": "usageTrusted", - "updated": "2019-03-08T23:49:08.796Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/inbox_view.js", - "line": " this.$('.conversation-stack').addClass('inactive');", - "lineNumber": 238, - "reasonCategory": "usageTrusted", - "updated": "2019-03-08T23:49:08.796Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/inbox_view.js", - "line": " this.$('.conversation:first .menu').trigger('close');", - "lineNumber": 240, - "reasonCategory": "usageTrusted", - "updated": "2019-03-08T23:49:08.796Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/inbox_view.js", - "line": " if (e && this.$(e.target).closest('.capture-audio').length > 0) {", - "lineNumber": 259, - "reasonCategory": "usageTrusted", - "updated": "2019-03-08T23:49:08.796Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/inbox_view.js", - "line": " this.$('.conversation:first .recorder').trigger('close');", - "lineNumber": 262, - "reasonCategory": "usageTrusted", - "updated": "2019-03-08T23:49:08.796Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/phone-input-view.js", - "line": " this.$('input.number').intlTelInput();", - "lineNumber": 14, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/phone-input-view.js", - "line": " const input = this.$('input.number');", - "lineNumber": 21, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/phone-input-view.js", - "line": " this.$('.number-container').removeClass('invalid');", - "lineNumber": 29, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/phone-input-view.js", - "line": " this.$('.number-container').removeClass('valid');", - "lineNumber": 32, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/recorder_view.js", - "line": " $(window).on('blur', this.onSwitchAwayBound);", - "lineNumber": 19, - "reasonCategory": "usageTrusted", - "updated": "2018-10-11T19:22:47.331Z", - "reasonDetail": "Operating on already-existing DOM elements" - }, - { - "rule": "jQuery-$(", - "path": "js/views/recorder_view.js", - "line": " this.$('.time').text(`${minutes}:${seconds}`);", - "lineNumber": 38, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/recorder_view.js", - "line": " $(window).off('blur', this.onSwitchAwayBound);", - "lineNumber": 69, - "reasonCategory": "usageTrusted", - "updated": "2018-10-11T19:22:47.331Z", - "reasonDetail": "Operating on already-existing DOM elements" - }, - { - "rule": "jQuery-$(", - "path": "js/views/settings_view.js", - "line": " this.$('input').prop('checked', !!this.value);", - "lineNumber": 30, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/settings_view.js", - "line": " this.$('input').prop('checked', Boolean(this.value));", - "lineNumber": 49, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/settings_view.js", - "line": " const value = this.$(e.target).val();", - "lineNumber": 64, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/settings_view.js", - "line": " this.$(`#${this.name}-${this.value}`).attr('checked', 'checked');", - "lineNumber": 69, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/settings_view.js", - "line": " el: this.$('.notification-settings'),", - "lineNumber": 78, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/settings_view.js", - "line": " el: this.$('.theme-settings'),", - "lineNumber": 84, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/settings_view.js", - "line": " $(document.body)", - "lineNumber": 88, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/settings_view.js", - "line": " el: this.$('.audio-notification-setting'),", - "lineNumber": 97, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/settings_view.js", - "line": " el: this.$('.spell-check-setting'),", - "lineNumber": 104, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/settings_view.js", - "line": " el: this.$('.menu-bar-setting'),", - "lineNumber": 111, - "reasonCategory": "usageTrusted", - "updated": "2019-04-08T18:24:35.255Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/settings_view.js", - "line": " el: this.$('.media-permissions'),", - "lineNumber": 118, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/settings_view.js", - "line": " this.$('.sync-setting').append(syncView.el);", - "lineNumber": 124, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-append(", - "path": "js/views/settings_view.js", - "line": " this.$('.sync-setting').append(syncView.el);", - "lineNumber": 124, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM nodes" - }, - { - "rule": "jQuery-$(", - "path": "js/views/settings_view.js", - "line": " this.$('.sync').text(i18n('syncNow'));", - "lineNumber": 179, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/settings_view.js", - "line": " this.$('.sync').attr('disabled', 'disabled');", - "lineNumber": 183, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/settings_view.js", - "line": " this.$('.synced_at').hide();", - "lineNumber": 195, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/settings_view.js", - "line": " this.$('.sync_failed').hide();", - "lineNumber": 200, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/standalone_registration_view.js", - "line": " this.$('input.number').val(number);", - "lineNumber": 21, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/standalone_registration_view.js", - "line": " el: this.$('#phone-number-input'),", - "lineNumber": 24, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/standalone_registration_view.js", - "line": " this.$('#error').hide();", - "lineNumber": 26, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/standalone_registration_view.js", - "line": " const verificationCode = $('#code')", - "lineNumber": 37, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/standalone_registration_view.js", - "line": " this.$('#status').text(s);", - "lineNumber": 50, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/standalone_registration_view.js", - "line": " const verificationCode = $('#code')", - "lineNumber": 53, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/standalone_registration_view.js", - "line": " this.$('#error')", - "lineNumber": 64, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/standalone_registration_view.js", - "line": " if (this.$('#number-container').hasClass('valid')) {", - "lineNumber": 71, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/standalone_registration_view.js", - "line": " this.$('#request-sms, #request-voice').prop('disabled', 'disabled');", - "lineNumber": 74, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/standalone_registration_view.js", - "line": " this.$('#code').addClass('invalid');", - "lineNumber": 79, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/standalone_registration_view.js", - "line": " this.$('#code').removeClass('invalid');", - "lineNumber": 81, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/standalone_registration_view.js", - "line": " this.$('#error').hide();", - "lineNumber": 86, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/standalone_registration_view.js", - "line": " this.$('#step2')", - "lineNumber": 92, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/standalone_registration_view.js", - "line": " this.$('#number-container').addClass('invalid');", - "lineNumber": 96, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/standalone_registration_view.js", - "line": " $('#error').hide();", - "lineNumber": 101, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/standalone_registration_view.js", - "line": " this.$('#step2')", - "lineNumber": 107, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/standalone_registration_view.js", - "line": " this.$('#number-container').addClass('invalid');", - "lineNumber": 111, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-html(", - "path": "js/views/toast_view.js", - "line": " this.$el.html(", - "lineNumber": 21, - "reasonCategory": "usageTrusted", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-html(", - "path": "js/views/whisper_view.js", - "line": " this.$el.html(Mustache.render(template, attrs, partials));", - "lineNumber": 51, - "reasonCategory": "usageTrusted", - "updated": "2018-09-15T00:38:04.183Z", - "reasonDetail": "Value set came directly from Mustache tempating engine" - }, - { - "rule": "jQuery-append(", - "path": "js/views/whisper_view.js", - "line": " this.$el.append(dialog.el);", - "lineNumber": 62, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM nodes" - }, - { - "rule": "jQuery-$(", - "path": "js/views/whisper_view.js", - "line": " $('script[type=\"text/x-tmpl-mustache\"]').each((i, el) => {", - "lineNumber": 70, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "js/views/whisper_view.js", - "line": " const $el = $(el);", - "lineNumber": 71, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-html(", - "path": "js/views/whisper_view.js", - "line": " templates[id] = $el.html();", - "lineNumber": 73, - "reasonCategory": "usageTrusted", - "updated": "2018-09-15T00:38:04.183Z", - "reasonDetail": "Getting the value, not setting it" - }, - { - "rule": "jQuery-wrap(", - "path": "libtextsecure/crypto.js", - "line": " const data = dcodeIO.ByteBuffer.wrap(", - "lineNumber": 205, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "libtextsecure/crypto.js", - "line": " return dcodeIO.ByteBuffer.wrap(padded)", - "lineNumber": 219, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "libtextsecure/message_receiver.js", - "line": " Promise.resolve(dcodeIO.ByteBuffer.wrap(string, 'binary').toArrayBuffer());", - "lineNumber": 145, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "libtextsecure/message_receiver.js", - "line": " Promise.resolve(dcodeIO.ByteBuffer.wrap(arrayBuffer).toString('binary'));", - "lineNumber": 147, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "libtextsecure/message_receiver.js", - "line": " const buffer = dcodeIO.ByteBuffer.wrap(ciphertext);", - "lineNumber": 833, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "libtextsecure/message_receiver.js", - "line": " const buffer = dcodeIO.ByteBuffer.wrap(ciphertext);", - "lineNumber": 858, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js", - "line": " function wrap(innerFn, outerFn, self, tryLocsList) {", - "lineNumber": 36, - "reasonCategory": "falseMatch", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js", - "line": " wrap(innerFn, outerFn, self, tryLocsList)", - "lineNumber": 228, - "reasonCategory": "falseMatch", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "eval", - "path": "node_modules/@protobufjs/inquire/index.js", - "line": " var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval", - "lineNumber": 12, - "reasonCategory": "usageTrusted", - "updated": "2018-09-18T19:19:27.699Z", - "reasonDetail": "What's being eval'd is a static string" - }, - { - "rule": "DOM-innerHTML", - "path": "node_modules/@sindresorhus/is/dist/index.js", - "line": " 'innerHTML',", - "lineNumber": 158, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "DOM-innerHTML", - "path": "node_modules/@sindresorhus/is/dist/source/index.js", - "line": " 'innerHTML',", - "lineNumber": 133, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "DOM-innerHTML", - "path": "node_modules/@sinonjs/formatio/lib/formatio.js", - "line": " // SVG elements have undefined innerHTML", - "lineNumber": 204, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/archiver/lib/core.js", - "line": " this._module.append(source, data, function(err) {", - "lineNumber": 179, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/archiver/lib/plugins/tar.js", - "line": " function append(err, sourceBuffer) {", - "lineNumber": 68, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/archiver/lib/plugins/tar.js", - "line": " append(null, source);", - "lineNumber": 80, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/archiver/node_modules/async/dist/async.js", - "line": "function wrap(defer) {", - "lineNumber": 62, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/archiver/node_modules/async/dist/async.js", - "line": "var setImmediate$1 = wrap(_defer);", - "lineNumber": 81, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-insertBefore(", - "path": "node_modules/archiver/node_modules/async/dist/async.js", - "line": " if (this.head) this.insertBefore(this.head, node);", - "lineNumber": 2151, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-insertAfter(", - "path": "node_modules/archiver/node_modules/async/dist/async.js", - "line": " if (this.tail) this.insertAfter(this.tail, node);", - "lineNumber": 2156, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/archiver/node_modules/async/dist/async.js", - "line": "var nextTick = wrap(_defer$1);", - "lineNumber": 3823, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-insertBefore(", - "path": "node_modules/archiver/node_modules/async/dist/async.js", - "line": " q._tasks.insertBefore(nextNode, item);", - "lineNumber": 4107, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/archiver/node_modules/async/dist/async.min.js", - "lineNumber": 1, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-insertAfter(", - "path": "node_modules/archiver/node_modules/async/dist/async.min.js", - "lineNumber": 1, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-insertBefore(", - "path": "node_modules/archiver/node_modules/async/dist/async.min.js", - "lineNumber": 1, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-insertBefore(", - "path": "node_modules/archiver/node_modules/async/internal/DoublyLinkedList.js", - "line": " if (this.head) this.insertBefore(this.head, node);else setInitial(this, node);", - "lineNumber": 52, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-insertAfter(", - "path": "node_modules/archiver/node_modules/async/internal/DoublyLinkedList.js", - "line": " if (this.tail) this.insertAfter(this.tail, node);else setInitial(this, node);", - "lineNumber": 56, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/archiver/node_modules/async/internal/setImmediate.js", - "line": "function wrap(defer) {", - "lineNumber": 23, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/archiver/node_modules/async/internal/setImmediate.js", - "line": "exports.default = wrap(_defer);", - "lineNumber": 42, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-insertBefore(", - "path": "node_modules/archiver/node_modules/async/priorityQueue.js", - "line": " q._tasks.insertBefore(nextNode, item);", - "lineNumber": 42, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-insertBefore(", - "path": "node_modules/ast-types/lib/path.js", - "line": " Pp.insertBefore = function insertBefore(node) {", - "lineNumber": 232, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-insertAfter(", - "path": "node_modules/ast-types/lib/path.js", - "line": " Pp.insertAfter = function insertAfter(node) {", - "lineNumber": 242, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/backbone/backbone-min.js", - "lineNumber": 1, - "reasonCategory": "ruleNeeded", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Need a rule for setElement, which contains this" - }, - { - "rule": "jQuery-insertBefore(", - "path": "node_modules/backbone/backbone-min.js", - "lineNumber": 1, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Part of backbone's browser history API" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/backbone/backbone.js", - "line": " this.$el = el instanceof Backbone.$ ? el : Backbone.$(el);", - "lineNumber": 1286, - "reasonCategory": "ruleNeeded", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Need a rule for setElement, which contains this" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/backbone/backbone.js", - "line": " // If `this.el` is a string, pass it through `$()`, take the first", - "lineNumber": 1347, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-insertBefore(", - "path": "node_modules/backbone/backbone.js", - "line": " var iWindow = body.insertBefore(this.iframe, body.firstChild).contentWindow;", - "lineNumber": 1707, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Part of backbone's browser history API" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/bl/bl.js", - "line": " this.append(callback)", - "lineNumber": 29, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/bl/bl.js", - "line": " this.append(buf[i])", - "lineNumber": 58, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/bl/bl.js", - "line": " this.append(buf._bufs[i])", - "lineNumber": 62, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/bl/bl.js", - "line": " copy.append(this._bufs[i])", - "lineNumber": 239, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/blob-util/dist/blob-util.js", - "line": " bb.append(ary[i]);", - "lineNumber": 79, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/blob-util/dist/blob-util.min.js", - "lineNumber": 1, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/blob/index.js", - "line": " bb.append(ary[i]);", - "lineNumber": 77, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/blueimp-canvas-to-blob/js/canvas-to-blob.js", - "line": " bb.append(arrayBuffer)", - "lineNumber": 93, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/blueimp-canvas-to-blob/js/canvas-to-blob.min.js", - "lineNumber": 1, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/boom/lib/index.js", - "line": " error = exports.wrap(data, statusCode, message);", - "lineNumber": 279, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/bunyan/node_modules/moment/min/locales.min.js", - "lineNumber": 75, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/bunyan/node_modules/moment/min/moment-with-locales.min.js", - "lineNumber": 1, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/bunyan/node_modules/moment/min/moment.min.js", - "lineNumber": 6, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.core.js", - "line": "function nodebackForPromise(promise, multiArgs) {", - "lineNumber": 2099, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.core.js", - "line": " } else if (!multiArgs) {", - "lineNumber": 2106, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.core.js", - "line": " var multiArgs = arguments.length > 1 ? !!Object(arguments[1]).multiArgs", - "lineNumber": 2296, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.core.js", - "line": " var result = tryCatch(fn)(nodebackForPromise(ret, multiArgs));", - "lineNumber": 2298, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "bluebird-toFastProperties", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.core.js", - "line": " util.toFastProperties(Promise); ", - "lineNumber": 2856, - "reasonCategory": "usageTrusted", - "updated": "2019-03-22T19:15:12.445Z", - "reasonDetail": "Promise is a known global" - }, - { - "rule": "bluebird-toFastProperties", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.core.js", - "line": "function toFastProperties(obj) {", - "lineNumber": 3592, - "reasonCategory": "usageTrusted", - "updated": "2019-03-22T19:15:12.445Z", - "reasonDetail": "Declaring a dangerous function" - }, - { - "rule": "eval", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.core.js", - "line": " eval(obj);", - "lineNumber": 3599, - "reasonCategory": "ruleNeeded", - "updated": "2019-03-22T19:00:07.131Z", - "reasonDetail": "his is run on whatever is provided to toFastProperties()" - }, - { - "rule": "bluebird-toFastProperties", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.core.js", - "line": " toFastProperties: toFastProperties,", - "lineNumber": 3752, - "reasonCategory": "falseMatch|testCode|exampleCode|otherUtilityCode|regexMatchedSafeCode|notExercisedByOurApp|ruleNeeded|usageTrusted", - "updated": "2019-03-22T19:15:12.445Z", - "reasonDetail": "Exposing a dangerous function" - }, - { - "rule": "bluebird-toFastProperties", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.core.js", - "line": "if (ret.isNode) ret.toFastProperties(process);", - "lineNumber": 3775, - "reasonCategory": "falseMatch|testCode|exampleCode|otherUtilityCode|regexMatchedSafeCode|notExercisedByOurApp|ruleNeeded|usageTrusted", - "updated": "2019-03-22T19:15:12.445Z", - "reasonDetail": "process is a known global" - }, - { - "rule": "bluebird-toFastProperties", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.core.min.js", - "lineNumber": 31, - "reasonCategory": "usageTrusted", - "updated": "2019-03-22T19:15:12.445Z", - "reasonDetail": "" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.core.min.js", - "lineNumber": 31, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": " var spawn = new PromiseSpawn$(undefined, undefined, yieldHandler,", - "lineNumber": 2228, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": " this.constructor$(promises);", - "lineNumber": 2441, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": " this._init$(undefined, -2);", - "lineNumber": 2456, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": "function nodebackForPromise(promise, multiArgs) {", - "lineNumber": 2687, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": " } else if (!multiArgs) {", - "lineNumber": 2694, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": " var multiArgs = arguments.length > 1 ? !!Object(arguments[1]).multiArgs", - "lineNumber": 2944, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": " var result = tryCatch(fn)(nodebackForPromise(ret, multiArgs));", - "lineNumber": 2946, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "bluebird-toFastProperties", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": " util.toFastProperties(Promise); ", - "lineNumber": 3519, - "reasonCategory": "usageTrusted", - "updated": "2019-03-22T19:15:12.445Z", - "reasonDetail": "" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": "function(callback, receiver, originalName, fn, _, multiArgs) {", - "lineNumber": 3846, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": " var nodeback = nodebackForPromise(promise, \" + multiArgs + \"); \\n\\", - "lineNumber": 3897, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": "function makeNodePromisifiedClosure(callback, receiver, _, fn, __, multiArgs) {", - "lineNumber": 3938, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": " var fn = nodebackForPromise(promise, multiArgs);", - "lineNumber": 3951, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": "function promisifyAll(obj, suffix, filter, promisifier, multiArgs) {", - "lineNumber": 3968, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": " makeNodePromisified(key, THIS, key, fn, suffix, multiArgs);", - "lineNumber": 3979, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": " fn, suffix, multiArgs);", - "lineNumber": 3983, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "bluebird-toFastProperties", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": " util.toFastProperties(obj);", - "lineNumber": 3989, - "reasonCategory": "usageTrusted", - "updated": "2019-03-22T19:15:12.445Z", - "reasonDetail": "promisifyAll calls toFastProperties() but is limited to function or object" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": "function promisify(callback, receiver, multiArgs) {", - "lineNumber": 3993, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": " callback, null, multiArgs);", - "lineNumber": 3995, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": " var multiArgs = !!options.multiArgs;", - "lineNumber": 4007, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": " var ret = promisify(fn, receiver, multiArgs);", - "lineNumber": 4008, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": " var multiArgs = !!options.multiArgs;", - "lineNumber": 4018, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": " multiArgs);", - "lineNumber": 4036, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": " promisifyAll(value, suffix, filter, promisifier, multiArgs);", - "lineNumber": 4037, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": " return promisifyAll(target, suffix, filter, promisifier, multiArgs);", - "lineNumber": 4041, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": " this.constructor$(entries);", - "lineNumber": 4102, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": " this._init$(undefined, isMap ? -6 : -3);", - "lineNumber": 4104, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": " this.constructor$(promises);", - "lineNumber": 4305, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": " this._init$(undefined, -5);", - "lineNumber": 4322, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": " this._resultCancelled$();", - "lineNumber": 4360, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": " this.constructor$(values);", - "lineNumber": 4537, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": " this.constructor$(values);", - "lineNumber": 4586, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": " this._init$(undefined, -5);", - "lineNumber": 4601, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": " this.constructor$(fn, promise, context);", - "lineNumber": 5104, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "bluebird-toFastProperties", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": "function toFastProperties(obj) {", - "lineNumber": 5434, - "reasonCategory": "usageTrusted", - "updated": "2019-03-22T19:15:12.445Z", - "reasonDetail": "Declaring a dangerous function" - }, - { - "rule": "eval", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": " eval(obj);", - "lineNumber": 5441, - "reasonCategory": "ruleNeeded", - "updated": "2019-03-22T19:00:07.131Z", - "reasonDetail": "This is run on whatever is provided to toFastProperties()" - }, - { - "rule": "bluebird-toFastProperties", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": " toFastProperties: toFastProperties,", - "lineNumber": 5594, - "reasonCategory": "usageTrusted", - "updated": "2019-03-22T19:15:12.445Z", - "reasonDetail": "Exposing a dangerous function" - }, - { - "rule": "bluebird-toFastProperties", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.js", - "line": "if (ret.isNode) ret.toFastProperties(process);", - "lineNumber": 5617, - "reasonCategory": "usageTrusted", - "updated": "2019-03-22T19:15:12.445Z", - "reasonDetail": "process is a known global" - }, - { - "rule": "bluebird-toFastProperties", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.min.js", - "lineNumber": 30, - "reasonCategory": "usageTrusted", - "updated": "2019-03-22T19:15:12.445Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.min.js", - "lineNumber": 30, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.min.js", - "lineNumber": 30, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/cacache/node_modules/bluebird/js/browser/bluebird.min.js", - "lineNumber": 31, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/cacache/node_modules/bluebird/js/release/assert.js", - "line": " this.constructor$(a);", - "lineNumber": 5, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/cacache/node_modules/bluebird/js/release/generators.js", - "line": " var spawn = new PromiseSpawn$(undefined, undefined, yieldHandler,", - "lineNumber": 197, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/cacache/node_modules/bluebird/js/release/map.js", - "line": " this.constructor$(promises);", - "lineNumber": 15, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/cacache/node_modules/bluebird/js/release/map.js", - "line": " this._init$(undefined, -2);", - "lineNumber": 30, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/release/nodeback.js", - "line": "function nodebackForPromise(promise, multiArgs) {", - "lineNumber": 34, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/release/nodeback.js", - "line": " } else if (!multiArgs) {", - "lineNumber": 41, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/release/promise.js", - "line": " var multiArgs = arguments.length > 1 ? !!Object(arguments[1]).multiArgs", - "lineNumber": 178, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/release/promise.js", - "line": " var result = tryCatch(fn)(nodebackForPromise(ret, multiArgs));", - "lineNumber": 180, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "bluebird-toFastProperties", - "path": "node_modules/cacache/node_modules/bluebird/js/release/promise.js", - "line": " util.toFastProperties(Promise); ", - "lineNumber": 753, - "reasonCategory": "usageTrusted", - "updated": "2019-03-22T19:15:12.445Z", - "reasonDetail": "Promise is a known global" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/release/promisify.js", - "line": "function(callback, receiver, originalName, fn, _, multiArgs) {", - "lineNumber": 116, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/release/promisify.js", - "line": " var nodeback = nodebackForPromise(promise, \" + multiArgs + \"); \\n\\", - "lineNumber": 167, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/release/promisify.js", - "line": "function makeNodePromisifiedClosure(callback, receiver, _, fn, __, multiArgs) {", - "lineNumber": 208, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/release/promisify.js", - "line": " var fn = nodebackForPromise(promise, multiArgs);", - "lineNumber": 221, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/release/promisify.js", - "line": "function promisifyAll(obj, suffix, filter, promisifier, multiArgs) {", - "lineNumber": 238, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/release/promisify.js", - "line": " makeNodePromisified(key, THIS, key, fn, suffix, multiArgs);", - "lineNumber": 249, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/release/promisify.js", - "line": " fn, suffix, multiArgs);", - "lineNumber": 253, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "bluebird-toFastProperties", - "path": "node_modules/cacache/node_modules/bluebird/js/release/promisify.js", - "line": " util.toFastProperties(obj);", - "lineNumber": 259, - "reasonCategory": "usageTrusted", - "updated": "2019-03-22T19:15:12.445Z", - "reasonDetail": "promisifyAll calls toFastProperties() but is limited to function or object" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/release/promisify.js", - "line": "function promisify(callback, receiver, multiArgs) {", - "lineNumber": 263, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/release/promisify.js", - "line": " callback, null, multiArgs);", - "lineNumber": 265, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/release/promisify.js", - "line": " var multiArgs = !!options.multiArgs;", - "lineNumber": 277, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/release/promisify.js", - "line": " var ret = promisify(fn, receiver, multiArgs);", - "lineNumber": 278, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/release/promisify.js", - "line": " var multiArgs = !!options.multiArgs;", - "lineNumber": 288, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/release/promisify.js", - "line": " multiArgs);", - "lineNumber": 306, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/release/promisify.js", - "line": " promisifyAll(value, suffix, filter, promisifier, multiArgs);", - "lineNumber": 307, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/cacache/node_modules/bluebird/js/release/promisify.js", - "line": " return promisifyAll(target, suffix, filter, promisifier, multiArgs);", - "lineNumber": 311, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/cacache/node_modules/bluebird/js/release/props.js", - "line": " this.constructor$(entries);", - "lineNumber": 56, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/cacache/node_modules/bluebird/js/release/props.js", - "line": " this._init$(undefined, isMap ? -6 : -3);", - "lineNumber": 58, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/cacache/node_modules/bluebird/js/release/reduce.js", - "line": " this.constructor$(promises);", - "lineNumber": 13, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/cacache/node_modules/bluebird/js/release/reduce.js", - "line": " this._init$(undefined, -5);", - "lineNumber": 30, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/cacache/node_modules/bluebird/js/release/reduce.js", - "line": " this._resultCancelled$();", - "lineNumber": 68, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/cacache/node_modules/bluebird/js/release/settle.js", - "line": " this.constructor$(values);", - "lineNumber": 8, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/cacache/node_modules/bluebird/js/release/some.js", - "line": " this.constructor$(values);", - "lineNumber": 12, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/cacache/node_modules/bluebird/js/release/some.js", - "line": " this._init$(undefined, -5);", - "lineNumber": 27, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/cacache/node_modules/bluebird/js/release/using.js", - "line": " this.constructor$(fn, promise, context);", - "lineNumber": 92, - "reasonCategory": "falseMatch", - "updated": "2019-03-22T19:00:07.131Z" - }, - { - "rule": "bluebird-toFastProperties", - "path": "node_modules/cacache/node_modules/bluebird/js/release/util.js", - "line": "function toFastProperties(obj) {", - "lineNumber": 194, - "reasonCategory": "usageTrusted", - "updated": "2019-03-22T19:15:12.445Z", - "reasonDetail": "Declaring a dangerous function" - }, - { - "rule": "eval", - "path": "node_modules/cacache/node_modules/bluebird/js/release/util.js", - "line": " eval(obj);", - "lineNumber": 201, - "reasonCategory": "ruleNeeded", - "updated": "2019-03-22T19:00:07.131Z", - "reasonDetail": "This is run on whatever is provided to toFastProperties()" - }, - { - "rule": "bluebird-toFastProperties", - "path": "node_modules/cacache/node_modules/bluebird/js/release/util.js", - "line": " toFastProperties: toFastProperties,", - "lineNumber": 354, - "reasonCategory": "usageTrusted", - "updated": "2019-03-22T19:15:12.445Z", - "reasonDetail": "Declaring a dangerous function" - }, - { - "rule": "bluebird-toFastProperties", - "path": "node_modules/cacache/node_modules/bluebird/js/release/util.js", - "line": "if (ret.isNode) ret.toFastProperties(process);", - "lineNumber": 377, - "reasonCategory": "usageTrusted", - "updated": "2019-03-22T19:15:12.445Z", - "reasonDetail": "process is a known global" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/caching-transform/index.js", - "line": "function wrap(opts) {", - "lineNumber": 13, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/cliui/index.js", - "line": " if (_this.wrap) wrapped = wrap(col.text, _this._negatePadding(col), {hard: true}).split('\\n')", - "lineNumber": 212, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/config/lib/config.js", - "line": " configObject = Yaml.load(content);", - "lineNumber": 994, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "eval", - "path": "node_modules/config/lib/config.js", - "line": " configObject = VisionmediaYaml.eval(util.stripYamlComments(content));", - "lineNumber": 1000, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/core-js/build/index.js", - "line": " if (name.indexOf(ns + \".\") === 0 && !in$(name, experimental)) {", - "lineNumber": 36, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/core-js/build/index.js", - "line": " function in$(x, xs){", - "lineNumber": 99, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/core-js/client/core.js", - "line": "\t return wrap(tag);", - "lineNumber": 391, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/core-js/client/core.js", - "line": "\t return wrap(wks(name));", - "lineNumber": 408, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/core-js/client/core.js", - "line": "\t if(!NPCG)separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\\\s)', flags);", - "lineNumber": 3893, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/core-js/client/core.js", - "line": "\t setTimeout: wrap(global.setTimeout),", - "lineNumber": 7226, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/core-js/client/core.min.js", - "lineNumber": 8, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/core-js/client/library.js", - "line": "\t return wrap(tag);", - "lineNumber": 379, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/core-js/client/library.js", - "line": "\t return wrap(wks(name));", - "lineNumber": 396, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/core-js/client/library.js", - "line": "\t setTimeout: wrap(global.setTimeout),", - "lineNumber": 6749, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/core-js/client/library.min.js", - "lineNumber": 8, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/core-js/client/shim.js", - "line": "\t return wrap(tag);", - "lineNumber": 377, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/core-js/client/shim.js", - "line": "\t return wrap(wks(name));", - "lineNumber": 394, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/core-js/client/shim.js", - "line": "\t if(!NPCG)separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\\\s)', flags);", - "lineNumber": 3879, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/core-js/client/shim.js", - "line": "\t setTimeout: wrap(global.setTimeout),", - "lineNumber": 7212, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/core-js/client/shim.min.js", - "lineNumber": 8, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/core-js/library/modules/es6.symbol.js", - "line": " return wrap(tag);", - "lineNumber": 142, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/core-js/library/modules/es6.symbol.js", - "line": " return wrap(wks(name));", - "lineNumber": 159, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/core-js/library/modules/web.timers.js", - "line": " setTimeout: wrap(global.setTimeout),", - "lineNumber": 18, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/core-js/modules/es6.regexp.split.js", - "line": " if(!NPCG)separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\\\s)', flags);", - "lineNumber": 36, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/core-js/modules/es6.symbol.js", - "line": " return wrap(tag);", - "lineNumber": 142, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/core-js/modules/es6.symbol.js", - "line": " return wrap(wks(name));", - "lineNumber": 159, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/core-js/modules/web.timers.js", - "line": " setTimeout: wrap(global.setTimeout),", - "lineNumber": 18, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-prepend(", - "path": "node_modules/css/node_modules/source-map/lib/source-map/source-node.js", - "line": " this.prepend(aChunk[i]);", - "lineNumber": 199, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/csso/dist/csso-browser.js", - "lineNumber": 2, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-prepend(", - "path": "node_modules/csso/dist/csso-browser.js", - "lineNumber": 3, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-prepend(", - "path": "node_modules/csso/node_modules/source-map/dist/source-map.debug.js", - "line": "\t this.prepend(aChunk[i]);", - "lineNumber": 2836, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-prepend(", - "path": "node_modules/csso/node_modules/source-map/dist/source-map.js", - "line": "\t this.prepend(aChunk[i]);", - "lineNumber": 2836, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-prepend(", - "path": "node_modules/csso/node_modules/source-map/dist/source-map.min.js", - "lineNumber": 1, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-prepend(", - "path": "node_modules/csso/node_modules/source-map/lib/source-node.js", - "line": " this.prepend(aChunk[i]);", - "lineNumber": 194, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/debug/src/browser.js", - "line": "function load() {", - "lineNumber": 150, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/debug/src/browser.js", - "line": "exports.enable(load());", - "lineNumber": 168, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/debug/src/node.js", - "line": "function load() {", - "lineNumber": 154, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/debug/src/node.js", - "line": "exports.enable(load());", - "lineNumber": 246, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/decompress-zip/lib/extractors.js", - "line": " input.wrap(fs.createReadStream(zip.filename, {start: file._offset, end: file._offset + file.uncompressedSize - 1}));", - "lineNumber": 64, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/decompress-zip/lib/extractors.js", - "line": " input.wrap(fs.createReadStream(zip.filename, {start: file._offset}));", - "lineNumber": 92, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/decompress-zip/lib/extractors.js", - "line": " input.wrap(fs.createReadStream(path.resolve(parent, linkTo)));", - "lineNumber": 131, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "eval", - "path": "node_modules/depd/index.js", - "line": " var deprecatedfn = eval('(function (' + args + ') {\\n' +", - "lineNumber": 410, - "reasonCategory": "usageTrusted", - "updated": "2018-09-18T19:19:27.699Z", - "reasonDetail": "What's being eval'd is a static string, with one variable: args. Args is of the form arg1, arg2, generated programmatically." - }, - { - "rule": "jQuery-load(", - "path": "node_modules/dmg-builder/node_modules/debug/dist/debug.js", - "line": " createDebug.enable(createDebug.load());", - "lineNumber": 721, - "reasonCategory": "falseMatch", - "updated": "2019-04-06T00:07:44.427Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/dmg-builder/node_modules/debug/dist/debug.js", - "line": " function load() {", - "lineNumber": 855, - "reasonCategory": "falseMatch", - "updated": "2019-04-06T00:07:44.427Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/dmg-builder/node_modules/debug/src/browser.js", - "line": "function load() {", - "lineNumber": 211, - "reasonCategory": "falseMatch", - "updated": "2019-04-06T00:07:44.427Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/dmg-builder/node_modules/debug/src/common.js", - "line": "\tcreateDebug.enable(createDebug.load());", - "lineNumber": 261, - "reasonCategory": "falseMatch", - "updated": "2019-04-06T00:07:44.427Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/dmg-builder/node_modules/debug/src/node.js", - "line": "function load() {", - "lineNumber": 216, - "reasonCategory": "falseMatch", - "updated": "2019-04-06T00:07:44.427Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/dotenv-expand/lib/main.js", - "line": " var matches = env.match(/\\$([a-zA-Z0-9_]+)|\\${([a-zA-Z0-9_]+)}/g) || []", - "lineNumber": 5, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/duplexer3/index.js", - "line": " readable = (new stream.Readable(options)).wrap(readable);", - "lineNumber": 15, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/duplexify/index.js", - "line": " return new (stream.Readable)({objectMode:true, highWaterMark:16}).wrap(rs)", - "lineNumber": 31, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-prepend(", - "path": "node_modules/electron-context-menu/index.js", - "line": "\t\t\tconst result = options.prepend(props, win);", - "lineNumber": 122, - "reasonCategory": "falseMatch", - "updated": "2019-04-10T19:08:25.356Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/electron-context-menu/index.js", - "line": "\t\t\tconst result = options.append(props, win);", - "lineNumber": 130, - "reasonCategory": "falseMatch", - "updated": "2019-04-10T19:08:25.356Z" - }, - { - "rule": "eval", - "path": "node_modules/electron/electron.d.ts", - "line": " eval(code: string): void;", - "lineNumber": 2031, - "reasonCategory": "falseMatch", - "updated": "2019-02-22T01:08:09.603Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/electron/electron.d.ts", - "line": " append(menuItem: MenuItem): void;", - "lineNumber": 3433, - "reasonCategory": "falseMatch", - "updated": "2019-02-22T01:08:09.603Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/electron/node_modules/@types/node/globals.d.ts", - "line": " wrap(oldStream: ReadableStream): this;", - "lineNumber": 573, - "reasonCategory": "otherUtilityCode", - "updated": "2019-04-03T00:52:04.925Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/electron/node_modules/@types/node/globals.d.ts", - "line": " static wrap(code: string): string;", - "lineNumber": 976, - "reasonCategory": "otherUtilityCode", - "updated": "2019-04-03T00:52:04.925Z" - }, - { - "rule": "eval", - "path": "node_modules/electron/node_modules/@types/node/repl.d.ts", - "line": " * Default: an async wrapper for the JavaScript `eval()` function. An `eval` function can", - "lineNumber": 31, - "reasonCategory": "exampleCode", - "updated": "2019-04-03T00:52:04.925Z" - }, - { - "rule": "eval", - "path": "node_modules/electron/node_modules/@types/node/repl.d.ts", - "line": " * for the JavaScript `eval()` function.", - "lineNumber": 180, - "reasonCategory": "exampleCode", - "updated": "2019-04-03T00:52:04.925Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/electron/node_modules/@types/node/stream.d.ts", - "line": " wrap(oldStream: NodeJS.ReadableStream): this;", - "lineNumber": 32, - "reasonCategory": "otherUtilityCode", - "updated": "2019-04-03T00:52:04.925Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/electron/node_modules/@types/node/url.d.ts", - "line": " append(name: string, value: string): void;", - "lineNumber": 90, - "reasonCategory": "otherUtilityCode", - "updated": "2019-04-03T00:52:04.925Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/emoji-js/lib/jquery.emoji.js", - "line": "\t\t$(this).html(function (i, oldHtml){", - "lineNumber": 5, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-html(", - "path": "node_modules/emoji-js/lib/jquery.emoji.js", - "line": "\t\t$(this).html(function (i, oldHtml){", - "lineNumber": 5, - "reasonCategory": "usageTrusted", - "updated": "2018-09-18T19:19:27.699Z", - "reasonDetail": "It's setting the html of the element to the previous HTML, just with the emoji replaced" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/es6-promisify/dist/promisify.js", - "line": " * @param {bool} settings.multiArgs - Should multiple arguments be returned as an array?", - "lineNumber": 34, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:06:35.446Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/es6-promisify/dist/promisify.js", - "line": " var returnMultipleArguments = settings && settings.multiArgs;", - "lineNumber": 44, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:06:35.446Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/expand-range/node_modules/fill-range/index.js", - "line": " return wrap([origA, origB], sep, opts);", - "lineNumber": 178, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/expand-range/node_modules/fill-range/index.js", - "line": " return wrap(arr, sep, opts);", - "lineNumber": 224, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/expand-range/node_modules/fill-range/index.js", - "line": "function wrap(arr, sep, opts) {", - "lineNumber": 235, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/extglob/index.js", - "line": " o[id] = wrap(inner, prefix, opts.escape);", - "lineNumber": 85, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/extglob/index.js", - "line": "function wrap(inner, prefix, esc) {", - "lineNumber": 119, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "DOM-innerHTML", - "path": "node_modules/fbjs/lib/createNodesFromMarkup.js", - "line": " node.innerHTML = wrap[1] + markup + wrap[2];", - "lineNumber": 58, - "reasonCategory": "ruleNeeded", - "updated": "2018-09-18T19:19:27.699Z", - "reasonDetail": "Need a rule for createNodesFromMarkup" - }, - { - "rule": "DOM-innerHTML", - "path": "node_modules/fbjs/lib/createNodesFromMarkup.js", - "line": " node.innerHTML = markup;", - "lineNumber": 65, - "reasonCategory": "ruleNeeded", - "updated": "2018-09-18T19:19:27.699Z", - "reasonDetail": "Need a rule for createNodesFromMarkup" - }, - { - "rule": "DOM-innerHTML", - "path": "node_modules/fbjs/lib/getMarkupWrap.js", - "line": " * Some browsers cannot use `innerHTML` to render certain elements standalone,", - "lineNumber": 23, - "reasonCategory": "falseMatch", - "updated": "2018-09-18T19:19:27.699Z" - }, - { - "rule": "DOM-innerHTML", - "path": "node_modules/fbjs/lib/getMarkupWrap.js", - "line": " dummyNode.innerHTML = '';", - "lineNumber": 83, - "reasonCategory": "usageTrusted", - "updated": "2018-09-18T19:19:27.699Z", - "reasonDetail": "Hard-coded string" - }, - { - "rule": "DOM-innerHTML", - "path": "node_modules/fbjs/lib/getMarkupWrap.js", - "line": " dummyNode.innerHTML = '<' + nodeName + '>';", - "lineNumber": 85, - "reasonCategory": "usageTrusted", - "updated": "2018-09-18T19:19:27.699Z", - "reasonDetail": "nodeName is limited to set of safe tag names." - }, - { - "rule": "jQuery-$(", - "path": "node_modules/fbjs/node_modules/core-js/build/index.js", - "line": " if (name.indexOf(ns + \".\") === 0 && !in$(name, experimental)) {", - "lineNumber": 43, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/fbjs/node_modules/core-js/build/index.js", - "line": " function in$(x, xs){", - "lineNumber": 93, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/fbjs/node_modules/core-js/client/core.js", - "line": "\t return wrap(uid(arguments.length > 0 ? arguments[0] : undefined));", - "lineNumber": 1082, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/fbjs/node_modules/core-js/client/core.js", - "line": "\t symbolStatics[it] = useNative ? sym : wrap(sym);", - "lineNumber": 1135, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/fbjs/node_modules/core-js/client/core.js", - "line": "\t setTimeout: wrap(global.setTimeout),", - "lineNumber": 4496, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/fbjs/node_modules/core-js/client/library.js", - "line": "\t return wrap(uid(arguments.length > 0 ? arguments[0] : undefined));", - "lineNumber": 1033, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/fbjs/node_modules/core-js/client/library.js", - "line": "\t symbolStatics[it] = useNative ? sym : wrap(sym);", - "lineNumber": 1086, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/fbjs/node_modules/core-js/client/library.js", - "line": "\t setTimeout: wrap(global.setTimeout),", - "lineNumber": 4136, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/fbjs/node_modules/core-js/client/shim.js", - "line": "\t return wrap(uid(arguments.length > 0 ? arguments[0] : undefined));", - "lineNumber": 1068, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/fbjs/node_modules/core-js/client/shim.js", - "line": "\t symbolStatics[it] = useNative ? sym : wrap(sym);", - "lineNumber": 1121, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/fbjs/node_modules/core-js/client/shim.js", - "line": "\t setTimeout: wrap(global.setTimeout),", - "lineNumber": 4482, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/fbjs/node_modules/core-js/library/modules/es6.symbol.js", - "line": " return wrap(uid(arguments.length > 0 ? arguments[0] : undefined));", - "lineNumber": 142, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/fbjs/node_modules/core-js/library/modules/es6.symbol.js", - "line": " symbolStatics[it] = useNative ? sym : wrap(sym);", - "lineNumber": 195, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/fbjs/node_modules/core-js/library/modules/web.timers.js", - "line": " setTimeout: wrap(global.setTimeout),", - "lineNumber": 18, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/fbjs/node_modules/core-js/modules/es6.symbol.js", - "line": " return wrap(uid(arguments.length > 0 ? arguments[0] : undefined));", - "lineNumber": 142, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/fbjs/node_modules/core-js/modules/es6.symbol.js", - "line": " symbolStatics[it] = useNative ? sym : wrap(sym);", - "lineNumber": 195, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/fbjs/node_modules/core-js/modules/web.timers.js", - "line": " setTimeout: wrap(global.setTimeout),", - "lineNumber": 18, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/file-entry-cache/cache.js", - "line": " var cache = flatCache.load( cacheId, _path );", - "lineNumber": 13, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/flat-cache/cache.js", - "line": " me.load( fName, dir );", - "lineNumber": 39, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/flat-cache/cache.js", - "line": " obj.load( docId, cacheDir );", - "lineNumber": 167, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/flat-cache/node_modules/pify/index.js", - "line": "\t\t\t\t} else if (opts.multiArgs) {", - "lineNumber": 16, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:06:35.446Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/form-data/lib/form_data.js", - "line": " append(header);", - "lineNumber": 73, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/form-data/lib/form_data.js", - "line": " append(footer);", - "lineNumber": 75, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/get-uri/node_modules/debug/src/browser.js", - "line": "function load() {", - "lineNumber": 150, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T18:02:26.186Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/get-uri/node_modules/debug/src/browser.js", - "line": "exports.enable(load());", - "lineNumber": 168, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T18:02:26.186Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/get-uri/node_modules/debug/src/node.js", - "line": "function load() {", - "lineNumber": 156, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T18:02:26.186Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/get-uri/node_modules/debug/src/node.js", - "line": "exports.enable(load());", - "lineNumber": 248, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T18:02:26.186Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/globby/node_modules/pify/index.js", - "line": "\t\t\t\t} else if (opts.multiArgs) {", - "lineNumber": 16, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:06:35.446Z" - }, - { - "rule": "eval", - "path": "node_modules/google-libphonenumber/dist/libphonenumber.js", - "line": " var a = !eval('\"use strict\";let x = 1; function f() { return typeof x; };f() == \"number\";');", - "lineNumber": 232, - "reasonCategory": "usageTrusted", - "updated": "2018-11-27T01:31:13.384Z", - "reasonDetail": "Hard-coded string used for testing capabilities." - }, - { - "rule": "eval", - "path": "node_modules/google-libphonenumber/dist/libphonenumber.js", - "line": " eval(a);", - "lineNumber": 267, - "reasonCategory": "notExercisedByOurApp", - "updated": "2018-11-27T01:31:13.384Z", - "reasonDetail": "Used to load dependencies; parent function loadModuleFromSource_ is used in one place only." - }, - { - "rule": "eval", - "path": "node_modules/google-libphonenumber/dist/libphonenumber.js", - "line": " eval(g + \"\\n//# sourceURL=\" + f);", - "lineNumber": 298, - "reasonCategory": "notExercisedByOurApp", - "updated": "2019-04-12T00:50:12.124Z", - "reasonDetail": "Used for google closure compiler transpilation scenarios" - }, - { - "rule": "eval", - "path": "node_modules/google-libphonenumber/dist/libphonenumber.js", - "line": " goog.global.eval(\"var _evalTest_ = 1;\");", - "lineNumber": 444, - "reasonCategory": "usageTrusted", - "updated": "2019-04-12T00:50:12.124Z", - "reasonDetail": "Hard-coded string used for testing capabilities" - }, - { - "rule": "eval", - "path": "node_modules/google-libphonenumber/dist/libphonenumber.js", - "line": " goog.global.eval(a);", - "lineNumber": 458, - "reasonCategory": "notExercisedByOurApp", - "updated": "2018-11-27T01:31:13.384Z", - "reasonDetail": "More transpilation logic" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/google-libphonenumber/dist/libphonenumber.js", - "line": " b && (a = a.replace(/\\{\\$([^}]+)}/g, function(a, d) {", - "lineNumber": 498, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T01:31:13.384Z" - }, - { - "rule": "eval", - "path": "node_modules/google-libphonenumber/dist/libphonenumber.js", - "line": " return !!eval(a);", - "lineNumber": 640, - "reasonCategory": "notExercisedByOurApp", - "updated": "2018-11-27T01:31:13.384Z", - "reasonDetail": "More transpilation logic" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/google-libphonenumber/dist/libphonenumber.js", - "line": " d.load(f);", - "lineNumber": 796, - "reasonCategory": "notExercisedByOurApp", - "updated": "2019-04-12T00:50:12.124Z", - "reasonDetail": "Part of their google closure 'debug loader'" - }, - { - "rule": "jQuery-globalEval(", - "path": "node_modules/google-libphonenumber/dist/libphonenumber.js", - "line": " goog.globalEval(c);", - "lineNumber": 991, - "reasonCategory": "notExercisedByOurApp", - "updated": "2019-04-12T00:50:12.124Z", - "reasonDetail": "Part of their google closure 'debug loader'" - }, - { - "rule": "DOM-innerHTML", - "path": "node_modules/google-libphonenumber/dist/libphonenumber.js", - "line": " e || (d.innerHTML = a + \" \", e = d.firstChild.nodeValue.slice(0, -1));", - "lineNumber": 2045, - "reasonCategory": "notExercisedByOurApp", - "updated": "2018-11-27T01:31:13.384Z", - "reasonDetail": "An odd technique of unescaping content by putting it into the dom" - }, - { - "rule": "DOM-innerHTML", - "path": "node_modules/got/node_modules/@sindresorhus/is/dist/index.js", - "line": " 'innerHTML',", - "lineNumber": 157, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "DOM-innerHTML", - "path": "node_modules/got/node_modules/@sindresorhus/is/dist/source/index.js", - "line": " 'innerHTML',", - "lineNumber": 133, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/http-proxy-agent/node_modules/debug/src/browser.js", - "line": "function load() {", - "lineNumber": 160, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T18:02:26.186Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/http-proxy-agent/node_modules/debug/src/browser.js", - "line": "exports.enable(load());", - "lineNumber": 178, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T18:02:26.186Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/http-proxy-agent/node_modules/debug/src/node.js", - "line": "function load() {", - "lineNumber": 162, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T18:02:26.186Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/http-proxy-agent/node_modules/debug/src/node.js", - "line": "exports.enable(load());", - "lineNumber": 186, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T18:02:26.186Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/https-proxy-agent/node_modules/debug/src/browser.js", - "line": "function load() {", - "lineNumber": 160, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T18:02:26.186Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/https-proxy-agent/node_modules/debug/src/browser.js", - "line": "exports.enable(load());", - "lineNumber": 178, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T18:02:26.186Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/https-proxy-agent/node_modules/debug/src/node.js", - "line": "function load() {", - "lineNumber": 162, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T18:02:26.186Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/https-proxy-agent/node_modules/debug/src/node.js", - "line": "exports.enable(load());", - "lineNumber": 186, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T18:02:26.186Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " $(window).on(\"load\", function() {", - "lineNumber": 68, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " this.telInput = $(element);", - "lineNumber": 73, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " this.hadInitialPlaceholder = Boolean($(element).attr(\"placeholder\"));", - "lineNumber": 79, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " $(\"body\").addClass(\"iti-mobile\");", - "lineNumber": 97, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " this.telInput.wrap($(\"
\", {", - "lineNumber": 199, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " this.telInput.wrap($(\"
\", {", - "lineNumber": 199, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Making a div with constrained options" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " this.flagsContainer = $(\"
\", {", - "lineNumber": 202, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-insertBefore(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " }).insertBefore(this.telInput);", - "lineNumber": 204, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM elements" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " var selectedFlag = $(\"
\", {", - "lineNumber": 206, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-appendTo(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " selectedFlag.appendTo(this.flagsContainer);", - "lineNumber": 209, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM elements" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " this.selectedFlagInner = $(\"
\", {", - "lineNumber": 210, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-appendTo(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " }).appendTo(selectedFlag);", - "lineNumber": 212, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM elements" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " this.selectedDialCode = $(\"
\", {", - "lineNumber": 214, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-appendTo(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " }).appendTo(selectedFlag);", - "lineNumber": 216, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM elements" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " $(\"
\", {", - "lineNumber": 222, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-appendTo(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " }).appendTo(selectedFlag);", - "lineNumber": 224, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM elements" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " this.countryList = $(\"
    \", {", - "lineNumber": 226, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " $(\"
  • \", {", - "lineNumber": 231, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-appendTo(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " }).appendTo(this.countryList);", - "lineNumber": 233, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM elements" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " this.dropdown = $(\"
    \", {", - "lineNumber": 240, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " }).append(this.countryList);", - "lineNumber": 242, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM elements" - }, - { - "rule": "jQuery-appendTo(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " this.countryList.appendTo(this.flagsContainer);", - "lineNumber": 244, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM elements" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " this.countryListItems = $();", - "lineNumber": 248, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " this.hiddenInput = $(\"\", {", - "lineNumber": 251, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-insertBefore(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " }).insertBefore(this.telInput);", - "lineNumber": 254, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM elements" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " this.countryList.append(tmp);", - "lineNumber": 275, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "tmp raw HTML, but it is generated from country data" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " $(window).on(\"load\", function() {", - "lineNumber": 385, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " $(\".intl-tel-input input\").intlTelInput(\"handleAutoCountry\");", - "lineNumber": 417, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " $(form).on(\"submit\" + this.ns, function() {", - "lineNumber": 483, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-appendTo(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " this.dropdown.appendTo(this.options.dropdownContainer);", - "lineNumber": 526, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM elements" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " var pos = this.telInput.offset(), inputTop = pos.top, windowTop = $(window).scrollTop(), // dropdownFitsBelow = (dropdownBottom < windowBottom)", - "lineNumber": 531, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " dropdownFitsBelow = inputTop + this.telInput.outerHeight() + this.dropdownHeight < windowTop + $(window).height(), dropdownFitsAbove = inputTop - this.dropdownHeight > windowTop;", - "lineNumber": 532, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " $(window).on(\"scroll\" + this.ns, function() {", - "lineNumber": 545, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input - ns is a controlled string" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " that._highlightListItem($(this));", - "lineNumber": 557, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " that._selectListItem($(this));", - "lineNumber": 561, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " $(\"html\").on(\"click\" + this.ns, function(e) {", - "lineNumber": 567, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " $(document).on(\"keydown\" + this.ns, function(e) {", - "lineNumber": 578, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input - ns is a controlled string" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " $(document).off(this.ns);", - "lineNumber": 793, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " $(\"html\").off(this.ns);", - "lineNumber": 795, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " $(window).off(\"scroll\" + this.ns);", - "lineNumber": 801, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " $(form).off(this.ns);", - "lineNumber": 968, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-before(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " container.before(this.telInput).remove();", - "lineNumber": 975, - "reasonCategory": "usageTrusted", - "updated": "2018-09-18T19:19:27.699Z", - "reasonDetail": "Updating existing DOM elements" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.js", - "line": " $(\".intl-tel-input input\").intlTelInput(\"handleUtils\");", - "lineNumber": 1103, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.min.js", - "lineNumber": 7, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "See other exceptions for intl-tel-input" - }, - { - "rule": "jQuery-appendTo(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.min.js", - "lineNumber": 7, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "See other exceptions for intl-tel-input" - }, - { - "rule": "jQuery-before(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.min.js", - "lineNumber": 7, - "reasonCategory": "usageTrusted", - "updated": "2018-09-18T19:19:27.699Z", - "reasonDetail": "Updating existing DOM element" - }, - { - "rule": "jQuery-insertBefore(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.min.js", - "lineNumber": 7, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "See other exceptions for intl-tel-input" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/intl-tel-input/build/js/intlTelInput.min.js", - "lineNumber": 7, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "See other exceptions for intl-tel-input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": "$(window).on(\"load\", function() {", - "lineNumber": 54, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " this.telInput = $(element);", - "lineNumber": 61, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "The Plugin constructor is only called within jquery-bound functions, and given existing DOM elements" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " this.hadInitialPlaceholder = Boolean($(element).attr(\"placeholder\"));", - "lineNumber": 71, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "The Plugin constructor is only called within jquery-bound functions, and given existing DOM elements" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " $(\"body\").addClass(\"iti-mobile\");", - "lineNumber": 95, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " this.telInput.wrap($(\"
    \", {", - "lineNumber": 225, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " this.telInput.wrap($(\"
    \", {", - "lineNumber": 225, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Making a div with constrained options" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " this.flagsContainer = $(\"
    \", {", - "lineNumber": 229, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-insertBefore(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " }).insertBefore(this.telInput);", - "lineNumber": 231, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM elements" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " var selectedFlag = $(\"
    \", {", - "lineNumber": 234, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-appendTo(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " selectedFlag.appendTo(this.flagsContainer);", - "lineNumber": 237, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM elements" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " this.selectedFlagInner = $(\"
    \", {", - "lineNumber": 238, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-appendTo(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " }).appendTo(selectedFlag);", - "lineNumber": 240, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM elements" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " this.selectedDialCode = $(\"
    \", {", - "lineNumber": 243, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-appendTo(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " }).appendTo(selectedFlag);", - "lineNumber": 245, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM elements" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " $(\"
    \", {", - "lineNumber": 252, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-appendTo(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " }).appendTo(selectedFlag);", - "lineNumber": 254, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM elements" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " this.countryList = $(\"
      \", {", - "lineNumber": 257, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " $(\"
    • \", {", - "lineNumber": 262, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-appendTo(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " }).appendTo(this.countryList);", - "lineNumber": 264, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM elements" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " this.dropdown = $(\"
      \", {", - "lineNumber": 273, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " }).append(this.countryList);", - "lineNumber": 275, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM elements" - }, - { - "rule": "jQuery-appendTo(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " this.countryList.appendTo(this.flagsContainer);", - "lineNumber": 277, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM elements" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " this.countryListItems = $();", - "lineNumber": 281, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " this.hiddenInput = $(\"\", {", - "lineNumber": 285, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-insertBefore(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " }).insertBefore(this.telInput);", - "lineNumber": 288, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM elements" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " this.countryList.append(tmp);", - "lineNumber": 311, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "tmp raw HTML, but it is generated from country data" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " $(window).on(\"load\", function() {", - "lineNumber": 449, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " $(\".intl-tel-input input\").intlTelInput(\"handleAutoCountry\");", - "lineNumber": 486, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " $(form).on(\"submit\" + this.ns, function () {", - "lineNumber": 564, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-appendTo(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " this.dropdown.appendTo(this.options.dropdownContainer);", - "lineNumber": 623, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM elements" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " windowTop = $(window).scrollTop(),", - "lineNumber": 632, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " dropdownFitsBelow = (inputTop + this.telInput.outerHeight() + this.dropdownHeight < windowTop + $(window).height()),", - "lineNumber": 634, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " $(window).on(\"scroll\" + this.ns, function() {", - "lineNumber": 652, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " that._highlightListItem($(this));", - "lineNumber": 667, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " that._selectListItem($(this));", - "lineNumber": 672, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " $(\"html\").on(\"click\" + this.ns, function(e) {", - "lineNumber": 679, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " $(document).on(\"keydown\" + this.ns, function(e) {", - "lineNumber": 692, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " $(document).off(this.ns);", - "lineNumber": 961, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " $(\"html\").off(this.ns);", - "lineNumber": 963, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " $(window).off(\"scroll\" + this.ns);", - "lineNumber": 969, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " $(form).off(this.ns);", - "lineNumber": 1180, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-before(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " container.before(this.telInput).remove();", - "lineNumber": 1189, - "reasonCategory": "usageTrusted", - "updated": "2018-09-18T19:19:27.699Z", - "reasonDetail": "Updating existing DOM element" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/js/intlTelInput.js", - "line": " $(\".intl-tel-input input\").intlTelInput(\"handleUtils\");", - "lineNumber": 1354, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/spec/helpers/helpers.js", - "line": " $(\"body\").trigger(getKeyEvent(key, \"keydown\"));", - "lineNumber": 119, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/intl-tel-input/src/spec/helpers/helpers.js", - "line": " $(\"body\").trigger(getKeyEvent(key, \"keyup\"));", - "lineNumber": 121, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "DOM-document.write(", - "path": "node_modules/is-function/browser-test.js", - "line": " iframe.contentWindow.document.write([", - "lineNumber": 6020, - "reasonCategory": "testCode", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "DOM-document.write(", - "path": "node_modules/is-function/test.js", - "line": " iframe.contentWindow.document.write([", - "lineNumber": 31, - "reasonCategory": "testCode", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-before(", - "path": "node_modules/javascript-stringify/javascript-stringify.js", - "line": " return before(value, function (value, space, next) {", - "lineNumber": 354, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/jpeg-js/lib/decoder.js", - "line": " load: function load(path) {", - "lineNumber": 527, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/js-tokens/index.js", - "lineNumber": 10, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/js-yaml/dist/js-yaml.js", - "line": "function load(input, options) {", - "lineNumber": 2557, - "reasonCategory": "falseMatch", - "updated": "2019-04-03T00:52:04.925Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/js-yaml/dist/js-yaml.js", - "line": " return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));", - "lineNumber": 2580, - "reasonCategory": "falseMatch", - "updated": "2019-04-03T00:52:04.925Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/js-yaml/dist/js-yaml.min.js", - "lineNumber": 1, - "reasonCategory": "falseMatch", - "updated": "2019-03-13T01:27:05.473Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/js-yaml/lib/js-yaml/loader.js", - "line": "function load(input, options) {", - "lineNumber": 1580, - "reasonCategory": "falseMatch", - "updated": "2019-04-03T00:52:04.925Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/js-yaml/lib/js-yaml/loader.js", - "line": " return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));", - "lineNumber": 1603, - "reasonCategory": "falseMatch", - "updated": "2019-04-03T00:52:04.925Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/levn/lib/parse-string.js", - "line": " function not$(x){ return !x; }", - "lineNumber": 112, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/load-json-file/node_modules/pify/index.js", - "line": "\t\t\t\t} else if (opts.multiArgs) {", - "lineNumber": 16, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:06:35.446Z" - }, - { - "rule": "jQuery-after(", - "path": "node_modules/lodash-es/after.js", - "line": " * var done = _.after(saves.length, function() {", - "lineNumber": 21, - "reasonCategory": "falseMatch", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-after(", - "path": "node_modules/lodash-es/after.js", - "line": "function after(n, func) {", - "lineNumber": 30, - "reasonCategory": "falseMatch", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-before(", - "path": "node_modules/lodash-es/before.js", - "line": " * jQuery(element).on('click', _.before(5, addContactToList));", - "lineNumber": 20, - "reasonCategory": "exampleCode", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-before(", - "path": "node_modules/lodash-es/before.js", - "line": "function before(n, func) {", - "lineNumber": 23, - "reasonCategory": "falseMatch", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-before(", - "path": "node_modules/lodash-es/once.js", - "line": " return before(2, func);", - "lineNumber": 22, - "reasonCategory": "falseMatch", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-after(", - "path": "node_modules/lodash/after.js", - "line": " * var done = _.after(saves.length, function() {", - "lineNumber": 21, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-after(", - "path": "node_modules/lodash/after.js", - "line": "function after(n, func) {", - "lineNumber": 30, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-before(", - "path": "node_modules/lodash/before.js", - "line": " * jQuery(element).on('click', _.before(5, addContactToList));", - "lineNumber": 20, - "reasonCategory": "exampleCode", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-before(", - "path": "node_modules/lodash/before.js", - "line": "function before(n, func) {", - "lineNumber": 23, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-before(", - "path": "node_modules/lodash/core.js", - "line": " * jQuery(element).on('click', _.before(5, addContactToList));", - "lineNumber": 2228, - "reasonCategory": "exampleCode", - "updated": "2018-11-27T01:59:02.018Z" - }, - { - "rule": "jQuery-before(", - "path": "node_modules/lodash/core.js", - "line": " function before(n, func) {", - "lineNumber": 2231, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T01:59:02.018Z" - }, - { - "rule": "jQuery-before(", - "path": "node_modules/lodash/core.js", - "line": " return before(2, func);", - "lineNumber": 2381, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T01:59:02.018Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/lodash/core.min.js", - "lineNumber": 15, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-after(", - "path": "node_modules/lodash/lodash.js", - "line": " * var done = _.after(saves.length, function() {", - "lineNumber": 9983, - "reasonCategory": "exampleCode", - "updated": "2018-11-27T01:59:02.018Z" - }, - { - "rule": "jQuery-after(", - "path": "node_modules/lodash/lodash.js", - "line": " function after(n, func) {", - "lineNumber": 9992, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T01:59:02.018Z" - }, - { - "rule": "jQuery-before(", - "path": "node_modules/lodash/lodash.js", - "line": " * jQuery(element).on('click', _.before(5, addContactToList));", - "lineNumber": 10041, - "reasonCategory": "exampleCode", - "updated": "2018-11-27T01:59:02.018Z" - }, - { - "rule": "jQuery-before(", - "path": "node_modules/lodash/lodash.js", - "line": " function before(n, func) {", - "lineNumber": 10044, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T01:59:02.018Z" - }, - { - "rule": "jQuery-before(", - "path": "node_modules/lodash/lodash.js", - "line": " return before(2, func);", - "lineNumber": 10619, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T01:59:02.018Z" - }, - { - "rule": "jQuery-before(", - "path": "node_modules/lodash/once.js", - "line": " return before(2, func);", - "lineNumber": 22, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/make-dir/node_modules/pify/index.js", - "line": "\t\t\t\t} else if (opts.multiArgs) {", - "lineNumber": 16, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:06:35.446Z" - }, - { - "rule": "jQuery-before(", - "path": "node_modules/micromatch/node_modules/braces/index.js", - "line": " str = tokens.before(str, es6Regex());", - "lineNumber": 92, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/micromatch/node_modules/braces/index.js", - "line": " return braces(str.replace(outter, wrap(segs, '|')), opts);", - "lineNumber": 121, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/micromatch/node_modules/braces/index.js", - "line": " segs[0] = wrap(segs[0], '\\\\');", - "lineNumber": 126, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-after(", - "path": "node_modules/micromatch/node_modules/braces/index.js", - "line": " arr.push(es6 ? tokens.after(val) : val);", - "lineNumber": 150, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/micromatch/node_modules/braces/index.js", - "line": "function wrap(val, ch) {", - "lineNumber": 216, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "DOM-innerHTML", - "path": "node_modules/min-document/serialize.js", - "line": " } else if (elem.innerHTML) {", - "lineNumber": 36, - "reasonCategory": "usageTrusted", - "updated": "2018-09-15T00:38:04.183Z", - "reasonDetail": "Getting the value, not setting it" - }, - { - "rule": "DOM-innerHTML", - "path": "node_modules/min-document/serialize.js", - "line": " key !== \"textContent\" && key !== \"innerText\" && key !== \"namespaceURI\" && key !== \"innerHTML\"", - "lineNumber": 56, - "reasonCategory": "usageTrusted", - "updated": "2018-09-15T00:38:04.183Z", - "reasonDetail": "Getting the value, not setting it" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/needle/lib/multipart.js", - "line": " function append(data, filename) {", - "lineNumber": 42, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/needle/lib/multipart.js", - "line": " if (part.buffer) return append(part.buffer, filename);", - "lineNumber": 58, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/needle/lib/multipart.js", - "line": " append(data, filename);", - "lineNumber": 62, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/needle/lib/multipart.js", - "line": " append();", - "lineNumber": 77, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/needle/node_modules/debug/src/browser.js", - "line": "function load() {", - "lineNumber": 150, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T18:02:26.186Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/needle/node_modules/debug/src/browser.js", - "line": "exports.enable(load());", - "lineNumber": 168, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T18:02:26.186Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/needle/node_modules/debug/src/node.js", - "line": "function load() {", - "lineNumber": 156, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T18:02:26.186Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/needle/node_modules/debug/src/node.js", - "line": "exports.enable(load());", - "lineNumber": 248, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T18:02:26.186Z" - }, - { - "rule": "jQuery-insertBefore(", - "path": "node_modules/neo-async/async.js", - "line": " this.insertBefore(this.head, node);", - "lineNumber": 7761, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-insertBefore(", - "path": "node_modules/neo-async/async.js", - "line": " q._tasks.insertBefore(nextNode, item);", - "lineNumber": 8061, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/neo-async/async.min.js", - "lineNumber": 21, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/neo-async/async.min.js", - "lineNumber": 25, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-insertBefore(", - "path": "node_modules/neo-async/async.min.js", - "lineNumber": 66, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-insertBefore(", - "path": "node_modules/neo-async/async.min.js", - "lineNumber": 75, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/node-forge/dist/forge.all.min.js", - "lineNumber": 4, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/node-forge/dist/forge.min.js", - "lineNumber": 3, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/node-forge/dist/prime.worker.min.js", - "lineNumber": 1, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/optionator/lib/help.js", - "line": " return namesString + \"\" + typeSeparatorString + wrap(type).replace(/^\\s+/, '');", - "lineNumber": 32, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/optionator/lib/help.js", - "line": " ? \"\\n\" + preDescription + \"\\n\" + wrap(fullDescription)", - "lineNumber": 74, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/optionator/lib/help.js", - "line": " seperator = defaultString || descriptionString || exampleString ? \"\\n\" + repeatString$('=', pre.length) : '';", - "lineNumber": 79, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/optionator/lib/help.js", - "line": " initialSpace = repeatString$(' ', initialIndent);", - "lineNumber": 181, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/optionator/lib/help.js", - "line": " out(initialSpace + \"\" + pre + \"\\n\" + wrap(desc));", - "lineNumber": 196, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/optionator/lib/help.js", - "line": " out(initialSpace + \"\" + pad(pre, padAmount) + descriptionSeparator + wrap(desc).replace(/^\\s+/, ''));", - "lineNumber": 200, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/optionator/lib/help.js", - "line": " return str + \"\" + repeatString$(' ', padAmount > 0 ? padAmount : 0);", - "lineNumber": 222, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/optionator/lib/help.js", - "line": " function repeatString$(str, n){", - "lineNumber": 243, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/optionator/lib/index.js", - "line": " function fn$(it){", - "lineNumber": 159, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/optionator/lib/index.js", - "line": " import$(obj[name], val);", - "lineNumber": 211, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/optionator/lib/index.js", - "line": " function import$(obj, src){", - "lineNumber": 460, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/pac-proxy-agent/node_modules/debug/src/browser.js", - "line": "function load() {", - "lineNumber": 160, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T18:02:26.186Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/pac-proxy-agent/node_modules/debug/src/browser.js", - "line": "exports.enable(load());", - "lineNumber": 178, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T18:02:26.186Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/pac-proxy-agent/node_modules/debug/src/node.js", - "line": "function load() {", - "lineNumber": 162, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T18:02:26.186Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/pac-proxy-agent/node_modules/debug/src/node.js", - "line": "exports.enable(load());", - "lineNumber": 186, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T18:02:26.186Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/pac-resolver/index.js", - "line": " var resolver = co.wrap(fn);", - "lineNumber": 97, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/parse-json/index.js", - "line": "\tfileName: errorEx.append('in %s')", - "lineNumber": 6, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/path-type/node_modules/pify/index.js", - "line": "\t\t\t\t} else if (opts.multiArgs) {", - "lineNumber": 16, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:06:35.446Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/pify/index.js", - "line": "\t\t\t\tif (opts.multiArgs) {", - "lineNumber": 14, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:06:35.446Z" - }, - { - "rule": "thenify-multiArgs", - "path": "node_modules/pify/index.js", - "line": "\t\t\t\tif (opts.multiArgs) {", - "lineNumber": 35, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:06:35.446Z" - }, - { - "rule": "jQuery-insertBefore(", - "path": "node_modules/plist/dist/plist-parse.js", - "line": "\t\tthis.insertBefore(newChild,oldChild);", - "lineNumber": 2749, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-insertBefore(", - "path": "node_modules/plist/dist/plist-parse.js", - "line": "\t\treturn this.insertBefore(newChild,null);", - "lineNumber": 2758, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-insertBefore(", - "path": "node_modules/plist/dist/plist-parse.js", - "line": "\t\t\t\tthis.insertBefore(child,refChild);", - "lineNumber": 2995, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-insertBefore(", - "path": "node_modules/plist/dist/plist-parse.js", - "line": "\t\t\treturn this.insertBefore(newChild,null);", - "lineNumber": 3157, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-insertBefore(", - "path": "node_modules/plist/dist/plist-parse.js", - "line": "\t\t\tthis.parentNode.insertBefore(newNode, this.nextSibling);", - "lineNumber": 3273, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-insertBefore(", - "path": "node_modules/plist/dist/plist.js", - "line": "\t\tthis.insertBefore(newChild,oldChild);", - "lineNumber": 5476, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-insertBefore(", - "path": "node_modules/plist/dist/plist.js", - "line": "\t\treturn this.insertBefore(newChild,null);", - "lineNumber": 5485, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-insertBefore(", - "path": "node_modules/plist/dist/plist.js", - "line": "\t\t\t\tthis.insertBefore(child,refChild);", - "lineNumber": 5722, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-insertBefore(", - "path": "node_modules/plist/dist/plist.js", - "line": "\t\t\treturn this.insertBefore(newChild,null);", - "lineNumber": 5884, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-insertBefore(", - "path": "node_modules/plist/dist/plist.js", - "line": "\t\t\tthis.parentNode.insertBefore(newNode, this.nextSibling);", - "lineNumber": 6000, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/pluralize/pluralize.js", - "line": " return str.replace(/\\$(\\d{1,2})/g, function (match, index) {", - "lineNumber": 72, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/progress-stream/node_modules/through2/test.js", - "line": " bufs.append(crypto.randomBytes(10))", - "lineNumber": 55, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/progress-stream/node_modules/through2/test.js", - "line": " bufs.append(crypto.randomBytes(10))", - "lineNumber": 57, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "eval", - "path": "node_modules/protobufjs/dist/light/protobuf.js", - "line": " var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval", - "lineNumber": 878, - "reasonCategory": "usageTrusted", - "updated": "2019-03-09T00:08:44.242Z", - "reasonDetail": "Eval is used here to produce and evaluate the expression 'require'" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/dist/light/protobuf.js", - "line": "function load(filename, root, callback) {", - "lineNumber": 2185, - "reasonCategory": "falseMatch", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/dist/light/protobuf.js", - "line": " return root.load(filename, callback);", - "lineNumber": 2191, - "reasonCategory": "falseMatch", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/dist/light/protobuf.js", - "line": "// function load(filename:string, callback:LoadCallback):undefined", - "lineNumber": 2204, - "reasonCategory": "exampleCode", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/dist/light/protobuf.js", - "line": "// function load(filename:string, [root:Root]):Promise", - "lineNumber": 2216, - "reasonCategory": "exampleCode", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/dist/light/protobuf.js", - "line": "Root.prototype.load = function load(filename, options, callback) {", - "lineNumber": 4096, - "reasonCategory": "falseMatch", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/dist/light/protobuf.js", - "line": "// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined", - "lineNumber": 4223, - "reasonCategory": "exampleCode", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/dist/light/protobuf.js", - "line": "// function load(filename:string, callback:LoadCallback):undefined", - "lineNumber": 4233, - "reasonCategory": "exampleCode", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/dist/light/protobuf.js", - "line": "// function load(filename:string, [options:IParseOptions]):Promise", - "lineNumber": 4243, - "reasonCategory": "exampleCode", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/dist/light/protobuf.js", - "line": " return this.load(filename, options, SYNC);", - "lineNumber": 4256, - "reasonCategory": "falseMatch", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "eval", - "path": "node_modules/protobufjs/dist/light/protobuf.min.js", - "lineNumber": 7, - "reasonCategory": "usageTrusted", - "updated": "2018-09-18T19:19:27.699Z", - "reasonDetail": "Hard-coded string" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/dist/light/protobuf.min.js", - "lineNumber": 7, - "reasonCategory": "falseMatch", - "updated": "2018-09-18T19:19:27.699Z" - }, - { - "rule": "eval", - "path": "node_modules/protobufjs/dist/minimal/protobuf.js", - "line": " var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval", - "lineNumber": 660, - "reasonCategory": "usageTrusted", - "updated": "2019-03-09T00:08:44.242Z", - "reasonDetail": "Eval is used here to produce and evaluate the expression 'require'" - }, - { - "rule": "eval", - "path": "node_modules/protobufjs/dist/minimal/protobuf.min.js", - "lineNumber": 7, - "reasonCategory": "falseMatch", - "updated": "2018-09-18T19:19:27.699Z", - "reasonDetail": "Inside of regular expression" - }, - { - "rule": "eval", - "path": "node_modules/protobufjs/dist/protobuf.js", - "line": " var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval", - "lineNumber": 878, - "reasonCategory": "usageTrusted", - "updated": "2019-03-09T00:08:44.242Z", - "reasonDetail": "Eval is used here to produce and evaluate the expression 'require'" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/dist/protobuf.js", - "line": "function load(filename, root, callback) {", - "lineNumber": 2586, - "reasonCategory": "falseMatch", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/dist/protobuf.js", - "line": " return root.load(filename, callback);", - "lineNumber": 2592, - "reasonCategory": "falseMatch", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/dist/protobuf.js", - "line": "// function load(filename:string, callback:LoadCallback):undefined", - "lineNumber": 2605, - "reasonCategory": "exampleCode", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/dist/protobuf.js", - "line": "// function load(filename:string, [root:Root]):Promise", - "lineNumber": 2617, - "reasonCategory": "exampleCode", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/dist/protobuf.js", - "line": "Root.prototype.load = function load(filename, options, callback) {", - "lineNumber": 5270, - "reasonCategory": "falseMatch", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/dist/protobuf.js", - "line": "// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined", - "lineNumber": 5397, - "reasonCategory": "exampleCode", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/dist/protobuf.js", - "line": "// function load(filename:string, callback:LoadCallback):undefined", - "lineNumber": 5407, - "reasonCategory": "exampleCode", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/dist/protobuf.js", - "line": "// function load(filename:string, [options:IParseOptions]):Promise", - "lineNumber": 5417, - "reasonCategory": "exampleCode", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/dist/protobuf.js", - "line": " return this.load(filename, options, SYNC);", - "lineNumber": 5430, - "reasonCategory": "falseMatch", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "eval", - "path": "node_modules/protobufjs/dist/protobuf.min.js", - "lineNumber": 7, - "reasonCategory": "usageTrusted", - "updated": "2018-09-18T19:19:27.699Z", - "reasonDetail": "Hard-coded string" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/protobufjs/dist/protobuf.min.js", - "lineNumber": 7, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/dist/protobuf.min.js", - "lineNumber": 7, - "reasonCategory": "falseMatch", - "updated": "2018-09-18T19:19:27.699Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/index.d.ts", - "line": "export function load(filename: (string|string[]), root: Root, callback: LoadCallback): void;", - "lineNumber": 414, - "reasonCategory": "falseMatch", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/index.d.ts", - "line": "export function load(filename: (string|string[]), callback: LoadCallback): void;", - "lineNumber": 422, - "reasonCategory": "falseMatch", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/index.d.ts", - "line": "export function load(filename: (string|string[]), root?: Root): Promise;", - "lineNumber": 431, - "reasonCategory": "falseMatch", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/index.d.ts", - "line": " public load(filename: (string|string[]), options: IParseOptions, callback: LoadCallback): void;", - "lineNumber": 1250, - "reasonCategory": "falseMatch", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/index.d.ts", - "line": " public load(filename: (string|string[]), callback: LoadCallback): void;", - "lineNumber": 1257, - "reasonCategory": "falseMatch", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/index.d.ts", - "line": " public load(filename: (string|string[]), options?: IParseOptions): Promise;", - "lineNumber": 1265, - "reasonCategory": "falseMatch", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/protobufjs/node_modules/@types/node/index.d.ts", - "line": " wrap(oldStream: ReadableStream): this;", - "lineNumber": 456, - "reasonCategory": "falseMatch", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/protobufjs/node_modules/@types/node/index.d.ts", - "line": " static wrap(code: string): string;", - "lineNumber": 824, - "reasonCategory": "falseMatch", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/protobufjs/node_modules/@types/node/index.d.ts", - "line": " append(name: string, value: string): void;", - "lineNumber": 2411, - "reasonCategory": "falseMatch", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/protobufjs/node_modules/@types/node/index.d.ts", - "line": " wrap(oldStream: NodeJS.ReadableStream): this;", - "lineNumber": 5464, - "reasonCategory": "falseMatch", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/src/index-light.js", - "line": "function load(filename, root, callback) {", - "lineNumber": 23, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/src/index-light.js", - "line": " return root.load(filename, callback);", - "lineNumber": 29, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/src/index-light.js", - "line": "// function load(filename:string, callback:LoadCallback):undefined", - "lineNumber": 42, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/src/index-light.js", - "line": "// function load(filename:string, [root:Root]):Promise", - "lineNumber": 54, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/src/root.js", - "line": "Root.prototype.load = function load(filename, options, callback) {", - "lineNumber": 75, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/src/root.js", - "line": "// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined", - "lineNumber": 202, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/src/root.js", - "line": "// function load(filename:string, callback:LoadCallback):undefined", - "lineNumber": 212, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/src/root.js", - "line": "// function load(filename:string, [options:IParseOptions]):Promise", - "lineNumber": 222, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/protobufjs/src/root.js", - "line": " return this.load(filename, options, SYNC);", - "lineNumber": 235, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/proxy-agent/node_modules/debug/src/browser.js", - "line": "function load() {", - "lineNumber": 160, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T18:02:26.186Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/proxy-agent/node_modules/debug/src/browser.js", - "line": "exports.enable(load());", - "lineNumber": 178, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T18:02:26.186Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/proxy-agent/node_modules/debug/src/node.js", - "line": "function load() {", - "lineNumber": 162, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T18:02:26.186Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/proxy-agent/node_modules/debug/src/node.js", - "line": "exports.enable(load());", - "lineNumber": 186, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T18:02:26.186Z" - }, - { - "rule": "eval", - "path": "node_modules/raw-body/node_modules/depd/index.js", - "line": " var deprecatedfn = eval('(function (' + args + ') {\\n' +", - "lineNumber": 408, - "reasonCategory": "usageTrusted", - "updated": "2018-09-18T19:19:27.699Z", - "reasonDetail": "What's being eval'd is a static string, with one variable: args. Args is of the form arg1, arg2, generated programmatically." - }, - { - "rule": "jQuery-$(", - "path": "node_modules/read-config-file/node_modules/uri-js/dist/es5/uri.all.min.js", - "lineNumber": 2, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/redux/node_modules/js-tokens/index.js", - "lineNumber": 10, - "reasonCategory": "falseMatch", - "updated": "2019-03-09T00:08:44.242Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/regenerate/regenerate.js", - "line": "\t\t\t// $()*+-./?[\\]^{|}", - "lineNumber": 550, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/regenerator-runtime/runtime.js", - "line": " function wrap(innerFn, outerFn, self, tryLocsList) {", - "lineNumber": 36, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/regenerator-runtime/runtime.js", - "line": " wrap(innerFn, outerFn, self, tryLocsList)", - "lineNumber": 236, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/regexpu-core/rewrite-pattern.js", - "line": "\t\t\ttree = wrap(tree, pattern);", - "lineNumber": 79, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/regexpu-core/rewrite-pattern.js", - "line": "function wrap(tree, pattern) {", - "lineNumber": 84, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-html(", - "path": "node_modules/remark-stringify/lib/visitors/html.js", - "line": "function html(node) {", - "lineNumber": 5, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/request/lib/multipart.js", - "line": " return chunked ? body.append(part) : body.push(Buffer.from(part))", - "lineNumber": 75, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/request/node_modules/ajv/dist/ajv.min.js", - "lineNumber": 2, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/request/node_modules/ajv/dist/ajv.min.js", - "lineNumber": 5, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/request/node_modules/ajv/dist/nodent.min.js", - "lineNumber": 2, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/request/node_modules/ajv/dist/nodent.min.js", - "lineNumber": 3, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "React-ref", - "path": "node_modules/request/node_modules/ajv/dist/nodent.min.js", - "lineNumber": 4, - "reasonCategory": "falseMatch", - "updated": "2018-09-18T19:19:27.699Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/request/node_modules/ajv/dist/nodent.min.js", - "lineNumber": 4, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-prepend(", - "path": "node_modules/request/node_modules/ajv/dist/nodent.min.js", - "lineNumber": 7, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/request/node_modules/ajv/dist/regenerator.min.js", - "lineNumber": 6, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-prepend(", - "path": "node_modules/request/node_modules/ajv/dist/regenerator.min.js", - "lineNumber": 7, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/request/node_modules/ajv/dist/regenerator.min.js", - "lineNumber": 8, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/request/node_modules/ajv/dist/regenerator.min.js", - "lineNumber": 9, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-insertAfter(", - "path": "node_modules/request/node_modules/ajv/dist/regenerator.min.js", - "lineNumber": 10, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-insertBefore(", - "path": "node_modules/request/node_modules/ajv/dist/regenerator.min.js", - "lineNumber": 10, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-insertAfter(", - "path": "node_modules/request/node_modules/ajv/dist/regenerator.min.js", - "lineNumber": 12, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-insertBefore(", - "path": "node_modules/request/node_modules/ajv/dist/regenerator.min.js", - "lineNumber": 12, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/request/node_modules/ajv/dist/regenerator.min.js", - "lineNumber": 22, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/request/node_modules/form-data/lib/form_data.js", - "line": " append(header);", - "lineNumber": 67, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/request/node_modules/form-data/lib/form_data.js", - "line": " append(footer);", - "lineNumber": 69, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/request/request.js", - "line": " requestForm.append(key, value.value, value.options)", - "lineNumber": 324, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/request/request.js", - "line": " requestForm.append(key, value)", - "lineNumber": 326, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/rx-lite-aggregates/rx.lite.aggregates.min.js", - "lineNumber": 2, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/rx-lite/rx.lite.min.js", - "lineNumber": 2, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/rx-lite/rx.lite.min.js", - "lineNumber": 4, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/schema-utils/node_modules/ajv/dist/ajv.min.js", - "lineNumber": 2, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/signal-exit/index.js", - "line": " load()", - "lineNumber": 35, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/socks/build/client/socksclient.js", - "line": " this._receiveBuffer.append(data);", - "lineNumber": 274, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T18:02:26.186Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/socks/build/common/receivebuffer.js", - "line": " append(data) {", - "lineNumber": 12, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T18:02:26.186Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/socks/typings/common/receiveBuffer.d.ts", - "line": " append(data: Buffer): number;", - "lineNumber": 8, - "reasonCategory": "falseMatch", - "updated": "2018-11-27T18:02:26.186Z" - }, - { - "rule": "jQuery-prepend(", - "path": "node_modules/source-map-support/browser-source-map-support.js", - "lineNumber": 90, - "reasonCategory": "falseMatch", - "updated": "2019-03-13T01:27:05.473Z" - }, - { - "rule": "eval", - "path": "node_modules/source-map-support/source-map-support.js", - "line": " // Most eval() calls are in this format", - "lineNumber": 234, - "reasonCategory": "falseMatch", - "updated": "2019-03-13T01:27:05.473Z" - }, - { - "rule": "eval", - "path": "node_modules/source-map-support/source-map-support.js", - "line": " // Parse nested eval() calls using recursion", - "lineNumber": 246, - "reasonCategory": "falseMatch", - "updated": "2019-03-13T01:27:05.473Z" - }, - { - "rule": "eval", - "path": "node_modules/source-map-support/source-map-support.js", - "line": " // passed to eval() ending in \"//# sourceURL=...\" will return the source file", - "lineNumber": 344, - "reasonCategory": "falseMatch", - "updated": "2019-03-13T01:27:05.473Z" - }, - { - "rule": "eval", - "path": "node_modules/source-map-support/source-map-support.js", - "line": " // Code called using eval() needs special handling", - "lineNumber": 373, - "reasonCategory": "falseMatch", - "updated": "2019-03-13T01:27:05.473Z" - }, - { - "rule": "jQuery-prepend(", - "path": "node_modules/source-map/dist/source-map.debug.js", - "line": "\t this.prepend(aChunk[i]);", - "lineNumber": 3014, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-prepend(", - "path": "node_modules/source-map/dist/source-map.js", - "line": "\t this.prepend(aChunk[i]);", - "lineNumber": 3014, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-prepend(", - "path": "node_modules/source-map/dist/source-map.min.js", - "lineNumber": 1, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-prepend(", - "path": "node_modules/source-map/lib/source-node.js", - "line": " this.prepend(aChunk[i]);", - "lineNumber": 200, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-prepend(", - "path": "node_modules/source-map/source-map.d.ts", - "line": " prepend(chunk: string): void;", - "lineNumber": 90, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/table/dist/createStream.js", - "line": " return append(row, columnWidthIndex, config);", - "lineNumber": 153, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/tar-stream/extract.js", - "line": " b.append(data)", - "lineNumber": 224, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/tar-stream/extract.js", - "line": " else b.append(data)", - "lineNumber": 240, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "eval", - "path": "node_modules/thenify/index.js", - "line": " return eval(createWrapper($$__fn__$$.name, options))", - "lineNumber": 17, - "reasonCategory": "ruleNeeded", - "updated": "2018-09-18T19:19:27.699Z", - "reasonDetail": "Add rule. multiArgs are the only way to get arbitrary information into string returned by createWrapper" - }, - { - "rule": "eval", - "path": "node_modules/thenify/index.js", - "line": " return eval(createWrapper($$__fn__$$.name, options))", - "lineNumber": 33, - "reasonCategory": "ruleNeeded", - "updated": "2018-09-18T19:19:27.699Z", - "reasonDetail": "Add rule. multiArgs are the only way to get arbitrary information into string returned by createWrapper" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/tiny-lr/node_modules/debug/browser.js", - "line": "function load() {", - "lineNumber": 139, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/tiny-lr/node_modules/debug/browser.js", - "line": "exports.enable(load());", - "lineNumber": 151, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/tiny-lr/node_modules/debug/node.js", - "line": "function load() {", - "lineNumber": 133, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-load(", - "path": "node_modules/tiny-lr/node_modules/debug/node.js", - "line": "exports.enable(load());", - "lineNumber": 209, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "eval", - "path": "node_modules/to-fast-properties/index.js", - "line": "\teval(\"o\" + o); // ensure no dead code elimination", - "lineNumber": 10, - "reasonCategory": "notExercisedByOurApp", - "updated": "2018-09-18T19:19:27.699Z", - "reasonDetail": "The line is never run, since it's after a return statement" - }, - { - "rule": "jQuery-before(", - "path": "node_modules/traverse/examples/stringify.js", - "line": " this.before(function () { s += '[' });", - "lineNumber": 9, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-after(", - "path": "node_modules/traverse/examples/stringify.js", - "line": " this.after(function () { s += ']' });", - "lineNumber": 13, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-before(", - "path": "node_modules/traverse/examples/stringify.js", - "line": " this.before(function () { s += '{' });", - "lineNumber": 16, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-after(", - "path": "node_modules/traverse/examples/stringify.js", - "line": " this.after(function () { s += '}' });", - "lineNumber": 24, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/tsutils/util/convert-ast.js", - "line": " ts.forEachChild(sourceFile, function wrap(node) {", - "lineNumber": 17, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/type-check/lib/parse-type.js", - "line": " if (in$('->', tokens)) {", - "lineNumber": 181, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/type-check/lib/parse-type.js", - "line": " function in$(x, xs){", - "lineNumber": 191, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/underscore.string/dist/underscore.string.js", - "line": "module.exports = function wrap(str, options){", - "lineNumber": 1100, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/underscore.string/wrap.js", - "line": "module.exports = function wrap(str, options){", - "lineNumber": 6, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/underscore/underscore-min.js", - "lineNumber": 5, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/update-notifier/index.js", - "line": "\t\t\t\t\tchalk().cyan(format(' sudo chown -R $USER:$(id -gn $USER) %s ', xdgBasedir().config));", - "lineNumber": 60, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/whatwg-fetch/fetch.js", - "line": " this.append(name, value)", - "lineNumber": 85, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/whatwg-fetch/fetch.js", - "line": " this.append(header[0], header[1])", - "lineNumber": 89, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/whatwg-fetch/fetch.js", - "line": " this.append(name, headers[name])", - "lineNumber": 93, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/whatwg-fetch/fetch.js", - "line": " form.append(decodeURIComponent(name), decodeURIComponent(value))", - "lineNumber": 353, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-append(", - "path": "node_modules/whatwg-fetch/fetch.js", - "line": " headers.append(key, value)", - "lineNumber": 366, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/xregexp/xregexp-all.js", - "line": " replacementToken = /\\$(?:{([\\w$]+)}|(\\d\\d?|[\\s\\S]))/g,", - "lineNumber": 70, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-$(", - "path": "node_modules/xregexp/xregexp-all.js", - "line": " endAnchor = /\\$(?:\\(\\?:\\))?$/; // Trailing `$` or `$(?:)` (handles /x cruft)", - "lineNumber": 2066, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, - { - "rule": "jQuery-wrap(", - "path": "node_modules/yargs/yargs.js", - "line": " usage.wrap(cols)", - "lineNumber": 643, - "reasonCategory": "falseMatch", - "updated": "2018-09-19T18:13:29.628Z" - }, - { - "rule": "DOM-innerHTML", - "path": "ts/backbone/views/Lightbox.js", - "line": " container.innerHTML = '';", - "lineNumber": 9, - "reasonCategory": "usageTrusted", - "updated": "2018-09-17T20:50:40.689Z", - "reasonDetail": "Hard-coded value" - }, - { - "rule": "DOM-innerHTML", - "path": "ts/backbone/views/Lightbox.js", - "line": " container.innerHTML = '';", - "lineNumber": 19, - "reasonCategory": "usageTrusted", - "updated": "2018-09-17T20:50:40.689Z", - "reasonDetail": "Hard-coded value" - }, - { - "rule": "DOM-innerHTML", - "path": "ts/backbone/views/Lightbox.ts", - "line": " container.innerHTML = '';", - "lineNumber": 9, - "reasonCategory": "usageTrusted", - "updated": "2018-09-17T20:50:40.689Z", - "reasonDetail": "Hard-coded value" - }, - { - "rule": "DOM-innerHTML", - "path": "ts/backbone/views/Lightbox.ts", - "line": " container.innerHTML = '';", - "lineNumber": 22, - "reasonCategory": "usageTrusted", - "updated": "2018-09-17T20:50:40.689Z", - "reasonDetail": "Hard-coded value" - }, - { - "rule": "React-createRef", - "path": "ts/components/CaptionEditor.js", - "line": " this.inputRef = react_1.default.createRef();", - "lineNumber": 27, - "reasonCategory": "usageTrusted", - "updated": "2019-03-09T00:08:44.242Z", - "reasonDetail": "Used only to set focus" - }, - { - "rule": "React-createRef", - "path": "ts/components/CaptionEditor.tsx", - "line": " this.inputRef = React.createRef();", - "lineNumber": 46, - "reasonCategory": "usageTrusted", - "updated": "2019-03-09T00:08:44.242Z", - "reasonDetail": "Used only to set focus" - }, - { - "rule": "React-createRef", - "path": "ts/components/Lightbox.js", - "line": " this.videoRef = react_1.default.createRef();", - "lineNumber": 180, - "reasonCategory": "usageTrusted", - "updated": "2019-03-09T00:08:44.242Z", - "reasonDetail": "Used to auto-start playback on videos" - }, - { - "rule": "React-createRef", - "path": "ts/components/Lightbox.tsx", - "line": " this.videoRef = React.createRef();", - "lineNumber": 176, - "reasonCategory": "usageTrusted", - "updated": "2019-03-09T00:08:44.242Z", - "reasonDetail": "Used to auto-start playback on videos" - }, - { - "rule": "React-createRef", - "path": "ts/components/MainHeader.js", - "line": " this.inputRef = react_1.default.createRef();", - "lineNumber": 17, - "reasonCategory": "usageTrusted", - "updated": "2019-03-09T00:08:44.242Z", - "reasonDetail": "Used only to set focus" - }, - { - "rule": "React-createRef", - "path": "ts/components/MainHeader.tsx", - "line": " this.inputRef = React.createRef();", - "lineNumber": 57, - "reasonCategory": "usageTrusted", - "updated": "2019-03-09T00:08:44.242Z", - "reasonDetail": "Used only to set focus" - }, - { - "rule": "React-createRef", - "path": "ts/components/conversation/ConversationHeader.js", - "line": " this.menuTriggerRef = react_1.default.createRef();", - "lineNumber": 13, - "reasonCategory": "usageTrusted", - "updated": "2019-03-09T00:08:44.242Z", - "reasonDetail": "Used only to trigger menu display" - }, - { - "rule": "React-createRef", - "path": "ts/components/conversation/ConversationHeader.tsx", - "line": " this.menuTriggerRef = React.createRef();", - "lineNumber": 58, - "reasonCategory": "usageTrusted", - "updated": "2019-03-09T00:08:44.242Z", - "reasonDetail": "Used only to trigger menu display" - } -] \ No newline at end of file diff --git a/ts/util/lint/linter.ts b/ts/util/lint/linter.ts deleted file mode 100644 index 080690540..000000000 --- a/ts/util/lint/linter.ts +++ /dev/null @@ -1,266 +0,0 @@ -// tslint:disable no-console - -import { readFileSync } from 'fs'; -import { join, relative } from 'path'; - -// @ts-ignore -import * as glob from 'glob'; -import { forEach, some, values } from 'lodash'; - -import { ExceptionType, REASONS, RuleType } from './types'; -import { ENCODING, loadJSON, sortExceptions } from './util'; - -const ALL_REASONS = REASONS.join('|'); -const now = new Date(); - -function getExceptionKey(exception: any) { - return `${exception.rule}-${exception.path}-${exception.lineNumber}`; -} - -function createLookup(list: Array) { - const lookup = Object.create(null); - - forEach(list, exception => { - const key = getExceptionKey(exception); - - if (lookup[key]) { - throw new Error(`Duplicate exception found for key ${key}`); - } - - lookup[key] = exception; - }); - - return lookup; -} - -const rulesPath = join(__dirname, 'rules.json'); -const exceptionsPath = join(__dirname, 'exceptions.json'); -const basePath = join(__dirname, '../../..'); - -const searchPattern = join(basePath, '**/*.{js,ts,tsx}'); - -const rules: Array = loadJSON(rulesPath); -const exceptions: Array = loadJSON(exceptionsPath); -const exceptionsLookup = createLookup(exceptions); -let scannedCount = 0; - -const allSourceFiles = glob.sync(searchPattern, { nodir: true }); - -const results: Array = []; - -const excludedFiles = [ - // High-traffic files in our project - '^js/background.js', - - // Generated files - '^js/components.js', - '^js/curve/', - '^js/libtextsecure.js', - '^js/util_worker.js', - '^libtextsecure/components.js', - '^libtextsecure/test/test.js', - '^test/test.js', - - // From libsignal-protocol-javascript project - '^libtextsecure/libsignal-protocol.js', - - // Test files - '^libtextsecure/test/*', - '^test/*', - - // Modules we trust - '^node_modules/react/*', - '^node_modules/react-dom/*', - - // Modules used only in test/development scenarios - '^node_modules/@types/*', - '^node_modules/ajv/*', - '^node_modules/amdefine/*', - '^node_modules/anymatch/*', - '^node_modules/app-builder-lib/*', - '^node_modules/asn1\\.js/*', - '^node_modules/autoprefixer/*', - '^node_modules/babel*', - '^node_modules/bluebird/*', - '^node_modules/body-parser/*', - '^node_modules/bower/*', - '^node_modules/buble/*', - '^node_modules/builder-util/*', - '^node_modules/builder-util-runtime/*', - '^node_modules/chai/*', - '^node_modules/cli-table2/*', - '^node_modules/codemirror/*', - '^node_modules/coffee-script/*', - '^node_modules/compression/*', - '^node_modules/degenerator/*', - '^node_modules/detect-port-alt/*', - '^node_modules/electron-builder/*', - '^node_modules/electron-osx-sign/*', - '^node_modules/electron-publish/*', - '^node_modules/escodegen/*', - '^node_modules/eslint*', - '^node_modules/esprima/*', - '^node_modules/express/*', - '^node_modules/finalhandler/*', - '^node_modules/fsevents/*', - '^node_modules/globule/*', - '^node_modules/grunt*', - '^node_modules/handle-thing/*', - '^node_modules/har-validator/*', - '^node_modules/highlight\\.js/*', - '^node_modules/hpack\\.js/*', - '^node_modules/http-proxy-middlewar/*', - '^node_modules/icss-utils/*', - '^node_modules/istanbul*', - '^node_modules/jimp/*', - '^node_modules/jquery/*', - '^node_modules/jss/*', - '^node_modules/jss-global/*', - '^node_modules/livereload-js/*', - '^node_modules/lolex/*', - '^node_modules/magic-string/*', - '^node_modules/mocha/*', - '^node_modules/minimatch/*', - '^node_modules/nise/*', - '^node_modules/node-sass-import-once/*', - '^node_modules/node-sass/*', - '^node_modules/nsp/*', - '^node_modules/phantomjs-prebuilt/*', - '^node_modules/postcss*', - '^node_modules/preserve/*', - '^node_modules/prettier/*', - '^node_modules/protobufjs/cli/*', - '^node_modules/ramda/*', - '^node_modules/react-docgen/*', - '^node_modules/react-error-overlay/*', - '^node_modules/recast/*', - '^node_modules/reduce-css-calc/*', - '^node_modules/resolve/*', - '^node_modules/sass-graph/*', - '^node_modules/scss-tokenizer/*', - '^node_modules/send/*', - '^node_modules/serve-index/*', - '^node_modules/sinon/*', - '^node_modules/snapdragon-util/*', - '^node_modules/snapdragon/*', - '^node_modules/sockjs-client/*', - '^node_modules/style-loader/*', - '^node_modules/svgo/*', - '^node_modules/text-encoding/*', - '^node_modules/tinycolor2/*', - '^node_modules/to-ast/*', - '^node_modules/trough/*', - '^node_modules/ts-loader/*', - '^node_modules/tslint*', - '^node_modules/tweetnacl/*', - '^node_modules/typescript/*', - '^node_modules/uglify-es/*', - '^node_modules/uglify-js/*', - '^node_modules/use/*', - '^node_modules/vary/*', - '^node_modules/vm-browserify/*', - '^node_modules/webdriverio/*', - '^node_modules/webpack*', - '^node_modules/xmldom/*', - '^node_modules/xml-parse-from-string/*', -]; - -function setupRules(allRules: Array) { - forEach(allRules, (rule, index) => { - if (!rule.name) { - throw new Error(`Rule at index ${index} is missing a name`); - } - - if (!rule.expression) { - throw new Error(`Rule '${rule.name}' is missing an expression`); - } - - rule.regex = new RegExp(rule.expression, 'g'); - }); -} - -setupRules(rules); - -forEach(allSourceFiles, file => { - const relativePath = relative(basePath, file).replace(/\\/g, '/'); - if ( - some(excludedFiles, excluded => { - const regex = new RegExp(excluded); - - return regex.test(relativePath); - }) - ) { - return; - } - - scannedCount += 1; - - const fileContents = readFileSync(file, ENCODING); - const lines = fileContents.split('\n'); - - forEach(rules, (rule: RuleType) => { - const excludedModules = rule.excludedModules || []; - if (some(excludedModules, module => relativePath.startsWith(module))) { - return; - } - - forEach(lines, (rawLine, lineIndex) => { - const line = rawLine.replace(/\r/g, ''); - if (!rule.regex.test(line)) { - return; - } - - const path = relativePath; - const lineNumber = lineIndex + 1; - - const exceptionKey = getExceptionKey({ - rule: rule.name, - path: relativePath, - lineNumber, - }); - - const exception = exceptionsLookup[exceptionKey]; - if (exception && (!exception.line || exception.line === line)) { - // tslint:disable-next-line no-dynamic-delete - delete exceptionsLookup[exceptionKey]; - - return; - } - - results.push({ - rule: rule.name, - path, - line: line.length < 300 ? line : undefined, - lineNumber, - reasonCategory: ALL_REASONS, - updated: now.toJSON(), - reasonDetail: '', - }); - }); - }); -}); - -const unusedExceptions = values(exceptionsLookup); - -console.log( - `${scannedCount} files scanned.`, - `${results.length} questionable lines,`, - `${unusedExceptions.length} unused exceptions,`, - `${exceptions.length} total exceptions.` -); - -if (results.length === 0 && unusedExceptions.length === 0) { - process.exit(); -} - -console.log(); -console.log('Questionable lines:'); -console.log(JSON.stringify(sortExceptions(results), null, ' ')); - -if (unusedExceptions.length) { - console.log(); - console.log('Unused exceptions!'); - console.log(JSON.stringify(sortExceptions(unusedExceptions), null, ' ')); -} - -process.exit(1); diff --git a/ts/util/lint/rules.json b/ts/util/lint/rules.json deleted file mode 100644 index 134f92638..000000000 --- a/ts/util/lint/rules.json +++ /dev/null @@ -1,135 +0,0 @@ -[ - { - "name": "eval", - "expression": "\\beval\\(", - "reason": "Arbitrary code execution" - }, - { - "name": "DOM-innerHTML", - "expression": "\\binnerHTML\\b", - "reason": "Potential XSS" - }, - { - "name": "DOM-outerHTML", - "expression": "\\bouterHTML\\b", - "reason": "Potential XSS" - }, - { - "name": "DOM-document.write(", - "expression": "\\bdocument.write(ln)?\\(", - "reason": "Potential XSS" - }, - { - "name": "jQuery-$(", - "expression": "\\$\\(", - "reason": "Potential XSS", - "excludedModules": ["node_modules/prelude-ls"] - }, - { - "name": "jQuery-html(", - "expression": "\\bhtml\\(", - "reason": "Potential XSS" - }, - { - "name": "jQuery-append(", - "expression": "\\bappend\\(", - "reason": "Potential XSS", - "excludedModules": [ - "components/bytebuffer", - "components/protobuf", - "node_modules/google-libphonenumber", - "node_modules/handlebars" - ] - }, - { - "name": "jQuery-appendTo(", - "expression": "\\bappendTo\\(", - "reason": "Potential XSS" - }, - { - "name": "jQuery-insertAfter(", - "expression": "\\binsertAfter\\(", - "reason": "Potential XSS" - }, - { - "name": "jQuery-insertBefore(", - "expression": "\\binsertBefore\\(", - "reason": "Potential XSS", - "excludedModules": ["node_modules/react-dom"] - }, - { - "name": "jQuery-prepend(", - "expression": "\\bprepend\\(", - "reason": "Potential XSS", - "excludedModules": ["components/bytebuffer", "node_modules/handlebars"] - }, - { - "name": "jQuery-prependTo(", - "expression": "\\bprependTo\\(", - "reason": "Potential XSS" - }, - { - "name": "jQuery-wrap(", - "expression": "\\bwrap\\(", - "reason": "Potential XSS", - "excludedModules": [ - "components/bytebuffer", - "components/protobuf", - "node_modules/handlebars", - "node_modules/lodash" - ] - }, - { - "name": "jQuery-wrapInner(", - "expression": "\\bwrapInner\\(", - "reason": "Potential XSS" - }, - { - "name": "jQuery-wrapAll(", - "expression": "\\bwrapAll\\(", - "reason": "Potential XSS" - }, - { - "name": "jQuery-before(", - "expression": "\\bbefore\\(", - "reason": "Potential XSS" - }, - { - "name": "jQuery-after(", - "expression": "\\bafter\\(", - "reason": "Potential XSS" - }, - { - "name": "jQuery-globalEval(", - "expression": "\\bglobalEval\\(", - "reason": "Arbitrary code execution" - }, - { - "name": "jQuery-getScript(", - "expression": "\\bgetScript\\(", - "reason": "Arbitrary code execution" - }, - { - "name": "jQuery-load(", - "expression": "\\bload\\(", - "reason": "Arbitrary code execution" - }, - { - "name": "fbjs-createNodesFromMarkup", - "expression": "\\bcreateNodesFromMarkup\\b", - "reason": "Potential XSS, pipes input to innerHTML", - "excludedModules": ["node_modules/react-dom", "node_modules/fbjs"] - }, - { - "name": "thenify-multiArgs", - "expression": "\\bmultiArgs\\b", - "reason": "Potential arbitrary code execution, piped to eval", - "excludedModules": ["node_modules/thenify"] - }, - { - "name": "bluebird-toFastProperties", - "expression": "\\btoFastProperties\\b", - "reason": "Whatever is provided is sent straight to eval()", - "excludedModules": [] - } -] diff --git a/ts/util/lint/sort_exceptions.ts b/ts/util/lint/sort_exceptions.ts deleted file mode 100644 index f5c9d7306..000000000 --- a/ts/util/lint/sort_exceptions.ts +++ /dev/null @@ -1,14 +0,0 @@ -// tslint:disable no-console - -import { join } from 'path'; -import { writeFileSync } from 'fs'; - -import { ExceptionType } from './types'; -import { loadJSON, sortExceptions } from './util'; - -const exceptionsPath = join(__dirname, 'exceptions.json'); -const exceptions: Array = loadJSON(exceptionsPath); - -const sorted = sortExceptions(exceptions); - -writeFileSync(exceptionsPath, JSON.stringify(sorted, null, ' ')); diff --git a/ts/util/lint/types.ts b/ts/util/lint/types.ts deleted file mode 100644 index 7579c73df..000000000 --- a/ts/util/lint/types.ts +++ /dev/null @@ -1,63 +0,0 @@ -// Tool requirements: -// - Feed it a set of regular expressions with descriptions as to what the risks are -// - Feed it also a set of exceptions -// - It would tell us if there were any new matches that didn't already have exceptions -// -// Rules: -// { -// "name": "rule-name", -// "expression": "^regex-as-string$", -// "reason": "Reason that this expression is dangerous" -// } -// -// Categories of reasons - low to high risk: -// "falseMatch" -// "testCode" -// "exampleCode" -// "otherUtilityCode" -// "regexMatchedSafeCode" -// "notExercisedByOurApp" -// "ruleNeeded" -// "usageTrusted" -// -// Exceptions: -// [{ -// "rule": "rule-name", -// "path": "path/to/filename.js", -// "lineNumber": 45, -// "reasonCategory": "", -// "updated": "2018-09-08T00:21:13.180Z", -// "reasonDetail": "" -// }] -// -// When the tool finds issues it outputs them in exception format to make it easy to add -// to the exceptions.json file - -export const REASONS = [ - 'falseMatch', - 'testCode', - 'exampleCode', - 'otherUtilityCode', - 'regexMatchedSafeCode', - 'notExercisedByOurApp', - 'ruleNeeded', - 'usageTrusted', -]; - -export type RuleType = { - name: string; - expression?: string; - reason: string; - regex: RegExp; - excludedModules?: Array; -}; - -export type ExceptionType = { - rule: string; - path: string; - line?: string; - lineNumber: number; - reasonCategory: string; - updated: string; - reasonDetail: string; -}; diff --git a/ts/util/lint/util.ts b/ts/util/lint/util.ts deleted file mode 100644 index 7c246eb30..000000000 --- a/ts/util/lint/util.ts +++ /dev/null @@ -1,24 +0,0 @@ -// tslint:disable no-console - -import { readFileSync } from 'fs'; - -import { orderBy } from 'lodash'; - -import { ExceptionType } from './types'; - -export const ENCODING = 'utf8'; - -export function loadJSON(target: string) { - try { - const contents = readFileSync(target, ENCODING); - - return JSON.parse(contents); - } catch (error) { - console.log(`Error loading JSON from ${target}: ${error.stack}`); - throw error; - } -} - -export function sortExceptions(exceptions: Array) { - return orderBy(exceptions, ['path', 'lineNumber', 'rule']); -} diff --git a/ts/window.d.ts b/ts/window.d.ts index 833e929ec..449167a80 100644 --- a/ts/window.d.ts +++ b/ts/window.d.ts @@ -16,8 +16,6 @@ We declare window stuff here instead of global.d.ts because we are importing oth If you import anything in global.d.ts, the type system won't work correctly. */ -type UtilWorkerFunctionType = (fnName: string, ...args: any) => Promise; - declare global { interface Window { CONSTANTS: any; diff --git a/yarn.lock b/yarn.lock index 9b47919d6..5184c22fb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1786,11 +1786,6 @@ boolean@^3.0.0: resolved "https://registry.yarnpkg.com/boolean/-/boolean-3.0.1.tgz#35ecf2b4a2ee191b0b44986f14eb5f052a5cbb4f" integrity sha512-HRZPIjPcbwAVQvOTxR4YE3o8Xs98NqbbL1iEZDCz7CL8ql0Lt5iOyJFxfnAB0oFs8Oh02F/lLlg30Mexv46LjA== -bower@1.8.2: - version "1.8.2" - resolved "https://registry.yarnpkg.com/bower/-/bower-1.8.2.tgz#adf53529c8d4af02ef24fb8d5341c1419d33e2f7" - integrity sha1-rfU1KcjUrwLvJPuNU0HBQZ0z4vc= - boxen@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/boxen/-/boxen-4.2.0.tgz#e411b62357d6d6d36587c8ac3d5d974daa070e64"