Skip to content

Commit 7f9de89

Browse files
Merge pull request #112 from terminusdb/fixLinting
Fix linting
2 parents 4698c5b + 35b761f commit 7f9de89

File tree

100 files changed

+14259
-14030
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+14259
-14030
lines changed

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ package.json
66
package-lock.json
77
.ci
88
.nyc_output
9+
test/
10+
tutorial/

.eslintrc.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
commonjs: true,
5+
es2021: true,
6+
node: true,
7+
},
8+
extends: [
9+
'airbnb-base',
10+
],
11+
parserOptions: {
12+
ecmaVersion: 13,
13+
},
14+
rules: {
15+
'func-names': ['error', 'never'],
16+
},
17+
};

.github/workflows/ci.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
7+
jobs:
8+
setup-test-lint:
9+
name: Setup, Test, and Lint
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
- name: Use Node.js ${{ matrix.node-version }}
15+
uses: actions/setup-node@v1
16+
with:
17+
node-version: 14
18+
- run: npm install
19+
- run: npm test
20+
- run: npm run lint:check

docs/_sidebar.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
- [generateCommitInfo](api/woqlClient.js?id=generateCommitInfo)
4747
- [generateCommitDescriptor](api/woqlClient.js?id=generateCommitDescriptor)
4848
- [prepareRevisionControlArgs](api/woqlClient.js?id=prepareRevisionControlArgs)
49+
- [getDatabase](api/woqlClient.js?id=getDatabase)
4950
- [updateDatabase](api/woqlClient.js?id=updateDatabase)
5051
- [addDocument](api/woqlClient.js?id=addDocument)
5152
- [queryDocument](api/woqlClient.js?id=queryDocument)

docs/api/woql.js.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,7 @@ get the predefined library query [WOQLLibrary](/api/woqlLibrary.js?id=WOQLLibrar
12711271
const query = WOQL.lib().previousCommits('m8vpxewh2aovfauebfkbzwmj4qwr5lb')
12721272

12731273
//return the commits of a specific branch starting from the head
1274-
//you can add the limit (how many results to return.) and the start point
1274+
//you can add the limit (how many results to return.) and the start point
12751275
//if a timestamp is given, gets the commits before the specified timestamp
12761276
//WOQL.lib().commits(branch='main',limit=0,start=0,timestamp=0)
12771277

docs/api/woqlClient.js.md

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@
44
**License**: Apache Version 2
55

66
#### new WOQLClient(serverUrl, [params])
7-
The core functionality of the TerminusDB javascript client is defined in the WOQLClient class - in the woqlClient.js file.
8-
This class provides methods which allow you to directly get and set all of the configuration and API endpoints of the client.
9-
The other parts of the WOQL core - connectionConfig.js and connectionCapabilities.js - are used by the client to store internal state - they should never have to be accessed directly.
10-
For situations where you want to communicate with a TerminusDB server API, the WOQLClient class is all you will need.
7+
The core functionality of the TerminusDB javascript client is
8+
defined in the WOQLClient class - in the woqlClient.js file. This class provides
9+
methods which allow you to directly get and set all of the configuration and API
10+
endpoints of the client. The other parts of the WOQL core - connectionConfig.js
11+
and connectionCapabilities.js - are used by the client to store internal state - they
12+
should never have to be accessed directly. For situations where you want to communicate
13+
with a TerminusDB server API, the WOQLClient class is all you will need.
1114

1215

1316
| Param | Type | Description |
@@ -30,7 +33,7 @@ async function getSchema() {
3033
//to connect with your TerminusDB Cloud Instance
3134
const client = new TerminusClient.WOQLClient('SERVER_CLOUD_URL/mycloudTeam',
3235
{user:"[email protected]", organization:'mycloudTeam'})
33-
36+
3437
client.setApiKey(MY_ACCESS_TOKEN)
3538

3639
//to get the list of all organization's databases
@@ -288,7 +291,8 @@ creates a copy of the client with identical internal state and context
288291
useful if we want to change context for a particular API call without changing
289292
the current client context
290293
291-
**Returns**: [<code>WOQLClient</code>](#WOQLClient) - new client object with identical state to original but which can be manipulated independently
294+
**Returns**: [<code>WOQLClient</code>](#WOQLClient) - new client object with identical state to original but
295+
which can be manipulated independently
292296
**Example**
293297
```js
294298
let newClient = client.copy()
@@ -304,7 +308,8 @@ it can only be set creating a new WOQLCLient instance
304308
#### woqlClient.api() ⇒ <code>string</code>
305309
Retrieve the URL of the server’s API base that we are currently connected to
306310
307-
**Returns**: <code>string</code> - the URL of the TerminusDB server api endpoint we are connected to (typically server() + “api/”)
311+
**Returns**: <code>string</code> - the URL of the TerminusDB server api endpoint we are connected
312+
to (typically server() + “api/”)
308313
**Example**
309314
```js
310315
let api_url = client.api()
@@ -504,7 +509,7 @@ of the current context for "commits" "meta" "branch" and "ref" special resources
504509
| Param | Type | Description |
505510
| --- | --- | --- |
506511
| resourceType | <code>typedef.ResourceType</code> | the type of resource string that is required - one of “db”, “meta”, “repo”, “commits”, “branch”, “ref” |
507-
| [resourceId] | <code>string</code> | can be used to specify a specific branch / ref - if not supplied the current context will be used |
512+
| [resourceId] | <code>string</code> | can be used to specify a specific branch / ref - if not supplied the current context will be used |
508513
509514
**Example**
510515
```js
@@ -661,6 +666,19 @@ Adds an author string (from the user object returned by connect) to the commit m
661666
| [rc_args] | <code>object</code> |
662667
663668
669+
### getDatabase
670+
#### woqlClient.getDatabase() ⇒ <code>Promise</code>
671+
Server Version API
672+
Note: the below endpoints are not part of the terminusdb desktop package
673+
they belong to the server package version of the DB which is under construction.
674+
Until that package is released all of the below endpoints should be considered
675+
as unreliable and subject to change - they are provided complete with the desktop
676+
version to show users what is coming and to allow people to use them at their own risk
677+
Any use of them should be considered unsupported and at your own risk
678+
get all the database information from the remote server
679+
680+
**Returns**: <code>Promise</code> - A promise that returns the call response object, or an Error if rejected.
681+
664682
### updateDatabase
665683
#### woqlClient.updateDatabase(dbDoc) ⇒ <code>Promise</code>
666684
update the database details
@@ -689,18 +707,18 @@ to add a new document or a list of new documents into the instance or the schema
689707
690708
**Example**
691709
```js
692-
const json = [{ "@type" : "Class",
710+
const json = [{ "@type" : "Class",
693711
"@id" : "Coordinate",
694-
"@key" : { '@type' : 'Hash',
695-
'@fields' : ['x','y'] },
712+
"@key" : { '@type' : 'Hash',
713+
'@fields' : ['x','y'] },
696714
"x" : "xsd:decimal",
697715
"y" : "xsd:decimal" },
698716
{ "@type" : "Class",
699717
"@id" : "Country",
700-
"@key" : { '@type' : 'Lexical',
701-
'@fields' : [name] },
718+
"@key" : { '@type' : 'Lexical',
719+
'@fields' : [name] },
702720
"name" : "xsd:string",
703-
"perimeter" : { "@type" : "List",
721+
"perimeter" : { "@type" : "List",
704722
"@class" : "Coordinate" } }]
705723
client.addDocument(json,{"graph_type":"schema"},"mydb","add new schema")
706724
```

0 commit comments

Comments
 (0)