Move rc-livechat server models to rc-models (#13384)

* 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

* MOve rc-livechat server models to rc-models

* Change imports of livechat server models to rc-models package

*  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/13389/head^2
Marcos Spessatto Defendi 6 years ago committed by Rodrigo Nascimento
parent 5dc95caaf1
commit eb993610ad
  1. 4
      packages/rocketchat-lib/server/functions/setUsername.js
  2. 2
      packages/rocketchat-livechat/imports/server/rest/departments.js
  3. 3
      packages/rocketchat-livechat/imports/server/rest/facebook.js
  4. 3
      packages/rocketchat-livechat/imports/server/rest/sms.js
  5. 3
      packages/rocketchat-livechat/imports/server/rest/upload.js
  6. 4
      packages/rocketchat-livechat/server/api/lib/livechat.js
  7. 3
      packages/rocketchat-livechat/server/api/v1/message.js
  8. 4
      packages/rocketchat-livechat/server/api/v1/visitor.js
  9. 2
      packages/rocketchat-livechat/server/hooks/leadCapture.js
  10. 6
      packages/rocketchat-livechat/server/index.js
  11. 4
      packages/rocketchat-livechat/server/lib/Livechat.js
  12. 3
      packages/rocketchat-livechat/server/lib/OfficeClock.js
  13. 3
      packages/rocketchat-livechat/server/methods/closeByVisitor.js
  14. 3
      packages/rocketchat-livechat/server/methods/getAgentData.js
  15. 2
      packages/rocketchat-livechat/server/methods/getCustomFields.js
  16. 4
      packages/rocketchat-livechat/server/methods/getInitialData.js
  17. 2
      packages/rocketchat-livechat/server/methods/loadHistory.js
  18. 2
      packages/rocketchat-livechat/server/methods/loginByToken.js
  19. 3
      packages/rocketchat-livechat/server/methods/registerGuest.js
  20. 2
      packages/rocketchat-livechat/server/methods/removeCustomField.js
  21. 2
      packages/rocketchat-livechat/server/methods/removeTrigger.js
  22. 2
      packages/rocketchat-livechat/server/methods/saveCustomField.js
  23. 2
      packages/rocketchat-livechat/server/methods/saveOfficeHours.js
  24. 3
      packages/rocketchat-livechat/server/methods/saveSurveyFeedback.js
  25. 2
      packages/rocketchat-livechat/server/methods/saveTrigger.js
  26. 3
      packages/rocketchat-livechat/server/methods/sendFileLivechatMessage.js
  27. 2
      packages/rocketchat-livechat/server/methods/sendMessageLivechat.js
  28. 4
      packages/rocketchat-livechat/server/methods/setCustomField.js
  29. 3
      packages/rocketchat-livechat/server/methods/setDepartmentForVisitor.js
  30. 2
      packages/rocketchat-livechat/server/methods/startFileUploadRoom.js
  31. 3
      packages/rocketchat-livechat/server/methods/transfer.js
  32. 6
      packages/rocketchat-livechat/server/models/index.js
  33. 2
      packages/rocketchat-livechat/server/publications/customFields.js
  34. 2
      packages/rocketchat-livechat/server/publications/departmentAgents.js
  35. 2
      packages/rocketchat-livechat/server/publications/livechatDepartments.js
  36. 2
      packages/rocketchat-livechat/server/publications/livechatOfficeHours.js
  37. 2
      packages/rocketchat-livechat/server/publications/livechatQueue.js
  38. 2
      packages/rocketchat-livechat/server/publications/livechatTriggers.js
  39. 2
      packages/rocketchat-livechat/server/publications/livechatVisitors.js
  40. 3
      packages/rocketchat-livechat/server/publications/visitorInfo.js
  41. 2
      packages/rocketchat-livechat/server/roomType.js
  42. 2
      packages/rocketchat-livechat/server/sendMessageBySMS.js
  43. 14
      packages/rocketchat-models/server/index.js
  44. 6
      packages/rocketchat-models/server/models/LivechatCustomField.js
  45. 7
      packages/rocketchat-models/server/models/LivechatDepartment.js
  46. 8
      packages/rocketchat-models/server/models/LivechatDepartmentAgents.js
  47. 6
      packages/rocketchat-models/server/models/LivechatOfficeHour.js
  48. 7
      packages/rocketchat-models/server/models/LivechatPageVisited.js
  49. 7
      packages/rocketchat-models/server/models/LivechatTrigger.js
  50. 7
      packages/rocketchat-models/server/models/LivechatVisitors.js
  51. 3
      packages/rocketchat-statistics/server/functions/get.js
  52. 6
      server/startup/migrations/v067.js
  53. 2
      server/startup/migrations/v106.js

@ -2,7 +2,7 @@ import s from 'underscore.string';
import { Accounts } from 'meteor/accounts-base';
import { FileUpload } from 'meteor/rocketchat:file-upload';
import { settings } from 'meteor/rocketchat:settings';
import { Users, Messages, Subscriptions, Rooms } from 'meteor/rocketchat:models';
import { Users, Messages, Subscriptions, Rooms, LivechatDepartmentAgents } from 'meteor/rocketchat:models';
import { hasPermission } from 'meteor/rocketchat:authorization';
import { RateLimiter } from '../lib';
import { checkUsernameAvailability, setUserAvatar } from '.';
@ -74,7 +74,7 @@ const _setUsername = function(userId, u) {
Rooms.replaceUsernameOfUserByUserId(user._id, username);
Subscriptions.setUserUsernameByUserId(user._id, username);
Subscriptions.setNameForDirectRoomsWithOldName(previousUsername, username);
RocketChat.models.LivechatDepartmentAgents.replaceUsernameOfAgentByUserId(user._id, username);
LivechatDepartmentAgents.replaceUsernameOfAgentByUserId(user._id, username);
const fileStore = FileUpload.getStore('Avatars');
const file = fileStore.model.findOneByName(previousUsername);

@ -1,7 +1,7 @@
import { check } from 'meteor/check';
import { API } from 'meteor/rocketchat:api';
import { hasPermission } from 'meteor/rocketchat:authorization';
import { LivechatDepartment, LivechatDepartmentAgents } from '../../../server/models';
import { LivechatDepartment, LivechatDepartmentAgents } from 'meteor/rocketchat:models';
import { Livechat } from '../../../server/lib/Livechat';
API.v1.addRoute('livechat/department', { authRequired: true }, {

@ -1,9 +1,8 @@
import crypto from 'crypto';
import { Random } from 'meteor/random';
import { API } from 'meteor/rocketchat:api';
import { Rooms, Users } from 'meteor/rocketchat:models';
import { Rooms, Users, LivechatVisitors } from 'meteor/rocketchat:models';
import { settings } from 'meteor/rocketchat:settings';
import LivechatVisitors from '../../../server/models/LivechatVisitors';
import { Livechat } from '../../../server/lib/Livechat';
/**

@ -1,9 +1,8 @@
import { Meteor } from 'meteor/meteor';
import { Random } from 'meteor/random';
import { Rooms } from 'meteor/rocketchat:models';
import { Rooms, LivechatVisitors } from 'meteor/rocketchat:models';
import { API } from 'meteor/rocketchat:api';
import { SMS } from 'meteor/rocketchat:sms';
import LivechatVisitors from '../../../server/models/LivechatVisitors';
import { Livechat } from '../../../server/lib/Livechat';
API.v1.addRoute('livechat/sms-incoming/:service', {

@ -1,12 +1,11 @@
import { Meteor } from 'meteor/meteor';
import { settings } from 'meteor/rocketchat:settings';
import { Settings, Rooms } from 'meteor/rocketchat:models';
import { Settings, Rooms, LivechatVisitors } from 'meteor/rocketchat:models';
import { fileUploadIsValidContentType } from 'meteor/rocketchat:utils';
import { FileUpload } from 'meteor/rocketchat:file-upload';
import { API } from 'meteor/rocketchat:api';
import Busboy from 'busboy';
import filesize from 'filesize';
import LivechatVisitors from '../../../server/models/LivechatVisitors';
let maxFileSize;
settings.get('FileUpload_MaxFileSize', function(key, value) {

@ -1,9 +1,7 @@
import { Meteor } from 'meteor/meteor';
import { Random } from 'meteor/random';
import { Users, Rooms } from 'meteor/rocketchat:models';
import { LivechatDepartment, LivechatTrigger } from '../../models';
import { Users, Rooms, LivechatVisitors, LivechatDepartment, LivechatTrigger } from 'meteor/rocketchat:models';
import _ from 'underscore';
import LivechatVisitors from '../../models/LivechatVisitors';
import { Livechat } from '../../lib/Livechat';
export function online() {

@ -1,11 +1,10 @@
import { Meteor } from 'meteor/meteor';
import { Match, check } from 'meteor/check';
import { Random } from 'meteor/random';
import { Messages, Rooms } from 'meteor/rocketchat:models';
import { Messages, Rooms, LivechatVisitors } from 'meteor/rocketchat:models';
import { hasPermission } from 'meteor/rocketchat:authorization';
import { API } from 'meteor/rocketchat:api';
import { loadMessageHistory } from 'meteor/rocketchat:lib';
import LivechatVisitors from '../../../server/models/LivechatVisitors';
import { findGuest, findRoom } from '../lib/livechat';
import { Livechat } from '../../lib/Livechat';

@ -1,11 +1,9 @@
import { Meteor } from 'meteor/meteor';
import { Match, check } from 'meteor/check';
import { Rooms } from 'meteor/rocketchat:models';
import { Rooms, LivechatVisitors, LivechatCustomField } from 'meteor/rocketchat:models';
import { hasPermission } from 'meteor/rocketchat:authorization';
import { API } from 'meteor/rocketchat:api';
import LivechatVisitors from '../../../server/models/LivechatVisitors';
import { findGuest } from '../lib/livechat';
import { LivechatCustomField } from '../../models';
import { Livechat } from '../../lib/Livechat';
API.v1.addRoute('livechat/visitor', {

@ -1,6 +1,6 @@
import { callbacks } from 'meteor/rocketchat:callbacks';
import { settings } from 'meteor/rocketchat:settings';
import LivechatVisitors from '../../server/models/LivechatVisitors';
import { LivechatVisitors } from 'meteor/rocketchat:models';
function validateMessage(message, room) {
// skips this callback if the message was edited

@ -59,13 +59,7 @@ import './methods/returnAsInquiry';
import './methods/saveOfficeHours';
import './methods/sendTranscript';
import '../lib/LivechatExternalMessage';
import './models/LivechatCustomField';
import './models/LivechatDepartment';
import './models/LivechatDepartmentAgents';
import './models/LivechatPageVisited';
import './models/LivechatTrigger';
import '../lib/LivechatInquiry';
import './models/LivechatOfficeHour';
export { Livechat } from './lib/Livechat';
import './lib/Analytics';
import './lib/QueueMethods';

@ -5,7 +5,7 @@ import { TAPi18n } from 'meteor/tap:i18n';
import { HTTP } from 'meteor/http';
import { settings } from 'meteor/rocketchat:settings';
import { callbacks } from 'meteor/rocketchat:callbacks';
import { Users, Rooms, Messages, Subscriptions, Settings } from 'meteor/rocketchat:models';
import { Users, Rooms, Messages, Subscriptions, Settings, LivechatDepartmentAgents, LivechatDepartment, LivechatCustomField, LivechatVisitors } from 'meteor/rocketchat:models';
import { Logger } from 'meteor/rocketchat:logger';
import { sendMessage, deleteMessage, updateMessage } from 'meteor/rocketchat:lib';
import { addUserRoles, removeUserFromRoles } from 'meteor/rocketchat:authorization';
@ -15,10 +15,8 @@ import moment from 'moment';
import dns from 'dns';
import UAParser from 'ua-parser-js';
import * as Mailer from 'meteor/rocketchat:mailer';
import { LivechatDepartmentAgents, LivechatDepartment, LivechatCustomField } from '../models';
import { LivechatInquiry } from '../../lib/LivechatInquiry';
import { QueueMethods } from './QueueMethods';
import LivechatVisitors from '../models/LivechatVisitors';
import { Analytics } from './Analytics';
export const Livechat = {

@ -1,8 +1,7 @@
// Every minute check if office closed
import { Meteor } from 'meteor/meteor';
import { settings } from 'meteor/rocketchat:settings';
import { Users } from 'meteor/rocketchat:models';
import { LivechatOfficeHour } from '../models';
import { Users, LivechatOfficeHour } from 'meteor/rocketchat:models';
Meteor.setInterval(function() {
if (settings.get('Livechat_enable_office_hours')) {

@ -1,8 +1,7 @@
import { Meteor } from 'meteor/meteor';
import { TAPi18n } from 'meteor/tap:i18n';
import { settings } from 'meteor/rocketchat:settings';
import { Rooms } from 'meteor/rocketchat:models';
import LivechatVisitors from '../models/LivechatVisitors';
import { Rooms, LivechatVisitors } from 'meteor/rocketchat:models';
import { Livechat } from '../lib/Livechat';
Meteor.methods({

@ -1,7 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';
import { Users, Rooms } from 'meteor/rocketchat:models';
import LivechatVisitors from '../models/LivechatVisitors';
import { Users, Rooms, LivechatVisitors } from 'meteor/rocketchat:models';
Meteor.methods({
'livechat:getAgentData'({ roomId, token }) {

@ -1,5 +1,5 @@
import { Meteor } from 'meteor/meteor';
import { LivechatCustomField } from '../models';
import { LivechatCustomField } from 'meteor/rocketchat:models';
Meteor.methods({
'livechat:getCustomFields'() {

@ -1,8 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { Rooms, Users } from 'meteor/rocketchat:models';
import { Rooms, Users, LivechatDepartment, LivechatTrigger, LivechatVisitors } from 'meteor/rocketchat:models';
import _ from 'underscore';
import { LivechatDepartment, LivechatTrigger } from '../models';
import LivechatVisitors from '../models/LivechatVisitors';
import { Livechat } from '../lib/Livechat';
Meteor.methods({

@ -1,6 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { loadMessageHistory } from 'meteor/rocketchat:lib';
import LivechatVisitors from '../models/LivechatVisitors';
import { LivechatVisitors } from 'meteor/rocketchat:models';
Meteor.methods({
'livechat:loadHistory'({ token, rid, end, limit = 20, ls }) {

@ -1,5 +1,5 @@
import { Meteor } from 'meteor/meteor';
import LivechatVisitors from '../models/LivechatVisitors';
import { LivechatVisitors } from 'meteor/rocketchat:models';
Meteor.methods({
'livechat:loginByToken'(token) {

@ -1,6 +1,5 @@
import { Meteor } from 'meteor/meteor';
import { Messages, Rooms } from 'meteor/rocketchat:models';
import LivechatVisitors from '../models/LivechatVisitors';
import { Messages, Rooms, LivechatVisitors } from 'meteor/rocketchat:models';
import { Livechat } from '../lib/Livechat';
Meteor.methods({

@ -1,7 +1,7 @@
import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';
import { hasPermission } from 'meteor/rocketchat:authorization';
import { LivechatCustomField } from '../models';
import { LivechatCustomField } from 'meteor/rocketchat:models';
Meteor.methods({
'livechat:removeCustomField'(_id) {

@ -1,7 +1,7 @@
import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';
import { hasPermission } from 'meteor/rocketchat:authorization';
import { LivechatTrigger } from '../models';
import { LivechatTrigger } from 'meteor/rocketchat:models';
Meteor.methods({
'livechat:removeTrigger'(triggerId) {

@ -1,7 +1,7 @@
import { Meteor } from 'meteor/meteor';
import { Match, check } from 'meteor/check';
import { hasPermission } from 'meteor/rocketchat:authorization';
import { LivechatCustomField } from '../models';
import { LivechatCustomField } from 'meteor/rocketchat:models';
Meteor.methods({
'livechat:saveCustomField'(_id, customFieldData) {

@ -1,5 +1,5 @@
import { Meteor } from 'meteor/meteor';
import { LivechatOfficeHour } from '../models';
import { LivechatOfficeHour } from 'meteor/rocketchat:models';
Meteor.methods({
'livechat:saveOfficeHours'(day, start, finish, open) {

@ -1,7 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { Match, check } from 'meteor/check';
import { Rooms } from 'meteor/rocketchat:models';
import LivechatVisitors from '../models/LivechatVisitors';
import { Rooms, LivechatVisitors } from 'meteor/rocketchat:models';
import _ from 'underscore';
Meteor.methods({

@ -1,7 +1,7 @@
import { Meteor } from 'meteor/meteor';
import { Match, check } from 'meteor/check';
import { hasPermission } from 'meteor/rocketchat:authorization';
import { LivechatTrigger } from '../models';
import { LivechatTrigger } from 'meteor/rocketchat:models';
Meteor.methods({
'livechat:saveTrigger'(trigger) {

@ -1,9 +1,8 @@
import { Meteor } from 'meteor/meteor';
import { Match, check } from 'meteor/check';
import { Random } from 'meteor/random';
import { Rooms } from 'meteor/rocketchat:models';
import { Rooms, LivechatVisitors } from 'meteor/rocketchat:models';
import { FileUpload } from 'meteor/rocketchat:file-upload';
import LivechatVisitors from '../models/LivechatVisitors';
Meteor.methods({
async 'sendFileLivechatMessage'(roomId, visitorToken, file, msgData = {}) {

@ -1,6 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { Match, check } from 'meteor/check';
import LivechatVisitors from '../models/LivechatVisitors';
import { LivechatVisitors } from 'meteor/rocketchat:models';
import { Livechat } from '../lib/Livechat';
Meteor.methods({

@ -1,7 +1,5 @@
import { Meteor } from 'meteor/meteor';
import { Rooms } from 'meteor/rocketchat:models';
import LivechatVisitors from '../models/LivechatVisitors';
import { LivechatCustomField } from '../models';
import { Rooms, LivechatVisitors, LivechatCustomField } from 'meteor/rocketchat:models';
Meteor.methods({
'livechat:setCustomField'(token, key, value, overwrite = true) {

@ -1,7 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';
import { Rooms, Messages } from 'meteor/rocketchat:models';
import LivechatVisitors from '../models/LivechatVisitors';
import { Rooms, Messages, LivechatVisitors } from 'meteor/rocketchat:models';
import { Livechat } from '../lib/Livechat';
Meteor.methods({

@ -1,6 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { Random } from 'meteor/random';
import LivechatVisitors from '../models/LivechatVisitors';
import { LivechatVisitors } from 'meteor/rocketchat:models';
import { Livechat } from '../lib/Livechat';
Meteor.methods({

@ -1,8 +1,7 @@
import { Meteor } from 'meteor/meteor';
import { Match, check } from 'meteor/check';
import { hasPermission, hasRole } from 'meteor/rocketchat:authorization';
import { Rooms, Subscriptions } from 'meteor/rocketchat:models';
import LivechatVisitors from '../models/LivechatVisitors';
import { Rooms, Subscriptions, LivechatVisitors } from 'meteor/rocketchat:models';
import { Livechat } from '../lib/Livechat';
Meteor.methods({

@ -1,6 +0,0 @@
export { LivechatCustomField } from './LivechatCustomField';
export { LivechatDepartment } from './LivechatDepartment';
export { LivechatDepartmentAgents } from './LivechatDepartmentAgents';
export { LivechatOfficeHour } from './LivechatOfficeHour';
export { LivechatPageVisited } from './LivechatPageVisited';
export { LivechatTrigger } from './LivechatTrigger';

@ -1,6 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { hasPermission } from 'meteor/rocketchat:authorization';
import { LivechatCustomField } from '../models';
import { LivechatCustomField } from 'meteor/rocketchat:models';
import s from 'underscore.string';
Meteor.publish('livechat:customFields', function(_id) {

@ -1,6 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { hasPermission } from 'meteor/rocketchat:authorization';
import { LivechatDepartmentAgents } from '../models';
import { LivechatDepartmentAgents } from 'meteor/rocketchat:models';
Meteor.publish('livechat:departmentAgents', function(departmentId) {
if (!this.userId) {

@ -1,6 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { hasPermission } from 'meteor/rocketchat:authorization';
import { LivechatDepartment } from '../models';
import { LivechatDepartment } from 'meteor/rocketchat:models';
Meteor.publish('livechat:departments', function(_id) {
if (!this.userId) {

@ -1,6 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { hasPermission } from 'meteor/rocketchat:authorization';
import { LivechatOfficeHour } from '../models';
import { LivechatOfficeHour } from 'meteor/rocketchat:models';
Meteor.publish('livechat:officeHour', function() {
if (!hasPermission(this.userId, 'view-l-room')) {

@ -1,6 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { hasPermission } from 'meteor/rocketchat:authorization';
import { LivechatDepartmentAgents } from '../models';
import { LivechatDepartmentAgents } from 'meteor/rocketchat:models';
Meteor.publish('livechat:queue', function() {
if (!this.userId) {

@ -1,6 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { hasPermission } from 'meteor/rocketchat:authorization';
import { LivechatTrigger } from '../models';
import { LivechatTrigger } from 'meteor/rocketchat:models';
Meteor.publish('livechat:triggers', function(_id) {
if (!this.userId) {

@ -1,7 +1,7 @@
import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';
import { hasPermission } from 'meteor/rocketchat:authorization';
import LivechatVisitors from '../models/LivechatVisitors';
import { LivechatVisitors } from 'meteor/rocketchat:models';
Meteor.publish('livechat:visitors', function(date) {
if (!this.userId) {

@ -1,7 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { hasPermission } from 'meteor/rocketchat:authorization';
import { Rooms } from 'meteor/rocketchat:models';
import LivechatVisitors from '../models/LivechatVisitors';
import { Rooms, LivechatVisitors } from 'meteor/rocketchat:models';
Meteor.publish('livechat:visitorInfo', function({ rid: roomId }) {
if (!this.userId) {

@ -1,7 +1,7 @@
import { Rooms } from 'meteor/rocketchat:models';
import { roomTypes } from 'meteor/rocketchat:utils';
import LivechatRoomType from '../lib/LivechatRoomType';
import LivechatVisitors from './models/LivechatVisitors';
import { LivechatVisitors } from 'meteor/rocketchat:models';
class LivechatRoomTypeServer extends LivechatRoomType {
getMsgSender(senderId) {

@ -1,7 +1,7 @@
import { callbacks } from 'meteor/rocketchat:callbacks';
import { settings } from 'meteor/rocketchat:settings';
import { SMS } from 'meteor/rocketchat:sms';
import LivechatVisitors from './models/LivechatVisitors';
import { LivechatVisitors } from 'meteor/rocketchat:models';
callbacks.add('afterSaveMessage', function(message, room) {
// skips this callback if the message was edited

@ -23,6 +23,13 @@ import OAuthApps from './models/OAuthApps';
import OEmbedCache from './models/OEmbedCache';
import SmarshHistory from './models/SmarshHistory';
import WebdavAccounts from './models/WebdavAccounts';
import LivechatCustomField from './models/LivechatCustomField';
import LivechatDepartment from './models/LivechatDepartment';
import LivechatDepartmentAgents from './models/LivechatDepartmentAgents';
import LivechatOfficeHour from './models/LivechatOfficeHour';
import LivechatPageVisited from './models/LivechatPageVisited';
import LivechatTrigger from './models/LivechatTrigger';
import LivechatVisitors from './models/LivechatVisitors';
export {
Base,
@ -50,4 +57,11 @@ export {
OEmbedCache,
SmarshHistory,
WebdavAccounts,
LivechatCustomField,
LivechatDepartment,
LivechatDepartmentAgents,
LivechatOfficeHour,
LivechatPageVisited,
LivechatTrigger,
LivechatVisitors,
};

@ -1,10 +1,10 @@
import { Base } from 'meteor/rocketchat:models';
import { Base } from './_Base';
import _ from 'underscore';
/**
* Livechat Custom Fields model
*/
class LivechatCustomFieldClass extends Base {
export class LivechatCustomField extends Base {
constructor() {
super('livechat_custom_field');
}
@ -43,4 +43,4 @@ class LivechatCustomFieldClass extends Base {
}
}
export const LivechatCustomField = new LivechatCustomFieldClass();
export default new LivechatCustomField();

@ -1,11 +1,11 @@
import { Base } from 'meteor/rocketchat:models';
import { Base } from './_Base';
import { LivechatDepartmentAgents } from './LivechatDepartmentAgents';
import _ from 'underscore';
/**
* Livechat Department model
*/
class LivechatDepartmentClass extends Base {
export class LivechatDepartment extends Base {
constructor() {
super('livechat_department');
@ -93,5 +93,4 @@ class LivechatDepartmentClass extends Base {
return this.findOne(query, options);
}
}
export const LivechatDepartment = new LivechatDepartmentClass();
RocketChat.models.LivechatDepartment = LivechatDepartment;
export default new LivechatDepartment();

@ -1,10 +1,11 @@
import { Meteor } from 'meteor/meteor';
import { Base, Users } from 'meteor/rocketchat:models';
import { Base } from './_Base';
import { Users } from './Users';
import _ from 'underscore';
/**
* Livechat Department model
*/
class LivechatDepartmentAgentsClass extends Base {
export class LivechatDepartmentAgents extends Base {
constructor() {
super('livechat_department_agents');
}
@ -133,5 +134,4 @@ class LivechatDepartmentAgentsClass extends Base {
return this.update(query, update, { multi: true });
}
}
export const LivechatDepartmentAgents = new LivechatDepartmentAgentsClass();
RocketChat.models.LivechatDepartmentAgents = LivechatDepartmentAgents;
export default new LivechatDepartmentAgents();

@ -1,7 +1,7 @@
import { Base } from 'meteor/rocketchat:models';
import { Base } from './_Base';
import moment from 'moment';
class LivechatOfficeHourClass extends Base {
export class LivechatOfficeHour extends Base {
constructor() {
super('livechat_office_hour');
@ -107,4 +107,4 @@ class LivechatOfficeHourClass extends Base {
return finish.isSame(currentTime, 'minute');
}
}
export const LivechatOfficeHour = new LivechatOfficeHourClass();
export default new LivechatOfficeHour();

@ -1,9 +1,9 @@
import { Base } from 'meteor/rocketchat:models';
import { Base } from './_Base';
/**
* Livechat Page Visited model
*/
class LivechatPageVisitedClass extends Base {
class LivechatPageVisited extends Base {
constructor() {
super('livechat_page_visited');
@ -45,5 +45,4 @@ class LivechatPageVisitedClass extends Base {
});
}
}
export const LivechatPageVisited = new LivechatPageVisitedClass();
RocketChat.models.LivechatPageVisited = LivechatPageVisited;
export default new LivechatPageVisited();

@ -1,9 +1,9 @@
import { Base } from 'meteor/rocketchat:models';
import { Base } from './_Base';
/**
* Livechat Trigger model
*/
class LivechatTriggerClass extends Base {
export class LivechatTrigger extends Base {
constructor() {
super('livechat_trigger');
}
@ -28,4 +28,5 @@ class LivechatTriggerClass extends Base {
return this.find({ enabled: true });
}
}
export const LivechatTrigger = new LivechatTriggerClass();
export default new LivechatTrigger();

@ -1,9 +1,10 @@
import { Meteor } from 'meteor/meteor';
import { Base, Settings } from 'meteor/rocketchat:models';
import { Base } from './_Base';
import { Settings } from './Settings';
import _ from 'underscore';
import s from 'underscore.string';
class LivechatVisitorsClass extends Base {
export class LivechatVisitors extends Base {
constructor() {
super('livechat_visitor');
}
@ -207,4 +208,4 @@ class LivechatVisitorsClass extends Base {
}
}
export default new LivechatVisitorsClass();
export default new LivechatVisitors();

@ -2,9 +2,8 @@ import { Meteor } from 'meteor/meteor';
import { MongoInternals } from 'meteor/mongo';
import _ from 'underscore';
import os from 'os';
import LivechatVisitors from 'meteor/rocketchat:livechat/server/models/LivechatVisitors';
import { InstanceStatus } from 'meteor/konecty:multiple-instances-status';
import { Sessions, Settings, Users, Rooms, Subscriptions, Uploads, Messages } from 'meteor/rocketchat:models';
import { Sessions, Settings, Users, Rooms, Subscriptions, Uploads, Messages, LivechatVisitors } from 'meteor/rocketchat:models';
import { settings } from 'meteor/rocketchat:settings';
import { Info } from 'meteor/rocketchat:utils';
import { Migrations } from 'meteor/rocketchat:migrations';

@ -1,8 +1,10 @@
import { LivechatDepartment } from 'meteor/rocketchat:models';
RocketChat.Migrations.add({
version: 67,
up() {
if (RocketChat && RocketChat.models && RocketChat.models.LivechatDepartment) {
RocketChat.models.LivechatDepartment.model.update({}, {
if (LivechatDepartment) {
LivechatDepartment.model.update({}, {
$set: {
showOnRegistration: true,
},

@ -1,5 +1,5 @@
import { Meteor } from 'meteor/meteor';
import LivechatVisitors from 'meteor/rocketchat:livechat/server/models/LivechatVisitors';
import { LivechatVisitors } from 'meteor/rocketchat:models';
RocketChat.Migrations.add({
version: 106,

Loading…
Cancel
Save