dbgate-api-premium 7.1.9 → 7.1.11
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dbgate-api-premium",
|
|
3
3
|
"main": "src/index.js",
|
|
4
|
-
"version": "7.1.
|
|
4
|
+
"version": "7.1.11",
|
|
5
5
|
"homepage": "https://www.dbgate.io/",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"compare-versions": "^3.6.0",
|
|
31
31
|
"cors": "^2.8.5",
|
|
32
32
|
"cross-env": "^6.0.3",
|
|
33
|
-
"dbgate-datalib": "7.1.
|
|
33
|
+
"dbgate-datalib": "7.1.11",
|
|
34
34
|
"dbgate-query-splitter": "^4.12.0",
|
|
35
|
-
"dbgate-rest": "7.1.
|
|
36
|
-
"dbgate-sqltree": "7.1.
|
|
37
|
-
"dbgate-tools": "7.1.
|
|
35
|
+
"dbgate-rest": "7.1.11",
|
|
36
|
+
"dbgate-sqltree": "7.1.11",
|
|
37
|
+
"dbgate-tools": "7.1.11",
|
|
38
38
|
"debug": "^4.3.4",
|
|
39
39
|
"diff": "^5.0.0",
|
|
40
40
|
"diff2html": "^3.4.13",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"devDependencies": {
|
|
89
89
|
"@types/fs-extra": "^9.0.11",
|
|
90
90
|
"@types/lodash": "^4.14.149",
|
|
91
|
-
"dbgate-types": "7.1.
|
|
91
|
+
"dbgate-types": "7.1.11",
|
|
92
92
|
"env-cmd": "^10.1.0",
|
|
93
93
|
"jsdoc-to-markdown": "^9.0.5",
|
|
94
94
|
"node-loader": "^1.0.2",
|
|
@@ -264,7 +264,7 @@ module.exports = {
|
|
|
264
264
|
try {
|
|
265
265
|
const fingerprint = await getPublicHardwareFingerprint();
|
|
266
266
|
|
|
267
|
-
const resp = await axios.default.post(
|
|
267
|
+
const resp = await axios.default.post(`https://api.dbgate.cloud/trial-license`, {
|
|
268
268
|
type: 'premium-trial',
|
|
269
269
|
days: 30,
|
|
270
270
|
fingerprint,
|
|
@@ -15,6 +15,7 @@ const {
|
|
|
15
15
|
getLogger,
|
|
16
16
|
extractErrorLogData,
|
|
17
17
|
filterStructureBySchema,
|
|
18
|
+
isCompositeDbName,
|
|
18
19
|
serializeJsTypesForJsonStringify,
|
|
19
20
|
} = require('dbgate-tools');
|
|
20
21
|
const { html, parse } = require('diff2html');
|
|
@@ -194,6 +195,8 @@ module.exports = {
|
|
|
194
195
|
);
|
|
195
196
|
pipeForkLogs(subprocess);
|
|
196
197
|
const lastClosed = this.closed[`${conid}/${database}`];
|
|
198
|
+
const initialStatusName =
|
|
199
|
+
!lastClosed && !(connection.useSeparateSchemas && !isCompositeDbName(database)) ? 'loadStructure' : 'pending';
|
|
197
200
|
const newOpened = {
|
|
198
201
|
conid,
|
|
199
202
|
database,
|
|
@@ -201,7 +204,7 @@ module.exports = {
|
|
|
201
204
|
structure: lastClosed ? lastClosed.structure : DatabaseAnalyser.createEmptyStructure(),
|
|
202
205
|
serverVersion: lastClosed ? lastClosed.serverVersion : null,
|
|
203
206
|
connection,
|
|
204
|
-
status: { name:
|
|
207
|
+
status: { name: initialStatusName },
|
|
205
208
|
};
|
|
206
209
|
this.opened.push(newOpened);
|
|
207
210
|
subprocess.on('message', message => {
|
|
@@ -332,7 +332,9 @@ module.exports = {
|
|
|
332
332
|
await this.checkFileReadAccess(existingFile, req);
|
|
333
333
|
const loadedPermissions = await loadPermissionsFromRequest(req);
|
|
334
334
|
if (!hasPermission(`all-team-files/create`, loadedPermissions)) {
|
|
335
|
-
|
|
335
|
+
if (!(await this.checkFolderCreateAccess(existingFile.team_folder_id, req, false))) {
|
|
336
|
+
throw new Error('No permission to create team files');
|
|
337
|
+
}
|
|
336
338
|
}
|
|
337
339
|
const userId = req?.user?.userId;
|
|
338
340
|
const resp = await storageCopyFile(teamFileId, newName, userId);
|
package/src/currentVersion.js
CHANGED
package/src/utility/authProxy.js
CHANGED
|
@@ -21,7 +21,7 @@ const AI_GATEWAY_URL = process.env.LOCAL_AI_GATEWAY
|
|
|
21
21
|
? 'http://localhost:3110'
|
|
22
22
|
: process.env.DEVWEB || process.env.DEVMODE
|
|
23
23
|
? 'https://aigw.dbgate.udolni.net'
|
|
24
|
-
: 'https://
|
|
24
|
+
: 'https://api.dbgate.cloud';
|
|
25
25
|
|
|
26
26
|
const DBGATE_API_URL = process.env.LOCAL_DBGATE_API
|
|
27
27
|
? 'http://localhost:3115'
|
|
@@ -177,7 +177,7 @@ async function obtainRefreshedLicense() {
|
|
|
177
177
|
|
|
178
178
|
try {
|
|
179
179
|
const respToken = await axios.default.post(
|
|
180
|
-
|
|
180
|
+
`https://api.dbgate.cloud/refresh-license`,
|
|
181
181
|
{},
|
|
182
182
|
{
|
|
183
183
|
headers: {
|
|
@@ -199,7 +199,7 @@ async function obtainRefreshedLicense() {
|
|
|
199
199
|
async function tryToGetRefreshedLicense(oldLicenseKey) {
|
|
200
200
|
try {
|
|
201
201
|
const respToken = await axios.default.post(
|
|
202
|
-
|
|
202
|
+
`https://api.dbgate.cloud/refresh-license`,
|
|
203
203
|
{},
|
|
204
204
|
{
|
|
205
205
|
headers: {
|
package/src/utility/cloudIntf.js
CHANGED
|
@@ -24,10 +24,10 @@ let promoWidgetDataLoaded = false;
|
|
|
24
24
|
const DBGATE_IDENTITY_URL = process.env.LOCAL_DBGATE_IDENTITY
|
|
25
25
|
? 'http://localhost:3103'
|
|
26
26
|
: process.env.PROD_DBGATE_IDENTITY
|
|
27
|
-
? 'https://identity.dbgate.
|
|
27
|
+
? 'https://identity.dbgate.cloud'
|
|
28
28
|
: process.env.DEVWEB || process.env.DEVMODE
|
|
29
29
|
? 'https://identity.dbgate.udolni.net'
|
|
30
|
-
: 'https://identity.dbgate.
|
|
30
|
+
: 'https://identity.dbgate.cloud';
|
|
31
31
|
|
|
32
32
|
const DBGATE_CLOUD_URL = process.env.LOCAL_DBGATE_CLOUD
|
|
33
33
|
? 'http://localhost:3110'
|
|
@@ -346,7 +346,7 @@ async function callCloudApiGet(endpoint, signinHolder = null, additionalHeaders
|
|
|
346
346
|
}
|
|
347
347
|
const signinHeaders = await getCloudSigninHeaders(signinHolder);
|
|
348
348
|
|
|
349
|
-
const resp = await axios.default.get(`${
|
|
349
|
+
const resp = await axios.default.get(`${DBGATE_PUBLIC_CLOUD_URL}/${endpoint}`, {
|
|
350
350
|
headers: {
|
|
351
351
|
...getLicenseHttpHeaders(),
|
|
352
352
|
...signinHeaders,
|
|
@@ -386,7 +386,7 @@ async function callCloudApiPost(endpoint, body, signinHolder = null) {
|
|
|
386
386
|
}
|
|
387
387
|
const signinHeaders = await getCloudSigninHeaders(signinHolder);
|
|
388
388
|
|
|
389
|
-
const resp = await axios.default.post(`${
|
|
389
|
+
const resp = await axios.default.post(`${DBGATE_PUBLIC_CLOUD_URL}/${endpoint}`, body, {
|
|
390
390
|
headers: {
|
|
391
391
|
...getLicenseHttpHeaders(),
|
|
392
392
|
...signinHeaders,
|
|
@@ -491,7 +491,7 @@ function removeCloudCachedConnection(folid, cntid) {
|
|
|
491
491
|
|
|
492
492
|
async function getPublicIpInfo() {
|
|
493
493
|
try {
|
|
494
|
-
const resp = await axios.default.get(`${
|
|
494
|
+
const resp = await axios.default.get(`${DBGATE_PUBLIC_CLOUD_URL}/ipinfo`, stageAxiosConfig);
|
|
495
495
|
if (!resp.data?.ip) {
|
|
496
496
|
return { ip: 'unknown-ip' };
|
|
497
497
|
}
|