Skip to content

Commit 0d25ffd

Browse files
committed
Merge branch 'canary' into rc
2 parents 24fe635 + 6715fe7 commit 0d25ffd

38 files changed

+1060
-370
lines changed

.ci/publish_bintray.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
BRANCH=$1
3+
curl -u "rrooij:$BINTRAY_API_TOKEN" "https://api.bintray.com/npm/terminusdb/npm-$BRANCH/auth" > .npmrc
4+
curl -XDELETE "https://api.bintray.com/packages/terminusdb/npm-$BRANCH/terminusdb:terminusdb-client" -u "rrooij:$BINTRAY_API_TOKEN"
5+
npm publish
6+
curl -T "dist/terminusdb-client.min.js" -u"rrooij:$BINTRAY_API_TOKEN" "https://api.bintray.com/content/terminusdb/terminusdb/terminusdb-client/$BRANCH/$BRANCH/terminusdb-client.min.js?publish=1&override=1"
7+
curl -T "dist/terminusdb-client.min.js.map" -u"rrooij:$BINTRAY_API_TOKEN" "https://api.bintray.com/content/terminusdb/terminusdb/terminusdb-client/$BRANCH/$BRANCH/terminusdb-client.min.js.map?publish=1&override=1"

.ci/publish_canary.sh

Lines changed: 0 additions & 10 deletions
This file was deleted.

.ci/publish_dev.sh

Lines changed: 0 additions & 10 deletions
This file was deleted.

.ci/publish_rc.sh

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Please include a code sample to reproduce the problem.
15+
16+
**Expected behavior**
17+
A clear and concise description of what you expected to happen.
18+
19+
**Error logs**
20+
If applicable, add error logs to help explain your problem.
21+
22+
**System information (please complete the following information):**
23+
- OS: [e.g. Ubuntu 18.04]
24+
- Browser/NodeJS version [e.g. chrome, safari]
25+
- terminus-client version
26+
27+
**Additional context**
28+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/workflows/workflow.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Build and release on production
2+
on:
3+
push:
4+
branches:
5+
- dev
6+
- canary
7+
- rc
8+
9+
jobs:
10+
setup-build-publish-deploy:
11+
name: Setup, Build, Publish, and Deploy
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
- name: Use Node.js ${{ matrix.node-version }}
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: 14
20+
- run: npm install
21+
- run: npm run build
22+
- run: bash ".ci/publish_bintray.sh" "${GITHUB_REF##*/}"
23+
env:
24+
BINTRAY_API_TOKEN: ${{ secrets.BINTRAY_API_TOKEN }}

.travis.yml

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,17 @@
11
language: node_js
22
sudo: required
33
node_js:
4-
- "stable"
4+
- stable
55

66
stages:
77
- build
8-
- name: deploy_dev
9-
if: branch = dev
10-
- name: deploy_rc
11-
if: branch = rc
12-
- name: deploy_canary
13-
if: branch = canary
148

159
jobs:
1610
include:
1711
- stage: build
1812
after_script:
1913
- npm run coveralls-after
2014

21-
- stage: deploy_dev
22-
script:
23-
- npm run build
24-
- bash .ci/publish_dev.sh
25-
26-
- stage: deploy_rc
27-
script:
28-
- npm run build
29-
- bash .ci/publish_rc.sh
30-
31-
- stage: deploy_canary
32-
script:
33-
- npn run build
34-
- bash .ci/publish_canary.sh
35-
36-
3715
before_deploy:
3816
- npm run doc
3917
- npm run build

README.md

Lines changed: 62 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
terminusdb-client
2-
===============
1+
# terminusdb-client
32

