Built motion from commit f861bcb808219e66da88ba48b61bddb35224a65e. Version 3.0.0...
[motion-next.git] / server / config / get-config.d.ts
1 import * as schema from './xcally_configuration.schema.json'
2
3 declare type ValidProperties = keyof typeof schema.properties
4
5 /**
6  * Logging Level. If VERBOSE and NODE_ENV is development, it will also make log each query
7  */
8 declare enum XcDebugLevel {
9   Debug = 'DEBUG',
10   Error = 'ERROR',
11   HTTP = 'HTTP',
12   Info = 'INFO',
13   Silly = 'SILLY',
14   Verbose = 'VERBOSE',
15   Warn = 'WARN',
16 }
17
18 /**
19  * Configuration Object for Motion V3
20  */
21 declare interface Configuration {
22   /**
23    * path of the execution root folder, resolved at runtime.
24    * In dev and test environment, it's 'src', while in the build it's usually 'dist/server'
25    */
26   root: string
27   /**
28    * Node ENV. Relevant values for motion are: development, test, build, production, vscode_debugger
29    */
30   environment: string
31
32   /**
33    * shortcut for environment === 'production'
34    */
35   isProduction: boolean
36   /**
37    *  shortcut for environment === 'test'
38    */
39   isTest: boolean
40   /**
41    * shortcut for environment !== 'production' && environment !== 'test' && environment !== build.
42    * When true, it usually means you are using nodemon in dev mode and both
43    * motion-client and motion-chat are running as detached projects with webpack-dev-server
44    */
45   isDevelopment: boolean
46
47   /**
48    * Domain for Google OAuth callback
49    */
50   domain: string
51   /**
52    * Google OAuth Client ID
53    */
54   googleId: string
55   /**
56    * Google OAuth Secret
57    */
58   googleSecret: string
59   /**
60    * Database name
61    */
62   mysqlDatabase: string
63   /**
64    * Database password
65    */
66   mysqlPassword: string
67   /**
68    * Database user name
69    */
70   mysqlUser: string
71
72   /**
73    * History/Replica Database name
74    */
75   mysqlHistoryDatabase: string
76   /**
77    * History/Replica Database password
78    */
79   mysqlHistoryPassword: string
80   /**
81    * History/Replica Database user name
82    */
83   mysqlHistoryUser: string
84
85   /**
86    * IP Address for RPC AGI motion process
87    */
88   agiIp: string
89   /**
90    * Port for the AGI motion process
91    */
92   agiPort: number
93   /**
94    * IP Address or hostname for Asterisk connection
95    */
96   asteriskHost: string
97   /**
98    * Asterisk password
99    */
100   asteriskPassword: string
101   /**
102    * Port for Asterisk connection
103    */
104   asteriskPort: number
105   /**
106    * Asterisk shared folder path
107    */
108   asteriskSharedFolder: string
109   /**
110    * Asterisk user name
111    */
112   asteriskUsername: string
113   /**
114    * Browser Sync Port
115    */
116   browserSyncPort: number
117   /**
118    * IP Address or hostname for MySQL Database connection
119    */
120   dbHost: string
121   /**
122    * Sequelize: The maximum time, in milliseconds, that a connection can be idle before being
123    * released.
124    */
125   dbPoolIdle: number
126   /**
127    * Sequelize: Maximum number of connection in pool
128    */
129   dbPoolMax: number
130   /**
131    * Sequelize: Minimum number of connection in pool
132    */
133   dbPoolMin: number
134   /**
135    * Port for MySQL Database connection
136    */
137   dbPort: number
138
139   /**
140    * IP Address or hostname for MySQL History/Replica Database connection
141    */
142   historyDbHost: string
143   /**
144    * Sequelize: The maximum time, in milliseconds, that a connection to History/Replica db can be idle before being
145    * released
146    */
147   historyDbPoolIdle: number
148   /**
149    * Sequelize: Maximum number of connection to History/Replica db in pool
150    */
151   historyDbPoolMax: number
152   /**
153    * Sequelize: Minimum number of connection to History/Replica db in pool
154    */
155   historyDbPoolMin: number
156   /**
157    * Port for MySQL History/Replica Database connection
158    */
159   historyDbPort: number
160
161   /**
162    * Logging Level. If VERBOSE and NODE_ENV is development, it will also make log each query
163    */
164   debugLevel: XcDebugLevel
165   /**
166    * License token. Required for development, or for cluster mode
167    */
168   licenseToken: null | string
169   /**
170    * When true, the debugger will attach to the processes in the test containers. Useful for
171    * debugging forked processes in integration tests
172    */
173   inspectTests: boolean
174   /**
175    * IP Address for the main motion process. Set 0.0.0.0 for listening on any interface, e.g.
176    * in development.
177    */
178   ip: string
179   /**
180    * Path where to store log files. Set to some folder on your machine when developing, e.g.
181    * ./logs
182    */
183   logPath: string
184   /**
185    * Port for the main motion process connection
186    */
187   port: number
188   /**
189    * Voice recording secret
190    */
191   recordingSecret: string
192   /**
193    * IP Address or hostname for Redis connection
194    */
195   redisHost: string
196   /**
197    * Redis password
198    */
199   redisPassword?: string
200   /**
201    * Port for Redis connection
202    */
203   redisPort: number
204   /**
205    * Redis user name
206    */
207   redisUsername?: string
208   /**
209    * IP Address for the RPC AMI motion process
210    */
211   rpcAmiIp: string
212   /**
213    * Port for the RPC AMI motion process
214    */
215   rpcAmiPort: number
216   /**
217    * IP Address for the RPC Email motion process
218    */
219   rpcEmailIp: string
220   /**
221    * Port for the RPC Email motion process
222    */
223   rpcEmailPort: number
224   /**
225    * IP Address for the RPC motion process
226    */
227   rpcIp: string
228   /**
229    * Port for the RPC motion process
230    */
231   rpcPort: number
232   /**
233    * IP Address for the RPC Routing motion process
234    */
235   rpcRoutingIp: string
236   /**
237    * Port for the RPC Routing motion process
238    */
239   rpcRoutingPort: number
240   /**
241    * When true, the server will perform DB Seed at startup
242    */
243   seedDb: boolean
244   /**
245    * Session secret for cookies
246    */
247   sessionSecret: string
248   /**
249    * When true, XDR will be disabled. Useful in development mode
250    */
251   xdrDisabled: boolean
252
253   /**
254    * Dialer max number originate
255    */
256   maxNumberOriginate: number
257 }
258
259 /**
260  * Returns a configuration as a singleton, immutable, object,
261  * that holds the whole app configuration values
262  * Usage:
263  * const config = getConfig()
264  * console.log('Root folder:', config.root)
265  */
266 declare function getConfig(): Readonly<Configuration>