
- 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.
93 lines
2.4 KiB
JavaScript
93 lines
2.4 KiB
JavaScript
'use strict';
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = reflectAll;
|
|
|
|
var _reflect = require('./reflect.js');
|
|
|
|
var _reflect2 = _interopRequireDefault(_reflect);
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
/**
|
|
* A helper function that wraps an array or an object of functions with `reflect`.
|
|
*
|
|
* @name reflectAll
|
|
* @static
|
|
* @memberOf module:Utils
|
|
* @method
|
|
* @see [async.reflect]{@link module:Utils.reflect}
|
|
* @category Util
|
|
* @param {Array|Object|Iterable} tasks - The collection of
|
|
* [async functions]{@link AsyncFunction} to wrap in `async.reflect`.
|
|
* @returns {Array} Returns an array of async functions, each wrapped in
|
|
* `async.reflect`
|
|
* @example
|
|
*
|
|
* let tasks = [
|
|
* function(callback) {
|
|
* setTimeout(function() {
|
|
* callback(null, 'one');
|
|
* }, 200);
|
|
* },
|
|
* function(callback) {
|
|
* // do some more stuff but error ...
|
|
* callback(new Error('bad stuff happened'));
|
|
* },
|
|
* function(callback) {
|
|
* setTimeout(function() {
|
|
* callback(null, 'two');
|
|
* }, 100);
|
|
* }
|
|
* ];
|
|
*
|
|
* async.parallel(async.reflectAll(tasks),
|
|
* // optional callback
|
|
* function(err, results) {
|
|
* // values
|
|
* // results[0].value = 'one'
|
|
* // results[1].error = Error('bad stuff happened')
|
|
* // results[2].value = 'two'
|
|
* });
|
|
*
|
|
* // an example using an object instead of an array
|
|
* let tasks = {
|
|
* one: function(callback) {
|
|
* setTimeout(function() {
|
|
* callback(null, 'one');
|
|
* }, 200);
|
|
* },
|
|
* two: function(callback) {
|
|
* callback('two');
|
|
* },
|
|
* three: function(callback) {
|
|
* setTimeout(function() {
|
|
* callback(null, 'three');
|
|
* }, 100);
|
|
* }
|
|
* };
|
|
*
|
|
* async.parallel(async.reflectAll(tasks),
|
|
* // optional callback
|
|
* function(err, results) {
|
|
* // values
|
|
* // results.one.value = 'one'
|
|
* // results.two.error = 'two'
|
|
* // results.three.value = 'three'
|
|
* });
|
|
*/
|
|
function reflectAll(tasks) {
|
|
var results;
|
|
if (Array.isArray(tasks)) {
|
|
results = tasks.map(_reflect2.default);
|
|
} else {
|
|
results = {};
|
|
Object.keys(tasks).forEach(key => {
|
|
results[key] = _reflect2.default.call(this, tasks[key]);
|
|
});
|
|
}
|
|
return results;
|
|
}
|
|
module.exports = exports.default; |