43
[![build status](https://api.travis-ci.com/terminusdb/terminusdb-client.svg?branch=master)](https://travis-ci.com/terminusdb/terminusdb-client)
54
[![Coverage Status](https://coveralls.io/repos/github/terminusdb/terminusdb-client/badge.svg?branch=master)](https://coveralls.io/repos/github/terminusdb/terminusdb-client/badge.svg?branch=master)
@@ -16,6 +15,7 @@ Promise based terminus client for the browser and node.js
1615
TerminusDB Client can be used as either a Node.js module available through the npm registry, or directly included in web-sites by including the script tag below.
1716

1817
### NPM Module
18+
1919
Before installing, download and install Node.js. Node.js 0.10 or higher is required.
2020

2121
Installation is done using the npm install command:
@@ -43,62 +43,87 @@ Download the terminusdb-client.min.js file from the /dist directory and save it
4343
```
4444

4545
## Usage
46-
For the [full Documentation](https://terminusdb.com/docs/client_api)
46+
47+
This example creates a simple Express.js server that will post an account to
48+
a database with the id "banker" and the default "admin" user with password "root"
49+
For the [full Documentation](https://terminusdb.com/docs/reference/js-client)
4750

4851
```javascript
49-
//
50-
const TerminusClient = require('@terminusdb/terminusdb-client');
51-
52-
//Create a new instance of terminusDB client
53-
const client = new TerminusClient.WOQLClient();
54-
55-
//Connect to a TerminusDB server at the given URI with an API key
56-
client.connect("http://localhost:6363/", 'myKey').
57-
.then(function (response) {
58-
// handle success
59-
console.log(response);
60-
})
61-
.catch(function (error) {
62-
// handle error
63-
console.log(error);
64-
})
65-
.finally(function () {
66-
// always executed
67-
});
68-
69-
70-
//use async/await.
71-
async function getCapabilities() {
52+
const express = require("express");
53+
const app = express();
54+
const port = 3000;
55+
56+
const TerminusClient = require("@terminusdb/terminusdb-client");
57+
58+
// Connect and configure the TerminusClient
59+
const client = new TerminusClient.WOQLClient("https://127.0.0.1:6363/", {
60+
dbid: "banker",
61+
user: "admin",
62+
key: "root",
63+
});
64+
client.db("banker");
65+
client.organization("admin");
66+
67+
async function postAccount() {
7268
try {
73-
const response = await client.connect("http://localhost:6363/", 'myKey');
74-
console.log(response);
69+
const WOQL = TerminusClient.WOQL;
70+
const query = WOQL.using("admin/banker").and(
71+
WOQL.add_triple("doc:smog", "type", "scm:BankAccount"),
72+
WOQL.add_triple("doc:smog", "owner", "smog"),
73+
WOQL.add_triple("doc:smog", "balance", 999)
74+
);
75+
await client.connect();
76+
client
77+
.query(query, "adding smog's bank account")
78+
.then((response) => {
79+
return response;
80+
})
81+
.catch((err) => {
82+
console.log("error", err);
83+
});
7584
} catch (err) {
7685
console.error(err);
7786
}
7887
}
7988

80-
```
81-
89+
app.post("/account", (req, res) => {
90+
postAccount().then((dbres) => res.send(JSON.stringify(dbres)));
91+
});
8292

93+
app.listen(port, () => {
94+
console.log(`Backend Server listening at http://localhost:${port}`);
95+
client
96+
.connect()
97+
.then(function (response) {
98+
// handle success
99+
console.log(response);
100+
})
101+
.catch(function (error) {
102+
// handle error
103+
console.log(error);
104+
});
105+
});
106+
```
83107

84108
## Options
109+
85110
connections options.
86111

87112
To initialize `TerminusDB client` with custom options use
88113

89114
```js
90-
const TerminusClient = require('@terminusdb/terminusdb-client')
115+
const TerminusClient = require("@terminusdb/terminusdb-client");
91116

92-
const client = new TerminusClient.WOQLClient("http://localhost/", {
93-
dbid:"test_db",
94-
user:"admin",
95-
key:"my_secret_key"
117+
const client = new TerminusClient.WOQLClient("https://127.0.0.1:6363/", {
118+
dbid: "test_db",
119+
user: "admin",
120+
key: "my_secret_key",
96121
});
97-
98122
```
123+
99124
## API
100125

101-
The API is documented at: https://terminusdb.github.io/terminusdb-client/
126+
The API is documented at: https://terminusdb.com/docs/reference/js-client/core/#terminusdb-client-api
102127

103128
## Report Issues
104129

RELEASE_NOTES.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# TerminusDB Client v4.0.0
2+
3+
## new
4+
5+
* add update_quad
6+
* add update_triple
7+
* add woql word once
8+
* add context to using
9+
* add type_of
10+
* better error reporting
11+
* add csv uploading
12+
13+
## fixes
14+
15+
* Fix group_by
16+
117
# TerminusDB Client v3.0.3
218

319
The liberation release

0 commit comments

Comments
 (0)