This commit is contained in:
2026-05-13 19:58:16 +03:00
commit f5adeb292b
78 changed files with 12024 additions and 0 deletions

46
rocketchat.js Normal file
View File

@@ -0,0 +1,46 @@
const context = require('./context/rocketchat')
const log = require('./lib/log')
const {
start,
version,
emoji,
team,
channels,
users,
posts,
directChannels,
end
} = require('./lib/rocketchat')
//
// Common function log errors and
// terminate the process
//
const abort = function (err) {
log.error(err)
//
// We set a timeout here to
// allow the log streams to finish
// writing.
//
setTimeout(function () {
process.exit(1)
}, 3000)
}
//
// Ensure we trap uncaught exceptions
// and properly abort
//
process.on('uncaughtException', abort)
start(context)
.then(version)
.then(emoji)
.then(team)
.then(channels)
.then(users)
.then(directChannels)
.then(posts)
.then(end)
.catch(abort)