@uhuru/awsiot-thing-creator
Advanced tools
Comparing version 1.0.1-beta.33 to 1.0.1-beta.34
@@ -165,9 +165,22 @@ "use strict"; | ||
for (const principal of principalsList) { | ||
const command = new client_iot_1.DetachThingPrincipalCommand({ | ||
const detachPolicyCmd = new client_iot_1.DetachPolicyCommand({ | ||
policyName: this.policyName, | ||
target: principal | ||
}); | ||
yield this.iotClient.send(detachPolicyCmd).catch((error) => { | ||
throw new Error(`Failed to detach policy ${this.policyName} from ${principal}, reason: ${error.message}`); | ||
}); | ||
const detachThingCmd = new client_iot_1.DetachThingPrincipalCommand({ | ||
principal: principal, | ||
thingName: this.thingName | ||
}); | ||
yield this.iotClient.send(command).catch((error) => { | ||
yield this.iotClient.send(detachThingCmd).catch((error) => { | ||
throw new Error(`Failed to detach AWS IoT thing. Please check your AWS IoT configuration, reason: ${error.message}`); | ||
}); | ||
const deleteCertCommand = new client_iot_1.DeleteCertificateCommand({ | ||
certificateId: principal | ||
}); | ||
yield this.iotClient.send(deleteCertCommand).catch((error) => { | ||
throw new Error(`Failed to delete certificate ${principal}, reason: ${error.message}`); | ||
}); | ||
} | ||
@@ -174,0 +187,0 @@ }); |
{ | ||
"name": "@uhuru/awsiot-thing-creator", | ||
"version": "1.0.1-beta.33", | ||
"version": "1.0.1-beta.34", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
57080
666