forked from open-source-labs/Docketeer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
1139 lines (988 loc) · 31.2 KB
/
types.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
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import { Request, Response, NextFunction } from 'express';
// * BH: I think we should have a separate file for each interface, and then import them into this file. That way, we can keep the interfaces organized and not have to scroll through a huge file to find the interface we need.
// ==============================================
// USER TYPES
// ==============================================
interface UserBase {
username: string;
password: string;
}
interface User extends UserBase {
username: string;
password: string;
// changed role_id from number to string check if that broke anything (from previous group)
role_id: string;
}
// ? not used anymore?
export interface SignUpValues extends UserBase {
passwordConfirmation: string;
showPassword: boolean;
}
export interface UserInfo extends User {
// removed password property on userInfo as it's not being used.
// changed id from number type to string type so see if that breaks anything
_id: string;
email: string;
phone: string;
role: string;
contact_pref: string;
// changed memthreshold from string to string to align with sessionState in sessions reducer. see if it broke something
mem_threshold: string;
// changed cpu threshold from string to string let's see what happens
cpu_threshold: string;
// changed container_stops from boolean to string so let's see what happens
container_stops: string;
token: string;
}
export interface SessionStateType extends UserInfo {
isLoggedIn: boolean;
// userList: any[];
}
export interface RootState {
session: {
isLoggedIn?: boolean;
role: string;
};
}
export interface userStateType {
userList: UserInfo[];
}
export interface userReducerStateType {
name: string;
email: string;
phone: string;
role: string;
role_id: string;
contact_pref: string;
mem_threshold: string;
cpu_threshold: string;
container_stops: boolean;
isSysAdmin: boolean;
}
// ==============================================
// CONTAINER TYPES
// ==============================================
// Stopped containers have a Names key and running containers have a Name key
export interface ContainerType {
ID: string;
Names?: string;
Image?: string;
RunningFor?: string;
}
export interface StoppedListType extends ContainerType {
Img: string;
Created: string;
name: string;
}
// export interface RunningListType {
// Names?: string;
// ID: string;
// Image: string;
// RunningFor: string;
// }
export interface ContainerStateType {
runningList: ContainerType[];
stoppedList: StoppedListType[];
networkList: any[];
composeStack: any[];
}
// for container's being run
export interface ContainerObj extends ContainerType {
Container: string;
}
// for container's being stopped
export interface StoppedContainerObj extends ContainerType {
Command: string;
CreatedAt: string;
Labels: string;
LocalVolumes: string;
Mounts: string;
Networks: string;
Ports: string;
Size: string;
State: string;
Status: string;
}
export interface containersList {
runningList: any[];
stoppedList: any[];
}
// ==============================================
// IMAGE TYPES
// ==============================================
export interface ImageObj {
reps: string;
tag: string;
imgid: string;
size: string;
}
export interface ImagesStateType {
imagesList: ImageObj[];
}
// ==============================================
// LOGS TYPES
// ==============================================
export interface LogObject {
timeStamp: string;
logMsg: string;
containerName: string;
}
export interface ProcessLogsSelectorProps {
containerList: ContainerType[];
handleCheck: (name: string) => void;
btnIdList: {
Names: boolean;
}[];
}
export interface ProcessLogsSelectorProps {
containerList: ContainerType[];
handleCheck: (name: string) => void;
btnIdList: { Names: boolean }[];
}
export interface stdType {
containerName: string;
logMsg: string;
timestamp: string;
}
export interface ContainerLogsType {
stdout: stdType[];
stderr: stdType[];
}
export interface LogsStateType {
containerLogs: ContainerLogsType;
}
export type CSVDataType = string[];
// ==============================================
// VOLUME TYPES
// ==============================================
export interface VolumeContainerObj {
Names: string;
State?: string | undefined;
Status?: string | undefined;
}
export interface VolumeObj {
vol_name: string;
containers: VolumeContainerObj[];
}
export interface VolumeNameObj {
Name: string;
}
export interface VolumeStateType {
arrayOfVolumeNames: VolumeNameObj[];
volumeContainersList: VolumeObj[];
}
// ==============================================
// MISC. TYPES
// ==============================================
export interface NetworkObj {
CreatedAt: string;
Driver: string;
ID: string;
IPv6: string;
Internal: string;
Labels: string;
Name: string;
Scope: string;
}
export interface composeStacksDockerObject {
Name: string[];
FilePath: string;
YmlFileName: string;
}
export interface notificationList {
phoneNumber: string[];
memoryNotificationList: any[];
cpuNotificationList: any[];
stoppedNotificationList: any[];
}
export interface AlertStateType {
alertList: (string | null)[];
promptList:
| [
prompt: string | null,
handleAccept: (() => void) | null,
handleDeny: (() => void) | null
]
| null[];
}
export interface notificationStateType {
phoneNumber: string;
memoryNotificationList: Set<any>;
cpuNotificationList: Set<any>;
stoppedNotificationList: Set<any>;
}
export interface RowsDataType {
container: string | undefined;
type: string;
time: string;
message: string;
id: number;
}
export interface ToggleDisplayProps {
container: ContainerType;
}
export interface ContainersCardsProps {
containerList: ContainerType[];
stopContainer: (container: ContainerType) => void;
runContainer: (container: ContainerType) => void;
removeContainer: (container: ContainerType) => void;
status: string;
}
// ==========================================================
// Server-Side Typing
// ==========================================================
export type ServerError = {
log: string;
status: number;
message: {
err: string;
};
};
export type SqlQuery = {
query: (text: string, params?: any | any[], callback?: any) => void | any;
};
// ==========================================================
// MiddleWare Function Type
// ==========================================================
export type MiddleWareFunction = (
req: Request,
res: Response,
next: NextFunction
) => void;
// ==========================================================
// Controller Types
// ==========================================================
export interface ApiController {
sendEmailAlert: MiddleWareFunction;
signupEmail: MiddleWareFunction;
}
export interface BcryptController {
/**
* @description destructures password from req.body then hashes it and adds it to locals under 'hash'
*/
hashPassword: MiddleWareFunction;
/**
* @description destructures new password from req.body then hashes it and adds it to locals under 'newHashedPassword'
*/
hashNewPassword: MiddleWareFunction;
/**
* @description destructures new password from req.body then hashes it and adds it to locals under 'newHashedPassword'
*/
hashCookie: MiddleWareFunction;
}
export interface CommandController {
/**
* @description pulls running container info from docker ps command as a json object
*/
getContainers: MiddleWareFunction;
/**
* @description executes the docker run command with parameters from body: reps, tag
* @note imgid is not used; may want it swapped with containerId in the exec?
*/
runImage: MiddleWareFunction;
/**
* @description executes the docker ps command with status=exited flag to get list of stopped containers
*/
refreshStopped: MiddleWareFunction;
/**
* @description executes the docker image command to get list of pulled images; invokes convertArrToObj and passes resulting value in locals to imagesList
*/
refreshImages: MiddleWareFunction;
/**
* @description executes docker rm {containerId} command to remove a stopped container
* @note id is grabbed from req.query
*/
remove: MiddleWareFunction;
/**
* @description executes docker stop {id} command to stop a running container
* @note id is grabbed from req.query
*/
stopContainer: MiddleWareFunction;
/**
* @description executes docker start {id} command to run a stopped container
* @note id is grabbed from req.query
*/
runStopped: MiddleWareFunction;
/**
* @description executes `docker rmi -f {id} command to remove a pulled image
* @note id is grabbed from req.query
*/
removeImage: MiddleWareFunction;
/**
* @description executes docker system prune --force command to remove all unused containers, networks, images (both dangling and unreferenced); passes a string to prop 'pruneMessage' in locals relaying the prune
*/
dockerPrune: MiddleWareFunction;
/**
* @description executes docker pull {repo} command to pull a new image; send a string to locals 'imgMessage'
* @note image's repo name grabbed from req.query
*/
pullImage: MiddleWareFunction;
/**
* @description Display all containers network based on docker-compose in a json object; when the application starts
*/
networkContainers: MiddleWareFunction;
/**
* @description inspects docker containers
* @note is not implemented right now
*/
inspectDockerContainer: MiddleWareFunction;
/**
* @description compose up a network and container from an uploaded yml file
* @note file path is grabbed from req.body; IS NOT USED
*/
composeUp: MiddleWareFunction;
/**
* @description get a list of all current container networks, based on running containers; passes the output to locals
* @note grabs file path and yml file name from req.body
*/
composeStacks: MiddleWareFunction;
/**
* @description composes down a container and network
* @note (from v10): causes server to shut down because container is not properly
stopped; button goes away when you leave the page because the
file name and location are not in "docker networks" so it gets
erased from the state
*/
composeDown: MiddleWareFunction;
/**
* @description retrieves the list of running volumes; passes the output to 'dockerVolumes' in locals
*/
getAllDockerVolumes: MiddleWareFunction;
/**
* @description runs docker ps filtering by volume name to get list of containers running in the specified volume; passes output to 'volumeContainers' in locals
* @note grabs volume name from query
*/
getVolumeContainers: MiddleWareFunction;
/**
* @description runs docker logs with timestamps and presists 'containerLogs' though locals, invokes makeArrayOfObjects passing in stdout/err to add to the 'containerLogs' obj
*/
getLogs: MiddleWareFunction;
/**
* @description verifies admin status before executing docker commands (i.e. remove image, docker stop)
*/
checkAdmin: MiddleWareFunction;
}
// this is not used
export interface CookieController {
setSSIDCookie: (req: Request, res: Response, next: NextFunction) => void;
setAdminCookie: (req: Request, res: Response, next: NextFunction) => void;
}
export interface ConfigController {
configureThresholds: (
req: Request,
res: Response,
next: NextFunction
) => void;
updateContactPref: (req: Request, res: Response, next: NextFunction) => void;
updateCPUThreshold: (req: Request, res: Response, next: NextFunction) => void;
updateMemThreshold: (req: Request, res: Response, next: NextFunction) => void;
updateStopPref: (req: Request, res: Response, next: NextFunction) => void;
}
export interface DbController {
/**
* @description creates a database table called "roles" if it doesn't exist. db.query executes SQL query.
* @note OIDS is optional for this middleware
*/
createRolesTable: MiddleWareFunction;
/**
* @description inserts 3 rows into databse for "roles": "system admin" (1), "admin" (2), "user" (3)
* @note uses single SQl query for all 3 rows in terms of string query
*/
insertRoles: MiddleWareFunction;
/**
* @description Creates a table in database called "users" with user and container info
*/
createUsersTable: MiddleWareFunction;
// not used
// insertAdmin: (req: Request, res: Response, next: NextFunction) => void;
/**
* @description Creates a hashed password for the system admin user with 10 salt rounds (decrease for faster processing)
* @note adds the password as a string for the res.locals object
*/
createAdminPassword: MiddleWareFunction;
/**
* @description Updates user token in the database
* @note Destructures username and token from request body
*/
addToken: MiddleWareFunction;
/**
* @description Removes token (sets token to null) after user logs out.
* @note Destructures username from request body. Logout propery is created if SQL query is able to update users token to null.
*/
removeToken: MiddleWareFunction;
}
export interface InitController {
/**
* @description Obtains github URL from containers name, and assigns it to 'parameter'
* @note 'url' property is set on res.locals upon success
*/
gitUrl?: MiddleWareFunction;
/**
* @description adds metrics to our metrics table of each individual container
*/
addMetrics: MiddleWareFunction;
/**
* @description Obtains metrics data
* @note returns a promise with an object that has the data, located in 'rows'
*/
getMetrics: MiddleWareFunction;
}
// not used
export interface SettingsController {
addContainer: (req: Request, res: Response, next: NextFunction) => void;
addContainerSettings: (
req: Request,
res: Response,
next: NextFunction
) => void;
deleteContainerSettings: (
req: Request,
res: Response,
next: NextFunction
) => void;
notificationSettings: (
req: Request,
res: Response,
next: NextFunction
) => void;
addPhoneNumber: (req: Request, res: Response, next: NextFunction) => void;
notificationFrequency: (
req: Request,
res: Response,
next: NextFunction
) => void;
monitoringFrequency: (
req: Request,
res: Response,
next: NextFunction
) => void;
addGitLinks: (req: Request, res: Response, next: NextFunction) => void;
}
export interface SignupController {
/**
* @description Checks if username already exists in the database
* @note If user exists, error handler will return an error object with the relevant middleware passing from next()
*/
usernameCheck: MiddleWareFunction;
/**
* @description Checks if password is at least 6 characters long
* @note Only performed if usernameCheck is successful with NO errors
*/
passwordCheck: MiddleWareFunction;
}
export interface UserController {
/**
* @description Performs SQL query to insert a new user, hashing the password before it does, into "users" table and then RETURNS those values.
* @note Extract isername, password, and role ID from req.body
*/
createUser: MiddleWareFunction;
/**
* @description Gets all users; returned in an array
* @note Sorts them by ASCENDING order
*/
getAllUsers: MiddleWareFunction;
/**
* @description Gets a single user yser
* @note Uses destructuring for _id from req.body
*/
getOneUser: MiddleWareFunction;
/**
* @description verifies username/password are correct and sends back that user info; otherwise sends an error message
* @note Extract the username and password from req.body. Any errors get passed onto an error object.
*/
verifyUser: MiddleWareFunction;
/**
* @description grabs all users that have a role of system admin and adds rowCount and id of the users to locals
* @note System admin ID has a role_id of 1
*/
checkSysAdmin?: MiddleWareFunction;
/**
* @description switches role of user in database upon designation by system admin; must be provided id of user and role
* @note roleMap maps role strings to the role ID's. If there is only one system admin and the _id's match, it results in an error from hasError being true.
*/
switchUserRole?: MiddleWareFunction;
// TODO: update description. no more res.locals.error
/**
* @description Checks for error prop in locals; if none, updates password and adds user with updated pw to locals
* @note If incorrect password is entered, then res.locals error property will exist and next() will occur because error.
*/
updatePassword: MiddleWareFunction;
/**
* @description updates the phone number of a user; column is 'phone'
*/
updatePhone: MiddleWareFunction;
/**
* @description updates the email of a user
*/
updateEmail: MiddleWareFunction;
/**
* @description adds a cookie to our user's browser to signify they are logged in
*/
addCookie: MiddleWareFunction;
/**
* @description checks if user has a valid cookie
*/
checkCookie: MiddleWareFunction;
/**
* @description removes our user's cookie
*/
removeCookie: MiddleWareFunction;
}
export interface ContainerNetworkObject {
Name: string;
Id: string;
CreatedAt: string;
Labels: Record<string, string>;
FilePath?: string;
YmlFileName?: string;
}
export interface MetricsQuery {
id: number;
container_id: string;
container_name: string;
cpu_pct: string;
memory_pct: string;
memory_usage: string;
net_io: string;
block_io: string;
pid: string;
created_at: Date;
}
export interface GlobalErrorObject {
log: string;
status: number;
message: { err: string };
}
// export interface containersList {
// runningList: any[];
// stoppedList: any[];
// }
// interface volumeList {
// arrayOfVolumeNames: any[];
// volumeContainersList: any[];
// }
// export interface ArrayOfVolumeNames {Name: string}[];
// "any" has been used below since strict typing was used to define these props in the tabs types
// interface imagesList {
// imagesList: any[];
// }
// for more info review actions.ts file and Settings.ts
// export type ContainerProps = {
// stoppedList: StoppedListType[];
// runStopped: (
// id: string,
// runStoppedContainerDispatcher: (id: string) => void
// ) => void;
// runStoppedContainer: (id: string) => void;
// removeContainer: (id: string) => void;
// refreshStoppedContainers: (data: StoppedContainerObj[]) => void;
// remove: (
// id: string,
// runStoppedContainerDispatcher: (id: string) => void
// ) => void;
// stop: (
// id: string,
// refreshStoppedContainers: (data: StoppedContainerObj[]) => void
// ) => void;
// runningList: RunningListType[];
// runIm: (
// id: ContainerType,
// runningList: RunningListType,
// callback_1: () => void,
// callback_2: () => void
// ) => void;
// };
// export type MetricsProps = {
// runningList: any[];
// threshold: any[];
// };
// export type RunningContainerType = {
// Names?: string;
// ID: string;
// Image: string;
// RunningFor: string;
// };
// not used at all since charts are not being used
// export type ChartInfoType = {
// labels: string[];
// datasets: DataSetType[];
// data?: any;
// };
// export type DataSetType = {
// stack: string;
// label: string;
// data: string[];
// backgroundColor: string[];
// borderColor: string;
// borderWidth: number;
// barPercentage: number;
// };
// export type DispatchType = (...args: any[]) => void;
// export type WindowType = {
// nodeMethod: NodeMethodType;
// };
// type NodeMethodType = {
// rendInvoke: (arg1: string, arg2: string | RendInvokebody) => Promise<any>;
// };
// type RendInvokebody = {
// code: string;
// mobileNumber: string;
// };
// export type SettingsProps = {
// addMonitoringFrequency: (data: any) => void;
// addMemoryNotificationSetting: (data: any) => void;
// addCpuNotificationSetting: (data: any) => void;
// addStoppedNotificationSetting: (data: any) => void;
// addPhoneNumber: (data: any) => void;
// addNotificationFrequency: (data: any) => void;
// runningList: any[];
// stop?: (id: any, callback: any) => void;
// stoppedList: any[];
// refreshStoppedContainers: (data: StoppedContainerObj[]) => void;
// runStopped: (id: any, runStoppedContainerDispatcher: any) => void;
// refreshRunningContainers: (data: any[]) => void;
// runStoppedContainer: (id: string) => void;
// phoneNumber?: string[];
// memoryNotificationList: any[];
// cpuNotificationList: any[];
// stoppedNotificationList: any[];
// };
// export interface imageObj {
// reps: string;
// tag: string;
// imgid: string;
// size: string;
// }
// export interface ImagesProps {
// imagesList: imageObj[];
// runningList: ContainerObj[];
// refreshRunningContainers: (data: ContainerObj[]) => void;
// refreshImagesList: (data: imageObj[]) => void;
// runIm: (
// ele: imageObj,
// refreshRunningContainers: (data: ContainerObj[]) => void
// ) => void;
// removeIm: (
// id: string,
// imagesList: imageObj[],
// callback_1: (callback: any) => void,
// callback_2: (data: imageObj[]) => void
// ) => void;
// }
// export interface NetworkObj {
// CreatedAt: string;
// Driver: string;
// ID: string;
// IPv6: string;
// Internal: string;
// Labels: string;
// Name: string;
// Scope: string;
// }
// export interface VolumeObj {
// vol_name: string;
// containers: object[];
// }
// export interface logObject {
// timeStamp: string;
// logMsg: string;
// containerName: string;
// }
// export interface composeStacksDockerObject {
// Name: string[];
// FilePath: string;
// YmlFileName: string;
// }
// // "any" has been used below since strict typing was used to define these props in the tabs types
// export interface containersList {
// runningList: any[];
// stoppedList: any[];
// }
// interface volumeList {
// arrayOfVolumeNames: any[];
// volumeContainersList: any[];
// }
// interface notificationList {
// phoneNumber: string[];
// memoryNotificationList: any[];
// cpuNotificationList: any[];
// stoppedNotificationList: any[];
// }
// export interface AlertStateType {
// alertList: (string | null)[];
// promptList:
// | [
// prompt: string | null,
// handleAccept: (() => void) | null,
// handleDeny: (() => void) | null
// ]
// | null[];
// }
// export interface StateType {
// containersList: containersList;
// images: imagesList;
// notificationList: notificationList;
// session: sessionStateType;
// volumeList: volumeList;
// }
// export interface RootState {
// session: {
// isLoggedIn?: boolean;
// role: string;
// };
// }
// export interface graphDataType {
// label: string;
// data: any[];
// fill: string;
// }
// need to update this with proper var types
// export interface graphStateType {
// graphAxis: any[];
// graphMemory: graphDataType[];
// graphCpu: graphDataType[];
// graphWrittenIO: graphDataType[];
// graphReadIO: graphDataType[];
// graphReceivedIO: graphDataType[];
// graphTransmittedIO: graphDataType[];
// }
// need to get type of the sets later by seeing what data is in the notification lists
// export interface notificationStateType {
// phoneNumber: string;
// memoryNotificationList: Set<any>;
// cpuNotificationList: Set<any>;
// stoppedNotificationList: Set<any>;
// }
// export interface stdType {
// containerName: string;
// logMsg: string;
// timestamp: string;
// }
// export interface containerLogsType {
// stdout: stdType[];
// stderr: stdType[];
// }
// export interface logsStateType {
// containerLogs: containerLogsType;
// }
// export interface userStateType {
// userList: UserInfo[];
// }
// export interface userReducerStateType {
// name: string;
// email: string;
// phone: string;
// role: string;
// role_id: string;
// contact_pref: string;
// mem_threshold: string;
// cpu_threshold: string;
// container_stops: boolean;
// isSysAdmin: boolean;
// }
// export interface volumeStateType {
// arrayOfVolumeNames: ArrayOfVolumeNames;
// volumeContainersList: VolumeObj[];
// }
// export type ArrayOfVolumeNames = { Name: string }[];
// export interface auxObjType {
// container?: ContainerInterface;
// currentContainer?: any;
// containerName?: string;
// }
// export interface ContainerInterface {
// memory?: any;
// cpu?: any;
// writtenIO?: any;
// readIO?: any;
// }
// export interface obType {
// containerName?: any;
// }
// export interface LogsCardProps {
// container: ContainerType;
// index: number;
// status: any;
// }
// export interface RowsDataType {
// container: string | undefined;
// type: string;
// time: string;
// message: string;
// id: number;
// }
// export interface ToggleDisplayProps {
// container: ContainerType;
// }
// ==========================================================
// Server-Side Typing
// ==========================================================
// export type ServerError = {
// log: string;
// status: number;
// message: {
// err: string;
// };
// };
// export type SqlQuery = {
// query: (text: string, params?: any | any[], callback?: any) => void | any;
// };
// ==========================================================
// Controller Types
// ==========================================================
// export interface ApiController {
// sendEmailAlert: (req: Request, res: Response, next: NextFunction) => void;
// signupEmail: (req: Request, res: Response, next: NextFunction) => void;
// }
// export interface BcryptController {
// hashPassword: (req: Request, res: Response, next: NextFunction) => void;
// hashNewPassword: (req: Request, res: Response, next: NextFunction) => void;
// hashCookie: (req: Request, res: Response, next: NextFunction) => void;
// }
// export interface CommandController {
// getContainers: (req: Request, res: Response, next: NextFunction) => void;
// runImage: (req: Request, res: Response, next: NextFunction) => void;
// refreshStopped: (req: Request, res: Response, next: NextFunction) => void;
// refreshImages: (req: Request, res: Response, next: NextFunction) => void;
// remove: (req: Request, res: Response, next: NextFunction) => void;
// stopContainer: (req: Request, res: Response, next: NextFunction) => void;
// runStopped: (req: Request, res: Response, next: NextFunction) => void;
// removeImage: (req: Request, res: Response, next: NextFunction) => void;
// dockerPrune: (req: Request, res: Response, next: NextFunction) => void;
// pullImage: (req: Request, res: Response, next: NextFunction) => void;
// networkContainers: (req: Request, res: Response, next: NextFunction) => void;
// inspectDockerContainer: (
// req: Request,
// res: Response,
// next: NextFunction
// ) => void;
// composeUp: (req: Request, res: Response, next: NextFunction) => void;