-
Notifications
You must be signed in to change notification settings - Fork 728
Expand file tree
/
Copy pathindex.ts
More file actions
163 lines (112 loc) · 5.94 KB
/
Copy pathindex.ts
File metadata and controls
163 lines (112 loc) · 5.94 KB
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
import config from 'config'
import { IDatabaseConfig } from '@crowd/data-access-layer/src/database'
import { ISearchSyncApiConfig } from '@crowd/opensearch'
import { IQueueClientConfig } from '@crowd/queue'
import { IRedisConfiguration } from '@crowd/redis'
import { ITemporalConfig } from '@crowd/temporal'
import { IGithubIssueReporterConfiguration, IJiraIssueReporterConfiguration } from '@crowd/types'
import {
ApiConfiguration,
Auth0Configuration,
ClearbitConfiguration,
ComprehendConfiguration,
CrowdAnalyticsConfiguration,
DbConfiguration,
DiscordConfiguration,
EagleEyeConfiguration,
EncryptionConfiguration,
EnrichmentConfiguration,
GithubConfiguration,
GithubTokenConfiguration,
GitlabConfiguration,
GoogleConfiguration,
IOpenSearchConfig,
IOpenStatusApiConfig,
IRedditConfig,
IntegrationProcessingConfiguration,
LinuxFoundationConfiguration,
NangoConfiguration,
OrganizationEnrichmentConfiguration,
S3Configuration,
SSOConfiguration,
SegmentConfiguration,
ServiceType,
SlackConfiguration,
SnowflakeConfiguration,
StackExchangeConfiguration,
TenantMode,
TwitterConfiguration,
} from './configTypes'
// TODO-kube
export const ENCRYPTION_SECRET_KEY = process.env.ENCRYPTION_SECRET_KEY
export const ENCRYPTION_INIT_VECTOR = process.env.ENCRYPTION_INIT_VECTOR
export const KUBE_MODE: boolean = process.env.KUBE_MODE !== undefined
export const SERVICE: ServiceType = process.env.SERVICE as ServiceType
export const TENANT_MODE: TenantMode = process.env.TENANT_MODE as TenantMode
export const IS_TEST_ENV: boolean = process.env.NODE_ENV === 'test'
export const IS_DEV_ENV: boolean =
process.env.NODE_ENV === 'development' ||
process.env.NODE_ENV === 'docker' ||
process.env.NODE_ENV === undefined
export const IS_PROD_ENV: boolean = process.env.NODE_ENV === 'production'
export const IS_STAGING_ENV: boolean = process.env.NODE_ENV === 'staging'
export const LOG_LEVEL: string = process.env.LOG_LEVEL || 'info'
export const IS_CLOUD_ENV: boolean = IS_PROD_ENV || IS_STAGING_ENV
export const ENCRYPTION_CONFIG: EncryptionConfiguration =
config.get<EncryptionConfiguration>('encryption')
export const QUEUE_CONFIG: IQueueClientConfig = config.get<IQueueClientConfig>('queue')
export const REDIS_CONFIG: IRedisConfiguration = config.get<IRedisConfiguration>('redis')
export const S3_CONFIG: S3Configuration = config.get<S3Configuration>('s3')
export const DB_CONFIG: DbConfiguration = config.get<DbConfiguration>('db')
export const PRODUCT_DB_CONFIG: IDatabaseConfig = config.has('productDb')
? config.get<IDatabaseConfig>('productDb')
: undefined
export const PACKAGES_DB_CONFIG: IDatabaseConfig | undefined = config.has('packagesDb')
? config.get<IDatabaseConfig>('packagesDb')
: undefined
export const SEGMENT_CONFIG: SegmentConfiguration = config.get<SegmentConfiguration>('segment')
export const COMPREHEND_CONFIG: ComprehendConfiguration =
config.get<ComprehendConfiguration>('comprehend')
export const CLEARBIT_CONFIG: ClearbitConfiguration = config.get<ClearbitConfiguration>('clearbit')
export const API_CONFIG: ApiConfiguration = config.get<ApiConfiguration>('api')
export const AUTH0_CONFIG: Auth0Configuration = config.get<Auth0Configuration>('auth0')
export const SSO_CONFIG: SSOConfiguration = config.get<SSOConfiguration>('sso')
export const TWITTER_CONFIG: TwitterConfiguration = config.get<TwitterConfiguration>('twitter')
export const SLACK_CONFIG: SlackConfiguration = config.get<SlackConfiguration>('slack')
export const GOOGLE_CONFIG: GoogleConfiguration = config.get<GoogleConfiguration>('google')
export const DISCORD_CONFIG: DiscordConfiguration = config.get<DiscordConfiguration>('discord')
export const GITHUB_CONFIG: GithubConfiguration = config.get<GithubConfiguration>('github')
export const GITHUB_ISSUE_REPORTER_CONFIG: IGithubIssueReporterConfiguration =
config.get<IGithubIssueReporterConfiguration>('githubIssueReporter')
export const JIRA_ISSUE_REPORTER_CONFIG: IJiraIssueReporterConfiguration =
config.get<IJiraIssueReporterConfiguration>('jiraIssueReporter')
export const NANGO_CONFIG: NangoConfiguration = config.get<NangoConfiguration>('nango')
export const ENRICHMENT_CONFIG: EnrichmentConfiguration =
config.get<EnrichmentConfiguration>('enrichment')
export const ORGANIZATION_ENRICHMENT_CONFIG: OrganizationEnrichmentConfiguration =
config.get<OrganizationEnrichmentConfiguration>('organizationEnrichment')
export const EAGLE_EYE_CONFIG: EagleEyeConfiguration = config.get<EagleEyeConfiguration>('eagleEye')
export const GITHUB_TOKEN_CONFIG: GithubTokenConfiguration =
config.get<GithubTokenConfiguration>('githubToken')
export const OPENSEARCH_CONFIG: IOpenSearchConfig = config.get<IOpenSearchConfig>('opensearch')
export const STACKEXCHANGE_CONFIG: StackExchangeConfiguration =
config.get<StackExchangeConfiguration>('stackexchange') ?? {
key: process.env.STACKEXCHANGE_KEY,
}
export const INTEGRATION_PROCESSING_CONFIG: IntegrationProcessingConfiguration =
config.get<IntegrationProcessingConfiguration>('integrationProcessing')
export const CROWD_ANALYTICS_CONFIG: CrowdAnalyticsConfiguration =
config.get<CrowdAnalyticsConfiguration>('crowdAnalytics')
export const TEMPORAL_CONFIG: ITemporalConfig = config.get<ITemporalConfig>('temporal')
export const SEARCH_SYNC_API_CONFIG: ISearchSyncApiConfig =
config.get<ISearchSyncApiConfig>('searchSyncApi')
export const OPEN_STATUS_API_CONFIG: IOpenStatusApiConfig =
config.get<IOpenStatusApiConfig>('openStatusApi')
export const GITLAB_CONFIG: GitlabConfiguration = config.get<GitlabConfiguration>('gitlab')
export const REDDIT_CONFIG: IRedditConfig = config.get<IRedditConfig>('reddit')
export const SNOWFLAKE_CONFIG: SnowflakeConfiguration =
config.get<SnowflakeConfiguration>('snowflake')
export const LINUX_FOUNDATION_CONFIG: LinuxFoundationConfiguration =
config.get<LinuxFoundationConfiguration>('linuxFoundation')
export const ENABLE_LF_COLLECTION_MANAGEMENT: boolean =
process.env.ENABLE_LF_COLLECTION_MANAGEMENT === 'true'