Skip to content

Commit 82098d7

Browse files
Kitty JoseKitty Jose
authored andcommitted
2 parents 31d964f + 1ee1d39 commit 82098d7

File tree

2 files changed

+48
-43
lines changed

2 files changed

+48
-43
lines changed

index.js

Lines changed: 20 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,24 @@
11
/* eslint-disable global-require */
2-
// const { Vars } = require('./lib/query/woqlDoc');
2+
const Vars = require('./lib/query/woqlDoc');
3+
const WOQLClient = require('./lib/woqlClient');
4+
const UTILS = require('./lib/utils');
5+
const View = require('./lib/viewer/woqlView');
6+
const WOQL = require('./lib/woql');
7+
const WOQLResult = require('./lib/viewer/woqlResult');
8+
const WOQLTable = require('./lib/viewer/woqlTable');
9+
const WOQLGraph = require('./lib/viewer/woqlGraph');
10+
const axiosInstance = require('./lib/axiosInstance');
11+
const AccessControl = require('./lib/accessControl');
312

413
module.exports = {
5-
/**
6-
* @type {typeof import('./lib/query/woqlDoc')}
7-
*/
8-
Vars: require('./lib/query/woqlDoc'),
9-
/**
10-
* @type {typeof import('./lib/woqlClient')}
11-
*/
12-
WOQLClient: require('./lib/woqlClient'),
13-
/**
14-
* @type {typeof import('./lib/utils')}
15-
*/
16-
UTILS: require('./lib/utils'),
17-
/**
18-
* @type {typeof import('./lib/viewer/woqlView')}
19-
*/
20-
View: require('./lib/viewer/woqlView'),
21-
/**
22-
* @type {typeof import('./lib/woql')}
23-
*/
24-
WOQL: require('./lib/woql'),
25-
/**
26-
* @type {typeof import('./lib/viewer/woqlResult')}
27-
*/
28-
WOQLResult: require('./lib/viewer/woqlResult'),
29-
/**
30-
* @type {typeof import('./lib/viewer/woqlTable')}
31-
*/
32-
WOQLTable: require('./lib/viewer/woqlTable'),
33-
/**
34-
* @type {typeof import('./lib/viewer/woqlGraph')}
35-
*/
36-
WOQLGraph: require('./lib/viewer/woqlGraph'),
37-
/**
38-
* @type {typeof import('./lib/axiosInstance')}
39-
*/
40-
axiosInstance: require('./lib/axiosInstance'),
41-
/**
42-
* @type {typeof import('./lib/accessControl')}
43-
*/
44-
AccessControl: require('./lib/accessControl'),
14+
Vars,
15+
WOQLClient,
16+
UTILS,
17+
View,
18+
WOQL,
19+
WOQLResult,
20+
WOQLTable,
21+
WOQLGraph,
22+
axiosInstance,
23+
AccessControl,
4524
};

lib/woqlClient.js

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,30 @@ const WOQLQuery = require('./query/woqlBuilder');
5656
* }
5757
*/
5858

59-
function WOQLClient(serverUrl, params) {
59+
class WOQLClient {
60+
connectionConfig = null;
61+
62+
databaseList = [];
63+
64+
organizationList = [];
65+
/**
66+
* @constructor
67+
* @param {string} serverUrl - the terminusdb server url
68+
* @param {typedef.ParamsObj} [params] - an object with the connection parameters
69+
* @example
70+
*/
71+
72+
constructor(serverUrl, params) {
73+
this.connectionConfig = new ConnectionConfig(serverUrl, params);
74+
}
75+
}
76+
77+
/* function WOQLClient(serverUrl, params) {
6078
// current connection context variables
6179
this.connectionConfig = new ConnectionConfig(serverUrl, params);
6280
this.databaseList = [];
6381
this.organizationList = [];
64-
}
82+
} */
6583

6684
/**
6785
* set the api key to access the cloud resources
@@ -1710,6 +1728,14 @@ WOQLClient.prototype.patch = function (before, patch) {
17101728
).then((response) => response);
17111729
};
17121730

1731+
WOQLClient.prototype.sendCustomRequest = function (requestType, customRequest, payload) {
1732+
return this.dispatch(
1733+
requestType,
1734+
customRequest,
1735+
payload,
1736+
).then((response) => response);
1737+
};
1738+
17131739
// export default WOQLClient;
17141740

17151741
module.exports = WOQLClient;

0 commit comments

Comments
 (0)