@wiotp/sdk
Advanced tools
Comparing version 0.2.0 to 0.3.0
{ | ||
"name": "@wiotp/sdk", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "SDK for developing device, gateway, and application clients for IBM Watson IoT Platform", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -49,3 +49,3 @@ # IBM Watson IoT Platform Javascript SDK | ||
let gwConfig = GatewayConfig.parseEnvVars(); | ||
let gwClient = new GatewayClient(appConfig); | ||
let gwClient = new GatewayClient(gwConfig); | ||
gwClient.connect(); | ||
@@ -69,2 +69,2 @@ // Do stuff | ||
npm publish . | ||
``` | ||
``` |
@@ -57,3 +57,7 @@ /** | ||
validateStatus: (status) => { | ||
return status === expectedHttpCode; | ||
if(Array.isArray(expectedHttpCode)) { | ||
return expectedHttpCode.includes(status); | ||
} else { | ||
return status === expectedHttpCode; | ||
} | ||
} | ||
@@ -60,0 +64,0 @@ }; |
@@ -41,2 +41,6 @@ /** | ||
createEventstreamsService({name, description, apiKey, adminUrl, brokers, user, password}) { | ||
return this.createService({name, description, type: 'eventstreams', credentials: {api_key: apiKey, kafka_admin_url: adminUrl, kafka_brokers_sasl: brokers, user, password}}) | ||
} | ||
getService(serviceId) { | ||
@@ -88,4 +92,8 @@ return this.apiClient.callApi('GET', 200, true, ['s2s', 'services', serviceId]) | ||
createEventstreamsDestination(connectorId, {name, partitions=1}) { | ||
return this.createDestination(connectorId, {name, type: 'eventstreams', configuration: { partitions }}); | ||
} | ||
deleteDestination(connectorId, destinationName) { | ||
return this.apiClient.callApi('DELETE', 200, false, ['historianconnectors', connectorId, 'destinations', destinationName]) | ||
return this.apiClient.callApi('DELETE', [200, 204], false, ['historianconnectors', connectorId, 'destinations', destinationName]) | ||
.catch(err => errors.handleError(err, {})); | ||
@@ -92,0 +100,0 @@ } |
128459
2482
69