Skip to content

Commit

Permalink
v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
juanhapes committed May 28, 2020
1 parent 9f5b888 commit 8e9cf5a
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [2.0.0] - 2020-05-28
### Changed
- Settings in `janiscommercerc.json` now are no longer mapped, the newClients settings will be setted in the new client document
- Setting `database` renamed from `dbDatabase`

## [1.3.0] - 2020-05-26
### Removed
- `session` in client create API and Listener
Expand Down
4 changes: 2 additions & 2 deletions lib/model-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ class Client extends Model {
}

static get excludeFieldsInLog() {
return ['user', 'password', 'host'];
return ['user', 'password', 'host', 'protocol', 'port', 'database'];
}

getFormattedClient(code) {
return {
code,
status: this.constructor.statuses.active,
dbDatabase: `janis-${code}`
database: `janis-${code}`
};
}
}
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@janiscommerce/client-creator",
"version": "1.3.0",
"version": "2.0.0",
"description": "A packge that wraps all the client creation in a JANIS Service",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -34,10 +34,10 @@
"test": "tests"
},
"dependencies": {
"@janiscommerce/api": "^4.3.0",
"@janiscommerce/api-test": "^2.3.1",
"@janiscommerce/event-listener": "^1.2.0",
"@janiscommerce/api": "^4.3.0",
"@janiscommerce/event-listener-test": "^1.0.0",
"@janiscommerce/event-listener": "^1.2.0",
"@janiscommerce/model": "^4.1.0",
"@janiscommerce/mongodb-index-creator": "^1.2.1",
"@janiscommerce/settings": "^1.0.1"
Expand Down
5 changes: 2 additions & 3 deletions tests/api-create.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ describe('APIs', () => {
const fakeSettings = {

database: {

core: {
host: 'core-database-host',
protocol: 'core-protocol://',
Expand All @@ -43,7 +42,7 @@ describe('APIs', () => {
code: 'some-client',
status: ClientModel.statuses.active,
...fakeSettings.database.newClients,
dbDatabase: 'janis-some-client'
database: 'janis-some-client'
};

APITest(ClientCreateAPI, '/api/client', [
Expand Down Expand Up @@ -83,7 +82,7 @@ describe('APIs', () => {
{
...expectedClientObject,
code: 'other-client',
dbDatabase: 'janis-other-client'
database: 'janis-other-client'
}
]);

Expand Down
3 changes: 1 addition & 2 deletions tests/listener-created.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ describe('Client Created Listener', async () => {
const fakeSettings = {

database: {

core: {
host: 'core-database-host',
protocol: 'core-protocol://',
Expand All @@ -50,7 +49,7 @@ describe('Client Created Listener', async () => {
code: 'some-client',
status: ClientModel.statuses.active,
...fakeSettings.database.newClients,
dbDatabase: 'janis-some-client'
database: 'janis-some-client'
};

await EventListenerTest(handler, [
Expand Down
2 changes: 1 addition & 1 deletion tests/model-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ describe('ClientModel', () => {
});

it('Should return the exclude fields for logging', async () => {
assert.deepStrictEqual(ClientModel.excludeFieldsInLog, ['user', 'password', 'host']);
assert.deepStrictEqual(ClientModel.excludeFieldsInLog, ['user', 'password', 'host', 'protocol', 'port', 'database']);
});

it('Should return false when shouldCreateLogs', () => {
Expand Down

0 comments on commit 8e9cf5a

Please sign in to comment.