dbgate-rest 7.1.3-alpha.3 → 7.1.4

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.
@@ -23,7 +23,7 @@ exports.graphQlDriver = {
23
23
  databaseEngineTypes: ['rest', 'graphql'],
24
24
  icon: '<svg version="1.1" id="GraphQL_Logo" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 400 400" enable-background="new 0 0 400 400" xml:space="preserve"><g><g><g><rect x="122" y="-0.4" transform="matrix(-0.866 -0.5 0.5 -0.866 163.3196 363.3136)" fill="#E535AB" width="16.6" height="320.3"/></g></g><g><g><rect x="39.8" y="272.2" fill="#E535AB" width="320.3" height="16.6"/></g></g><g><g><rect x="37.9" y="312.2" transform="matrix(-0.866 -0.5 0.5 -0.866 83.0693 663.3409)" fill="#E535AB" width="185" height="16.6"/></g></g><g><g><rect x="177.1" y="71.1" transform="matrix(-0.866 -0.5 0.5 -0.866 463.3409 283.0693)" fill="#E535AB" width="185" height="16.6"/></g></g><g><g><rect x="122.1" y="-13" transform="matrix(-0.5 -0.866 0.866 -0.5 126.7903 232.1221)" fill="#E535AB" width="16.6" height="185"/></g></g><g><g><rect x="109.6" y="151.6" transform="matrix(-0.5 -0.866 0.866 -0.5 266.0828 473.3766)" fill="#E535AB" width="320.3" height="16.6"/></g></g><g><g><rect x="52.5" y="107.5" fill="#E535AB" width="16.6" height="185"/></g></g><g><g><rect x="330.9" y="107.5" fill="#E535AB" width="16.6" height="185"/></g></g><g><g><rect x="262.4" y="240.1" transform="matrix(-0.5 -0.866 0.866 -0.5 126.7953 714.2875)" fill="#E535AB" width="14.5" height="160.9"/></g></g><path fill="#E535AB" d="M369.5,297.9c-9.6,16.7-31,22.4-47.7,12.8c-16.7-9.6-22.4-31-12.8-47.7c9.6-16.7,31-22.4,47.7-12.8 C373.5,259.9,379.2,281.2,369.5,297.9"/><path fill="#E535AB" d="M90.9,137c-9.6,16.7-31,22.4-47.7,12.8c-16.7-9.6-22.4-31-12.8-47.7c9.6-16.7,31-22.4,47.7-12.8 C94.8,99,100.5,120.3,90.9,137"/><path fill="#E535AB" d="M30.5,297.9c-9.6-16.7-3.9-38,12.8-47.7c16.7-9.6,38-3.9,47.7,12.8c9.6,16.7,3.9,38-12.8,47.7 C61.4,320.3,40.1,314.6,30.5,297.9"/><path fill="#E535AB" d="M309.1,137c-9.6-16.7-3.9-38,12.8-47.7c16.7-9.6,38-3.9,47.7,12.8c9.6-16.7,3.9-38-12.8,47.7 C340.1,159.4,318.7,153.7,309.1,137"/><path fill="#E535AB" d="M200,395.8c-19.3,0-34.9-15.6-34.9-34.9c0-19.3,15.6-34.9,34.9-34.9c19.3,0,34.9,15.6,34.9,34.9 C234.9,380.1,219.3,395.8,200,395.8"/><path fill="#E535AB" d="M200,74c-19.3,0-34.9-15.6-34.9-34.9c0-19.3,15.6-34.9,34.9-34.9c19.3,0,34.9,15.6,34.9,34.9 C234.9,58.4,219.3,74,200,74"/></g></svg>',
25
25
  showConnectionField: (field, values) => {
26
- if (restDriverBase_1.apiDriverBase.showAuthConnectionField(field, values))
26
+ if (restDriverBase_1.apiDriverBase.showConnectionField(field, values))
27
27
  return true;
28
28
  if (field === 'apiServerUrl1')
29
29
  return true;
@@ -23,17 +23,17 @@ function resolveServiceRoot(contextUrl, fallbackUrl) {
23
23
  async function loadODataServiceDocument(dbhan) {
24
24
  var _a;
25
25
  if (!((_a = dbhan === null || dbhan === void 0 ? void 0 : dbhan.connection) === null || _a === void 0 ? void 0 : _a.apiServerUrl1)) {
26
- throw new Error('DBGM-00000 OData endpoint URL is not configured');
26
+ throw new Error('DBGM-00330 OData endpoint URL is not configured');
27
27
  }
28
28
  const response = await dbhan.axios.get(dbhan.connection.apiServerUrl1, {
29
29
  headers: (0, restAuthTools_1.buildRestAuthHeaders)(dbhan.connection.restAuth),
30
30
  });
31
31
  const document = response === null || response === void 0 ? void 0 : response.data;
32
32
  if (!document || typeof document !== 'object') {
33
- throw new Error('DBGM-00000 OData service document is empty or invalid');
33
+ throw new Error('DBGM-00331 OData service document is empty or invalid');
34
34
  }
35
35
  if (!document['@odata.context']) {
36
- throw new Error('DBGM-00000 OData service document does not contain @odata.context');
36
+ throw new Error('DBGM-00332 OData service document does not contain @odata.context');
37
37
  }
38
38
  return document;
39
39
  }
@@ -54,7 +54,7 @@ exports.oDataDriver = {
54
54
  icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"><rect width="128" height="128" fill="#f9a000"/><rect x="12" y="12" width="47" height="12" fill="#ffffff"/><rect x="69" y="12" width="47" height="12" fill="#ffffff"/><rect x="12" y="37" width="47" height="12" fill="#ffffff"/><rect x="69" y="37" width="47" height="12" fill="#ffffff"/><rect x="12" y="62" width="47" height="12" fill="#ffffff"/><rect x="69" y="62" width="47" height="12" fill="#ffffff"/><rect x="69" y="87" width="47" height="12" fill="#ffffff"/><circle cx="35" cy="102" r="20" fill="#e6e6e6"/></svg>',
55
55
  apiServerUrl1Label: 'OData Service URL',
56
56
  showConnectionField: (field, values) => {
57
- if (restDriverBase_1.apiDriverBase.showAuthConnectionField(field, values))
57
+ if (restDriverBase_1.apiDriverBase.showConnectionField(field, values))
58
58
  return true;
59
59
  if (field === 'apiServerUrl1')
60
60
  return true;
@@ -39,7 +39,7 @@ exports.openApiDriver = {
39
39
  apiServerUrl2Placeholder: '(optional - if not set, the first server URL from the API definition will be used)',
40
40
  loadApiServerUrl2Options: true,
41
41
  showConnectionField: (field, values) => {
42
- if (restDriverBase_1.apiDriverBase.showAuthConnectionField(field, values))
42
+ if (restDriverBase_1.apiDriverBase.showConnectionField(field, values))
43
43
  return true;
44
44
  if (field === 'apiServerUrl1')
45
45
  return true;
@@ -5,6 +5,7 @@ export declare const apiDriverBase: {
5
5
  name: string;
6
6
  }[];
7
7
  showAuthConnectionField: (field: any, values: any) => boolean;
8
+ showConnectionField: (field: any, values: any) => boolean;
8
9
  analyserClass: any;
9
10
  dumperClass: typeof import("dbgate-tools").SqlDumper;
10
11
  dialect: {
@@ -36,7 +37,6 @@ export declare const apiDriverBase: {
36
37
  }[];
37
38
  loadFieldValues(pool: any, name: any, columnName: any, search: any, dataType: any): Promise<any>;
38
39
  readJsonQuery(pool: any, select: any, structure: any): any;
39
- showConnectionField: (field: any, values: any) => boolean;
40
40
  showConnectionTab: (field: any) => boolean;
41
41
  getAccessTokenFromAuth: (connection: any, req: any) => Promise<any>;
42
42
  getFilterBehaviour(dataType: string, standardFilterBehaviours: any): import("dbgate-types").FilterBehaviour;
@@ -46,4 +46,15 @@ exports.apiDriverBase = {
46
46
  }
47
47
  return false;
48
48
  },
49
+ showConnectionField: (field, values) => {
50
+ if (exports.apiDriverBase.showAuthConnectionField(field, values))
51
+ return true;
52
+ if (field === 'httpProxyUrl')
53
+ return true;
54
+ if (field === 'httpProxyUser')
55
+ return true;
56
+ if (field === 'httpProxyPassword')
57
+ return true;
58
+ return false;
59
+ },
49
60
  };
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "7.1.3-alpha.3",
2
+ "version": "7.1.4",
3
3
  "name": "dbgate-rest",
4
4
  "main": "lib/index.js",
5
5
  "typings": "lib/index.d.ts",
@@ -26,13 +26,13 @@
26
26
  ],
27
27
  "devDependencies": {
28
28
  "@types/node": "^13.7.0",
29
- "dbgate-types": "7.1.3-alpha.3",
29
+ "dbgate-types": "7.1.4",
30
30
  "jest": "^28.1.3",
31
31
  "ts-jest": "^28.0.7",
32
32
  "typescript": "^4.4.3"
33
33
  },
34
34
  "dependencies": {
35
- "dbgate-tools": "7.1.3-alpha.3",
35
+ "dbgate-tools": "7.1.4",
36
36
  "lodash": "^4.17.21",
37
37
  "openapi-types": "^12.1.3",
38
38
  "pinomin": "^1.0.5",