Constructor
new DataHubSDK(portopt, hostnameopt, protocolopt)
const client = new SDK({
port: 5678,
hostname: '127.0.0.1',
});
- Source:
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
port |
string
|
<optional> |
5678 |
DataHub port. |
hostname |
string
|
<optional> |
'127.0.0.1' |
DataHub hostname. |
protocol |
string
|
<optional> |
'http' |
DataHub protocol. |
Methods
(async) getSceneData(options)
await client.getSceneData({
hub: 'app',
pathname: 'api',
scene: 'success',
method: 'POST',
})
- Source:
Parameters:
| Name | Type | Description | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
scene options
|
(async) switchAllScenes(options)
await client.switchAllScenes({
hub: 'app',
scene: 'success',
})
- Source:
Parameters:
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
switch scene options
|
(async) switchMultiScenes(options)
await client.switchMultiScenes([{
hub: 'app',
pathname: 'api',
scene: 'success',
method: 'POST',
}, {
hub: 'app',
pathname: 'api2',
scene: 'success',
method: 'POST',
}])
- Source:
Parameters:
| Name | Type | Description | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Array.<Object>
|
switch scene options
|
(async) switchScene(options)
await client.switchScene({
hub: 'app',
pathname: 'api',
scene: 'success',
method: 'POST',
})await client.switchScene({
hub: 'app',
pathname: 'api',
scene: 'success',
method: 'POST',
})
- Source:
Parameters:
| Name | Type | Description | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
switch scene options
|