-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrule-engine.ts
63 lines (51 loc) · 1.51 KB
/
rule-engine.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import { ExternalEventPayload, ProductEventPayload } from '@freshworks-jaya/marketplace-models';
import { RequestProxy } from '@freshworks-jaya/marketplace-models/lib/services/request';
import { GoogleCloudLoggingConfig } from '../services/GoogleCloudLogging';
export interface RuleEngineOptions {
enableLogger?: boolean; // this is to be enabled only for debugging, should be disabled afterwards
isSchedulerEnabled: boolean;
isUseStaticIP: boolean;
maxProductEventDelay: number;
}
export enum ExternalEventType {
DeleteSchedules = 'DELETE_SCHEDULES',
}
export interface Integrations {
emailService?: {
apiKey: string;
url: string;
};
freshchatv1: ProductCredentials;
freshchatv2: ProductCredentials;
freshdesk?: ProductCredentials;
googleCloudLoggingConfig: GoogleCloudLoggingConfig;
marketplaceServices: {
requestProxy: RequestProxy;
};
timezoneOffset: number;
featureFlags: Record<string, boolean>;
}
export interface ProductCredentials {
token: string;
url: string;
}
export interface RuleEngineExternalEventPayload extends ExternalEventPayload {
data: TimerCompletionPayload;
}
export interface DeleteSchedulesData {
jobsToDelete: string[];
}
export interface TimerCompletionPayload {
eventData?: DeleteSchedulesData;
eventType?: ExternalEventType;
jobId: string;
originalPayload: ProductEventPayload | string;
ruleAlias?: string;
ruleIndex: number;
scheduled_at?: string;
}
export interface KairosCredentials {
group: string;
token: string;
url: string;
}