@wiotp/sdk
Advanced tools
Comparing version 0.7.5-pre.monitoring-dashboard-updates to 0.7.6-pre.monitoring-dashboard-updates
@@ -330,3 +330,2 @@ "use strict"; | ||
return this.callApi('PATCH', 200, true, ["draft", "logicalinterfaces", logicalInterfaceId], body); | ||
break; | ||
@@ -346,3 +345,3 @@ case 'activate-configuration': | ||
} else { | ||
return this.invalidOperation("PATCH operation not allowed on logical interface"); | ||
return this.invalidOperation("PATCH operation not allowed on active logical interface"); | ||
} | ||
@@ -364,2 +363,32 @@ } // Application interface patch operation on active version | ||
} | ||
} // Application interface patch operation on draft version | ||
// Acceptable operation id - validate-configuration, activate-configuration, list-differences | ||
}, { | ||
key: "patchOperationDeviceType", | ||
value: function patchOperationDeviceType(deviceTypeId, operationId) { | ||
var body = { | ||
"operation": operationId | ||
}; | ||
if (this.draftMode) { | ||
switch (operationId) { | ||
case 'validate-configuration': | ||
return this.callApi('PATCH', 200, true, ["draft", "device", "types", deviceTypeId], body); | ||
case 'activate-configuration': | ||
return this.callApi('PATCH', 202, true, ["draft", "device", "types", deviceTypeId], body); | ||
case 'deactivate-configuration': | ||
return this.callApi('PATCH', 202, true, ["draft", "device", "types", deviceTypeId], body); | ||
case 'list-differences': | ||
return this.callApi('PATCH', 200, true, ["draft", "device", "types", deviceTypeId], body); | ||
default: | ||
return this.callApi('PATCH', 200, true, ["draft", "device", "types", deviceTypeId], body); | ||
} | ||
} else { | ||
return this.invalidOperation("this method cannot be called when draftMode=false"); | ||
} | ||
} // Create device type with physical Interface Id | ||
@@ -366,0 +395,0 @@ |
{ | ||
"name": "@wiotp/sdk", | ||
"version": "0.7.5-pre.monitoring-dashboard-updates", | ||
"version": "0.7.6-pre.monitoring-dashboard-updates", | ||
"description": "SDK for developing device, gateway, and application clients for IBM Watson IoT Platform", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -285,3 +285,2 @@ /** | ||
return this.callApi('PATCH', 200, true, ["draft", "logicalinterfaces", logicalInterfaceId], body); | ||
break | ||
case 'activate-configuration': | ||
@@ -297,3 +296,3 @@ return this.callApi('PATCH', 202, true, ["draft", "logicalinterfaces", logicalInterfaceId], body); | ||
} else { | ||
return this.invalidOperation("PATCH operation not allowed on logical interface"); | ||
return this.invalidOperation("PATCH operation not allowed on active logical interface"); | ||
} | ||
@@ -317,2 +316,27 @@ } | ||
// Application interface patch operation on draft version | ||
// Acceptable operation id - validate-configuration, activate-configuration, list-differences | ||
patchOperationDeviceType(deviceTypeId, operationId) { | ||
var body = { | ||
"operation": operationId | ||
} | ||
if(this.draftMode) { | ||
switch(operationId) { | ||
case 'validate-configuration': | ||
return this.callApi('PATCH', 200, true, ["draft", "device", "types", deviceTypeId], body); | ||
case 'activate-configuration': | ||
return this.callApi('PATCH', 202, true, ["draft", "device", "types", deviceTypeId], body); | ||
case 'deactivate-configuration': | ||
return this.callApi('PATCH', 202, true, ["draft", "device", "types", deviceTypeId], body); | ||
case 'list-differences': | ||
return this.callApi('PATCH', 200, true, ["draft", "device", "types", deviceTypeId], body); | ||
default: | ||
return this.callApi('PATCH', 200, true, ["draft", "device", "types", deviceTypeId], body); | ||
} | ||
} else { | ||
return this.invalidOperation("this method cannot be called when draftMode=false"); | ||
} | ||
} | ||
// Create device type with physical Interface Id | ||
@@ -319,0 +343,0 @@ createDeviceType(typeId, description, deviceInfo, metadata, classId, physicalInterfaceId) { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
2170335
38254