Skip to content

Commit

Permalink
Merge pull request #22 from OpenSTFoundation/release-0.9
Browse files Browse the repository at this point in the history
Releasing v0.9.0 to master
  • Loading branch information
Kedar committed May 18, 2018
2 parents 6c85b11 + 02cee1b commit b3af4b0
Show file tree
Hide file tree
Showing 24 changed files with 2,368 additions and 190 deletions.
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,19 @@ build/Release
# https://docs.npmjs.com/cli/shrinkwrap#caveats
node_modules

tests/scripts/st-poa/

tests/scripts/poa-genesis.json

tests/scripts/pw


# Dev Folder
.dev

# Debug log from npm
npm-debug.log
.vscode

.DS_Store
.DS_Store

43 changes: 43 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
dist: trusty
language: node_js
cache:
directories:
- ~/.ethash
sudo: required
branches:
only:
- master
- develop
notifications:
email:
recipients:
- ci.report@ost.com
on_success: always
on_failure: always
node_js:
- "8"
before_install:
- sudo apt-get update
- sudo apt-get install nodejs
- sudo apt-get install npm
- sudo apt-get install software-properties-common
- sudo add-apt-repository -y ppa:ethereum/ethereum
- sudo apt-get update
- sudo bash tests/scripts/install_geth_1_8_3.sh
- geth version
install:
- npm install
before_script:
- mkdir -p ~/.ethash
- geth makedag 0 ~/.ethash
- node tests/scripts/setup_geth.js
script:
- node_modules/mocha/bin/mocha tests/mocha/lib/logger/custom_console_logger.js --timeout 5000 --exit
- node_modules/mocha/bin/mocha tests/mocha/lib/ost_web3/ost-web3.js --timeout 50000 --exit
- node_modules/mocha/bin/mocha tests/mocha/lib/promise_context/promise_context.js --timeout 50000 --exit
- node_modules/mocha/bin/mocha tests/mocha/lib/promise_context/promise_queue_manager.js --timeout 50000 --exit
- node_modules/mocha/bin/mocha tests/mocha/lib/formatter/response_helper.js --timeout 5000 --exit
- node_modules/mocha/bin/mocha tests/mocha/lib/web3_pool/ost_web3_pool_factory.js --timeout 50000 --exit

after_script:
- kill $(ps aux | grep 'geth' | awk '{print $2}')
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## OpenST-Base v0.9.0 (17 May 2018)
- OpenST Base repository was created and all the common functionality which different openst modules need were moved to it. Example - Logger, response helper, promise context, promise queue manager and web3.
- Log level support was introduced and non-important logs were moved to debug log level.
- Standardized error codes are now being used in OpenST Base.
71 changes: 64 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,18 +182,75 @@ Log Level only controls what needs to be logged.
| trace | TRACE |
# OpenST formatter usage
# OpenST response formatter usage
```bash

const rootPrefix = '.'
, paramErrorConfig = require(rootPrefix + '/tests/mocha/lib/formatter/param_error_config')
, apiErrorConfig = require(rootPrefix + '/tests/mocha/lib/formatter/api_error_config')
;

const OSTCore = require('@openstfoundation/openst-base')
, ResponseHelper = OSTCore.responseHelper;
, ResponseHelper = OSTCore.responseHelper
, responseHelper = new ResponseHelper({
moduleName: 'companyRestFulApi'
});

responseHelper = new ResponseHelper();
//using error function
responseHelper.error({
internal_error_identifier: 's_vt_1',
api_error_identifier: 'test_1',
debug_options: {client_id: 1234},
error_config: {
param_error_config: paramErrorConfig,
api_error_config: apiErrorConfig
}
});

//using successWithData function
responseHelper.successWithData({field: value});
//using paramValidationError function
responseHelper.paramValidationError({
internal_error_identifier:"s_vt_2",
api_error_identifier: "test_1",
params_error_identifiers: ["user_name_inappropriate"],
debug_options: {client_id: 1234},
error_config: {
param_error_config: paramErrorConfig,
api_error_config: apiErrorConfig
}
});

//using error function
responseHelper.error("err_code", "Unhandled result", {}, {sendErrorEmail: false});
// Result object is returned from responseHelper method invocations above, we can chain several methods as shown below

responseHelper.error({
internal_error_identifier: 's_vt_1',
api_error_identifier: 'invalid_api_params',
debug_options: {client_id: 1234},
error_config: {
param_error_config: paramErrorConfig,
api_error_config: apiErrorConfig
}
}).isSuccess();

responseHelper.error({
internal_error_identifier: 's_vt_1',
api_error_identifier: 'invalid_api_params',
debug_options: {client_id: 1234},
error_config: {
param_error_config: paramErrorConfig,
api_error_config: apiErrorConfig
}
}).isFailure();

responseHelper.error({
internal_error_identifier: 's_vt_1',
api_error_identifier: 'invalid_api_params',
debug_options: {client_id: 1234},
error_config: {
param_error_config: paramErrorConfig,
api_error_config: apiErrorConfig
}
}).toHash();


```
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.0-beta.13
0.9.0
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const rootPrefix = '.'
, PCQueueManager = require( rootPrefix + '/lib/promise_context/promise_queue_manager' )
, Web3PoolFactory = require( rootPrefix + '/lib/web3_pool/ost_web3_pool_factory' )
, Web3Pool = require( rootPrefix + '/lib/web3_pool/ost_web3_pool' )
, responseHelper = require(rootPrefix + '/lib/formatter/response')
, responseHelper = require(rootPrefix + '/lib/formatter/response_helper')
;

// Expose all libs here.
Expand Down
165 changes: 0 additions & 165 deletions lib/formatter/response.js

This file was deleted.

Loading

0 comments on commit b3af4b0

Please sign in to comment.