Skip to content

Commit

Permalink
fix: Update dependencies, fixes for updated dependencies (#20)
Browse files Browse the repository at this point in the history
* chore(package): update dependencies

* Fix client constructor call

* Update .gitignore

* fix: switch to _system before getting list of databases

* chore: Add .releaserc for semantic-release

* chore: Fix package.json for semantic-release
  • Loading branch information
greenkeeper[bot] authored and bdfoster committed Apr 10, 2019
1 parent 6d84252 commit abceb20
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 27 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,9 @@ typings/
.env
/test/fixtures/config/development.json
/test/fixtures/config/test.json
/src/**/*.js
/src/*.js
/src/**/*.js.map
/src/*.js.map
/src/**/*.d.ts
/src/*.d.ts
8 changes: 8 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github"
]
}
23 changes: 12 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
{
"name": "nomatic-arangodb-adapter",
"description": "ArangoDB Adapter for nomatic-data",
"version": "0.0.0-development",
"main": "src/index.js",
"scripts": {
"build": "npm run clean && tsc",
"build": "tsc",
"clean": "rm -rf src/**/*.js src/**/*.d.ts src/**/*.js.map src/*.js src/*.d.ts src/*.js.map",
"lint": "tslint -c tslint.json --project tsconfig.json",
"lint:fix": "npm run lint -- --fix",
"test": "rm -rf coverage/ && cross-env NODE_ENV=test nyc mocha --reporter spec",
"test": "cross-env NODE_ENV=test nyc mocha --reporter spec",
"test:ci": "NODE_ENV=ci nyc mocha --reporter spec",
"coveralls": "nyc report --reporter=text-lcov | coveralls",
"docs": "typedoc --out ./docs/ --module commonjs --name nomatic-arangodb-adapter --hideGenerator --mode file --excludeExternals --excludePrivate --includeDeclarations --gaID UA-96699243-1 ./src",
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
"semantic-release": "semantic-release"
},
"repository": {
"type": "git",
Expand All @@ -36,22 +37,22 @@
"nomatic-data": ">= 3.0.0"
},
"dependencies": {
"arangojs": "^5.7.0",
"arangojs": "^6.10.0",
"lodash.set": "^4.3.2"
},
"devDependencies": {
"@types/chai": "^4.0.4",
"@types/mocha": "^2.2.43",
"@types/mocha": "^5.2.6",
"chai": "^4.1.2",
"coveralls": "^3.0.0",
"cross-env": "^5.0.5",
"nomatic-data": "^4.0.1",
"mocha": "^4.0.0",
"nyc": "^11.2.1",
"semantic-release": "^8.0.3",
"ts-node": "^3.3.0",
"mocha": "^6.1.2",
"nyc": "^13.3.0",
"semantic-release": "^15.13.3",
"ts-node": "^8.0.3",
"tslint": "^5.7.0",
"typedoc": "^0.9.0",
"typescript": "^2.5.3"
"typedoc": "^0.14.2",
"typescript": "^3.4.3"
}
}
23 changes: 7 additions & 16 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ export class ArangoDBAdapter extends DatabaseAdapter {
+ options.port;

this.client = new Database({
url: url,
databaseName: options.name
url: url
});

this.name = options.name;
Expand All @@ -51,7 +50,7 @@ export class ArangoDBAdapter extends DatabaseAdapter {
this._password = password;

if (this.user) {
this.client['useBasicAuth'](this._user, this._password);
this.client.useBasicAuth(this._user, this._password);
}
}

Expand Down Expand Up @@ -236,24 +235,16 @@ export class ArangoDBAdapter extends DatabaseAdapter {
}

public getDatabaseNames(): Promise<string[]> {
const currentDatabase = this.name;
if (this.name != '_system') {
this.name = '_system';
}
return this.client.listDatabases().then((list) => {
if (!list || !(list instanceof Array)) {
list = [];
}

this.name = currentDatabase;
return list;
}).catch((error) => {
if (error.name === 'ArangoError' && error['errorNum'] === 1228 && this.name !== '_system') {
const currentDatabase = this.name;
this.name = '_system';
return this.getDatabaseNames().then((list) => {
this.name = currentDatabase;
return list;
});
}

this.handleError(error);
return [];
});
}

Expand Down

0 comments on commit abceb20

Please sign in to comment.