Remove dependency of RC namespace in rc-livechat/server/publications (#13383)

* Remove some dependencies inside rocketchat-lib/client  (#13210)

* Move function to rc-utils

* Change import from to export directly

* Removing duplicated dependency and remove old code

* Import some variables to remove dependency of RC namespace

* Remove some dependencies inside rocketchat-lib/lib (#13212)

* Move some functions from lib to rc-ui-utils

* Move some functions from lib ro rc-utils

* Remove hostname from RC namespace

* Import variables to remove dependency of RC namespace

* Remove some dependencies inside rocketchat-lib/server/functions (#13214)

* Move integrations models to rc-models

* Move composeMessage function to rc-utils

* Move PushNotifications class to push-notifications package

* Import variables to remove dependency of RC namespace

* Remove some dependencies inside rocketchat-lib/server/lib (#13217)

* Move integrations models to rc-models

* Move composeMessage function to rc-utils

* Move PushNotifications class to push-notifications package

* Import variables to remove dependency of RC namespace

* Import variables to remove RC namespace dependency inside rc-lib/server/lib

* Remove some dependencies inside rocketchat-lib/server/methods (#13218)

* Move integrations models to rc-models

* Move composeMessage function to rc-utils

* Move PushNotifications class to push-notifications package

* Import variables to remove dependency of RC namespace

* Import variables to remove RC namespace dependency inside rc-lib/server/lib

* Import variables to remove RC namespace inside rc-lib/server/methods

* Remove some dependencies inside rocketchat-lib/server/startup, publications... (#13222)

* Move integrations models to rc-models

* Move composeMessage function to rc-utils

* Move PushNotifications class to push-notifications package

* Import variables to remove dependency of RC namespace

* Import variables to remove RC namespace dependency inside rc-lib/server/lib

* Import variables to remove RC namespace inside rc-lib/server/methods

* Import variables to remove dependency with RC namespace

* Remove duplicated server settings (#13223)

* Move integrations models to rc-models

* Move composeMessage function to rc-utils

* Move PushNotifications class to push-notifications package

* Import variables to remove dependency of RC namespace

* Import variables to remove RC namespace dependency inside rc-lib/server/lib

* Import variables to remove RC namespace inside rc-lib/server/methods

* Import variables to remove dependency with RC namespace

* Remove duplicated server settings located in rc-lib

*  Export functions and lib function of rc-lib but keep it inside RC namespace (#13225)

* Move integrations models to rc-models

* Move composeMessage function to rc-utils

* Move PushNotifications class to push-notifications package

* Import variables to remove dependency of RC namespace

* Import variables to remove RC namespace dependency inside rc-lib/server/lib

* Import variables to remove RC namespace inside rc-lib/server/methods

* Import variables to remove dependency with RC namespace

* Remove duplicated server settings located in rc-lib

* Export function and lib function of rc-lib but keep it inside RC namespace

* Fix missed exports and re-add some functions to RC namespace

*  Import variables from functions and lib to remove RC namespace dependency (#13226)

* Move integrations models to rc-models

* Move composeMessage function to rc-utils

* Move PushNotifications class to push-notifications package

* Import variables to remove dependency of RC namespace

* Import variables to remove RC namespace dependency inside rc-lib/server/lib

* Import variables to remove RC namespace inside rc-lib/server/methods

* Import variables to remove dependency with RC namespace

* Remove duplicated server settings located in rc-lib

* Export function and lib function of rc-lib but keep it inside RC namespace

* Import variables from functions and lib to remove RC namespace dependency

*  Remove dependency of RC namespace in rc-sandstorm (#13227)

* Move integrations models to rc-models

* Move composeMessage function to rc-utils

* Move PushNotifications class to push-notifications package

* Import variables to remove dependency of RC namespace

* Import variables to remove RC namespace dependency inside rc-lib/server/lib

* Import variables to remove RC namespace inside rc-lib/server/methods

* Import variables to remove dependency with RC namespace

* Remove duplicated server settings located in rc-lib

* Export function and lib function of rc-lib but keep it inside RC namespace

* Import variables from functions and lib to remove RC namespace dependency

* Remove dependency of RC namespace in rc-sandstorm

*  Remove dependency of RC namespace in chatpal-search (#13231)

* Move integrations models to rc-models

* Move composeMessage function to rc-utils

* Move PushNotifications class to push-notifications package

* Import variables to remove dependency of RC namespace

* Import variables to remove RC namespace dependency inside rc-lib/server/lib

* Import variables to remove RC namespace inside rc-lib/server/methods

* Import variables to remove dependency with RC namespace

* Remove duplicated server settings located in rc-lib

* Export function and lib function of rc-lib but keep it inside RC namespace

* Import variables from functions and lib to remove RC namespace dependency

* Remove dependency of RC namespace in rc-sandstorm

* Remove dependency of RC namespace in chatpal-search

*  Remove dependency of RC namespace in meteor saml (#13233)

* Move integrations models to rc-models

* Move composeMessage function to rc-utils

* Move PushNotifications class to push-notifications package

* Import variables to remove dependency of RC namespace

* Import variables to remove RC namespace dependency inside rc-lib/server/lib

* Import variables to remove RC namespace inside rc-lib/server/methods

* Import variables to remove dependency with RC namespace

* Remove duplicated server settings located in rc-lib

* Export function and lib function of rc-lib but keep it inside RC namespace

* Import variables from functions and lib to remove RC namespace dependency

* Remove dependency of RC namespace in rc-sandstorm

* Remove dependency of RC namespace in chatpal-search

* Move CreadentialTokens model to rc-models

* Move getUsernameSuggestion function and method from server/ to rc-lib

* Remove dependency of RC namespace in meteor saml

*  Remove dependency of RC namespace in rc-theme (#13234)

* Move integrations models to rc-models

* Move composeMessage function to rc-utils

* Move PushNotifications class to push-notifications package

* Import variables to remove dependency of RC namespace

* Import variables to remove RC namespace dependency inside rc-lib/server/lib

* Import variables to remove RC namespace inside rc-lib/server/methods

* Import variables to remove dependency with RC namespace

* Remove duplicated server settings located in rc-lib

* Export function and lib function of rc-lib but keep it inside RC namespace

* Import variables from functions and lib to remove RC namespace dependency

* Remove dependency of RC namespace in rc-sandstorm

* Remove dependency of RC namespace in chatpal-search

* Move CreadentialTokens model to rc-models

* Move getUsernameSuggestion function and method from server/ to rc-lib

* Remove dependency of RC namespace in meteor saml

* Remove dependency of RC namespace in rc-theme

*  Remove dependency of RC namespace in rc-2fa (#13235)

* Move integrations models to rc-models

* Move composeMessage function to rc-utils

* Move PushNotifications class to push-notifications package

* Import variables to remove dependency of RC namespace

* Import variables to remove RC namespace dependency inside rc-lib/server/lib

* Import variables to remove RC namespace inside rc-lib/server/methods

* Import variables to remove dependency with RC namespace

* Remove duplicated server settings located in rc-lib

* Export function and lib function of rc-lib but keep it inside RC namespace

* Import variables from functions and lib to remove RC namespace dependency

* Remove dependency of RC namespace in rc-sandstorm

* Remove dependency of RC namespace in chatpal-search

* Move CreadentialTokens model to rc-models

* Move getUsernameSuggestion function and method from server/ to rc-lib

* Remove dependency of RC namespace in meteor saml

* Remove dependency of RC namespace in rc-theme

* Move 2FA Users model to rc-models

* Remove dependency of RC namespace in rc-2fa

*  Remove dependency of RC namespace in rc-action-links (#13236)

* Move integrations models to rc-models

* Move composeMessage function to rc-utils

* Move PushNotifications class to push-notifications package

* Import variables to remove dependency of RC namespace

* Import variables to remove RC namespace dependency inside rc-lib/server/lib

* Import variables to remove RC namespace inside rc-lib/server/methods

* Import variables to remove dependency with RC namespace

* Remove duplicated server settings located in rc-lib

* Export function and lib function of rc-lib but keep it inside RC namespace

* Import variables from functions and lib to remove RC namespace dependency

* Remove dependency of RC namespace in rc-sandstorm

* Remove dependency of RC namespace in chatpal-search

* Move CreadentialTokens model to rc-models

* Move getUsernameSuggestion function and method from server/ to rc-lib

* Remove dependency of RC namespace in meteor saml

* Remove dependency of RC namespace in rc-theme

* Move 2FA Users model to rc-models

* Remove dependency of RC namespace in rc-2fa

* Remove dependency of RC namespace in rc-action-links

* Add action links in the RC namespace

*  Remove dependency of RC namespace in rc-analytics and rc-assets (#13237)

* Move integrations models to rc-models

* Move composeMessage function to rc-utils

* Move PushNotifications class to push-notifications package

* Import variables to remove dependency of RC namespace

* Import variables to remove RC namespace dependency inside rc-lib/server/lib

* Import variables to remove RC namespace inside rc-lib/server/methods

* Import variables to remove dependency with RC namespace

* Remove duplicated server settings located in rc-lib

* Export function and lib function of rc-lib but keep it inside RC namespace

* Import variables from functions and lib to remove RC namespace dependency

* Remove dependency of RC namespace in rc-sandstorm

* Remove dependency of RC namespace in chatpal-search

* Move CreadentialTokens model to rc-models

* Move getUsernameSuggestion function and method from server/ to rc-lib

* Remove dependency of RC namespace in meteor saml

* Remove dependency of RC namespace in rc-theme

* Move 2FA Users model to rc-models

* Remove dependency of RC namespace in rc-2fa

* Remove dependency of RC namespace in rc-action-links

* Add action links in the RC namespace

* Remove dependency of RC namespace in rc-analytics

* Remove dependency of RC namespace in rc-assets

* Add Assets in RC namespace

* Rename Assets variable to avoid conflicts

* Fix rename Assets

*  Remove dependency of RC namespace in rc-markdown, rc-autolinker and rc-autotranslate (#13240)

* Move integrations models to rc-models

* Move composeMessage function to rc-utils

* Move PushNotifications class to push-notifications package

* Import variables to remove dependency of RC namespace

* Import variables to remove RC namespace dependency inside rc-lib/server/lib

* Import variables to remove RC namespace inside rc-lib/server/methods

* Import variables to remove dependency with RC namespace

* Remove duplicated server settings located in rc-lib

* Export function and lib function of rc-lib but keep it inside RC namespace

* Import variables from functions and lib to remove RC namespace dependency

* Remove dependency of RC namespace in rc-sandstorm

* Remove dependency of RC namespace in chatpal-search

* Move CreadentialTokens model to rc-models

* Move getUsernameSuggestion function and method from server/ to rc-lib

* Remove dependency of RC namespace in meteor saml

* Remove dependency of RC namespace in rc-theme

* Move 2FA Users model to rc-models

* Remove dependency of RC namespace in rc-2fa

* Remove dependency of RC namespace in rc-action-links

* Add action links in the RC namespace

* Remove dependency of RC namespace in rc-analytics

* Remove dependency of RC namespace in rc-assets

* Add Assets in RC namespace

* Remove dependency of RC namespace in rc-autolinker

* Move autotranslate models to rc-models

* Partial remove dependency of Rc namespace in rc-autotranslate

* Remove dependency of RC namespace in rc-markdown

* Finish of remotion of RC namespace in rc-autotranslate

* Import Autotranslate where it has been used

* Fix lint

* Rename Assets variable to avoid conflicts

* Fix rename Assets

* Fix wrong imports

*  Remove dependency of RC namespace in rc-blockstack, bot-helpers and cas (#13246)

* Move integrations models to rc-models

* Move composeMessage function to rc-utils

* Move PushNotifications class to push-notifications package

* Import variables to remove dependency of RC namespace

* Import variables to remove RC namespace dependency inside rc-lib/server/lib

* Import variables to remove RC namespace inside rc-lib/server/methods

* Import variables to remove dependency with RC namespace

* Remove duplicated server settings located in rc-lib

* Export function and lib function of rc-lib but keep it inside RC namespace

* Import variables from functions and lib to remove RC namespace dependency

* Remove dependency of RC namespace in rc-sandstorm

* Remove dependency of RC namespace in chatpal-search

* Move CreadentialTokens model to rc-models

* Move getUsernameSuggestion function and method from server/ to rc-lib

* Remove dependency of RC namespace in meteor saml

* Remove dependency of RC namespace in rc-theme

* Move 2FA Users model to rc-models

* Remove dependency of RC namespace in rc-2fa

* Remove dependency of RC namespace in rc-action-links

* Add action links in the RC namespace

* Remove dependency of RC namespace in rc-analytics

* Remove dependency of RC namespace in rc-assets

* Add Assets in RC namespace

* Remove dependency of RC namespace in rc-autolinker

* Move autotranslate models to rc-models

* Partial remove dependency of Rc namespace in rc-autotranslate

* Remove dependency of RC namespace in rc-markdown

* Finish of remotion of RC namespace in rc-autotranslate

* Import Autotranslate where it has been used

* Fix lint

* Rename Assets variable to avoid conflicts

* Fix rename Assets

* Remove dependency of RC namespace in rc-blockstack

* Remove RC dependency in bot-helpers

* Remove RC dependency in rc-cas

* Fix wrong imports

* Remove dependency of RC namespace in rc-channel-settings (#13251)

* Move integrations models to rc-models

* Move composeMessage function to rc-utils

* Move PushNotifications class to push-notifications package

* Import variables to remove dependency of RC namespace

* Import variables to remove RC namespace dependency inside rc-lib/server/lib

* Import variables to remove RC namespace inside rc-lib/server/methods

* Import variables to remove dependency with RC namespace

* Remove duplicated server settings located in rc-lib

* Export function and lib function of rc-lib but keep it inside RC namespace

* Import variables from functions and lib to remove RC namespace dependency

* Remove dependency of RC namespace in rc-sandstorm

* Remove dependency of RC namespace in chatpal-search

* Move CreadentialTokens model to rc-models

* Move getUsernameSuggestion function and method from server/ to rc-lib

* Remove dependency of RC namespace in meteor saml

* Remove dependency of RC namespace in rc-theme

* Move 2FA Users model to rc-models

* Remove dependency of RC namespace in rc-2fa

* Remove dependency of RC namespace in rc-action-links

* Add action links in the RC namespace

* Remove dependency of RC namespace in rc-analytics

* Remove dependency of RC namespace in rc-assets

* Add Assets in RC namespace

* Remove dependency of RC namespace in rc-autolinker

* Move autotranslate models to rc-models

* Partial remove dependency of Rc namespace in rc-autotranslate

* Remove dependency of RC namespace in rc-markdown

* Finish of remotion of RC namespace in rc-autotranslate

* Import Autotranslate where it has been used

* Fix lint

* Rename Assets variable to avoid conflicts

* Fix rename Assets

* Remove dependency of RC namespace in rc-blockstack

* Remove RC dependency in bot-helpers

* Remove RC dependency in rc-cas

* Move some functions from tokenpass to channel settings and models

* Move some function from livestream to channel settings

* Remove dependency of RC namespace in rc-channel-settings

* Fix wrong imports

* readd saveRoomName to RC namespace

*  Remove dependency of RC namespace in rc-channel-mail-messages and cloud (#13254)

* Move integrations models to rc-models

* Move composeMessage function to rc-utils

* Move PushNotifications class to push-notifications package

* Import variables to remove dependency of RC namespace

* Import variables to remove RC namespace dependency inside rc-lib/server/lib

* Import variables to remove RC namespace inside rc-lib/server/methods

* Import variables to remove dependency with RC namespace

* Remove duplicated server settings located in rc-lib

* Export function and lib function of rc-lib but keep it inside RC namespace

* Import variables from functions and lib to remove RC namespace dependency

* Remove dependency of RC namespace in rc-sandstorm

* Remove dependency of RC namespace in chatpal-search

* Move CreadentialTokens model to rc-models

* Move getUsernameSuggestion function and method from server/ to rc-lib

* Remove dependency of RC namespace in meteor saml

* Remove dependency of RC namespace in rc-theme

* Move 2FA Users model to rc-models

* Remove dependency of RC namespace in rc-2fa

* Remove dependency of RC namespace in rc-action-links

* Add action links in the RC namespace

* Remove dependency of RC namespace in rc-analytics

* Remove dependency of RC namespace in rc-assets

* Add Assets in RC namespace

* Remove dependency of RC namespace in rc-autolinker

* Move autotranslate models to rc-models

* Partial remove dependency of Rc namespace in rc-autotranslate

* Remove dependency of RC namespace in rc-markdown

* Finish of remotion of RC namespace in rc-autotranslate

* Import Autotranslate where it has been used

* Fix lint

* Rename Assets variable to avoid conflicts

* Fix rename Assets

* Remove dependency of RC namespace in rc-blockstack

* Remove RC dependency in bot-helpers

* Remove RC dependency in rc-cas

* Move some functions from tokenpass to channel settings and models

* Move some function from livestream to channel settings

* Remove dependency of RC namespace in rc-channel-settings

* Fix wrong imports

* Remove dependency of RC namespace in rc-channel-mail-messages

* Remove dependency of RC namespace in rc-cloud

*  Remove dependency of RC namespace in rc-colors, cors, crowd and dolphin (#13255)

* Move integrations models to rc-models

* Move composeMessage function to rc-utils

* Move PushNotifications class to push-notifications package

* Import variables to remove dependency of RC namespace

* Import variables to remove RC namespace dependency inside rc-lib/server/lib

* Import variables to remove RC namespace inside rc-lib/server/methods

* Import variables to remove dependency with RC namespace

* Remove duplicated server settings located in rc-lib

* Export function and lib function of rc-lib but keep it inside RC namespace

* Import variables from functions and lib to remove RC namespace dependency

* Remove dependency of RC namespace in rc-sandstorm

* Remove dependency of RC namespace in chatpal-search

* Move CreadentialTokens model to rc-models

* Move getUsernameSuggestion function and method from server/ to rc-lib

* Remove dependency of RC namespace in meteor saml

* Remove dependency of RC namespace in rc-theme

* Move 2FA Users model to rc-models

* Remove dependency of RC namespace in rc-2fa

* Remove dependency of RC namespace in rc-action-links

* Add action links in the RC namespace

* Remove dependency of RC namespace in rc-analytics

* Remove dependency of RC namespace in rc-assets

* Add Assets in RC namespace

* Remove dependency of RC namespace in rc-autolinker

* Move autotranslate models to rc-models

* Partial remove dependency of Rc namespace in rc-autotranslate

* Remove dependency of RC namespace in rc-markdown

* Finish of remotion of RC namespace in rc-autotranslate

* Import Autotranslate where it has been used

* Fix lint

* Rename Assets variable to avoid conflicts

* Fix rename Assets

* Remove dependency of RC namespace in rc-blockstack

* Remove RC dependency in bot-helpers

* Remove RC dependency in rc-cas

* Move some functions from tokenpass to channel settings and models

* Move some function from livestream to channel settings

* Remove dependency of RC namespace in rc-channel-settings

* Fix wrong imports

* Remove dependency of RC namespace in rc-channel-mail-messages

* Remove dependency of RC namespace in rc-cloud

* Remove dependency of RC namespace in rc-colors

* Remove dependency of RC namespace in rc-cors

* Remove dependency of RC namespace in rc-crowd

* Remove dependency of RC namespace in rc-dolphin

*  Remove dependency of RC namespace in rc-emoji-custom and drupal (#13256)

* Move integrations models to rc-models

* Move composeMessage function to rc-utils

* Move PushNotifications class to push-notifications package

* Import variables to remove dependency of RC namespace

* Import variables to remove RC namespace dependency inside rc-lib/server/lib

* Import variables to remove RC namespace inside rc-lib/server/methods

* Import variables to remove dependency with RC namespace

* Remove duplicated server settings located in rc-lib

* Export function and lib function of rc-lib but keep it inside RC namespace

* Import variables from functions and lib to remove RC namespace dependency

* Remove dependency of RC namespace in rc-sandstorm

* Remove dependency of RC namespace in chatpal-search

* Move CreadentialTokens model to rc-models

* Move getUsernameSuggestion function and method from server/ to rc-lib

* Remove dependency of RC namespace in meteor saml

* Remove dependency of RC namespace in rc-theme

* Move 2FA Users model to rc-models

* Remove dependency of RC namespace in rc-2fa

* Remove dependency of RC namespace in rc-action-links

* Add action links in the RC namespace

* Remove dependency of RC namespace in rc-analytics

* Remove dependency of RC namespace in rc-assets

* Add Assets in RC namespace

* Remove dependency of RC namespace in rc-autolinker

* Move autotranslate models to rc-models

* Partial remove dependency of Rc namespace in rc-autotranslate

* Remove dependency of RC namespace in rc-markdown

* Finish of remotion of RC namespace in rc-autotranslate

* Import Autotranslate where it has been used

* Fix lint

* Rename Assets variable to avoid conflicts

* Fix rename Assets

* Remove dependency of RC namespace in rc-blockstack

* Remove RC dependency in bot-helpers

* Remove RC dependency in rc-cas

* Move some functions from tokenpass to channel settings and models

* Move some function from livestream to channel settings

* Remove dependency of RC namespace in rc-channel-settings

* Fix wrong imports

* Remove dependency of RC namespace in rc-channel-mail-messages

* Remove dependency of RC namespace in rc-cloud

* Remove dependency of RC namespace in rc-colors

* Remove dependency of RC namespace in rc-cors

* Remove dependency of RC namespace in rc-crowd

* Remove dependency of RC namespace in rc-dolphin

* Remove dependency of RC namespace in rc-drupal

* Move Emoji custom server and client models to rc-models

* Remove dependency of RC namespace in rc-emoji-custom

* Remove dependency of RC namespace in rc-emojione, error-handler, gh-enterprise and gitlab (#13257)

* Move integrations models to rc-models

* Move composeMessage function to rc-utils

* Move PushNotifications class to push-notifications package

* Import variables to remove dependency of RC namespace

* Import variables to remove RC namespace dependency inside rc-lib/server/lib

* Import variables to remove RC namespace inside rc-lib/server/methods

* Import variables to remove dependency with RC namespace

* Remove duplicated server settings located in rc-lib

* Export function and lib function of rc-lib but keep it inside RC namespace

* Import variables from functions and lib to remove RC namespace dependency

* Remove dependency of RC namespace in rc-sandstorm

* Remove dependency of RC namespace in chatpal-search

* Move CreadentialTokens model to rc-models

* Move getUsernameSuggestion function and method from server/ to rc-lib

* Remove dependency of RC namespace in meteor saml

* Remove dependency of RC namespace in rc-theme

* Move 2FA Users model to rc-models

* Remove dependency of RC namespace in rc-2fa

* Remove dependency of RC namespace in rc-action-links

* Add action links in the RC namespace

* Remove dependency of RC namespace in rc-analytics

* Remove dependency of RC namespace in rc-assets

* Add Assets in RC namespace

* Remove dependency of RC namespace in rc-autolinker

* Move autotranslate models to rc-models

* Partial remove dependency of Rc namespace in rc-autotranslate

* Remove dependency of RC namespace in rc-markdown

* Finish of remotion of RC namespace in rc-autotranslate

* Import Autotranslate where it has been used

* Fix lint

* Rename Assets variable to avoid conflicts

* Fix rename Assets

* Remove dependency of RC namespace in rc-blockstack

* Remove RC dependency in bot-helpers

* Remove RC dependency in rc-cas

* Move some functions from tokenpass to channel settings and models

* Move some function from livestream to channel settings

* Remove dependency of RC namespace in rc-channel-settings

* Fix wrong imports

* Remove dependency of RC namespace in rc-channel-mail-messages

* Remove dependency of RC namespace in rc-cloud

* Remove dependency of RC namespace in rc-colors

* Remove dependency of RC namespace in rc-cors

* Remove dependency of RC namespace in rc-crowd

* Remove dependency of RC namespace in rc-dolphin

* Remove dependency of RC namespace in rc-drupal

* Move Emoji custom server and client models to rc-models

* Remove dependency of RC namespace in rc-emoji-custom

* Remove dependency of RC namespace in rc-emojione

* Remove dependency of RC namespace in rc-error-handler

* Remove dependency of RC namespace in rc-gh-enterprise

* Remove dependency of RC namespace in rc-gitlab

* Remove dependency of RC namespace in rc-google-natural-language, grant, google-vision and highlight-words (#13258)

* Move integrations models to rc-models

* Move composeMessage function to rc-utils

* Move PushNotifications class to push-notifications package

* Import variables to remove dependency of RC namespace

* Import variables to remove RC namespace dependency inside rc-lib/server/lib

* Import variables to remove RC namespace inside rc-lib/server/methods

* Import variables to remove dependency with RC namespace

* Remove duplicated server settings located in rc-lib

* Export function and lib function of rc-lib but keep it inside RC namespace

* Import variables from functions and lib to remove RC namespace dependency

* Remove dependency of RC namespace in rc-sandstorm

* Remove dependency of RC namespace in chatpal-search

* Move CreadentialTokens model to rc-models

* Move getUsernameSuggestion function and method from server/ to rc-lib

* Remove dependency of RC namespace in meteor saml

* Remove dependency of RC namespace in rc-theme

* Move 2FA Users model to rc-models

* Remove dependency of RC namespace in rc-2fa

* Remove dependency of RC namespace in rc-action-links

* Add action links in the RC namespace

* Remove dependency of RC namespace in rc-analytics

* Remove dependency of RC namespace in rc-assets

* Add Assets in RC namespace

* Remove dependency of RC namespace in rc-autolinker

* Move autotranslate models to rc-models

* Partial remove dependency of Rc namespace in rc-autotranslate

* Remove dependency of RC namespace in rc-markdown

* Finish of remotion of RC namespace in rc-autotranslate

* Import Autotranslate where it has been used

* Fix lint

* Rename Assets variable to avoid conflicts

* Fix rename Assets

* Remove dependency of RC namespace in rc-blockstack

* Remove RC dependency in bot-helpers

* Remove RC dependency in rc-cas

* Move some functions from tokenpass to channel settings and models

* Move some function from livestream to channel settings

* Remove dependency of RC namespace in rc-channel-settings

* Fix wrong imports

* Remove dependency of RC namespace in rc-channel-mail-messages

* Remove dependency of RC namespace in rc-cloud

* Remove dependency of RC namespace in rc-colors

* Remove dependency of RC namespace in rc-cors

* Remove dependency of RC namespace in rc-crowd

* Remove dependency of RC namespace in rc-dolphin

* Remove dependency of RC namespace in rc-drupal

* Move Emoji custom server and client models to rc-models

* Remove dependency of RC namespace in rc-emoji-custom

* Remove dependency of RC namespace in rc-emojione

* Remove dependency of RC namespace in rc-error-handler

* Remove dependency of RC namespace in rc-gh-enterprise

* Remove dependency of RC namespace in rc-gitlab

* Remove dependency of RC namespace in rc-google-natural-language

* Remove dependency of RC namespace in rc-grant

* Remove dependency of RC namespace in rc-highlight-words

* Remove dependency of RC namespace in rc-google-vision

* Fix lint

*  Remove dependency of RC namespace in rc-iframe-login and all imports, except hipchat-enterprise (#13259)

* Move integrations models to rc-models

* Move composeMessage function to rc-utils

* Move PushNotifications class to push-notifications package

* Import variables to remove dependency of RC namespace

* Import variables to remove RC namespace dependency inside rc-lib/server/lib

* Import variables to remove RC namespace inside rc-lib/server/methods

* Import variables to remove dependency with RC namespace

* Remove duplicated server settings located in rc-lib

* Export function and lib function of rc-lib but keep it inside RC namespace

* Import variables from functions and lib to remove RC namespace dependency

* Remove dependency of RC namespace in rc-sandstorm

* Remove dependency of RC namespace in chatpal-search

* Move CreadentialTokens model to rc-models

* Move getUsernameSuggestion function and method from server/ to rc-lib

* Remove dependency of RC namespace in meteor saml

* Remove dependency of RC namespace in rc-theme

* Move 2FA Users model to rc-models

* Remove dependency of RC namespace in rc-2fa

* Remove dependency of RC namespace in rc-action-links

* Add action links in the RC namespace

* Remove dependency of RC namespace in rc-analytics

* Remove dependency of RC namespace in rc-assets

* Add Assets in RC namespace

* Remove dependency of RC namespace in rc-autolinker

* Move autotranslate models to rc-models

* Partial remove dependency of Rc namespace in rc-autotranslate

* Remove dependency of RC namespace in rc-markdown

* Finish of remotion of RC namespace in rc-autotranslate

* Import Autotranslate where it has been used

* Fix lint

* Rename Assets variable to avoid conflicts

* Fix rename Assets

* Remove dependency of RC namespace in rc-blockstack

* Remove RC dependency in bot-helpers

* Remove RC dependency in rc-cas

* Move some functions from tokenpass to channel settings and models

* Move some function from livestream to channel settings

* Remove dependency of RC namespace in rc-channel-settings

* Fix wrong imports

* Remove dependency of RC namespace in rc-channel-mail-messages

* Remove dependency of RC namespace in rc-cloud

* Remove dependency of RC namespace in rc-colors

* Remove dependency of RC namespace in rc-cors

* Remove dependency of RC namespace in rc-crowd

* Remove dependency of RC namespace in rc-dolphin

* Remove dependency of RC namespace in rc-drupal

* Move Emoji custom server and client models to rc-models

* Remove dependency of RC namespace in rc-emoji-custom

* Remove dependency of RC namespace in rc-emojione

* Remove dependency of RC namespace in rc-error-handler

* Remove dependency of RC namespace in rc-gh-enterprise

* Remove dependency of RC namespace in rc-gitlab

* Remove dependency of RC namespace in rc-google-natural-language

* Remove dependency of RC namespace in rc-grant

* Remove dependency of RC namespace in rc-highlight-words

* Remove dependency of RC namespace in rc-google-vision

* Fix lint

* Remove dependency of RC namespace in rc-iframe-login

* Remove dependency of RC namespace in all importes, except hipchat-enterprise

* Move RestAPI client to rc-api package

* Remove dependency of RC namespace in rc-api/helpers and api.js

* Remove dependency of RC namespace on half of api files

* Partial Remove dependency of RC namespace in rc-api

* import API where it was being used by the RC namespace

* Move processWebhookMessage function to rc-lib package

* Remove API from RC namespace and import missing function that was being used with namespace

* Remove dependency of RC namespace in rc-graphql

* Fix import from wrong package

* Remove dependency of RC namespace in rc-importer

* Remove dependency of RC namespace in rc-issue-links

* Remove dependency of RC namespace in rc-katex

* Move templateVarHandler fn to rc-utils

* Remove dependency of RC namespace in rc-ldap

* Remove dependency of RC namespace in rc-livestream

* Remove dependency of RC namespace in rc-mail-messages

* Remove dependency of RC namespace in rc-mapview

* Remove dependency of RC namespace in rc-mentions

* Remove dependency of RC namespace in rc-mentions-flextab

* Remove depedency of RC namespace in rc-message-attachements

* Remove dependdency of RC namespace in rc-message-mark-as-unread

* Remove dependency of RC namespace in rc-message-pin

* Fix templateVarHandler that was in wrong folder

* Remove namespace in the new livechat endpoint

* Remove dependency of RC namespace in rc-message-snippet

* Remove dependency of RC namespace in rc-message-star

* Remove dependency of RC namespace in rc-oauth2

* Remove dependency of RC namespace in rc-oembed

* Remove dependency of RC namespace in rc-otr

* Remove dependency of RC namespace in rc-reactions

* Remove dependency of RC namespace in rc-retention-policy

* Remove dependency of RC namespace in rc-earch

* Remove dependency of RC namespace in rc-setup-wizard

* Remove dependency of RC namespace in rc-slackbridge

* Remove dependency of Rc namespace in slashcommands-asciiarts

* Remove depedency of RC namespace in rc-slash-archiveroom

* Remove dependency of RC namespace in rc-slash-create

* Remove dependency of RC namespace in rc-slash-help

* Remove dependency of RC namespace in rc-slash-hide

* Remove dependency of RC namespace in rc-slash-invite

* Remove dependency of RC namespace in rc-slash-inviteall

* Remove dependency of RC namespace in rc-slash-join

* Remove dependency of RC namespace in rc-slash-kick

* Remove dependency of RC namespace in rc-slash-leave

* Remove dependency of RC namespace in rc-slash-me

* Remove dependency of RC namespace in rc-slash-msg

* Remove dependency of RC namespace in rc-slash-mute

* Remove dependency of RC namespace in rc-slash-open

* Remove dependency of RC namespace in rc-slash-topic

* Remove dependency of RC namespace in rc-slash-unarchiveroom

* Remove dependency of RC namespace in rc-smarsh-connector

* Remove dependency of RC namespace in rc-sms

* Remove dependency of RC namespace in rc-spotify

* Remove dependency of RC namespace in rc-statistics

* Move tokenpass models methods to rc-models

* Remove dependency of RC namespace in rc-tokenpass

* import tokenpass inside rc-lib

* Remove dependency of RC namespace in rc-ui

* Move webdavAccounts models to rc-model

* Remove dependency of RC namespace in rc-ui-account

* Remove dependency of RC namespace in rc-ui-admin

* Remove dependency of RC namespace in rc-ui-clean-history

* Remove dependency of RC namespace in rc-ui-flextab

* Remove dependency of RC namespace in rc-ui-login

* Remove dependency of RC namespace in rc-ui-master

* Remove dependency of RC namespace in rc-ui-message

* REmove dependency of RC namespace in rc-user-data-download

* Remove dependency of RC namespace in rc-version-check

* Remove dependency of RC namespace in rc-videobridge

* Remove dependency of RC namespace in rc-webdav

* Remove dependency of RC namespace in rc-wordpress

* Remove some RC namespace use in chatpal-search

* Remove dependency of RC namespace in rc-irc

* Remove dependency of RC namespace in livechat/client

* Move methods in common livechat models to rc-models

* Remove dependency of RC namespace in rc-livechat/server/models

* Remove LIvechat global variable from RC namespace

* Remove dependency of RC namespace in rc-livechat/imports, lib, server/api, server/hooks and server/lib

* Remove dependency of RC namespace in rc-livechat/server/methods

* Fix duplicated import

* Remove unused import

* Remove dependency of RC namespace in rc-livechat/server/publications

*  Remove dependency of RC namespace in rc-api/helpers and api.js (#13273)

* Move RestAPI client to rc-api package

* Remove dependency of RC namespace in rc-api/helpers and api.js

*  Remove dependency of RC namespace on half of api files (#13275)

* Move RestAPI client to rc-api package

* Remove dependency of RC namespace in rc-api/helpers and api.js

* Remove dependency of RC namespace on half of api files

* Import missed functions in rc-irc

* Partial Remove dependency of RC namespace in rc-api (#13277)

* Move RestAPI client to rc-api package

* Remove dependency of RC namespace in rc-api/helpers and api.js

* Remove dependency of RC namespace on half of api files

* Partial Remove dependency of RC namespace in rc-api

* Remove dependency of RC namespace in rc-api (#13278)

* Move RestAPI client to rc-api package

* Remove dependency of RC namespace in rc-api/helpers and api.js

* Remove dependency of RC namespace on half of api files

* Partial Remove dependency of RC namespace in rc-api

* import API where it was being used by the RC namespace

* Move processWebhookMessage function to rc-lib package

* Remove API from RC namespace and import missing function that was being used with namespace

* Remove namespace in the new livechat endpoint

*  Remove dependency of RC namespace in rc-graphql (#13279)

* Move RestAPI client to rc-api package

* Remove dependency of RC namespace in rc-api/helpers and api.js

* Remove dependency of RC namespace on half of api files

* Partial Remove dependency of RC namespace in rc-api

* import API where it was being used by the RC namespace

* Move processWebhookMessage function to rc-lib package

* Remove API from RC namespace and import missing function that was being used with namespace

* Remove dependency of RC namespace in rc-graphql

* Fix import from wrong package

* Remove namespace in the new livechat endpoint

* Remove dependency of RC namespace in rc-importer (#13280)

* Move RestAPI client to rc-api package

* Remove dependency of RC namespace in rc-api/helpers and api.js

* Remove dependency of RC namespace on half of api files

* Partial Remove dependency of RC namespace in rc-api

* import API where it was being used by the RC namespace

* Move processWebhookMessage function to rc-lib package

* Remove API from RC namespace and import missing function that was being used with namespace

* Remove dependency of RC namespace in rc-graphql

* Fix import from wrong package

* Remove dependency of RC namespace in rc-importer

* Remove namespace in the new livechat endpoint

*  Remove dependency of RC namespace in rc-ldap, katex and issue-links (#13281)

* Move RestAPI client to rc-api package

* Remove dependency of RC namespace in rc-api/helpers and api.js

* Remove dependency of RC namespace on half of api files

* Partial Remove dependency of RC namespace in rc-api

* import API where it was being used by the RC namespace

* Move processWebhookMessage function to rc-lib package

* Remove API from RC namespace and import missing function that was being used with namespace

* Remove dependency of RC namespace in rc-graphql

* Fix import from wrong package

* Remove dependency of RC namespace in rc-importer

* Remove dependency of RC namespace in rc-issue-links

* Remove dependency of RC namespace in rc-katex

* Move templateVarHandler fn to rc-utils

* Remove dependency of RC namespace in rc-ldap

* Fix templateVarHandler that was in wrong folder

* Remove namespace in the new livechat endpoint

*  Remove dependency of RC namespace in rc-livestream and rc-mail-messages (#13320)

* Move RestAPI client to rc-api package

* Remove dependency of RC namespace in rc-api/helpers and api.js

* Remove dependency of RC namespace on half of api files

* Partial Remove dependency of RC namespace in rc-api

* import API where it was being used by the RC namespace

* Move processWebhookMessage function to rc-lib package

* Remove API from RC namespace and import missing function that was being used with namespace

* Remove dependency of RC namespace in rc-graphql

* Fix import from wrong package

* Remove dependency of RC namespace in rc-importer

* Remove dependency of RC namespace in rc-issue-links

* Remove dependency of RC namespace in rc-katex

* Move templateVarHandler fn to rc-utils

* Remove dependency of RC namespace in rc-ldap

* Remove dependency of RC namespace in rc-livestream

* Remove dependency of RC namespace in rc-mail-messages

* Fix templateVarHandler that was in wrong folder

* Remove namespace in the new livechat endpoint
pull/13384/head^2
Marcos Spessatto Defendi 7 years ago committed by Rodrigo Nascimento
parent 71568d942d
commit 5dc95caaf1
  1. 1
      packages/rocketchat-livechat/server/models/LivechatCustomField.js
  2. 1
      packages/rocketchat-livechat/server/models/LivechatOfficeHour.js
  3. 1
      packages/rocketchat-livechat/server/models/LivechatTrigger.js
  4. 4
      packages/rocketchat-livechat/server/publications/customFields.js
  5. 4
      packages/rocketchat-livechat/server/publications/departmentAgents.js
  6. 6
      packages/rocketchat-livechat/server/publications/livechatAgents.js
  7. 7
      packages/rocketchat-livechat/server/publications/livechatAppearance.js
  8. 4
      packages/rocketchat-livechat/server/publications/livechatDepartments.js
  9. 4
      packages/rocketchat-livechat/server/publications/livechatInquiries.js
  10. 7
      packages/rocketchat-livechat/server/publications/livechatIntegration.js
  11. 6
      packages/rocketchat-livechat/server/publications/livechatManagers.js
  12. 7
      packages/rocketchat-livechat/server/publications/livechatMonitoring.js
  13. 4
      packages/rocketchat-livechat/server/publications/livechatOfficeHours.js
  14. 4
      packages/rocketchat-livechat/server/publications/livechatQueue.js
  15. 7
      packages/rocketchat-livechat/server/publications/livechatRooms.js
  16. 4
      packages/rocketchat-livechat/server/publications/livechatTriggers.js
  17. 4
      packages/rocketchat-livechat/server/publications/livechatVisitors.js
  18. 11
      packages/rocketchat-livechat/server/publications/visitorHistory.js
  19. 7
      packages/rocketchat-livechat/server/publications/visitorInfo.js
  20. 9
      packages/rocketchat-livechat/server/publications/visitorPageVisited.js

@ -44,4 +44,3 @@ class LivechatCustomFieldClass extends Base {
}
export const LivechatCustomField = new LivechatCustomFieldClass();
RocketChat.models.LivechatCustomField = LivechatCustomField;

@ -108,4 +108,3 @@ class LivechatOfficeHourClass extends Base {
}
}
export const LivechatOfficeHour = new LivechatOfficeHourClass();
RocketChat.models.LivechatOfficeHour = LivechatOfficeHour;

@ -29,4 +29,3 @@ class LivechatTriggerClass extends Base {
}
}
export const LivechatTrigger = new LivechatTriggerClass();
RocketChat.models.LivechatTrigger = LivechatTrigger;

@ -1,5 +1,5 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
import { hasPermission } from 'meteor/rocketchat:authorization';
import { LivechatCustomField } from '../models';
import s from 'underscore.string';
@ -8,7 +8,7 @@ Meteor.publish('livechat:customFields', function(_id) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:customFields' }));
}
if (!RocketChat.authz.hasPermission(this.userId, 'view-l-room')) {
if (!hasPermission(this.userId, 'view-l-room')) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:customFields' }));
}

@ -1,5 +1,5 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
import { hasPermission } from 'meteor/rocketchat:authorization';
import { LivechatDepartmentAgents } from '../models';
Meteor.publish('livechat:departmentAgents', function(departmentId) {
@ -7,7 +7,7 @@ Meteor.publish('livechat:departmentAgents', function(departmentId) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:departmentAgents' }));
}
if (!RocketChat.authz.hasPermission(this.userId, 'view-livechat-rooms')) {
if (!hasPermission(this.userId, 'view-livechat-rooms')) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:departmentAgents' }));
}

@ -1,18 +1,18 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
import { hasPermission, getUsersInRole } from 'meteor/rocketchat:authorization';
Meteor.publish('livechat:agents', function() {
if (!this.userId) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:agents' }));
}
if (!RocketChat.authz.hasPermission(this.userId, 'view-l-room')) {
if (!hasPermission(this.userId, 'view-l-room')) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:agents' }));
}
const self = this;
const handle = RocketChat.authz.getUsersInRole('livechat-agent').observeChanges({
const handle = getUsersInRole('livechat-agent').observeChanges({
added(id, fields) {
self.added('agentUsers', id, fields);
},

@ -1,12 +1,13 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
import { hasPermission } from 'meteor/rocketchat:authorization';
import { Settings } from 'meteor/rocketchat:models';
Meteor.publish('livechat:appearance', function() {
if (!this.userId) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:appearance' }));
}
if (!RocketChat.authz.hasPermission(this.userId, 'view-livechat-manager')) {
if (!hasPermission(this.userId, 'view-livechat-manager')) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:appearance' }));
}
@ -34,7 +35,7 @@ Meteor.publish('livechat:appearance', function() {
const self = this;
const handle = RocketChat.models.Settings.find(query).observeChanges({
const handle = Settings.find(query).observeChanges({
added(id, fields) {
self.added('livechatAppearance', id, fields);
},

@ -1,5 +1,5 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
import { hasPermission } from 'meteor/rocketchat:authorization';
import { LivechatDepartment } from '../models';
Meteor.publish('livechat:departments', function(_id) {
@ -7,7 +7,7 @@ Meteor.publish('livechat:departments', function(_id) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:agents' }));
}
if (!RocketChat.authz.hasPermission(this.userId, 'view-l-room')) {
if (!hasPermission(this.userId, 'view-l-room')) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:agents' }));
}

@ -1,5 +1,5 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
import { hasPermission } from 'meteor/rocketchat:authorization';
import { LivechatInquiry } from '../../lib/LivechatInquiry';
Meteor.publish('livechat:inquiry', function() {
@ -7,7 +7,7 @@ Meteor.publish('livechat:inquiry', function() {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:inquiry' }));
}
if (!RocketChat.authz.hasPermission(this.userId, 'view-l-room')) {
if (!hasPermission(this.userId, 'view-l-room')) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:inquiry' }));
}

@ -1,18 +1,19 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
import { hasPermission } from 'meteor/rocketchat:authorization';
import { Settings } from 'meteor/rocketchat:models';
Meteor.publish('livechat:integration', function() {
if (!this.userId) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:integration' }));
}
if (!RocketChat.authz.hasPermission(this.userId, 'view-livechat-manager')) {
if (!hasPermission(this.userId, 'view-livechat-manager')) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:integration' }));
}
const self = this;
const handle = RocketChat.models.Settings.findByIds(['Livechat_webhookUrl', 'Livechat_secret_token', 'Livechat_webhook_on_close', 'Livechat_webhook_on_offline_msg', 'Livechat_webhook_on_visitor_message', 'Livechat_webhook_on_agent_message']).observeChanges({
const handle = Settings.findByIds(['Livechat_webhookUrl', 'Livechat_secret_token', 'Livechat_webhook_on_close', 'Livechat_webhook_on_offline_msg', 'Livechat_webhook_on_visitor_message', 'Livechat_webhook_on_agent_message']).observeChanges({
added(id, fields) {
self.added('livechatIntegration', id, fields);
},

@ -1,18 +1,18 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
import { hasPermission, getUsersInRole } from 'meteor/rocketchat:authorization';
Meteor.publish('livechat:managers', function() {
if (!this.userId) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:managers' }));
}
if (!RocketChat.authz.hasPermission(this.userId, 'view-livechat-rooms')) {
if (!hasPermission(this.userId, 'view-livechat-rooms')) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:managers' }));
}
const self = this;
const handle = RocketChat.authz.getUsersInRole('livechat-manager').observeChanges({
const handle = getUsersInRole('livechat-manager').observeChanges({
added(id, fields) {
self.added('managerUsers', id, fields);
},

@ -1,13 +1,14 @@
import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';
import { RocketChat } from 'meteor/rocketchat:lib';
import { hasPermission } from 'meteor/rocketchat:authorization';
import { Rooms } from 'meteor/rocketchat:models';
Meteor.publish('livechat:monitoring', function(date) {
if (!this.userId) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:monitoring' }));
}
if (!RocketChat.authz.hasPermission(this.userId, 'view-livechat-manager')) {
if (!hasPermission(this.userId, 'view-livechat-manager')) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:monitoring' }));
}
@ -21,7 +22,7 @@ Meteor.publish('livechat:monitoring', function(date) {
const self = this;
const handle = RocketChat.models.Rooms.getAnalyticsMetricsBetweenDate('l', date).observeChanges({
const handle = Rooms.getAnalyticsMetricsBetweenDate('l', date).observeChanges({
added(id, fields) {
self.added('livechatMonitoring', id, fields);
},

@ -1,9 +1,9 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
import { hasPermission } from 'meteor/rocketchat:authorization';
import { LivechatOfficeHour } from '../models';
Meteor.publish('livechat:officeHour', function() {
if (!RocketChat.authz.hasPermission(this.userId, 'view-l-room')) {
if (!hasPermission(this.userId, 'view-l-room')) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:agents' }));
}

@ -1,5 +1,5 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
import { hasPermission } from 'meteor/rocketchat:authorization';
import { LivechatDepartmentAgents } from '../models';
Meteor.publish('livechat:queue', function() {
@ -7,7 +7,7 @@ Meteor.publish('livechat:queue', function() {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:queue' }));
}
if (!RocketChat.authz.hasPermission(this.userId, 'view-l-room')) {
if (!hasPermission(this.userId, 'view-l-room')) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:queue' }));
}

@ -1,13 +1,14 @@
import { Meteor } from 'meteor/meteor';
import { Match, check } from 'meteor/check';
import { RocketChat } from 'meteor/rocketchat:lib';
import { hasPermission } from 'meteor/rocketchat:authorization';
import { Rooms } from 'meteor/rocketchat:models';
Meteor.publish('livechat:rooms', function(filter = {}, offset = 0, limit = 20) {
if (!this.userId) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:rooms' }));
}
if (!RocketChat.authz.hasPermission(this.userId, 'view-livechat-rooms')) {
if (!hasPermission(this.userId, 'view-livechat-rooms')) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:rooms' }));
}
@ -50,7 +51,7 @@ Meteor.publish('livechat:rooms', function(filter = {}, offset = 0, limit = 20) {
const self = this;
const handle = RocketChat.models.Rooms.findLivechat(query, offset, limit).observeChanges({
const handle = Rooms.findLivechat(query, offset, limit).observeChanges({
added(id, fields) {
self.added('livechatRoom', id, fields);
},

@ -1,5 +1,5 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
import { hasPermission } from 'meteor/rocketchat:authorization';
import { LivechatTrigger } from '../models';
Meteor.publish('livechat:triggers', function(_id) {
@ -7,7 +7,7 @@ Meteor.publish('livechat:triggers', function(_id) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:triggers' }));
}
if (!RocketChat.authz.hasPermission(this.userId, 'view-livechat-manager')) {
if (!hasPermission(this.userId, 'view-livechat-manager')) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:triggers' }));
}

@ -1,6 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';
import { RocketChat } from 'meteor/rocketchat:lib';
import { hasPermission } from 'meteor/rocketchat:authorization';
import LivechatVisitors from '../models/LivechatVisitors';
Meteor.publish('livechat:visitors', function(date) {
@ -8,7 +8,7 @@ Meteor.publish('livechat:visitors', function(date) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:visitors' }));
}
if (!RocketChat.authz.hasPermission(this.userId, 'view-livechat-manager')) {
if (!hasPermission(this.userId, 'view-livechat-manager')) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:visitors' }));
}

@ -1,18 +1,19 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
import { hasPermission } from 'meteor/rocketchat:authorization';
import { Rooms, Subscriptions } from 'meteor/rocketchat:models';
Meteor.publish('livechat:visitorHistory', function({ rid: roomId }) {
if (!this.userId) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:visitorHistory' }));
}
if (!RocketChat.authz.hasPermission(this.userId, 'view-l-room')) {
if (!hasPermission(this.userId, 'view-l-room')) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:visitorHistory' }));
}
const room = RocketChat.models.Rooms.findOneById(roomId);
const room = Rooms.findOneById(roomId);
const subscription = RocketChat.models.Subscriptions.findOneByRoomIdAndUserId(room._id, this.userId, { fields: { _id: 1 } });
const subscription = Subscriptions.findOneByRoomIdAndUserId(room._id, this.userId, { fields: { _id: 1 } });
if (!subscription) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:visitorHistory' }));
}
@ -20,7 +21,7 @@ Meteor.publish('livechat:visitorHistory', function({ rid: roomId }) {
const self = this;
if (room && room.v && room.v._id) {
const handle = RocketChat.models.Rooms.findByVisitorId(room.v._id).observeChanges({
const handle = Rooms.findByVisitorId(room.v._id).observeChanges({
added(id, fields) {
self.added('visitor_history', id, fields);
},

@ -1,5 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
import { hasPermission } from 'meteor/rocketchat:authorization';
import { Rooms } from 'meteor/rocketchat:models';
import LivechatVisitors from '../models/LivechatVisitors';
Meteor.publish('livechat:visitorInfo', function({ rid: roomId }) {
@ -7,11 +8,11 @@ Meteor.publish('livechat:visitorInfo', function({ rid: roomId }) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:visitorInfo' }));
}
if (!RocketChat.authz.hasPermission(this.userId, 'view-l-room')) {
if (!hasPermission(this.userId, 'view-l-room')) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:visitorInfo' }));
}
const room = RocketChat.models.Rooms.findOneById(roomId);
const room = Rooms.findOneById(roomId);
if (room && room.v && room.v._id) {
return LivechatVisitors.findById(room.v._id);

@ -1,5 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
import { hasPermission } from 'meteor/rocketchat:authorization';
import { Rooms, Messages } from 'meteor/rocketchat:models';
Meteor.publish('livechat:visitorPageVisited', function({ rid: roomId }) {
@ -7,15 +8,15 @@ Meteor.publish('livechat:visitorPageVisited', function({ rid: roomId }) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:visitorPageVisited' }));
}
if (!RocketChat.authz.hasPermission(this.userId, 'view-l-room')) {
if (!hasPermission(this.userId, 'view-l-room')) {
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:visitorPageVisited' }));
}
const self = this;
const room = RocketChat.models.Rooms.findOneById(roomId);
const room = Rooms.findOneById(roomId);
if (room) {
const handle = RocketChat.models.Messages.findByRoomIdAndType(room._id, 'livechat_navigation_history').observeChanges({
const handle = Messages.findByRoomIdAndType(room._id, 'livechat_navigation_history').observeChanges({
added(id, fields) {
self.added('visitor_navigation_history', id, fields);
},

Loading…
Cancel
Save