chore: introduced string to json from user-settings and moved types

This commit is contained in:
ankitsridhar16
2023-01-19 16:24:31 +05:30
parent 669f8b0431
commit f6f4547af3
3 changed files with 29 additions and 12 deletions

View File

@@ -1,18 +1,11 @@
import { Injectable } from '@nestjs/common';
import { PubSubService } from './pubsub/pubsub.service';
import { PrimitiveTypes } from './types/primitive-types';
import { ModuleTypes } from './types/module-types';
import { CustomModuleTypes } from './types/custom-module-types';
import { SubscriptionType } from './types/subscription-types';
// Custom generic type to indicate the type of module
type ModuleType = PrimitiveTypes | ModuleTypes;
// Contains constants for the subscription types we use in Subscription Handler
enum SubscriptionType {
Created = 'created',
Updated = 'updated',
Deleted = 'deleted',
DeleteMany = 'delete_many',
}
type ModuleType = PrimitiveTypes | CustomModuleTypes;
@Injectable()
export class SubscriptionHandler {
@@ -20,8 +13,8 @@ export class SubscriptionHandler {
/**
* Publishes a subscription using the pubsub module
* @param topic a string containing the module name, an uid and the type of subscription
* @param subscriptionType type of subscription being called
* @param topic a string containing the "module_name/identifier"
* @param subscriptionType type of subscription being published
* @param moduleType type of the module model being called
* @returns a promise of type void
*/