-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
Copy pathcapabilities.ts
101 lines (97 loc) · 3.83 KB
/
capabilities.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import { PluginServerCapabilities, PluginServerMode, PluginsServerConfig, stringToPluginServerMode } from './types'
export function getPluginServerCapabilities(config: PluginsServerConfig): PluginServerCapabilities {
const mode: PluginServerMode | null = config.PLUGIN_SERVER_MODE
? stringToPluginServerMode[config.PLUGIN_SERVER_MODE]
: null
switch (mode) {
case null:
return {
mmdb: true,
propertyDefs: true,
ingestionV2Combined: true,
processAsyncOnEventHandlers: true,
processAsyncWebhooksHandlers: true,
sessionRecordingBlobIngestion: true,
sessionRecordingBlobOverflowIngestion: config.SESSION_RECORDING_OVERFLOW_ENABLED,
sessionRecordingBlobIngestionV2: true,
sessionRecordingBlobIngestionV2Overflow: config.SESSION_RECORDING_OVERFLOW_ENABLED,
appManagementSingleton: true,
preflightSchedules: true,
cdpProcessedEvents: true,
cdpInternalEvents: true,
cdpCyclotronWorker: true,
cdpCyclotronWorkerPlugins: true,
cdpApi: true,
}
case PluginServerMode.ingestion_v2:
// NOTE: this mode will be removed in the future and replaced with
// `analytics-ingestion` and `recordings-ingestion` modes.
return {
mmdb: true,
ingestionV2: true,
}
case PluginServerMode.property_defs:
return {
propertyDefs: true,
}
case PluginServerMode.recordings_blob_ingestion:
return {
sessionRecordingBlobIngestion: true,
}
case PluginServerMode.recordings_blob_ingestion_overflow:
return {
sessionRecordingBlobOverflowIngestion: true,
}
case PluginServerMode.recordings_blob_ingestion_v2:
return {
sessionRecordingBlobIngestionV2: true,
}
case PluginServerMode.recordings_blob_ingestion_v2_overflow:
return {
sessionRecordingBlobIngestionV2Overflow: true,
}
case PluginServerMode.async_onevent:
return {
processAsyncOnEventHandlers: true,
}
case PluginServerMode.async_webhooks:
return {
processAsyncWebhooksHandlers: true,
}
case PluginServerMode.cdp_processed_events:
return {
cdpProcessedEvents: true,
}
case PluginServerMode.cdp_internal_events:
return {
cdpInternalEvents: true,
}
case PluginServerMode.cdp_cyclotron_worker:
return {
cdpCyclotronWorker: true,
}
case PluginServerMode.cdp_cyclotron_worker_plugins:
return {
cdpCyclotronWorkerPlugins: true,
}
case PluginServerMode.cdp_api:
return {
cdpApi: true,
mmdb: true,
// NOTE: This is temporary until we have removed plugins
appManagementSingleton: true,
}
// This is only for functional tests, which time out if all capabilities are used
// ideally we'd run just the specific capability needed per test, but that's not easy to do atm
case PluginServerMode.functional_tests:
return {
mmdb: true,
ingestionV2Combined: true,
processAsyncOnEventHandlers: true,
processAsyncWebhooksHandlers: true,
sessionRecordingBlobIngestion: true,
appManagementSingleton: true,
preflightSchedules: true,
}
}
}