
- 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.
73 lines
1.4 KiB
Markdown
73 lines
1.4 KiB
Markdown
# stubs
|
|
|
|
> It's a simple stubber.
|
|
|
|
## About
|
|
|
|
For when you don't want to write the same thing over and over to cache a method and call an override, then revert it, and blah blah.
|
|
|
|
|
|
## Use
|
|
```sh
|
|
$ npm install --save-dev stubs
|
|
```
|
|
```js
|
|
var mylib = require('./lib/index.js')
|
|
var stubs = require('stubs')
|
|
|
|
// make it a noop
|
|
stubs(mylib, 'create')
|
|
|
|
// stub it out
|
|
stubs(mylib, 'create', function() {
|
|
// calls this instead
|
|
})
|
|
|
|
// stub it out, but call the original first
|
|
stubs(mylib, 'create', { callthrough: true }, function() {
|
|
// call original method, then call this
|
|
})
|
|
|
|
// use the stub for a while, then revert
|
|
stubs(mylib, 'create', { calls: 3 }, function() {
|
|
// call this 3 times, then use the original method
|
|
})
|
|
```
|
|
|
|
|
|
## API
|
|
|
|
### stubs(object, method[[, opts], stub])
|
|
|
|
#### object
|
|
- Type: Object
|
|
|
|
#### method
|
|
- Type: String
|
|
|
|
Name of the method to stub.
|
|
|
|
#### opts
|
|
- (optional)
|
|
- Type: Object
|
|
|
|
##### opts.callthrough
|
|
- (optional)
|
|
- Type: Boolean
|
|
- Default: `false`
|
|
|
|
Call the original method as well as the stub (if a stub is provided).
|
|
|
|
##### opts.calls
|
|
- (optional)
|
|
- Type: Number
|
|
- Default: `0` (never revert)
|
|
|
|
Number of calls to allow the stub to receive until reverting to the original.
|
|
|
|
#### stub
|
|
- (optional)
|
|
- Type: Function
|
|
- Default: `function() {}`
|
|
|
|
This method is called in place of the original method. If `opts.callthrough` is `true`, this method is called *after* the original method is called as well. |