The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Rocket.Chat/packages/rocketchat-lib/package.js

258 lines
10 KiB

Package.describe({
name: 'rocketchat:lib',
version: '0.0.1',
summary: 'RocketChat libraries',
git: '',
});
Package.onUse(function(api) {
api.use('rate-limit');
api.use('webapp');
api.use('session');
api.use('reactive-var');
api.use('reactive-dict');
api.use('accounts-base');
api.use('ecmascript');
api.use('random');
api.use('check');
10 years ago
api.use('tracker');
api.use('ddp-rate-limiter');
api.use('mongo');
api.use('oauth');
api.use('matb33:collection-hooks');
api.use('service-configuration');
api.use('check');
9 years ago
api.use('rocketchat:accounts');
api.use('modules');
9 years ago
api.use('rocketchat:i18n');
api.use('rocketchat:streamer');
api.use('rocketchat:version');
api.use('rocketchat:logger');
api.use('rocketchat:mailer');
api.use('rocketchat:custom-oauth');
api.use('rocketchat:authorization', { unordered: true });
api.use('rocketchat:push-notifications', { unordered: true });
api.use('templating', 'client');
api.use('kadira:flow-router');
api.addFiles('lib/core.js');
api.addFiles('lib/settings.js');
// DEBUGGER
api.addFiles('server/lib/debug.js', 'server');
// ROOM TYPES
api.addFiles('lib/RoomTypeConfig.js');
api.addFiles([
'lib/roomTypes/conversation.js',
'lib/roomTypes/direct.js',
'lib/roomTypes/favorite.js',
'lib/roomTypes/index.js',
'lib/roomTypes/private.js',
'lib/roomTypes/public.js',
'lib/roomTypes/unread.js',
]);
// COMMON LIB
api.addFiles('lib/getURL.js');
9 years ago
api.addFiles('lib/callbacks.js');
api.addFiles('lib/fileUploadRestrictions.js');
api.addFiles('lib/getAvatarColor.js');
api.addFiles('lib/getDefaultSubscriptionPref.js');
api.addFiles('lib/getValidRoomName.js');
api.addFiles('lib/placeholders.js');
9 years ago
api.addFiles('lib/promises.js');
api.addFiles('lib/RoomTypesCommon.js');
9 years ago
api.addFiles('lib/slashCommand.js');
api.addFiles('lib/Message.js');
api.addFiles('lib/MessageProperties.js');
api.addFiles('lib/messageBox.js');
9 years ago
api.addFiles('lib/MessageTypes.js');
api.addFiles('lib/templateVarHandler.js');
api.addFiles('lib/getUserNotificationPreference.js');
api.addFiles('lib/getUserPreference.js');
api.addFiles('server/lib/bugsnag.js', 'server');
api.addFiles('server/lib/metrics.js', 'server');
9 years ago
api.addFiles('server/lib/RateLimiter.js', 'server');
// SERVER FUNCTIONS
api.addFiles('server/functions/isDocker.js', 'server');
api.addFiles('server/functions/isTheLastMessage.js', 'server');
api.addFiles('server/functions/addUserToDefaultChannels.js', 'server');
api.addFiles('server/functions/addUserToRoom.js', 'server');
api.addFiles('server/functions/archiveRoom.js', 'server');
api.addFiles('server/functions/checkUsernameAvailability.js', 'server');
api.addFiles('server/functions/checkEmailAvailability.js', 'server');
api.addFiles('server/functions/composeMessageObjectWithUser.js', 'server');
api.addFiles('server/functions/createRoom.js', 'server');
[NEW][BREAK] Message retention policy and pruning (#11236) Closes #6749 Closes #8321 Closes #9374 Closes #2700 Closes #2639 Closes #2355 Closes #1861 Closes #8757 Closes #7228 Closes #10870 Closes #6193 Closes #11299 Closes #11468 Closes #9317 Closes #11300 (will incorporate a fix to this PR's issue) Closes #11046 (will incorporate a fix to this PR's issue) Contributes to #5944 Contributes to #11475 _...and possibly more!_ This PR makes deleting messages (automatically and manually) a lot easier on Rocket.Chat. - [X] Implement a bulk message deletion notification, to quickly push large message deletions to users without reload - [X] Use it in `rooms.cleanHistory` - [X] Use it in user deletions - [X] Completely remove cleanChannelHistory as required by v0.67 - [X] Remove server method `cleanChannelHistory` - [X] Remove REST API `channels.cleanHistory` - [x] Implement a sidebar option to clean history - [x] Basic implementation - [x] Allow excluding pinned messages - [x] Allow attachment-only mode - [x] Allow specifying user(s) to narrow down to - [x] Also update REST API - [x] Also update docs - [x] Break the deletion into multiple different requests, so the client can keep track of progress - [x] Clear animation / progress bar for deleting - [x] Retention policy - [X] Global, set by admin - [X] Global timer that runs every second and deletes messages over the set limit - [X] Can change its timer's resolution to prevent insane CPU overhead - [X] Admin can decide what room types to target (channels, groups and/or DMs) - [X] Allow excluding pinned messages - [X] Allow attachment-only mode - [x] Per-channel, set by those with a new permission - [x] Disabled when master switch off - [x] Set in channel info - [x] Can override global policy with a switch that requires `edit-privileged-setting` - [x] Allow excluding pinned messages - [x] Allow attachment-only mode - [x] Uses same global timer for cleanup - [X] Message at start of channel history / in channel info if there is a retention policy set - [x] Message in channel info if there is a retention policy set on that channel specifically - [X] Make cleaning history also delete files (completely!) - [X] Manual purging - [X] Automatic purging - [x] Make other deletions also delete files - [x] User deletion - [X] Own messages - [x] DMs with them's partner messages - [x] Room deletion - [x] Cleanup - [x] Finish related [docs](https://github.com/RocketChat/docs/pull/815) - [x] Link to the docs in the settings Please suggest any cool changes/additions! Any support is greatly appreciated. **Breaking change:** This PR removes REST API endpoint `channels.cleanHistory` and Meteor callable `cleanChannelHistory` as per the protocol specified for them. ![bzzzzzzzz](https://user-images.githubusercontent.com/39674991/41799087-56d1dea0-7670-11e8-94c0-bc534b1f832d.png)
8 years ago
api.addFiles('server/functions/cleanRoomHistory.js', 'server');
api.addFiles('server/functions/deleteMessage.js', 'server');
api.addFiles('server/functions/deleteUser.js', 'server');
api.addFiles('server/functions/getFullUserData.js', 'server');
Enhance outgoing webhooks and add history (#5823) * Convert the majority of the integrations package to JavaScript * Move the trigger handler to it's own class * Start trying to generalize integration items * Yay, additional events trigger outgoing webhooks * Silence codacy and fix eslint problems. * Started work on user created event for outgoing integrations * Finish the outgoing integration work on the user created event. * Add user join and leave room events for outgoing webhooks * Add fields to the rest api integration creation and clean up the processWebhookMessage * Add the HTTP to the incoming webhook context * Don't check for property on result if it isn't there. Closes #4175, #5762, and #5896. * Add archive room and file upload events for the webhooks * Disable integrations when the user to run/post as gets deleted. * Try to fix the tests failing due to the requird events property * Add history of integration which get fired * Add the missing file for the IntegrationHistory * Fix deleting users being broke due to my code * Add the outgoing webhook integration history viewing page along with v1 rest api to retrieve it * Integration history replays are now enabled along with advanced settings * Work on the advanced settings and enable paging on the integration history * Enable i18n for the history and advanced settings * Update the wording on the word placement * Move migration to be 88 now. * Add missing translations for the webhooks * Fix en.i18n.json identation * Fix integrations.html indentation * Fix more identations * Fix identation of integrationsOutgoing.html
9 years ago
api.addFiles('server/functions/getRoomByNameOrIdWithOptionToJoin.js', 'server');
api.addFiles('server/functions/loadMessageHistory.js', 'server');
api.addFiles('server/functions/removeUserFromRoom.js', 'server');
api.addFiles('server/functions/saveUser.js', 'server');
api.addFiles('server/functions/saveCustomFields.js', 'server');
api.addFiles('server/functions/saveCustomFieldsWithoutValidation.js', 'server');
api.addFiles('server/functions/sendMessage.js', 'server');
api.addFiles('server/functions/settings.js', 'server');
api.addFiles('server/functions/setUserAvatar.js', 'server');
api.addFiles('server/functions/setUsername.js', 'server');
9 years ago
api.addFiles('server/functions/setRealName.js', 'server');
api.addFiles('server/functions/setEmail.js', 'server');
api.addFiles('server/functions/unarchiveRoom.js', 'server');
api.addFiles('server/functions/updateMessage.js', 'server');
api.addFiles('server/functions/validateCustomFields.js', 'server');
api.addFiles('server/functions/Notifications.js', 'server');
// SERVER LIB
api.addFiles('server/lib/configLogger.js', 'server');
api.addFiles('server/lib/PushNotification.js', 'server');
api.addFiles('server/lib/defaultBlockedDomainsList.js', 'server');
api.addFiles('server/lib/interceptDirectReplyEmails.js', 'server');
api.addFiles('server/lib/loginErrorMessageOverride.js', 'server');
api.addFiles('server/lib/notifyUsersOnMessage.js', 'server');
api.addFiles('server/lib/processDirectEmail.js', 'server');
9 years ago
api.addFiles('server/lib/roomTypes.js', 'server');
api.addFiles('server/lib/sendNotificationsOnMessage.js', 'server');
api.addFiles('server/lib/validateEmailDomain.js', 'server');
api.addFiles('server/lib/passwordPolicy.js', 'server');
// SERVER MODELS
api.addFiles('server/models/_Base.js', 'server');
api.addFiles('server/models/Avatars.js', 'server');
api.addFiles('server/models/Messages.js', 'server');
api.addFiles('server/models/Reports.js', 'server');
api.addFiles('server/models/Rooms.js', 'server');
api.addFiles('server/models/Settings.js', 'server');
api.addFiles('server/models/Subscriptions.js', 'server');
api.addFiles('server/models/Uploads.js', 'server');
api.addFiles('server/models/Users.js', 'server');
api.addFiles('server/models/ExportOperations.js', 'server');
api.addFiles('server/models/UserDataFiles.js', 'server');
api.addFiles('server/oauth/oauth.js', 'server');
api.addFiles('server/oauth/facebook.js', 'server');
api.addFiles('server/oauth/twitter.js', 'server');
api.addFiles('server/oauth/google.js', 'server');
api.addFiles('server/oauth/proxy.js', 'server');
api.addFiles('server/startup/statsTracker.js', 'server');
// SERVER PUBLICATIONS
api.addFiles('server/publications/settings.js', 'server');
// SERVER METHODS
api.addFiles('server/methods/addOAuthService.js', 'server');
api.addFiles('server/methods/refreshOAuthService.js', 'server');
api.addFiles('server/methods/addUserToRoom.js', 'server');
api.addFiles('server/methods/addUsersToRoom.js', 'server');
api.addFiles('server/methods/archiveRoom.js', 'server');
api.addFiles('server/methods/blockUser.js', 'server');
api.addFiles('server/methods/checkRegistrationSecretURL.js', 'server');
9 years ago
api.addFiles('server/methods/checkUsernameAvailability.js', 'server');
api.addFiles('server/methods/cleanRoomHistory.js', 'server');
api.addFiles('server/methods/createChannel.js', 'server');
api.addFiles('server/methods/createToken.js', 'server');
api.addFiles('server/methods/createPrivateGroup.js', 'server');
9 years ago
api.addFiles('server/methods/deleteMessage.js', 'server');
api.addFiles('server/methods/deleteUserOwnAccount.js', 'server');
api.addFiles('server/methods/executeSlashCommandPreview.js', 'server');
api.addFiles('server/methods/filterBadWords.js', ['server']);
api.addFiles('server/methods/filterATAllTag.js', 'server');
api.addFiles('server/methods/filterATHereTag.js', 'server');
api.addFiles('server/methods/getChannelHistory.js', 'server');
api.addFiles('server/methods/getFullUserData.js', 'server');
api.addFiles('server/methods/getRoomJoinCode.js', 'server');
api.addFiles('server/methods/getRoomRoles.js', 'server');
api.addFiles('server/methods/getServerInfo.js', 'server');
api.addFiles('server/methods/getSingleMessage.js', 'server');
api.addFiles('server/methods/getSlashCommandPreviews.js', 'server');
api.addFiles('server/methods/getUserRoles.js', 'server');
api.addFiles('server/methods/insertOrUpdateUser.js', 'server');
api.addFiles('server/methods/joinDefaultChannels.js', 'server');
api.addFiles('server/methods/joinRoom.js', 'server');
api.addFiles('server/methods/leaveRoom.js', 'server');
api.addFiles('server/methods/removeOAuthService.js', 'server');
api.addFiles('server/methods/restartServer.js', 'server');
9 years ago
api.addFiles('server/methods/robotMethods.js', 'server');
api.addFiles('server/methods/saveSetting.js', 'server');
9 years ago
api.addFiles('server/methods/sendInvitationEmail.js', 'server');
api.addFiles('server/methods/sendMessage.js', 'server');
9 years ago
api.addFiles('server/methods/sendSMTPTestEmail.js', 'server');
api.addFiles('server/methods/setAdminStatus.js', 'server');
api.addFiles('server/methods/setRealName.js', 'server');
api.addFiles('server/methods/setUsername.js', 'server');
api.addFiles('server/methods/setEmail.js', 'server');
api.addFiles('server/methods/unarchiveRoom.js', 'server');
api.addFiles('server/methods/unblockUser.js', 'server');
api.addFiles('server/methods/updateMessage.js', 'server');
// SERVER STARTUP
api.addFiles('server/startup/settingsOnLoadCdnPrefix.js', 'server');
api.addFiles('server/startup/settingsOnLoadDirectReply.js', 'server');
api.addFiles('server/startup/settingsOnLoadSMTP.js', 'server');
api.addFiles('server/startup/oAuthServicesUpdate.js', 'server');
api.addFiles('server/startup/settings.js', 'server');
// COMMON STARTUP
9 years ago
api.addFiles('lib/startup/settingsOnLoadSiteUrl.js');
// CLIENT LIB
api.addFiles('client/Notifications.js', 'client');
api.addFiles('client/OAuthProxy.js', 'client');
[NEW][BREAK] Message retention policy and pruning (#11236) Closes #6749 Closes #8321 Closes #9374 Closes #2700 Closes #2639 Closes #2355 Closes #1861 Closes #8757 Closes #7228 Closes #10870 Closes #6193 Closes #11299 Closes #11468 Closes #9317 Closes #11300 (will incorporate a fix to this PR's issue) Closes #11046 (will incorporate a fix to this PR's issue) Contributes to #5944 Contributes to #11475 _...and possibly more!_ This PR makes deleting messages (automatically and manually) a lot easier on Rocket.Chat. - [X] Implement a bulk message deletion notification, to quickly push large message deletions to users without reload - [X] Use it in `rooms.cleanHistory` - [X] Use it in user deletions - [X] Completely remove cleanChannelHistory as required by v0.67 - [X] Remove server method `cleanChannelHistory` - [X] Remove REST API `channels.cleanHistory` - [x] Implement a sidebar option to clean history - [x] Basic implementation - [x] Allow excluding pinned messages - [x] Allow attachment-only mode - [x] Allow specifying user(s) to narrow down to - [x] Also update REST API - [x] Also update docs - [x] Break the deletion into multiple different requests, so the client can keep track of progress - [x] Clear animation / progress bar for deleting - [x] Retention policy - [X] Global, set by admin - [X] Global timer that runs every second and deletes messages over the set limit - [X] Can change its timer's resolution to prevent insane CPU overhead - [X] Admin can decide what room types to target (channels, groups and/or DMs) - [X] Allow excluding pinned messages - [X] Allow attachment-only mode - [x] Per-channel, set by those with a new permission - [x] Disabled when master switch off - [x] Set in channel info - [x] Can override global policy with a switch that requires `edit-privileged-setting` - [x] Allow excluding pinned messages - [x] Allow attachment-only mode - [x] Uses same global timer for cleanup - [X] Message at start of channel history / in channel info if there is a retention policy set - [x] Message in channel info if there is a retention policy set on that channel specifically - [X] Make cleaning history also delete files (completely!) - [X] Manual purging - [X] Automatic purging - [x] Make other deletions also delete files - [x] User deletion - [X] Own messages - [x] DMs with them's partner messages - [x] Room deletion - [x] Cleanup - [x] Finish related [docs](https://github.com/RocketChat/docs/pull/815) - [x] Link to the docs in the settings Please suggest any cool changes/additions! Any support is greatly appreciated. **Breaking change:** This PR removes REST API endpoint `channels.cleanHistory` and Meteor callable `cleanChannelHistory` as per the protocol specified for them. ![bzzzzzzzz](https://user-images.githubusercontent.com/39674991/41799087-56d1dea0-7670-11e8-94c0-bc534b1f832d.png)
8 years ago
api.addFiles('client/UserDeleted.js', 'client');
api.addFiles('client/lib/RestApiClient.js', 'client');
api.addFiles('client/lib/TabBar.js', 'client');
api.addFiles('client/lib/RocketChatTabBar.js', 'client');
api.addFiles('client/lib/RocketChatAnnouncement.js', 'client');
api.addFiles('client/lib/cachedCollection.js', 'client');
9 years ago
api.addFiles('client/lib/openRoom.js', 'client');
api.addFiles('client/lib/roomExit.js', 'client');
api.addFiles('client/lib/settings.js', 'client');
9 years ago
api.addFiles('client/lib/roomTypes.js', 'client');
api.addFiles('client/lib/userRoles.js', 'client');
api.addFiles('client/lib/Layout.js', 'client');
// CLIENT LIB STARTUP
api.addFiles('client/lib/startup/commands.js', 'client');
// CLIENT METHODS
api.addFiles('client/methods/sendMessage.js', 'client');
api.addFiles('client/AdminBox.js', 'client');
api.addFiles('client/MessageAction.js', 'client');
api.addFiles('client/defaultTabBars.js', 'client');
api.addFiles('client/CustomTranslations.js', 'client');
// CLIENT MODELS
api.addFiles('client/models/_Base.js', 'client');
api.addFiles('client/models/Avatars.js', 'client');
api.addFiles('client/models/Uploads.js', 'client');
// CLIENT VIEWS
api.addFiles('client/views/customFieldsForm.html', 'client');
api.addFiles('client/views/customFieldsForm.js', 'client');
api.addFiles('startup/defaultRoomTypes.js');
api.addFiles('startup/index.js', 'server');
// VERSION
api.addFiles('rocketchat.info');
// EXPORT
api.export('RocketChat');
// exports
api.mainModule('server/lib/index.js', 'server');
api.mainModule('client/lib/index.js', 'client');
api.imply('tap:i18n');
});