
- 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.
71 lines
2.1 KiB
JavaScript
71 lines
2.1 KiB
JavaScript
var fs = require('fs');
|
|
var path = require('path');
|
|
var test = require('tape');
|
|
var resolve = require('../');
|
|
|
|
test('$NODE_PATH', function (t) {
|
|
t.plan(8);
|
|
|
|
var isDir = function (dir, cb) {
|
|
if (dir === '/node_path' || dir === 'node_path/x') {
|
|
return cb(null, true);
|
|
}
|
|
fs.stat(dir, function (err, stat) {
|
|
if (!err) {
|
|
return cb(null, stat.isDirectory());
|
|
}
|
|
if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false);
|
|
return cb(err);
|
|
});
|
|
};
|
|
|
|
resolve('aaa', {
|
|
paths: [
|
|
path.join(__dirname, '/node_path/x'),
|
|
path.join(__dirname, '/node_path/y')
|
|
],
|
|
basedir: __dirname,
|
|
isDirectory: isDir
|
|
}, function (err, res) {
|
|
t.error(err);
|
|
t.equal(res, path.join(__dirname, '/node_path/x/aaa/index.js'), 'aaa resolves');
|
|
});
|
|
|
|
resolve('bbb', {
|
|
paths: [
|
|
path.join(__dirname, '/node_path/x'),
|
|
path.join(__dirname, '/node_path/y')
|
|
],
|
|
basedir: __dirname,
|
|
isDirectory: isDir
|
|
}, function (err, res) {
|
|
t.error(err);
|
|
t.equal(res, path.join(__dirname, '/node_path/y/bbb/index.js'), 'bbb resolves');
|
|
});
|
|
|
|
resolve('ccc', {
|
|
paths: [
|
|
path.join(__dirname, '/node_path/x'),
|
|
path.join(__dirname, '/node_path/y')
|
|
],
|
|
basedir: __dirname,
|
|
isDirectory: isDir
|
|
}, function (err, res) {
|
|
t.error(err);
|
|
t.equal(res, path.join(__dirname, '/node_path/x/ccc/index.js'), 'ccc resolves');
|
|
});
|
|
|
|
// ensure that relative paths still resolve against the regular `node_modules` correctly
|
|
resolve('tap', {
|
|
paths: [
|
|
'node_path'
|
|
],
|
|
basedir: path.join(__dirname, 'node_path/x'),
|
|
isDirectory: isDir
|
|
}, function (err, res) {
|
|
var root = require('tap/package.json').main; // eslint-disable-line global-require
|
|
t.error(err);
|
|
t.equal(res, path.resolve(__dirname, '..', 'node_modules/tap', root), 'tap resolves');
|
|
});
|
|
});
|