
- 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.
57 lines
2.3 KiB
JavaScript
57 lines
2.3 KiB
JavaScript
'use strict';
|
|
|
|
var $defineProperty = require('es-define-property');
|
|
|
|
var $SyntaxError = require('es-errors/syntax');
|
|
var $TypeError = require('es-errors/type');
|
|
|
|
var gopd = require('gopd');
|
|
|
|
/** @type {import('.')} */
|
|
module.exports = function defineDataProperty(
|
|
obj,
|
|
property,
|
|
value
|
|
) {
|
|
if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
|
throw new $TypeError('`obj` must be an object or a function`');
|
|
}
|
|
if (typeof property !== 'string' && typeof property !== 'symbol') {
|
|
throw new $TypeError('`property` must be a string or a symbol`');
|
|
}
|
|
if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {
|
|
throw new $TypeError('`nonEnumerable`, if provided, must be a boolean or null');
|
|
}
|
|
if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {
|
|
throw new $TypeError('`nonWritable`, if provided, must be a boolean or null');
|
|
}
|
|
if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {
|
|
throw new $TypeError('`nonConfigurable`, if provided, must be a boolean or null');
|
|
}
|
|
if (arguments.length > 6 && typeof arguments[6] !== 'boolean') {
|
|
throw new $TypeError('`loose`, if provided, must be a boolean');
|
|
}
|
|
|
|
var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
|
|
var nonWritable = arguments.length > 4 ? arguments[4] : null;
|
|
var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
|
|
var loose = arguments.length > 6 ? arguments[6] : false;
|
|
|
|
/* @type {false | TypedPropertyDescriptor<unknown>} */
|
|
var desc = !!gopd && gopd(obj, property);
|
|
|
|
if ($defineProperty) {
|
|
$defineProperty(obj, property, {
|
|
configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
|
|
enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
|
|
value: value,
|
|
writable: nonWritable === null && desc ? desc.writable : !nonWritable
|
|
});
|
|
} else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {
|
|
// must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable
|
|
obj[property] = value; // eslint-disable-line no-param-reassign
|
|
} else {
|
|
throw new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');
|
|
}
|
|
};
|