parent
a5cb22bb00
commit
fc1fd30276
@ -1,107 +1,115 @@ |
||||
{ |
||||
"maxerr" : 50, // {int} Maximum error before stopping |
||||
"maxerr" : 50, // {int} Maximum error before stopping |
||||
|
||||
// Enforcing |
||||
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.) |
||||
"camelcase" : true, // true: Identifiers must be in camelCase |
||||
"curly" : true, // true: Require {} for every new block or scope |
||||
"eqeqeq" : true, // true: Require triple equals (===) for comparison |
||||
"forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty() |
||||
"freeze" : true, // true: prohibits overwriting prototypes of native objects such as Array, Date etc. |
||||
"immed" : false, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());` |
||||
"indent" : 2, // {int} Number of spaces to use for indentation |
||||
"latedef" : false, // true: Require variables/functions to be defined before being used |
||||
"newcap" : true, // true: Require capitalization of all constructor functions e.g. `new F()` |
||||
"noarg" : false, // true: Prohibit use of `arguments.caller` and `arguments.callee` |
||||
"noempty" : true, // true: Prohibit use of empty blocks |
||||
"nonbsp" : true, // true: Prohibit "non-breaking whitespace" characters. |
||||
"nonew" : false, // true: Prohibit use of constructors for side-effects (without assignment) |
||||
"plusplus" : false, // true: Prohibit use of `++` & `--` |
||||
"quotmark" : "single", // Quotation mark consistency: |
||||
// false : do nothing (default) |
||||
// true : ensure whatever is used is consistent |
||||
// "single" : require single quotes |
||||
// "double" : require double quotes |
||||
"undef" : true, // true: Require all non-global variables to be declared (prevents global leaks) |
||||
"unused" : true, // true: Require all defined variables be used |
||||
"strict" : false, // true: Requires all functions run in ES5 Strict Mode |
||||
"maxparams" : false, // {int} Max number of formal params allowed per function |
||||
"maxdepth" : false, // {int} Max depth of nested blocks (within functions) |
||||
"maxstatements" : false, // {int} Max number statements per function |
||||
"maxcomplexity" : false, // {int} Max cyclomatic complexity per function |
||||
"maxlen" : false, // {int} Max number of characters per line |
||||
// Enforcing |
||||
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.) |
||||
"camelcase" : false, // true: Identifiers must be in camelCase |
||||
"curly" : true, // true: Require {} for every new block or scope |
||||
"eqeqeq" : true, // true: Require triple equals (===) for comparison |
||||
"forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty() |
||||
"freeze" : true, // true: prohibits overwriting prototypes of native objects such as Array, Date etc. |
||||
"immed" : false, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());` |
||||
"indent" : 2, // {int} Number of spaces to use for indentation |
||||
"latedef" : false, // true: Require variables/functions to be defined before being used |
||||
"newcap" : true, // true: Require capitalization of all constructor functions e.g. `new F()` |
||||
"noarg" : false, // true: Prohibit use of `arguments.caller` and `arguments.callee` |
||||
"noempty" : true, // true: Prohibit use of empty blocks |
||||
"nonbsp" : true, // true: Prohibit "non-breaking whitespace" characters. |
||||
"nonew" : false, // true: Prohibit use of constructors for side-effects (without assignment) |
||||
"plusplus" : false, // true: Prohibit use of `++` & `--` |
||||
"quotmark" : "single", // Quotation mark consistency: |
||||
// false : do nothing (default) |
||||
// true : ensure whatever is used is consistent |
||||
// "single" : require single quotes |
||||
// "double" : require double quotes |
||||
"undef" : true, // true: Require all non-global variables to be declared (prevents global leaks) |
||||
"unused" : true, // true: Require all defined variables be used |
||||
"strict" : false, // true: Requires all functions run in ES5 Strict Mode |
||||
"maxparams" : false, // {int} Max number of formal params allowed per function |
||||
"maxdepth" : false, // {int} Max depth of nested blocks (within functions) |
||||
"maxstatements" : false, // {int} Max number statements per function |
||||
"maxcomplexity" : false, // {int} Max cyclomatic complexity per function |
||||
"maxlen" : false, // {int} Max number of characters per line |
||||
|
||||
// Relaxing |
||||
"asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons) |
||||
"boss" : false, // true: Tolerate assignments where comparisons would be expected |
||||
"debug" : false, // true: Allow debugger statements e.g. browser breakpoints. |
||||
"eqnull" : true, // true: Tolerate use of `== null` |
||||
"es5" : false, // true: Allow ES5 syntax (ex: getters and setters) |
||||
"esnext" : true, // true: Allow ES.next (ES6) syntax (ex: `const`) |
||||
"moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features) |
||||
// (ex: `for each`, multiple try/catch, function expression…) |
||||
"evil" : false, // true: Tolerate use of `eval` and `new Function()` |
||||
"expr" : false, // true: Tolerate `ExpressionStatement` as Programs |
||||
"funcscope" : false, // true: Tolerate defining variables inside control statements |
||||
"globalstrict" : false, // true: Allow global "use strict" (also enables 'strict') |
||||
"iterator" : false, // true: Tolerate using the `__iterator__` property |
||||
"lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block |
||||
"laxbreak" : false, // true: Tolerate possibly unsafe line breakings |
||||
"laxcomma" : false, // true: Tolerate comma-first style coding |
||||
"loopfunc" : false, // true: Tolerate functions being defined in loops |
||||
"multistr" : false, // true: Tolerate multi-line strings |
||||
"noyield" : false, // true: Tolerate generator functions with no yield statement in them. |
||||
"notypeof" : false, // true: Tolerate invalid typeof operator values |
||||
"proto" : false, // true: Tolerate using the `__proto__` property |
||||
"scripturl" : false, // true: Tolerate script-targeted URLs |
||||
"shadow" : false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;` |
||||
"sub" : false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation |
||||
"supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;` |
||||
"validthis" : false, // true: Tolerate using this in a non-constructor function |
||||
// Relaxing |
||||
"asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons) |
||||
"boss" : false, // true: Tolerate assignments where comparisons would be expected |
||||
"debug" : false, // true: Allow debugger statements e.g. browser breakpoints. |
||||
"eqnull" : true, // true: Tolerate use of `== null` |
||||
"es5" : false, // true: Allow ES5 syntax (ex: getters and setters) |
||||
"esnext" : true, // true: Allow ES.next (ES6) syntax (ex: `const`) |
||||
"moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features) |
||||
// (ex: `for each`, multiple try/catch, function expression…) |
||||
"evil" : false, // true: Tolerate use of `eval` and `new Function()` |
||||
"expr" : false, // true: Tolerate `ExpressionStatement` as Programs |
||||
"funcscope" : false, // true: Tolerate defining variables inside control statements |
||||
"globalstrict" : false, // true: Allow global "use strict" (also enables 'strict') |
||||
"iterator" : false, // true: Tolerate using the `__iterator__` property |
||||
"lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block |
||||
"laxbreak" : false, // true: Tolerate possibly unsafe line breakings |
||||
"laxcomma" : false, // true: Tolerate comma-first style coding |
||||
"loopfunc" : false, // true: Tolerate functions being defined in loops |
||||
"multistr" : false, // true: Tolerate multi-line strings |
||||
"noyield" : false, // true: Tolerate generator functions with no yield statement in them. |
||||
"notypeof" : false, // true: Tolerate invalid typeof operator values |
||||
"proto" : false, // true: Tolerate using the `__proto__` property |
||||
"scripturl" : false, // true: Tolerate script-targeted URLs |
||||
"shadow" : false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;` |
||||
"sub" : false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation |
||||
"supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;` |
||||
"validthis" : false, // true: Tolerate using this in a non-constructor function |
||||
|
||||
// Environments |
||||
"browser" : true, // Web Browser (window, document, etc) |
||||
"browserify" : false, // Browserify (node.js code in the browser) |
||||
"couch" : false, // CouchDB |
||||
"devel" : false, // Development/debugging (alert, confirm, etc) |
||||
"dojo" : false, // Dojo Toolkit |
||||
"jasmine" : false, // Jasmine |
||||
"jquery" : true, // jQuery |
||||
"mocha" : false, // Mocha |
||||
"mootools" : false, // MooTools |
||||
"node" : true, // Node.js |
||||
"nonstandard" : false, // Widely adopted globals (escape, unescape, etc) |
||||
"prototypejs" : false, // Prototype and Scriptaculous |
||||
"qunit" : false, // QUnit |
||||
"rhino" : false, // Rhino |
||||
"shelljs" : false, // ShellJS |
||||
"worker" : false, // Web Workers |
||||
"wsh" : false, // Windows Scripting Host |
||||
"yui" : false, // Yahoo User Interface |
||||
// Environments |
||||
"browser" : true, // Web Browser (window, document, etc) |
||||
"browserify" : false, // Browserify (node.js code in the browser) |
||||
"couch" : false, // CouchDB |
||||
"devel" : false, // Development/debugging (alert, confirm, etc) |
||||
"dojo" : false, // Dojo Toolkit |
||||
"jasmine" : false, // Jasmine |
||||
"jquery" : true, // jQuery |
||||
"mocha" : false, // Mocha |
||||
"mootools" : false, // MooTools |
||||
"node" : true, // Node.js |
||||
"nonstandard" : false, // Widely adopted globals (escape, unescape, etc) |
||||
"prototypejs" : false, // Prototype and Scriptaculous |
||||
"qunit" : false, // QUnit |
||||
"rhino" : false, // Rhino |
||||
"shelljs" : false, // ShellJS |
||||
"worker" : false, // Web Workers |
||||
"wsh" : false, // Windows Scripting Host |
||||
"yui" : false, // Yahoo User Interface |
||||
|
||||
// Custom Globals |
||||
"globals" : { |
||||
"_" : true, |
||||
"Assets" : true, |
||||
"Blaze" : true, |
||||
"crypto" : true, |
||||
"EJSON" : true, |
||||
"FlowRouter" : true, |
||||
"Meteor" : true, |
||||
"Npm" : true, |
||||
"Package" : true, |
||||
"Promise" : true, // Avoid "redefinition of Promise" warning |
||||
"Random" : true, |
||||
"ReactiveVar" : true, |
||||
"RocketChat" : true, |
||||
"s" : true, |
||||
"Session" : true, |
||||
"swal" : true, |
||||
"t" : true, |
||||
"TAPi18n" : true, |
||||
"Template" : true, |
||||
"TimeSync" : true, |
||||
"toastr" : true, |
||||
"Tracker" : true |
||||
} |
||||
// Custom Globals |
||||
"globals" : { |
||||
"_" : true, |
||||
"Assets" : true, |
||||
"SHA256" : true, |
||||
"Accounts" : true, |
||||
"Blaze" : true, |
||||
"Email" : true, |
||||
"check" : true, |
||||
"crypto" : true, |
||||
"EJSON" : true, |
||||
"FlowRouter" : true, |
||||
"BlazeLayout" : true, |
||||
"Meteor" : true, |
||||
"Npm" : true, |
||||
"Package" : true, |
||||
"Promise" : true, // Avoid "redefinition of Promise" warning |
||||
"Random" : true, |
||||
"ReactiveVar" : true, |
||||
"RocketChat" : true, |
||||
"RocketChatFile" : true, |
||||
"RocketChatFileAvatarInstance" : true, |
||||
"s" : true, |
||||
"Session" : true, |
||||
"swal" : true, |
||||
"t" : true, |
||||
"TAPi18n" : true, |
||||
"Template" : true, |
||||
"TimeSync" : true, |
||||
"toastr" : true, |
||||
"Logger" : true, |
||||
"Tracker" : true |
||||
} |
||||
} |
||||
|
||||
@ -1,35 +1,36 @@ |
||||
Meteor.subscribe('scopedRoles', 'Subscriptions'); |
||||
|
||||
if (_.isUndefined(RocketChat.models.Subscriptions)) { |
||||
RocketChat.models.Subscriptions = {} |
||||
RocketChat.models.Subscriptions = {}; |
||||
} |
||||
|
||||
RocketChat.models.Subscriptions.isUserInRole = function(userId, roleName, roomId) { |
||||
query = { |
||||
var query = { |
||||
rid: roomId, |
||||
roles: roleName |
||||
}; |
||||
|
||||
return !_.isUndefined(this.findOne(query)); |
||||
} |
||||
}; |
||||
|
||||
RocketChat.models.Subscriptions.findUsersInRoles = function(roles, scope, options) { |
||||
roles = [].concat(roles); |
||||
|
||||
var query = { |
||||
roles: { $in: roles } |
||||
} |
||||
}; |
||||
|
||||
if (scope) { |
||||
query.rid = scope; |
||||
} |
||||
|
||||
subscriptions = this.find(query).fetch(); |
||||
var subscriptions = this.find(query).fetch(); |
||||
|
||||
users = _.compact(_.map(subscriptions, function(subscription) { |
||||
if ('undefined' !== typeof subscription.u && 'undefined' !== typeof subscription.u._id) |
||||
return subscription.u._id |
||||
var users = _.compact(_.map(subscriptions, function(subscription) { |
||||
if ('undefined' !== typeof subscription.u && 'undefined' !== typeof subscription.u._id) { |
||||
return subscription.u._id; |
||||
} |
||||
})); |
||||
|
||||
return RocketChat.models.Users.find({ _id: { $in: users } }, options); |
||||
} |
||||
}; |
||||
|
||||
@ -1,24 +1,24 @@ |
||||
Meteor.subscribe('scopedRoles', 'Users'); |
||||
|
||||
if (_.isUndefined(RocketChat.models.Users)) { |
||||
RocketChat.models.Users = {} |
||||
RocketChat.models.Users = {}; |
||||
} |
||||
|
||||
RocketChat.models.Users.isUserInRole = function(userId, roleName) { |
||||
query = { |
||||
var query = { |
||||
_id: userId, |
||||
roles: roleName |
||||
}; |
||||
|
||||
return !_.isUndefined(this.findOne(query)); |
||||
} |
||||
}; |
||||
|
||||
RocketChat.models.Users.findUsersInRoles = function(roles, scope, options) { |
||||
roles = [].concat(roles); |
||||
|
||||
var query = { |
||||
roles: { $in: roles } |
||||
} |
||||
}; |
||||
|
||||
return this.find(query, options); |
||||
} |
||||
}; |
||||
|
||||
@ -1,38 +1,40 @@ |
||||
RocketChat.models._Base.prototype.roleBaseQuery = function(userId, scope) { return {} } |
||||
RocketChat.models._Base.prototype.roleBaseQuery = function(/*userId, scope*/) { |
||||
return {}; |
||||
}; |
||||
|
||||
RocketChat.models._Base.prototype.findRolesByUserId = function(userId, options) { |
||||
RocketChat.models._Base.prototype.findRolesByUserId = function(userId/*, options*/) { |
||||
var query = this.roleBaseQuery(userId); |
||||
return this.find(query, { fields: { roles: 1 } }); |
||||
} |
||||
}; |
||||
|
||||
RocketChat.models._Base.prototype.isUserInRole = function(userId, roleName, scope) { |
||||
var query = this.roleBaseQuery(userId, scope); |
||||
query.roles = roleName; |
||||
return !_.isUndefined(this.findOne(query)); |
||||
} |
||||
}; |
||||
|
||||
RocketChat.models._Base.prototype.addRolesByUserId = function(userId, roles, scope) { |
||||
var roles = [].concat(roles); |
||||
roles = [].concat(roles); |
||||
var query = this.roleBaseQuery(userId, scope); |
||||
var update = { |
||||
$addToSet: { |
||||
roles: { $each: roles } |
||||
} |
||||
} |
||||
}; |
||||
return this.update(query, update); |
||||
} |
||||
}; |
||||
|
||||
RocketChat.models._Base.prototype.removeRolesByUserId = function(userId, roles, scope) { |
||||
var roles = [].concat(roles); |
||||
roles = [].concat(roles); |
||||
var query = this.roleBaseQuery(userId, scope); |
||||
var update = { |
||||
$pullAll: { |
||||
roles: roles |
||||
} |
||||
} |
||||
}; |
||||
return this.update(query, update); |
||||
} |
||||
}; |
||||
|
||||
RocketChat.models._Base.prototype.findUsersInRoles = function() { |
||||
throw new Meteor.Error('overwrite-function', 'You must overwrite this function in the extended classes'); |
||||
} |
||||
}; |
||||
|
||||
@ -1,28 +1,29 @@ |
||||
RocketChat.models.Subscriptions.roleBaseQuery = function(userId, scope) { |
||||
var query = { "u._id": userId } |
||||
var query = { 'u._id': userId }; |
||||
if (!_.isUndefined(scope)) { |
||||
query.rid = scope; |
||||
} |
||||
return query; |
||||
} |
||||
}; |
||||
|
||||
RocketChat.models.Subscriptions.findUsersInRoles = function(roles, scope, options) { |
||||
roles = [].concat(roles); |
||||
|
||||
var query = { |
||||
roles: { $in: roles } |
||||
} |
||||
}; |
||||
|
||||
if (scope) { |
||||
query.rid = scope; |
||||
} |
||||
|
||||
subscriptions = this.find(query).fetch(); |
||||
var subscriptions = this.find(query).fetch(); |
||||
|
||||
users = _.compact(_.map(subscriptions, function(subscription) { |
||||
if ('undefined' !== typeof subscription.u && 'undefined' !== typeof subscription.u._id) |
||||
return subscription.u._id |
||||
var users = _.compact(_.map(subscriptions, function(subscription) { |
||||
if ('undefined' !== typeof subscription.u && 'undefined' !== typeof subscription.u._id) { |
||||
return subscription.u._id; |
||||
} |
||||
})); |
||||
|
||||
return RocketChat.models.Users.find({ _id: { $in: users } }, options); |
||||
} |
||||
}; |
||||
|
||||
@ -1,13 +1,13 @@ |
||||
RocketChat.models.Users.roleBaseQuery = function(userId, scope) { |
||||
return { _id: userId } |
||||
} |
||||
RocketChat.models.Users.roleBaseQuery = function(userId) { |
||||
return { _id: userId }; |
||||
}; |
||||
|
||||
RocketChat.models.Users.findUsersInRoles = function(roles, scope, options) { |
||||
roles = [].concat(roles); |
||||
|
||||
var query = { |
||||
roles: { $in: roles } |
||||
} |
||||
}; |
||||
|
||||
return this.find(query, options); |
||||
} |
||||
}; |
||||
|
||||
@ -1,77 +1,77 @@ |
||||
Package.describe({ |
||||
name: 'rocketchat:integrations', |
||||
version: '0.0.1', |
||||
summary: 'Integrations with services and WebHooks', |
||||
git: '', |
||||
documentation: 'README.md' |
||||
name: 'rocketchat:integrations', |
||||
version: '0.0.1', |
||||
summary: 'Integrations with services and WebHooks', |
||||
git: '', |
||||
documentation: 'README.md' |
||||
}); |
||||
|
||||
Package.onUse(function(api) { |
||||
api.versionsFrom('1.0'); |
||||
api.versionsFrom('1.0'); |
||||
|
||||
api.use('coffeescript'); |
||||
api.use('underscore'); |
||||
api.use('ecmascript'); |
||||
api.use('babel-compiler'); |
||||
api.use('simple:highlight.js'); |
||||
api.use('rocketchat:lib'); |
||||
api.use('rocketchat:authorization'); |
||||
api.use('rocketchat:api'); |
||||
api.use('rocketchat:theme'); |
||||
api.use('rocketchat:logger'); |
||||
api.use('coffeescript'); |
||||
api.use('underscore'); |
||||
api.use('ecmascript'); |
||||
api.use('babel-compiler'); |
||||
api.use('simple:highlight.js'); |
||||
api.use('rocketchat:lib'); |
||||
api.use('rocketchat:authorization'); |
||||
api.use('rocketchat:api'); |
||||
api.use('rocketchat:theme'); |
||||
api.use('rocketchat:logger'); |
||||
|
||||
api.use('kadira:flow-router', 'client'); |
||||
api.use('templating', 'client'); |
||||
api.use('kadira:flow-router', 'client'); |
||||
api.use('templating', 'client'); |
||||
|
||||
api.addFiles('lib/rocketchat.coffee', ['server','client']); |
||||
api.addFiles('client/collection.coffee', ['client']); |
||||
api.addFiles('client/startup.coffee', 'client'); |
||||
api.addFiles('client/route.coffee', 'client'); |
||||
api.addFiles('lib/rocketchat.coffee', ['server','client']); |
||||
api.addFiles('client/collection.coffee', ['client']); |
||||
api.addFiles('client/startup.coffee', 'client'); |
||||
api.addFiles('client/route.coffee', 'client'); |
||||
|
||||
// views
|
||||
api.addFiles('client/views/integrations.html', 'client'); |
||||
api.addFiles('client/views/integrations.coffee', 'client'); |
||||
api.addFiles('client/views/integrationsNew.html', 'client'); |
||||
api.addFiles('client/views/integrationsNew.coffee', 'client'); |
||||
api.addFiles('client/views/integrationsIncoming.html', 'client'); |
||||
api.addFiles('client/views/integrationsIncoming.coffee', 'client'); |
||||
api.addFiles('client/views/integrationsOutgoing.html', 'client'); |
||||
api.addFiles('client/views/integrationsOutgoing.coffee', 'client'); |
||||
// views
|
||||
api.addFiles('client/views/integrations.html', 'client'); |
||||
api.addFiles('client/views/integrations.coffee', 'client'); |
||||
api.addFiles('client/views/integrationsNew.html', 'client'); |
||||
api.addFiles('client/views/integrationsNew.coffee', 'client'); |
||||
api.addFiles('client/views/integrationsIncoming.html', 'client'); |
||||
api.addFiles('client/views/integrationsIncoming.coffee', 'client'); |
||||
api.addFiles('client/views/integrationsOutgoing.html', 'client'); |
||||
api.addFiles('client/views/integrationsOutgoing.coffee', 'client'); |
||||
|
||||
// stylesheets
|
||||
api.addAssets('client/stylesheets/integrations.less', 'server'); |
||||
api.addFiles('client/stylesheets/load.coffee', 'server'); |
||||
// stylesheets
|
||||
api.addAssets('client/stylesheets/integrations.less', 'server'); |
||||
api.addFiles('client/stylesheets/load.coffee', 'server'); |
||||
|
||||
api.addFiles('server/logger.js', 'server'); |
||||
api.addFiles('server/logger.js', 'server'); |
||||
|
||||
api.addFiles('server/models/Integrations.coffee', 'server'); |
||||
api.addFiles('server/models/Integrations.coffee', 'server'); |
||||
|
||||
// publications
|
||||
api.addFiles('server/publications/integrations.coffee', 'server'); |
||||
// publications
|
||||
api.addFiles('server/publications/integrations.coffee', 'server'); |
||||
|
||||
// methods
|
||||
api.addFiles('server/methods/incoming/addIncomingIntegration.coffee', 'server'); |
||||
api.addFiles('server/methods/incoming/updateIncomingIntegration.coffee', 'server'); |
||||
api.addFiles('server/methods/incoming/deleteIncomingIntegration.coffee', 'server'); |
||||
api.addFiles('server/methods/outgoing/addOutgoingIntegration.coffee', 'server'); |
||||
api.addFiles('server/methods/outgoing/updateOutgoingIntegration.coffee', 'server'); |
||||
api.addFiles('server/methods/outgoing/deleteOutgoingIntegration.coffee', 'server'); |
||||
// methods
|
||||
api.addFiles('server/methods/incoming/addIncomingIntegration.coffee', 'server'); |
||||
api.addFiles('server/methods/incoming/updateIncomingIntegration.coffee', 'server'); |
||||
api.addFiles('server/methods/incoming/deleteIncomingIntegration.coffee', 'server'); |
||||
api.addFiles('server/methods/outgoing/addOutgoingIntegration.coffee', 'server'); |
||||
api.addFiles('server/methods/outgoing/updateOutgoingIntegration.coffee', 'server'); |
||||
api.addFiles('server/methods/outgoing/deleteOutgoingIntegration.coffee', 'server'); |
||||
|
||||
// api
|
||||
api.addFiles('server/api/api.coffee', 'server'); |
||||
// api
|
||||
api.addFiles('server/api/api.coffee', 'server'); |
||||
|
||||
|
||||
api.addFiles('server/triggers.coffee', 'server'); |
||||
api.addFiles('server/triggers.coffee', 'server'); |
||||
|
||||
api.addFiles('server/processWebhookMessage.js', 'server'); |
||||
api.addFiles('server/processWebhookMessage.js', 'server'); |
||||
|
||||
var _ = Npm.require('underscore'); |
||||
var fs = Npm.require('fs'); |
||||
tapi18nFiles = _.compact(_.map(fs.readdirSync('packages/rocketchat-integrations/i18n'), function(filename) { |
||||
if (fs.statSync('packages/rocketchat-integrations/i18n/' + filename).size > 16) { |
||||
return 'i18n/' + filename; |
||||
} |
||||
})); |
||||
api.use('tap:i18n'); |
||||
api.addFiles(tapi18nFiles); |
||||
var _ = Npm.require('underscore'); |
||||
var fs = Npm.require('fs'); |
||||
var tapi18nFiles = _.compact(_.map(fs.readdirSync('packages/rocketchat-integrations/i18n'), function(filename) { |
||||
if (fs.statSync('packages/rocketchat-integrations/i18n/' + filename).size > 16) { |
||||
return 'i18n/' + filename; |
||||
} |
||||
})); |
||||
api.use('tap:i18n'); |
||||
api.addFiles(tapi18nFiles); |
||||
}); |
||||
|
||||
@ -1,3 +1,3 @@ |
||||
RocketChat.checkEmailAvailability = function(email) { |
||||
return !Meteor.users.findOne({ "emails.address": { $regex : new RegExp("^" + s.trim(s.escapeRegExp(email)) + "$", "i") } }) |
||||
} |
||||
return !Meteor.users.findOne({ 'emails.address': { $regex : new RegExp('^' + s.trim(s.escapeRegExp(email)) + '$', 'i') } }); |
||||
}; |
||||
|
||||
@ -1,9 +1,9 @@ |
||||
Meteor.methods({ |
||||
clearRequirePasswordChange: function() { |
||||
if (!Meteor.userId()) { |
||||
throw new Meteor.Error('invalid-user', "[methods] clearRequirePasswordChange -> Invalid user"); |
||||
throw new Meteor.Error('invalid-user', '[methods] clearRequirePasswordChange -> Invalid user'); |
||||
} |
||||
|
||||
return RocketChat.models.Users.unsetRequirePasswordChange(Meteor.userId()); |
||||
} |
||||
}) |
||||
}); |
||||
|
||||
@ -1,3 +1,3 @@ |
||||
RocketChat.settings.addGroup("OTR", function() { |
||||
this.add("OTR_Enable", true, { type: "boolean", public: true }); |
||||
}) |
||||
RocketChat.settings.addGroup('OTR', function() { |
||||
this.add('OTR_Enable', true, { type: 'boolean', public: true }); |
||||
}); |
||||
|
||||
@ -1,5 +1,6 @@ |
||||
// Write your tests here!
|
||||
// Here is an example.
|
||||
/* globals Tinytest */ |
||||
Tinytest.add('example', function (test) { |
||||
test.equal(true, true); |
||||
}); |
||||
|
||||
@ -1,5 +1,6 @@ |
||||
// Write your tests here!
|
||||
// Here is an example.
|
||||
/* globals Tinytest */ |
||||
Tinytest.add('example', function (test) { |
||||
test.equal(true, true); |
||||
}); |
||||
|
||||
@ -1,3 +1,3 @@ |
||||
Template.loginLayout.onRendered(function() { |
||||
$('.page-loading').remove(); |
||||
}) |
||||
}); |
||||
|
||||
@ -1,4 +1,6 @@ |
||||
FastRender.onAllRoutes(function(path) { |
||||
/* globals FastRender */ |
||||
|
||||
FastRender.onAllRoutes(function(/*path*/) { |
||||
this.subscribe('settings'); |
||||
this.subscribe("meteor.loginServiceConfiguration"); |
||||
this.subscribe('meteor.loginServiceConfiguration'); |
||||
}); |
||||
|
||||
Loading…
Reference in new issue