2.2.1 • Published 5 years ago

datahub-nodejs-sdk v2.2.1

Weekly downloads
166
License
MIT
Repository
github
Last release
5 years ago

datahub-nodejs-sdk


NPM version build status Test coverage node version npm download

DataHub Node.js SDK

Contributors

zhangyuhengxudafengzivyangll

This project follows the git-contributor spec, auto updated at Fri Feb 15 2019 23:07:40 GMT+0800.

Installment

$ npm i datahub-nodejs-sdk --save-dev

Common Usage

import DataHubSDK from 'datahub-nodejs-sdk';

const sdkClient = new DataHubSDK();

// switch currentScene for 'POST api/create' to 'sucess'
await sdkClient.switchScene({
  hub: 'app',
  pathname: 'api/create',
  scene: 'success',
  method: 'POST',   // method is optional, default method is 'ALL'
})

// switch currentScene for 'GET api/read' to 'success'
// switch currentScene for 'DELETE api/delete' to 'success'
await sdkClient.switchMultiScenes([{
  hub: 'app',
  pathname: 'api/read',
  scene: 'success',
  method: 'GET',   // method is optional, default method is 'ALL'
}, {
  hub: 'app',
  pathname: 'api/delete',
  scene: 'success',
  method: 'DELETE',  // method is optional, default method is 'ALL'
}])

// switch all scenes for all pathnames under app to 'success'
await sdkClient.switchAllScenes({
  hub: 'app',
  scene: 'success',
})

API Documents

License

The MIT License (MIT)

2.2.1

5 years ago

2.2.0

5 years ago

2.0.3

5 years ago

2.0.0

6 years ago

1.1.0

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago