feat: used new pubsub method to publish

This commit is contained in:
Mir Arif Hasan
2023-01-23 15:28:55 +06:00
16 changed files with 1369 additions and 5 deletions

View File

@@ -0,0 +1,14 @@
import { User } from 'src/user/user.model';
import { UserEnvironment } from '../user-environment/user-environments.model';
// A custom message type that defines the topic and the corresponding payload.
// For every module that publishes a subscription add its type def and the possible subscription type.
export type TopicDef = {
[
topic: `user_environment/${string}/${'created' | 'updated' | 'deleted'}`
]: UserEnvironment;
[
topic: `user/${string}/${'created' | 'updated' | 'deleted'}`
]: User;
[topic: `user_environment/${string}/deleted_many`]: number;
};