gemcap-be-common 1.5.35 → 1.5.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/microservice/channels.constants.d.ts +0 -1
- package/microservice/channels.constants.ts +0 -2
- package/microservice/events.constants.d.ts +0 -1
- package/microservice/events.constants.ts +0 -2
- package/microservice/rabbitmq.types.d.ts +28 -0
- package/microservice/rabbitmq.types.js +3 -0
- package/microservice/rabbitmq.types.ts +33 -0
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { EVENT_KEYS } from './events.constants';
|
|
2
|
+
import { MESSAGE_CHANNELS } from './channels.constants';
|
|
3
|
+
type ValueOf<T> = T[keyof T];
|
|
4
|
+
export type ExchangeEventMap = {
|
|
5
|
+
[MESSAGE_CHANNELS.AI]: typeof EVENT_KEYS.ai;
|
|
6
|
+
[MESSAGE_CHANNELS.AUTH]: typeof EVENT_KEYS.auth;
|
|
7
|
+
[MESSAGE_CHANNELS.COMPLIANCE]: typeof EVENT_KEYS.compliance;
|
|
8
|
+
[MESSAGE_CHANNELS.CRM]: typeof EVENT_KEYS.crm;
|
|
9
|
+
[MESSAGE_CHANNELS.FINANCE]: typeof EVENT_KEYS.finance;
|
|
10
|
+
[MESSAGE_CHANNELS.PORTFOLIO]: typeof EVENT_KEYS.portfolio;
|
|
11
|
+
[MESSAGE_CHANNELS.NOTIFICATIONS]: typeof EVENT_KEYS.notifications;
|
|
12
|
+
};
|
|
13
|
+
type QueueMessageForExchange<TExchange extends keyof ExchangeEventMap> = {
|
|
14
|
+
exchange: TExchange;
|
|
15
|
+
routingKey: ValueOf<ExchangeEventMap[TExchange]>;
|
|
16
|
+
taskId: string;
|
|
17
|
+
createdAt: string;
|
|
18
|
+
source: string;
|
|
19
|
+
payload: unknown;
|
|
20
|
+
};
|
|
21
|
+
export type TQueueParams = ValueOf<{
|
|
22
|
+
[TExchange in keyof ExchangeEventMap]: QueueMessageForExchange<TExchange>;
|
|
23
|
+
}>;
|
|
24
|
+
export type TExchange = (typeof MESSAGE_CHANNELS)[keyof typeof MESSAGE_CHANNELS];
|
|
25
|
+
export type TEventKey = ValueOf<{
|
|
26
|
+
[Domain in keyof typeof EVENT_KEYS]: ValueOf<(typeof EVENT_KEYS)[Domain]>;
|
|
27
|
+
}>;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { EVENT_KEYS } from './events.constants';
|
|
2
|
+
import { MESSAGE_CHANNELS } from './channels.constants';
|
|
3
|
+
|
|
4
|
+
type ValueOf<T> = T[keyof T];
|
|
5
|
+
|
|
6
|
+
export type ExchangeEventMap = {
|
|
7
|
+
[MESSAGE_CHANNELS.AI]: typeof EVENT_KEYS.ai;
|
|
8
|
+
[MESSAGE_CHANNELS.AUTH]: typeof EVENT_KEYS.auth;
|
|
9
|
+
[MESSAGE_CHANNELS.COMPLIANCE]: typeof EVENT_KEYS.compliance;
|
|
10
|
+
[MESSAGE_CHANNELS.CRM]: typeof EVENT_KEYS.crm;
|
|
11
|
+
[MESSAGE_CHANNELS.FINANCE]: typeof EVENT_KEYS.finance;
|
|
12
|
+
[MESSAGE_CHANNELS.PORTFOLIO]: typeof EVENT_KEYS.portfolio;
|
|
13
|
+
[MESSAGE_CHANNELS.NOTIFICATIONS]: typeof EVENT_KEYS.notifications;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
type QueueMessageForExchange<TExchange extends keyof ExchangeEventMap> = {
|
|
17
|
+
exchange: TExchange;
|
|
18
|
+
routingKey: ValueOf<ExchangeEventMap[TExchange]>;
|
|
19
|
+
taskId: string;
|
|
20
|
+
createdAt: string;
|
|
21
|
+
source: string;
|
|
22
|
+
payload: unknown;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export type TQueueParams = ValueOf<{
|
|
26
|
+
[TExchange in keyof ExchangeEventMap]: QueueMessageForExchange<TExchange>;
|
|
27
|
+
}>;
|
|
28
|
+
|
|
29
|
+
export type TExchange = (typeof MESSAGE_CHANNELS)[keyof typeof MESSAGE_CHANNELS];
|
|
30
|
+
|
|
31
|
+
export type TEventKey = ValueOf<{
|
|
32
|
+
[Domain in keyof typeof EVENT_KEYS]: ValueOf<(typeof EVENT_KEYS)[Domain]>;
|
|
33
|
+
}>;
|