From 413d64356ac8d39aafa5eae84aaacbddb88ab7a7 Mon Sep 17 00:00:00 2001 From: Bradley Hilton Date: Thu, 6 Apr 2017 13:14:52 -0400 Subject: [PATCH 1/2] Add a setting to not run outgoing integrations on message edits --- .../.npm/package/npm-shrinkwrap.json | 527 ++++++------------ packages/rocketchat-i18n/i18n/en.i18n.json | 2 + .../client/views/integrationsOutgoing.html | 8 + .../client/views/integrationsOutgoing.js | 11 +- .../server/lib/triggerHandler.js | 10 + .../server/lib/validation.js | 5 + .../outgoing/updateOutgoingIntegration.js | 1 + server/startup/migrations/v092.js | 10 + 8 files changed, 214 insertions(+), 360 deletions(-) create mode 100644 server/startup/migrations/v092.js diff --git a/packages/rocketchat-google-natural-language/.npm/package/npm-shrinkwrap.json b/packages/rocketchat-google-natural-language/.npm/package/npm-shrinkwrap.json index 2d1adcaa6c59..58b6a4b24371 100644 --- a/packages/rocketchat-google-natural-language/.npm/package/npm-shrinkwrap.json +++ b/packages/rocketchat-google-natural-language/.npm/package/npm-shrinkwrap.json @@ -1,8 +1,8 @@ { "dependencies": { "ajv": { - "version": "4.11.4", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.4.tgz", + "version": "4.11.5", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.5.tgz", "from": "ajv@>=4.9.1 <5.0.0" }, "ansi-regex": { @@ -46,8 +46,8 @@ "from": "assert-plus@>=0.2.0 <0.3.0" }, "async": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/async/-/async-2.1.5.tgz", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/async/-/async-2.3.0.tgz", "from": "async@>=2.1.2 <3.0.0" }, "asynckit": { @@ -71,44 +71,15 @@ "from": "balanced-match@>=0.4.1 <0.5.0" }, "base64url": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/base64url/-/base64url-1.0.6.tgz", - "from": "base64url@>=1.0.4 <1.1.0", - "dependencies": { - "concat-stream": { - "version": "1.4.10", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.4.10.tgz", - "from": "concat-stream@>=1.4.7 <1.5.0" - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "from": "isarray@0.0.1" - }, - "readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "from": "readable-stream@>=1.1.9 <1.2.0" - } - } + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/base64url/-/base64url-2.0.0.tgz", + "from": "base64url@>=2.0.0 <3.0.0" }, "bcrypt-pbkdf": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", "from": "bcrypt-pbkdf@>=1.0.0 <2.0.0" }, - "bl": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/bl/-/bl-1.1.2.tgz", - "from": "bl@>=1.1.2 <1.2.0", - "dependencies": { - "readable-stream": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", - "from": "readable-stream@>=2.0.5 <2.1.0" - } - } - }, "boom": { "version": "2.10.1", "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", @@ -122,7 +93,7 @@ "buffer-equal-constant-time": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "from": "buffer-equal-constant-time@>=1.0.1 <2.0.0" + "from": "buffer-equal-constant-time@1.0.1" }, "buffer-shims": { "version": "1.0.0", @@ -135,14 +106,9 @@ "from": "bytebuffer@>=5.0.0 <6.0.0" }, "camelcase": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", - "from": "camelcase@>=1.0.1 <2.0.0" - }, - "camelcase-keys": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-1.0.0.tgz", - "from": "camelcase-keys@>=1.0.0 <2.0.0" + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "from": "camelcase@>=2.0.1 <3.0.0" }, "capture-stack-trace": { "version": "1.0.0", @@ -249,14 +215,7 @@ "ecdsa-sig-formatter": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.9.tgz", - "from": "ecdsa-sig-formatter@>=1.0.0 <2.0.0", - "dependencies": { - "base64url": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/base64url/-/base64url-2.0.0.tgz", - "from": "base64url@>=2.0.0 <3.0.0" - } - } + "from": "ecdsa-sig-formatter@1.0.9" }, "end-of-stream": { "version": "1.0.0", @@ -308,11 +267,6 @@ "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", "from": "generate-object-property@>=1.1.0 <2.0.0" }, - "get-stdin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", - "from": "get-stdin@>=4.0.1 <5.0.0" - }, "getpass": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.6.tgz", @@ -331,62 +285,13 @@ "from": "glob@>=7.0.5 <8.0.0" }, "google-auth-library": { - "version": "0.9.10", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-0.9.10.tgz", - "from": "google-auth-library@>=0.9.10 <0.10.0", - "dependencies": { - "async": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.4.2.tgz", - "from": "async@>=1.4.2 <1.5.0" - }, - "caseless": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", - "from": "caseless@>=0.11.0 <0.12.0" - }, - "form-data": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-1.0.1.tgz", - "from": "form-data@>=1.0.0-rc4 <1.1.0", - "dependencies": { - "async": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/async/-/async-2.1.5.tgz", - "from": "async@^2.0.1" - } - } - }, - "har-validator": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", - "from": "har-validator@>=2.0.6 <2.1.0" - }, - "node-uuid": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz", - "from": "node-uuid@>=1.4.7 <1.5.0" - }, - "qs": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.2.3.tgz", - "from": "qs@>=6.2.0 <6.3.0" - }, - "request": { - "version": "2.74.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.74.0.tgz", - "from": "request@>=2.74.0 <2.75.0" - }, - "tunnel-agent": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", - "from": "tunnel-agent@>=0.4.1 <0.5.0" - } - } + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-0.10.0.tgz", + "from": "google-auth-library@>=0.10.0 <0.11.0" }, "google-auto-auth": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/google-auto-auth/-/google-auto-auth-0.5.2.tgz", + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/google-auto-auth/-/google-auto-auth-0.5.4.tgz", "from": "google-auto-auth@>=0.5.2 <0.6.0" }, "google-gax": { @@ -417,14 +322,14 @@ "from": "graceful-readlink@>=1.0.0" }, "grpc": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/grpc/-/grpc-1.1.2.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/grpc/-/grpc-1.2.0.tgz", "from": "grpc@>=1.1.0 <2.0.0", "dependencies": { "node-pre-gyp": { - "version": "0.6.33", - "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.6.33.tgz", - "from": "node-pre-gyp@0.6.33", + "version": "0.6.34", + "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.6.34.tgz", + "from": "node-pre-gyp@0.6.34", "dependencies": { "mkdirp": { "version": "0.5.1", @@ -439,21 +344,38 @@ } }, "nopt": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "from": "nopt@>=3.0.6 <3.1.0", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", + "from": "nopt@>=4.0.1 <5.0.0", "dependencies": { "abbrev": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz", "from": "abbrev@>=1.0.0 <2.0.0" + }, + "osenv": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.4.tgz", + "from": "osenv@>=0.1.4 <0.2.0", + "dependencies": { + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "from": "os-homedir@>=1.0.0 <2.0.0" + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "from": "os-tmpdir@>=1.0.0 <2.0.0" + } + } } } }, "npmlog": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.0.2.tgz", - "from": "npmlog@>=4.0.1 <5.0.0", + "from": "npmlog@>=4.0.2 <5.0.0", "dependencies": { "are-we-there-yet": { "version": "1.1.2", @@ -466,8 +388,8 @@ "from": "delegates@>=1.0.0 <2.0.0" }, "readable-stream": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.2.tgz", + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.6.tgz", "from": "readable-stream@>=2.0.0 <3.0.0||>=1.1.13 <2.0.0", "dependencies": { "buffer-shims": { @@ -520,8 +442,8 @@ "from": "gauge@>=2.7.1 <2.8.0", "dependencies": { "aproba": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.1.0.tgz", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.1.1.tgz", "from": "aproba@>=1.0.3 <2.0.0" }, "has-unicode": { @@ -590,9 +512,9 @@ } }, "rc": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.1.6.tgz", - "from": "rc@>=1.1.6 <1.2.0", + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.1.7.tgz", + "from": "rc@>=1.1.7 <2.0.0", "dependencies": { "deep-extend": { "version": "0.4.1", @@ -610,16 +532,16 @@ "from": "minimist@>=1.2.0 <2.0.0" }, "strip-json-comments": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz", - "from": "strip-json-comments@>=1.0.4 <1.1.0" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "from": "strip-json-comments@>=2.0.1 <2.1.0" } } }, "request": { - "version": "2.79.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.79.0.tgz", - "from": "request@>=2.79.0 <3.0.0", + "version": "2.81.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz", + "from": "request@>=2.81.0 <3.0.0", "dependencies": { "aws-sign2": { "version": "0.6.0", @@ -632,9 +554,9 @@ "from": "aws4@>=1.2.1 <2.0.0" }, "caseless": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", - "from": "caseless@>=0.11.0 <0.12.0" + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "from": "caseless@>=0.12.0 <0.13.0" }, "combined-stream": { "version": "1.0.5", @@ -671,113 +593,38 @@ } }, "har-validator": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", - "from": "har-validator@>=2.0.6 <2.1.0", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-4.2.1.tgz", + "from": "har-validator@>=4.2.1 <4.3.0", "dependencies": { - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "from": "chalk@>=1.1.1 <2.0.0", + "ajv": { + "version": "4.11.5", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.5.tgz", + "from": "ajv@>=4.9.1 <5.0.0", "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "from": "ansi-styles@>=2.2.1 <3.0.0" - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "from": "escape-string-regexp@>=1.0.2 <2.0.0" + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "from": "co@>=4.6.0 <5.0.0" }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "from": "has-ansi@>=2.0.0 <3.0.0", - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "from": "ansi-regex@>=2.0.0 <3.0.0" - } - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "from": "strip-ansi@>=3.0.0 <4.0.0", - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "from": "ansi-regex@>=2.0.0 <3.0.0" - } - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "from": "supports-color@>=2.0.0 <3.0.0" - } - } - }, - "commander": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", - "from": "commander@>=2.9.0 <3.0.0", - "dependencies": { - "graceful-readlink": { + "json-stable-stringify": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", - "from": "graceful-readlink@>=1.0.0" - } - } - }, - "is-my-json-valid": { - "version": "2.15.0", - "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.15.0.tgz", - "from": "is-my-json-valid@>=2.12.4 <3.0.0", - "dependencies": { - "generate-function": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", - "from": "generate-function@>=2.0.0 <3.0.0" - }, - "generate-object-property": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", - "from": "generate-object-property@>=1.1.0 <2.0.0", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "from": "json-stable-stringify@>=1.0.1 <2.0.0", "dependencies": { - "is-property": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", - "from": "is-property@>=1.0.0 <2.0.0" + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "from": "jsonify@>=0.0.0 <0.1.0" } } - }, - "jsonpointer": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", - "from": "jsonpointer@>=4.0.0 <5.0.0" - }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "from": "xtend@>=4.0.0 <5.0.0" } } }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "from": "pinkie-promise@>=2.0.0 <3.0.0", - "dependencies": { - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "from": "pinkie@>=2.0.0 <3.0.0" - } - } + "har-schema": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-1.0.5.tgz", + "from": "har-schema@>=1.0.5 <2.0.0" } } }, @@ -819,10 +666,15 @@ "from": "assert-plus@>=0.2.0 <0.3.0" }, "jsprim": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.3.1.tgz", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.0.tgz", "from": "jsprim@>=1.2.2 <2.0.0", "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "from": "assert-plus@1.0.0" + }, "extsprintf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz", @@ -841,8 +693,8 @@ } }, "sshpk": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.10.2.tgz", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.11.0.tgz", "from": "sshpk@>=1.7.0 <2.0.0", "dependencies": { "asn1": { @@ -881,8 +733,8 @@ "from": "jodid25519@>=1.0.0 <2.0.0" }, "jsbn": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.0.tgz", + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "from": "jsbn@>=0.1.0 <0.2.0" }, "tweetnacl": { @@ -926,10 +778,20 @@ "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", "from": "oauth-sign@>=0.8.1 <0.9.0" }, + "performance-now": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-0.2.0.tgz", + "from": "performance-now@>=0.2.0 <0.3.0" + }, "qs": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.3.0.tgz", - "from": "qs@>=6.3.0 <6.4.0" + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", + "from": "qs@>=6.4.0 <6.5.0" + }, + "safe-buffer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.0.1.tgz", + "from": "safe-buffer@>=5.0.1 <6.0.0" }, "stringstream": { "version": "0.0.5", @@ -949,9 +811,9 @@ } }, "tunnel-agent": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", - "from": "tunnel-agent@>=0.4.1 <0.5.0" + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "from": "tunnel-agent@>=0.6.0 <0.7.0" }, "uuid": { "version": "3.0.1", @@ -961,9 +823,9 @@ } }, "rimraf": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz", - "from": "rimraf@>=2.5.4 <2.6.0", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz", + "from": "rimraf@>=2.6.1 <3.0.0", "dependencies": { "glob": { "version": "7.1.1", @@ -1040,12 +902,12 @@ "semver": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "from": "semver@>=5.3.0 <5.4.0" + "from": "semver@>=5.3.0 <6.0.0" }, "tar": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", - "from": "tar@>=2.2.1 <2.3.0", + "from": "tar@>=2.2.1 <3.0.0", "dependencies": { "block-stream": { "version": "0.0.9", @@ -1053,8 +915,8 @@ "from": "block-stream@*" }, "fstream": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.10.tgz", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", "from": "fstream@>=1.0.2 <2.0.0", "dependencies": { "graceful-fs": { @@ -1072,26 +934,26 @@ } }, "tar-pack": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/tar-pack/-/tar-pack-3.3.0.tgz", - "from": "tar-pack@>=3.3.0 <3.4.0", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/tar-pack/-/tar-pack-3.4.0.tgz", + "from": "tar-pack@>=3.4.0 <4.0.0", "dependencies": { "debug": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", - "from": "debug@>=2.2.0 <2.3.0", + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.3.tgz", + "from": "debug@>=2.2.0 <3.0.0", "dependencies": { "ms": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", - "from": "ms@0.7.1" + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "from": "ms@0.7.2" } } }, "fstream": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.10.tgz", - "from": "fstream@>=1.0.10 <1.1.0", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", + "from": "fstream@>=1.0.10 <2.0.0", "dependencies": { "graceful-fs": { "version": "4.1.11", @@ -1108,7 +970,7 @@ "fstream-ignore": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/fstream-ignore/-/fstream-ignore-1.0.5.tgz", - "from": "fstream-ignore@>=1.0.5 <1.1.0", + "from": "fstream-ignore@>=1.0.5 <2.0.0", "dependencies": { "inherits": { "version": "2.0.3", @@ -1142,9 +1004,9 @@ } }, "once": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", - "from": "once@>=1.3.3 <1.4.0", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "from": "once@>=1.3.3 <2.0.0", "dependencies": { "wrappy": { "version": "1.0.2", @@ -1154,9 +1016,9 @@ } }, "readable-stream": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.5.tgz", - "from": "readable-stream@>=2.1.4 <2.2.0", + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.6.tgz", + "from": "readable-stream@>=2.1.4 <3.0.0", "dependencies": { "buffer-shims": { "version": "1.0.0", @@ -1171,7 +1033,7 @@ "inherits": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "from": "inherits@>=2.0.0 <3.0.0" + "from": "inherits@>=2.0.1 <2.1.0" }, "isarray": { "version": "1.0.0", @@ -1198,7 +1060,7 @@ "uid-number": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz", - "from": "uid-number@>=0.0.6 <0.1.0" + "from": "uid-number@>=0.0.6 <0.0.7" } } } @@ -1207,9 +1069,9 @@ } }, "gtoken": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-1.2.1.tgz", - "from": "gtoken@>=1.1.0 <2.0.0" + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-1.2.2.tgz", + "from": "gtoken@>=1.2.1 <2.0.0" }, "har-schema": { "version": "1.0.5", @@ -1241,11 +1103,6 @@ "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", "from": "http-signature@>=1.1.0 <1.2.0" }, - "indent-string": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-1.2.2.tgz", - "from": "indent-string@>=1.1.0 <2.0.0" - }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -1266,11 +1123,6 @@ "resolved": "https://registry.npmjs.org/is/-/is-3.2.1.tgz", "from": "is@>=3.0.1 <4.0.0" }, - "is-finite": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", - "from": "is-finite@>=1.0.0 <2.0.0" - }, "is-fullwidth-code-point": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", @@ -1342,26 +1194,26 @@ "from": "jsonpointer@>=4.0.0 <5.0.0" }, "jsprim": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.3.1.tgz", - "from": "jsprim@>=1.2.2 <2.0.0" - }, - "jwa": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.0.2.tgz", - "from": "jwa@>=1.0.0 <1.1.0", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.0.tgz", + "from": "jsprim@>=1.2.2 <2.0.0", "dependencies": { - "base64url": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/base64url/-/base64url-0.0.6.tgz", - "from": "base64url@>=0.0.4 <0.1.0" + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "from": "assert-plus@1.0.0" } } }, + "jwa": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.1.5.tgz", + "from": "jwa@>=1.1.4 <2.0.0" + }, "jws": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.0.0.tgz", - "from": "jws@>=3.0.0 <3.1.0" + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.1.4.tgz", + "from": "jws@>=3.1.4 <4.0.0" }, "lcid": { "version": "1.0.0", @@ -1376,7 +1228,7 @@ "lodash.noop": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/lodash.noop/-/lodash.noop-3.0.1.tgz", - "from": "lodash.noop@>=3.0.0 <3.1.0" + "from": "lodash.noop@>=3.0.1 <4.0.0" }, "log-driver": { "version": "1.2.5", @@ -1388,23 +1240,6 @@ "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", "from": "long@>=3.0.0 <4.0.0" }, - "map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "from": "map-obj@>=1.0.0 <2.0.0" - }, - "meow": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-2.0.0.tgz", - "from": "meow@>=2.0.0 <2.1.0", - "dependencies": { - "object-assign": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-1.0.0.tgz", - "from": "object-assign@>=1.0.0 <2.0.0" - } - } - }, "methmeth": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/methmeth/-/methmeth-1.1.0.tgz", @@ -1416,13 +1251,13 @@ "from": "mime@>=1.2.11 <2.0.0" }, "mime-db": { - "version": "1.26.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.26.0.tgz", - "from": "mime-db@>=1.26.0 <1.27.0" + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.27.0.tgz", + "from": "mime-db@>=1.27.0 <1.28.0" }, "mime-types": { - "version": "2.1.14", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.14.tgz", + "version": "2.1.15", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.15.tgz", "from": "mime-types@>=2.1.7 <2.2.0" }, "minimatch": { @@ -1430,19 +1265,14 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", "from": "minimatch@>=3.0.2 <4.0.0" }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "from": "minimist@>=1.1.0 <2.0.0" - }, "modelo": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/modelo/-/modelo-4.2.0.tgz", "from": "modelo@>=4.2.0 <5.0.0" }, "nan": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.5.1.tgz", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.6.1.tgz", "from": "nan@>=2.0.0 <3.0.0" }, "node-forge": { @@ -1526,15 +1356,10 @@ "from": "qs@>=6.4.0 <6.5.0" }, "readable-stream": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz", + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.6.tgz", "from": "readable-stream@>=2.2.2 <3.0.0" }, - "repeating": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-1.1.3.tgz", - "from": "repeating@>=1.1.0 <2.0.0" - }, "request": { "version": "2.81.0", "resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz", @@ -1556,9 +1381,9 @@ "from": "har-validator@>=2.0.6 <2.1.0" }, "node-uuid": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz", - "from": "node-uuid@~1.4.7" + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.8.tgz", + "from": "node-uuid@>=1.4.7 <1.5.0" }, "qs": { "version": "6.3.2", @@ -1626,11 +1451,6 @@ "resolved": "https://registry.npmjs.org/string-format-obj/-/string-format-obj-1.1.0.tgz", "from": "string-format-obj@>=1.1.0 <2.0.0" }, - "string-template": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/string-template/-/string-template-0.2.1.tgz", - "from": "string-template@>=0.2.0 <0.3.0" - }, "string-width": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", @@ -1729,14 +1549,7 @@ "yargs": { "version": "3.32.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz", - "from": "yargs@>=3.10.0 <4.0.0", - "dependencies": { - "camelcase": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", - "from": "camelcase@>=2.0.1 <3.0.0" - } - } + "from": "yargs@>=3.10.0 <4.0.0" } } } diff --git a/packages/rocketchat-i18n/i18n/en.i18n.json b/packages/rocketchat-i18n/i18n/en.i18n.json index 3dfe8c4b2d5e..f89ba644cc63 100644 --- a/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/packages/rocketchat-i18n/i18n/en.i18n.json @@ -730,6 +730,8 @@ "Integration_Retry_Count_Description": "How many times should the integration be tried if the call to the url fails?", "Integration_Retry_Delay": "Retry Delay", "Integration_Retry_Delay_Description": "Which delay algorithm should the retrying use? 10^x or 2^x or x*2", + "Integration_Run_When_Message_Is_Edited": "Run On Edits", + "Integration_Run_When_Message_Is_Edited_Description": "Should the integration run when the message is edited? Setting this to false will cause the integration to only run on new messages.", "Integration_Word_Trigger_Placement": "Word Placement Anywhere", "Integration_Word_Trigger_Placement_Description": "Should the Word be Triggered when placed anywhere in the sentence other than the beginning?", "Integration_updated": "Integration has been updated.", diff --git a/packages/rocketchat-integrations/client/views/integrationsOutgoing.html b/packages/rocketchat-integrations/client/views/integrationsOutgoing.html index 2a2e6b9e8656..687be0a6ca1a 100644 --- a/packages/rocketchat-integrations/client/views/integrationsOutgoing.html +++ b/packages/rocketchat-integrations/client/views/integrationsOutgoing.html @@ -225,6 +225,14 @@

{{_ "Integration_Word_Trigger_Placement_Description"}}
+
+ +
+ + +
{{{_ "Integration_Run_When_Message_Is_Edited_Description"}}}
+
+
{{/if}} diff --git a/packages/rocketchat-integrations/client/views/integrationsOutgoing.js b/packages/rocketchat-integrations/client/views/integrationsOutgoing.js index d8a9418fd47b..8c98f87e0701 100644 --- a/packages/rocketchat-integrations/client/views/integrationsOutgoing.js +++ b/packages/rocketchat-integrations/client/views/integrationsOutgoing.js @@ -9,7 +9,8 @@ Template.integrationsOutgoing.onCreated(function _integrationsOutgoingOnCreated( token: Random.id(24), retryFailedCalls: true, retryCount: 6, - retryDelay: 'powers-of-ten' + retryDelay: 'powers-of-ten', + runOnEdits: true }); this.updateRecord = () => { @@ -31,7 +32,8 @@ Template.integrationsOutgoing.onCreated(function _integrationsOutgoingOnCreated( triggerWordAnywhere: $('[name=triggerWordAnywhere]').val() ? $('[name=triggerWordAnywhere]').val().trim() : undefined, retryFailedCalls: $('[name=retryFailedCalls]:checked').val().trim() === '1', retryCount: $('[name=retryCount]').val() ? $('[name=retryCount]').val().trim() : 6, - retryDelay: $('[name=retryDelay]').val() ? $('[name=retryDelay]').val().trim() : 'powers-of-ten' + retryDelay: $('[name=retryDelay]').val() ? $('[name=retryDelay]').val().trim() : 'powers-of-ten', + runOnEdits: $('[name=runOnEdits]:checked').val().trim() === '1' }); }; @@ -287,11 +289,13 @@ Template.integrationsOutgoing.events({ let triggerWords; let triggerWordAnywhere; + let runOnEdits; if (RocketChat.integrations.outgoingEvents[event].use.triggerWords) { triggerWords = $('[name=triggerWords]').val().trim(); triggerWords = triggerWords.split(',').filter((word) => word.trim() !== ''); triggerWordAnywhere = $('[name=triggerWordAnywhere]').val().trim(); + runOnEdits = $('[name=runOnEdits]:checked').val().trim(); } let channel; @@ -338,7 +342,8 @@ Template.integrationsOutgoing.events({ retryFailedCalls: retryFailedCalls === '1', retryCount: retryCount ? retryCount : 6, retryDelay: retryDelay ? retryDelay : 'powers-of-ten', - triggerWordAnywhere: triggerWordAnywhere === '1' + triggerWordAnywhere: triggerWordAnywhere === '1', + runOnEdits: runOnEdits === '1' }; const params = Template.instance().data.params? Template.instance().data.params() : undefined; diff --git a/packages/rocketchat-integrations/server/lib/triggerHandler.js b/packages/rocketchat-integrations/server/lib/triggerHandler.js index a40664743305..36cd9e929a00 100644 --- a/packages/rocketchat-integrations/server/lib/triggerHandler.js +++ b/packages/rocketchat-integrations/server/lib/triggerHandler.js @@ -389,6 +389,10 @@ RocketChat.integrations.triggerHandler = new class RocketChatIntegrationHandler if (message.bot) { data.bot = message.bot; } + + if (message.editedAt) { + data.isEdited = true; + } break; case 'fileUploaded': data.channel_id = room._id; @@ -585,6 +589,12 @@ RocketChat.integrations.triggerHandler = new class RocketChatIntegrationHandler } } + if (message && message.editedAt && !trigger.runOnEdits) { + console.log(`The trigger "${ trigger.name }"'s run on edits is disabled and the message was edited.`); + logger.outgoing.debug(`The trigger "${ trigger.name }"'s run on edits is disabled and the message was edited.`); + return; + } + const historyId = this.updateHistory({ step: 'start-execute-trigger-url', integration: trigger, event }); const data = { diff --git a/packages/rocketchat-integrations/server/lib/validation.js b/packages/rocketchat-integrations/server/lib/validation.js index 9da2094cb763..d25a42c45e18 100644 --- a/packages/rocketchat-integrations/server/lib/validation.js +++ b/packages/rocketchat-integrations/server/lib/validation.js @@ -138,6 +138,11 @@ RocketChat.integrations.validateOutgoing = function _validateOutgoing(integratio } } + if (typeof integration.runOnEdits !== 'undefined') { + // Verify this value is only true/false + integration.runOnEdits = integration.runOnEdits === true; + } + _verifyUserHasPermissionForChannels(integration, userId, channels); _verifyRetryInformation(integration); diff --git a/packages/rocketchat-integrations/server/methods/outgoing/updateOutgoingIntegration.js b/packages/rocketchat-integrations/server/methods/outgoing/updateOutgoingIntegration.js index aaf1f3376bc3..7719215729c9 100644 --- a/packages/rocketchat-integrations/server/methods/outgoing/updateOutgoingIntegration.js +++ b/packages/rocketchat-integrations/server/methods/outgoing/updateOutgoingIntegration.js @@ -44,6 +44,7 @@ Meteor.methods({ retryCount: integration.retryCount, retryDelay: integration.retryDelay, triggerWordAnywhere: integration.triggerWordAnywhere, + runOnEdits: integration.runOnEdits, _updatedAt: new Date(), _updatedBy: RocketChat.models.Users.findOne(this.userId, {fields: {username: 1}}) } diff --git a/server/startup/migrations/v092.js b/server/startup/migrations/v092.js new file mode 100644 index 000000000000..b88165afe17a --- /dev/null +++ b/server/startup/migrations/v092.js @@ -0,0 +1,10 @@ +RocketChat.Migrations.add({ + version: 92, + up() { + const outgoingIntegrations = RocketChat.models.Integrations.find({ type: 'webhook-outgoing', 'event': 'sendMessage' }, { fields: { name: 1 }}).fetch(); + + outgoingIntegrations.forEach((i) => { + RocketChat.models.Integrations.update(i._id, { $set: { runOnEdits: true }}); + }); + } +}); From 64e6cd35fd5d985c052c037318d12944fd85fd4a Mon Sep 17 00:00:00 2001 From: Bradley Hilton Date: Thu, 6 Apr 2017 13:20:04 -0400 Subject: [PATCH 2/2] Remove the left over log in the triggerHandler --- packages/rocketchat-integrations/server/lib/triggerHandler.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/rocketchat-integrations/server/lib/triggerHandler.js b/packages/rocketchat-integrations/server/lib/triggerHandler.js index 36cd9e929a00..a06a8f4bdaa5 100644 --- a/packages/rocketchat-integrations/server/lib/triggerHandler.js +++ b/packages/rocketchat-integrations/server/lib/triggerHandler.js @@ -590,7 +590,6 @@ RocketChat.integrations.triggerHandler = new class RocketChatIntegrationHandler } if (message && message.editedAt && !trigger.runOnEdits) { - console.log(`The trigger "${ trigger.name }"'s run on edits is disabled and the message was edited.`); logger.outgoing.debug(`The trigger "${ trigger.name }"'s run on edits is disabled and the message was edited.`); return; }