dbgate-api 6.5.3 → 6.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -5
- package/src/auth/authProvider.js +2 -2
- package/src/controllers/auth.js +51 -7
- package/src/controllers/cloud.js +18 -0
- package/src/controllers/config.js +16 -2
- package/src/controllers/connections.js +5 -5
- package/src/controllers/databaseConnections.js +102 -8
- package/src/controllers/files.js +2 -2
- package/src/controllers/runners.js +24 -1
- package/src/controllers/serverConnections.js +12 -0
- package/src/controllers/sessions.js +14 -1
- package/src/controllers/storage.js +7 -0
- package/src/currentVersion.js +2 -2
- package/src/shell/deployDb.js +1 -1
- package/src/shell/generateDeploySql.js +1 -1
- package/src/shell/importDbFromFolder.js +2 -5
- package/src/storageModel.js +304 -62
- package/src/utility/auditlog.js +9 -0
- package/src/utility/cloudIntf.js +33 -2
- package/src/utility/connectUtility.js +2 -1
- package/src/utility/getChartExport.js +11 -3
- package/src/utility/getMapExport.js +1 -1
- package/src/utility/loginchecker.js +15 -0
package/src/storageModel.js
CHANGED
|
@@ -1,5 +1,192 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
"tables": [
|
|
3
|
+
{
|
|
4
|
+
"pureName": "audit_log",
|
|
5
|
+
"columns": [
|
|
6
|
+
{
|
|
7
|
+
"pureName": "audit_log",
|
|
8
|
+
"columnName": "id",
|
|
9
|
+
"dataType": "int",
|
|
10
|
+
"autoIncrement": true,
|
|
11
|
+
"notNull": true
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"pureName": "audit_log",
|
|
15
|
+
"columnName": "created",
|
|
16
|
+
"dataType": "bigint",
|
|
17
|
+
"notNull": true
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"pureName": "audit_log",
|
|
21
|
+
"columnName": "modified",
|
|
22
|
+
"dataType": "bigint",
|
|
23
|
+
"notNull": false
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"pureName": "audit_log",
|
|
27
|
+
"columnName": "user_id",
|
|
28
|
+
"dataType": "int",
|
|
29
|
+
"notNull": false
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"pureName": "audit_log",
|
|
33
|
+
"columnName": "user_login",
|
|
34
|
+
"dataType": "varchar(250)",
|
|
35
|
+
"notNull": false
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"pureName": "audit_log",
|
|
39
|
+
"columnName": "category",
|
|
40
|
+
"dataType": "varchar(50)",
|
|
41
|
+
"notNull": false
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"pureName": "audit_log",
|
|
45
|
+
"columnName": "component",
|
|
46
|
+
"dataType": "varchar(50)",
|
|
47
|
+
"notNull": false
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"pureName": "audit_log",
|
|
51
|
+
"columnName": "action",
|
|
52
|
+
"dataType": "varchar(50)",
|
|
53
|
+
"notNull": false
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"pureName": "audit_log",
|
|
57
|
+
"columnName": "severity",
|
|
58
|
+
"dataType": "varchar(50)",
|
|
59
|
+
"notNull": false
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"pureName": "audit_log",
|
|
63
|
+
"columnName": "event",
|
|
64
|
+
"dataType": "varchar(100)",
|
|
65
|
+
"notNull": false
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"pureName": "audit_log",
|
|
69
|
+
"columnName": "message",
|
|
70
|
+
"dataType": "varchar(250)",
|
|
71
|
+
"notNull": false
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"pureName": "audit_log",
|
|
75
|
+
"columnName": "detail",
|
|
76
|
+
"dataType": "varchar(1000)",
|
|
77
|
+
"notNull": false
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"pureName": "audit_log",
|
|
81
|
+
"columnName": "detail_full_length",
|
|
82
|
+
"dataType": "int",
|
|
83
|
+
"notNull": false
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"pureName": "audit_log",
|
|
87
|
+
"columnName": "session_id",
|
|
88
|
+
"dataType": "varchar(200)",
|
|
89
|
+
"notNull": false
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"pureName": "audit_log",
|
|
93
|
+
"columnName": "session_group",
|
|
94
|
+
"dataType": "varchar(50)",
|
|
95
|
+
"notNull": false
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"pureName": "audit_log",
|
|
99
|
+
"columnName": "session_param",
|
|
100
|
+
"dataType": "varchar(200)",
|
|
101
|
+
"notNull": false
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"pureName": "audit_log",
|
|
105
|
+
"columnName": "conid",
|
|
106
|
+
"dataType": "varchar(100)",
|
|
107
|
+
"notNull": false
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"pureName": "audit_log",
|
|
111
|
+
"columnName": "connection_data",
|
|
112
|
+
"dataType": "varchar(1000)",
|
|
113
|
+
"notNull": false
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"pureName": "audit_log",
|
|
117
|
+
"columnName": "database",
|
|
118
|
+
"dataType": "varchar(200)",
|
|
119
|
+
"notNull": false
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"pureName": "audit_log",
|
|
123
|
+
"columnName": "schema_name",
|
|
124
|
+
"dataType": "varchar(100)",
|
|
125
|
+
"notNull": false
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"pureName": "audit_log",
|
|
129
|
+
"columnName": "pure_name",
|
|
130
|
+
"dataType": "varchar(100)",
|
|
131
|
+
"notNull": false
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"pureName": "audit_log",
|
|
135
|
+
"columnName": "sumint_1",
|
|
136
|
+
"dataType": "int",
|
|
137
|
+
"notNull": false
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"pureName": "audit_log",
|
|
141
|
+
"columnName": "sumint_2",
|
|
142
|
+
"dataType": "int",
|
|
143
|
+
"notNull": false
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
"foreignKeys": [
|
|
147
|
+
{
|
|
148
|
+
"constraintType": "foreignKey",
|
|
149
|
+
"constraintName": "FK_audit_log_user_id",
|
|
150
|
+
"pureName": "audit_log",
|
|
151
|
+
"refTableName": "users",
|
|
152
|
+
"deleteAction": "SET NULL",
|
|
153
|
+
"columns": [
|
|
154
|
+
{
|
|
155
|
+
"columnName": "user_id",
|
|
156
|
+
"refColumnName": "id"
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
"indexes": [
|
|
162
|
+
{
|
|
163
|
+
"constraintName": "idx_audit_log_session",
|
|
164
|
+
"pureName": "audit_log",
|
|
165
|
+
"constraintType": "index",
|
|
166
|
+
"columns": [
|
|
167
|
+
{
|
|
168
|
+
"columnName": "session_group"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"columnName": "session_id"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"columnName": "session_param"
|
|
175
|
+
}
|
|
176
|
+
]
|
|
177
|
+
}
|
|
178
|
+
],
|
|
179
|
+
"primaryKey": {
|
|
180
|
+
"pureName": "audit_log",
|
|
181
|
+
"constraintType": "primaryKey",
|
|
182
|
+
"constraintName": "PK_audit_log",
|
|
183
|
+
"columns": [
|
|
184
|
+
{
|
|
185
|
+
"columnName": "id"
|
|
186
|
+
}
|
|
187
|
+
]
|
|
188
|
+
}
|
|
189
|
+
},
|
|
3
190
|
{
|
|
4
191
|
"pureName": "auth_methods",
|
|
5
192
|
"columns": [
|
|
@@ -50,6 +237,7 @@ module.exports = {
|
|
|
50
237
|
"primaryKey": {
|
|
51
238
|
"pureName": "auth_methods",
|
|
52
239
|
"constraintType": "primaryKey",
|
|
240
|
+
"constraintName": "PK_auth_methods",
|
|
53
241
|
"columns": [
|
|
54
242
|
{
|
|
55
243
|
"columnName": "id"
|
|
@@ -61,7 +249,8 @@ module.exports = {
|
|
|
61
249
|
"id": -1,
|
|
62
250
|
"amoid": "790ca4d2-7f01-4800-955b-d691b890cc50",
|
|
63
251
|
"name": "Anonymous",
|
|
64
|
-
"type": "none"
|
|
252
|
+
"type": "none",
|
|
253
|
+
"is_disabled": 1
|
|
65
254
|
},
|
|
66
255
|
{
|
|
67
256
|
"id": -2,
|
|
@@ -69,6 +258,9 @@ module.exports = {
|
|
|
69
258
|
"name": "Local",
|
|
70
259
|
"type": "local"
|
|
71
260
|
}
|
|
261
|
+
],
|
|
262
|
+
"preloadedRowsInsertOnly": [
|
|
263
|
+
"is_disabled"
|
|
72
264
|
]
|
|
73
265
|
},
|
|
74
266
|
{
|
|
@@ -103,6 +295,7 @@ module.exports = {
|
|
|
103
295
|
"foreignKeys": [
|
|
104
296
|
{
|
|
105
297
|
"constraintType": "foreignKey",
|
|
298
|
+
"constraintName": "FK_auth_methods_config_auth_method_id",
|
|
106
299
|
"pureName": "auth_methods_config",
|
|
107
300
|
"refTableName": "auth_methods",
|
|
108
301
|
"deleteAction": "CASCADE",
|
|
@@ -114,9 +307,25 @@ module.exports = {
|
|
|
114
307
|
]
|
|
115
308
|
}
|
|
116
309
|
],
|
|
310
|
+
"uniques": [
|
|
311
|
+
{
|
|
312
|
+
"constraintName": "UQ_auth_methods_config_auth_method_id_key",
|
|
313
|
+
"pureName": "auth_methods_config",
|
|
314
|
+
"constraintType": "unique",
|
|
315
|
+
"columns": [
|
|
316
|
+
{
|
|
317
|
+
"columnName": "auth_method_id"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"columnName": "key"
|
|
321
|
+
}
|
|
322
|
+
]
|
|
323
|
+
}
|
|
324
|
+
],
|
|
117
325
|
"primaryKey": {
|
|
118
326
|
"pureName": "auth_methods_config",
|
|
119
327
|
"constraintType": "primaryKey",
|
|
328
|
+
"constraintName": "PK_auth_methods_config",
|
|
120
329
|
"columns": [
|
|
121
330
|
{
|
|
122
331
|
"columnName": "id"
|
|
@@ -154,9 +363,25 @@ module.exports = {
|
|
|
154
363
|
}
|
|
155
364
|
],
|
|
156
365
|
"foreignKeys": [],
|
|
366
|
+
"uniques": [
|
|
367
|
+
{
|
|
368
|
+
"constraintName": "UQ_config_group_key",
|
|
369
|
+
"pureName": "config",
|
|
370
|
+
"constraintType": "unique",
|
|
371
|
+
"columns": [
|
|
372
|
+
{
|
|
373
|
+
"columnName": "group"
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
"columnName": "key"
|
|
377
|
+
}
|
|
378
|
+
]
|
|
379
|
+
}
|
|
380
|
+
],
|
|
157
381
|
"primaryKey": {
|
|
158
382
|
"pureName": "config",
|
|
159
383
|
"constraintType": "primaryKey",
|
|
384
|
+
"constraintName": "PK_config",
|
|
160
385
|
"columns": [
|
|
161
386
|
{
|
|
162
387
|
"columnName": "id"
|
|
@@ -449,6 +674,7 @@ module.exports = {
|
|
|
449
674
|
"primaryKey": {
|
|
450
675
|
"pureName": "connections",
|
|
451
676
|
"constraintType": "primaryKey",
|
|
677
|
+
"constraintName": "PK_connections",
|
|
452
678
|
"columns": [
|
|
453
679
|
{
|
|
454
680
|
"columnName": "id"
|
|
@@ -456,48 +682,6 @@ module.exports = {
|
|
|
456
682
|
]
|
|
457
683
|
}
|
|
458
684
|
},
|
|
459
|
-
{
|
|
460
|
-
"pureName": "roles",
|
|
461
|
-
"columns": [
|
|
462
|
-
{
|
|
463
|
-
"pureName": "roles",
|
|
464
|
-
"columnName": "id",
|
|
465
|
-
"dataType": "int",
|
|
466
|
-
"autoIncrement": true,
|
|
467
|
-
"notNull": true
|
|
468
|
-
},
|
|
469
|
-
{
|
|
470
|
-
"pureName": "roles",
|
|
471
|
-
"columnName": "name",
|
|
472
|
-
"dataType": "varchar(250)",
|
|
473
|
-
"notNull": false
|
|
474
|
-
}
|
|
475
|
-
],
|
|
476
|
-
"foreignKeys": [],
|
|
477
|
-
"primaryKey": {
|
|
478
|
-
"pureName": "roles",
|
|
479
|
-
"constraintType": "primaryKey",
|
|
480
|
-
"columns": [
|
|
481
|
-
{
|
|
482
|
-
"columnName": "id"
|
|
483
|
-
}
|
|
484
|
-
]
|
|
485
|
-
},
|
|
486
|
-
"preloadedRows": [
|
|
487
|
-
{
|
|
488
|
-
"id": -1,
|
|
489
|
-
"name": "anonymous-user"
|
|
490
|
-
},
|
|
491
|
-
{
|
|
492
|
-
"id": -2,
|
|
493
|
-
"name": "logged-user"
|
|
494
|
-
},
|
|
495
|
-
{
|
|
496
|
-
"id": -3,
|
|
497
|
-
"name": "superadmin"
|
|
498
|
-
}
|
|
499
|
-
]
|
|
500
|
-
},
|
|
501
685
|
{
|
|
502
686
|
"pureName": "role_connections",
|
|
503
687
|
"columns": [
|
|
@@ -524,6 +708,7 @@ module.exports = {
|
|
|
524
708
|
"foreignKeys": [
|
|
525
709
|
{
|
|
526
710
|
"constraintType": "foreignKey",
|
|
711
|
+
"constraintName": "FK_role_connections_role_id",
|
|
527
712
|
"pureName": "role_connections",
|
|
528
713
|
"refTableName": "roles",
|
|
529
714
|
"deleteAction": "CASCADE",
|
|
@@ -536,6 +721,7 @@ module.exports = {
|
|
|
536
721
|
},
|
|
537
722
|
{
|
|
538
723
|
"constraintType": "foreignKey",
|
|
724
|
+
"constraintName": "FK_role_connections_connection_id",
|
|
539
725
|
"pureName": "role_connections",
|
|
540
726
|
"refTableName": "connections",
|
|
541
727
|
"deleteAction": "CASCADE",
|
|
@@ -550,6 +736,7 @@ module.exports = {
|
|
|
550
736
|
"primaryKey": {
|
|
551
737
|
"pureName": "role_connections",
|
|
552
738
|
"constraintType": "primaryKey",
|
|
739
|
+
"constraintName": "PK_role_connections",
|
|
553
740
|
"columns": [
|
|
554
741
|
{
|
|
555
742
|
"columnName": "id"
|
|
@@ -583,6 +770,7 @@ module.exports = {
|
|
|
583
770
|
"foreignKeys": [
|
|
584
771
|
{
|
|
585
772
|
"constraintType": "foreignKey",
|
|
773
|
+
"constraintName": "FK_role_permissions_role_id",
|
|
586
774
|
"pureName": "role_permissions",
|
|
587
775
|
"refTableName": "roles",
|
|
588
776
|
"deleteAction": "CASCADE",
|
|
@@ -597,6 +785,7 @@ module.exports = {
|
|
|
597
785
|
"primaryKey": {
|
|
598
786
|
"pureName": "role_permissions",
|
|
599
787
|
"constraintType": "primaryKey",
|
|
788
|
+
"constraintName": "PK_role_permissions",
|
|
600
789
|
"columns": [
|
|
601
790
|
{
|
|
602
791
|
"columnName": "id"
|
|
@@ -605,44 +794,47 @@ module.exports = {
|
|
|
605
794
|
}
|
|
606
795
|
},
|
|
607
796
|
{
|
|
608
|
-
"pureName": "
|
|
797
|
+
"pureName": "roles",
|
|
609
798
|
"columns": [
|
|
610
799
|
{
|
|
611
|
-
"pureName": "
|
|
800
|
+
"pureName": "roles",
|
|
612
801
|
"columnName": "id",
|
|
613
802
|
"dataType": "int",
|
|
614
803
|
"autoIncrement": true,
|
|
615
804
|
"notNull": true
|
|
616
805
|
},
|
|
617
806
|
{
|
|
618
|
-
"pureName": "
|
|
619
|
-
"columnName": "
|
|
620
|
-
"dataType": "varchar(250)",
|
|
621
|
-
"notNull": false
|
|
622
|
-
},
|
|
623
|
-
{
|
|
624
|
-
"pureName": "users",
|
|
625
|
-
"columnName": "password",
|
|
626
|
-
"dataType": "varchar(250)",
|
|
627
|
-
"notNull": false
|
|
628
|
-
},
|
|
629
|
-
{
|
|
630
|
-
"pureName": "users",
|
|
631
|
-
"columnName": "email",
|
|
807
|
+
"pureName": "roles",
|
|
808
|
+
"columnName": "name",
|
|
632
809
|
"dataType": "varchar(250)",
|
|
633
810
|
"notNull": false
|
|
634
811
|
}
|
|
635
812
|
],
|
|
636
813
|
"foreignKeys": [],
|
|
637
814
|
"primaryKey": {
|
|
638
|
-
"pureName": "
|
|
815
|
+
"pureName": "roles",
|
|
639
816
|
"constraintType": "primaryKey",
|
|
817
|
+
"constraintName": "PK_roles",
|
|
640
818
|
"columns": [
|
|
641
819
|
{
|
|
642
820
|
"columnName": "id"
|
|
643
821
|
}
|
|
644
822
|
]
|
|
645
|
-
}
|
|
823
|
+
},
|
|
824
|
+
"preloadedRows": [
|
|
825
|
+
{
|
|
826
|
+
"id": -1,
|
|
827
|
+
"name": "anonymous-user"
|
|
828
|
+
},
|
|
829
|
+
{
|
|
830
|
+
"id": -2,
|
|
831
|
+
"name": "logged-user"
|
|
832
|
+
},
|
|
833
|
+
{
|
|
834
|
+
"id": -3,
|
|
835
|
+
"name": "superadmin"
|
|
836
|
+
}
|
|
837
|
+
]
|
|
646
838
|
},
|
|
647
839
|
{
|
|
648
840
|
"pureName": "user_connections",
|
|
@@ -670,6 +862,7 @@ module.exports = {
|
|
|
670
862
|
"foreignKeys": [
|
|
671
863
|
{
|
|
672
864
|
"constraintType": "foreignKey",
|
|
865
|
+
"constraintName": "FK_user_connections_user_id",
|
|
673
866
|
"pureName": "user_connections",
|
|
674
867
|
"refTableName": "users",
|
|
675
868
|
"deleteAction": "CASCADE",
|
|
@@ -682,6 +875,7 @@ module.exports = {
|
|
|
682
875
|
},
|
|
683
876
|
{
|
|
684
877
|
"constraintType": "foreignKey",
|
|
878
|
+
"constraintName": "FK_user_connections_connection_id",
|
|
685
879
|
"pureName": "user_connections",
|
|
686
880
|
"refTableName": "connections",
|
|
687
881
|
"deleteAction": "CASCADE",
|
|
@@ -696,6 +890,7 @@ module.exports = {
|
|
|
696
890
|
"primaryKey": {
|
|
697
891
|
"pureName": "user_connections",
|
|
698
892
|
"constraintType": "primaryKey",
|
|
893
|
+
"constraintName": "PK_user_connections",
|
|
699
894
|
"columns": [
|
|
700
895
|
{
|
|
701
896
|
"columnName": "id"
|
|
@@ -729,6 +924,7 @@ module.exports = {
|
|
|
729
924
|
"foreignKeys": [
|
|
730
925
|
{
|
|
731
926
|
"constraintType": "foreignKey",
|
|
927
|
+
"constraintName": "FK_user_permissions_user_id",
|
|
732
928
|
"pureName": "user_permissions",
|
|
733
929
|
"refTableName": "users",
|
|
734
930
|
"deleteAction": "CASCADE",
|
|
@@ -743,6 +939,7 @@ module.exports = {
|
|
|
743
939
|
"primaryKey": {
|
|
744
940
|
"pureName": "user_permissions",
|
|
745
941
|
"constraintType": "primaryKey",
|
|
942
|
+
"constraintName": "PK_user_permissions",
|
|
746
943
|
"columns": [
|
|
747
944
|
{
|
|
748
945
|
"columnName": "id"
|
|
@@ -776,6 +973,7 @@ module.exports = {
|
|
|
776
973
|
"foreignKeys": [
|
|
777
974
|
{
|
|
778
975
|
"constraintType": "foreignKey",
|
|
976
|
+
"constraintName": "FK_user_roles_user_id",
|
|
779
977
|
"pureName": "user_roles",
|
|
780
978
|
"refTableName": "users",
|
|
781
979
|
"deleteAction": "CASCADE",
|
|
@@ -788,6 +986,7 @@ module.exports = {
|
|
|
788
986
|
},
|
|
789
987
|
{
|
|
790
988
|
"constraintType": "foreignKey",
|
|
989
|
+
"constraintName": "FK_user_roles_role_id",
|
|
791
990
|
"pureName": "user_roles",
|
|
792
991
|
"refTableName": "roles",
|
|
793
992
|
"deleteAction": "CASCADE",
|
|
@@ -802,6 +1001,48 @@ module.exports = {
|
|
|
802
1001
|
"primaryKey": {
|
|
803
1002
|
"pureName": "user_roles",
|
|
804
1003
|
"constraintType": "primaryKey",
|
|
1004
|
+
"constraintName": "PK_user_roles",
|
|
1005
|
+
"columns": [
|
|
1006
|
+
{
|
|
1007
|
+
"columnName": "id"
|
|
1008
|
+
}
|
|
1009
|
+
]
|
|
1010
|
+
}
|
|
1011
|
+
},
|
|
1012
|
+
{
|
|
1013
|
+
"pureName": "users",
|
|
1014
|
+
"columns": [
|
|
1015
|
+
{
|
|
1016
|
+
"pureName": "users",
|
|
1017
|
+
"columnName": "id",
|
|
1018
|
+
"dataType": "int",
|
|
1019
|
+
"autoIncrement": true,
|
|
1020
|
+
"notNull": true
|
|
1021
|
+
},
|
|
1022
|
+
{
|
|
1023
|
+
"pureName": "users",
|
|
1024
|
+
"columnName": "login",
|
|
1025
|
+
"dataType": "varchar(250)",
|
|
1026
|
+
"notNull": false
|
|
1027
|
+
},
|
|
1028
|
+
{
|
|
1029
|
+
"pureName": "users",
|
|
1030
|
+
"columnName": "password",
|
|
1031
|
+
"dataType": "varchar(250)",
|
|
1032
|
+
"notNull": false
|
|
1033
|
+
},
|
|
1034
|
+
{
|
|
1035
|
+
"pureName": "users",
|
|
1036
|
+
"columnName": "email",
|
|
1037
|
+
"dataType": "varchar(250)",
|
|
1038
|
+
"notNull": false
|
|
1039
|
+
}
|
|
1040
|
+
],
|
|
1041
|
+
"foreignKeys": [],
|
|
1042
|
+
"primaryKey": {
|
|
1043
|
+
"pureName": "users",
|
|
1044
|
+
"constraintType": "primaryKey",
|
|
1045
|
+
"constraintName": "PK_users",
|
|
805
1046
|
"columns": [
|
|
806
1047
|
{
|
|
807
1048
|
"columnName": "id"
|
|
@@ -815,5 +1056,6 @@ module.exports = {
|
|
|
815
1056
|
"matviews": [],
|
|
816
1057
|
"functions": [],
|
|
817
1058
|
"procedures": [],
|
|
818
|
-
"triggers": []
|
|
1059
|
+
"triggers": [],
|
|
1060
|
+
"schedulerEvents": []
|
|
819
1061
|
};
|
package/src/utility/cloudIntf.js
CHANGED
|
@@ -34,11 +34,12 @@ const DBGATE_CLOUD_URL = process.env.LOCAL_DBGATE_CLOUD
|
|
|
34
34
|
? 'https://cloud.dbgate.udolni.net'
|
|
35
35
|
: 'https://cloud.dbgate.io';
|
|
36
36
|
|
|
37
|
-
async function createDbGateIdentitySession(client) {
|
|
37
|
+
async function createDbGateIdentitySession(client, redirectUri) {
|
|
38
38
|
const resp = await axios.default.post(
|
|
39
39
|
`${DBGATE_IDENTITY_URL}/api/create-session`,
|
|
40
40
|
{
|
|
41
41
|
client,
|
|
42
|
+
redirectUri,
|
|
42
43
|
},
|
|
43
44
|
{
|
|
44
45
|
headers: {
|
|
@@ -70,7 +71,7 @@ function startCloudTokenChecking(sid, callback) {
|
|
|
70
71
|
});
|
|
71
72
|
// console.log('CHECK RESP:', resp.data);
|
|
72
73
|
|
|
73
|
-
if (resp.data
|
|
74
|
+
if (resp.data?.email) {
|
|
74
75
|
clearInterval(interval);
|
|
75
76
|
callback(resp.data);
|
|
76
77
|
}
|
|
@@ -80,6 +81,34 @@ function startCloudTokenChecking(sid, callback) {
|
|
|
80
81
|
}, 500);
|
|
81
82
|
}
|
|
82
83
|
|
|
84
|
+
async function readCloudTokenHolder(sid) {
|
|
85
|
+
const resp = await axios.default.get(`${DBGATE_IDENTITY_URL}/api/get-token/${sid}`, {
|
|
86
|
+
headers: {
|
|
87
|
+
...getLicenseHttpHeaders(),
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
if (resp.data?.email) {
|
|
91
|
+
return resp.data;
|
|
92
|
+
}
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
async function readCloudTestTokenHolder(email) {
|
|
97
|
+
const resp = await axios.default.post(
|
|
98
|
+
`${DBGATE_IDENTITY_URL}/api/test-token`,
|
|
99
|
+
{ email },
|
|
100
|
+
{
|
|
101
|
+
headers: {
|
|
102
|
+
...getLicenseHttpHeaders(),
|
|
103
|
+
},
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
if (resp.data?.email) {
|
|
107
|
+
return resp.data;
|
|
108
|
+
}
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
|
|
83
112
|
async function loadCloudFiles() {
|
|
84
113
|
try {
|
|
85
114
|
const fileContent = await fs.readFile(path.join(datadir(), 'cloud-files.jsonl'), 'utf-8');
|
|
@@ -396,4 +425,6 @@ module.exports = {
|
|
|
396
425
|
loadCachedCloudConnection,
|
|
397
426
|
putCloudContent,
|
|
398
427
|
removeCloudCachedConnection,
|
|
428
|
+
readCloudTokenHolder,
|
|
429
|
+
readCloudTestTokenHolder,
|
|
399
430
|
};
|
|
@@ -4,7 +4,6 @@ const { getSshTunnelProxy } = require('./sshTunnelProxy');
|
|
|
4
4
|
const platformInfo = require('../utility/platformInfo');
|
|
5
5
|
const connections = require('../controllers/connections');
|
|
6
6
|
const _ = require('lodash');
|
|
7
|
-
const { getCloudFolderEncryptor } = require('./cloudIntf');
|
|
8
7
|
|
|
9
8
|
async function loadConnection(driver, storedConnection, connectionMode) {
|
|
10
9
|
const { allowShellConnection, allowConnectionFromEnvVariables } = platformInfo;
|
|
@@ -90,6 +89,8 @@ async function extractConnectionSslParams(connection) {
|
|
|
90
89
|
}
|
|
91
90
|
|
|
92
91
|
async function decryptCloudConnection(connection) {
|
|
92
|
+
const { getCloudFolderEncryptor } = require('./cloudIntf');
|
|
93
|
+
|
|
93
94
|
const m = connection?._id?.match(/^cloud\:\/\/(.+)\/(.+)$/);
|
|
94
95
|
if (!m) {
|
|
95
96
|
throw new Error('Invalid cloud connection ID format');
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
const getChartExport = (title, config, imageFile) => {
|
|
1
|
+
const getChartExport = (title, config, imageFile, plugins) => {
|
|
2
|
+
const PLUGIN_TAGS = {
|
|
3
|
+
zoom: '<script src="https://cdnjs.cloudflare.com/ajax/libs/chartjs-plugin-zoom/1.2.0/chartjs-plugin-zoom.min.js" integrity="sha512-TT0wAMqqtjXVzpc48sI0G84rBP+oTkBZPgeRYIOVRGUdwJsyS3WPipsNh///ay2LJ+onCM23tipnz6EvEy2/UA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>',
|
|
4
|
+
dataLabels:
|
|
5
|
+
'<script src="https://cdnjs.cloudflare.com/ajax/libs/chartjs-plugin-datalabels/2.2.0/chartjs-plugin-datalabels.min.js" integrity="sha512-JPcRR8yFa8mmCsfrw4TNte1ZvF1e3+1SdGMslZvmrzDYxS69J7J49vkFL8u6u8PlPJK+H3voElBtUCzaXj+6ig==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>',
|
|
6
|
+
outlabels:
|
|
7
|
+
'<script src="https://cdn.jsdelivr.net/npm/@energiency/chartjs-plugin-piechart-outlabels@1.3.4/dist/chartjs-plugin-piechart-outlabels.min.js"></script>',
|
|
8
|
+
};
|
|
9
|
+
|
|
2
10
|
return `<html>
|
|
3
11
|
<meta charset='utf-8'>
|
|
4
12
|
|
|
@@ -8,7 +16,7 @@ const getChartExport = (title, config, imageFile) => {
|
|
|
8
16
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js" integrity="sha512-qTXRIMyZIFb8iQcfjXWCO8+M5Tbc38Qi5WzdPOYZHIlZpzBHG3L3by84BBBOiRGiEb7KKtAOAs5qYdUiZiQNNQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
9
17
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/chartjs-adapter-moment/1.0.0/chartjs-adapter-moment.min.js" integrity="sha512-oh5t+CdSBsaVVAvxcZKy3XJdP7ZbYUBSRCXDTVn0ODewMDDNnELsrG9eDm8rVZAQg7RsDD/8K3MjPAFB13o6eA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
10
18
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/hammer.js/2.0.8/hammer.min.js" integrity="sha512-UXumZrZNiOwnTcZSHLOfcTs0aos2MzBWHXOHOuB0J/R44QB0dwY5JgfbvljXcklVf65Gc4El6RjZ+lnwd2az2g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
11
|
-
|
|
19
|
+
${plugins.map(plugin => PLUGIN_TAGS[plugin] ?? '')}
|
|
12
20
|
|
|
13
21
|
<style>
|
|
14
22
|
a { text-decoration: none }
|
|
@@ -45,7 +53,7 @@ const getChartExport = (title, config, imageFile) => {
|
|
|
45
53
|
</div>
|
|
46
54
|
|
|
47
55
|
<div class="footer">
|
|
48
|
-
Exported from <a href='https://dbgate.
|
|
56
|
+
Exported from <a href='https://dbgate.io/' target='_blank'>DbGate</a>, powered by <a href='https://www.chartjs.org/' target='_blank'>Chart.js</a>
|
|
49
57
|
</div>
|
|
50
58
|
</body>
|
|
51
59
|
|
|
@@ -18,7 +18,7 @@ const getMapExport = (geoJson) => {
|
|
|
18
18
|
leaflet
|
|
19
19
|
.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
|
20
20
|
maxZoom: 19,
|
|
21
|
-
attribution: '<a href="https://dbgate.
|
|
21
|
+
attribution: '<a href="https://dbgate.io" title="Exported from DbGate">DbGate</a> | © OpenStreetMap',
|
|
22
22
|
})
|
|
23
23
|
.addTo(map);
|
|
24
24
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// only in DbGate Premium
|
|
2
|
+
|
|
3
|
+
function markUserAsActive(licenseUid) {}
|
|
4
|
+
|
|
5
|
+
async function isLoginLicensed(req, licenseUid) {
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const LOGIN_LIMIT_ERROR = '';
|
|
10
|
+
|
|
11
|
+
module.exports = {
|
|
12
|
+
markUserAsActive,
|
|
13
|
+
isLoginLicensed,
|
|
14
|
+
LOGIN_LIMIT_ERROR,
|
|
15
|
+
};
|