
- Complete NestJS TypeScript implementation with WebSocket support - Direct messaging (DM) and group chat functionality - End-to-end encryption with AES encryption and key pairs - Media file support (images, videos, audio, documents) up to 100MB - Push notifications with Firebase Cloud Messaging integration - Mention alerts and real-time typing indicators - User authentication with JWT and Passport - SQLite database with TypeORM entities and relationships - Comprehensive API documentation with Swagger/OpenAPI - File upload handling with secure access control - Online/offline status tracking and presence management - Message editing, deletion, and reply functionality - Notification management with automatic cleanup - Health check endpoint for monitoring - CORS configuration for cross-origin requests - Environment-based configuration management - Structured for Flutter SDK integration Features implemented: ✅ Real-time messaging with Socket.IO ✅ User registration and authentication ✅ Direct messages and group chats ✅ Media file uploads and management ✅ End-to-end encryption ✅ Push notifications ✅ Mention alerts ✅ Typing indicators ✅ Message read receipts ✅ Online status tracking ✅ File access control ✅ Comprehensive API documentation Ready for Flutter SDK development and production deployment.
83 lines
2.2 KiB
JavaScript
83 lines
2.2 KiB
JavaScript
'use strict'
|
|
|
|
const test = require('tap').test
|
|
const path = require('path')
|
|
const devDir = require('./common').devDir()
|
|
const gyp = require('../lib/node-gyp')
|
|
const requireInject = require('require-inject')
|
|
const configure = requireInject('../lib/configure', {
|
|
'graceful-fs': {
|
|
openSync: function () { return 0 },
|
|
closeSync: function () { },
|
|
writeFile: function (file, data, cb) { cb() },
|
|
stat: function (file, cb) { cb(null, {}) },
|
|
mkdir: function (dir, options, cb) { cb() },
|
|
promises: {
|
|
writeFile: function (file, data) { return Promise.resolve(null) }
|
|
}
|
|
}
|
|
})
|
|
|
|
const EXPECTED_PYPATH = path.join(__dirname, '..', 'gyp', 'pylib')
|
|
const SEPARATOR = process.platform === 'win32' ? ';' : ':'
|
|
const SPAWN_RESULT = { on: function () { } }
|
|
|
|
require('npmlog').level = 'warn'
|
|
|
|
test('configure PYTHONPATH with no existing env', function (t) {
|
|
t.plan(1)
|
|
|
|
delete process.env.PYTHONPATH
|
|
|
|
var prog = gyp()
|
|
prog.parseArgv([])
|
|
prog.spawn = function () {
|
|
t.equal(process.env.PYTHONPATH, EXPECTED_PYPATH)
|
|
return SPAWN_RESULT
|
|
}
|
|
prog.devDir = devDir
|
|
configure(prog, [], t.fail)
|
|
})
|
|
|
|
test('configure PYTHONPATH with existing env of one dir', function (t) {
|
|
t.plan(2)
|
|
|
|
var existingPath = path.join('a', 'b')
|
|
process.env.PYTHONPATH = existingPath
|
|
|
|
var prog = gyp()
|
|
prog.parseArgv([])
|
|
prog.spawn = function () {
|
|
t.equal(process.env.PYTHONPATH, [EXPECTED_PYPATH, existingPath].join(SEPARATOR))
|
|
|
|
var dirs = process.env.PYTHONPATH.split(SEPARATOR)
|
|
t.deepEqual(dirs, [EXPECTED_PYPATH, existingPath])
|
|
|
|
return SPAWN_RESULT
|
|
}
|
|
prog.devDir = devDir
|
|
configure(prog, [], t.fail)
|
|
})
|
|
|
|
test('configure PYTHONPATH with existing env of multiple dirs', function (t) {
|
|
t.plan(2)
|
|
|
|
var pythonDir1 = path.join('a', 'b')
|
|
var pythonDir2 = path.join('b', 'c')
|
|
var existingPath = [pythonDir1, pythonDir2].join(SEPARATOR)
|
|
process.env.PYTHONPATH = existingPath
|
|
|
|
var prog = gyp()
|
|
prog.parseArgv([])
|
|
prog.spawn = function () {
|
|
t.equal(process.env.PYTHONPATH, [EXPECTED_PYPATH, existingPath].join(SEPARATOR))
|
|
|
|
var dirs = process.env.PYTHONPATH.split(SEPARATOR)
|
|
t.deepEqual(dirs, [EXPECTED_PYPATH, pythonDir1, pythonDir2])
|
|
|
|
return SPAWN_RESULT
|
|
}
|
|
prog.devDir = devDir
|
|
configure(prog, [], t.fail)
|
|
})
|