I am working on AWS IoT, trying to create API to update Shadow things.
What I have done (in ClaudiaJS)
refer to https://github.com/aws/aws-iot-device-sdk-js
var awsIot = require('aws-iot-device-sdk');
api.post(PREFIX + '/iot/test/{property}', function (request) {
var property = request.pathParams.property;
var thingShadows = awsIot.thingShadow({
   keyPath: <YourPrivateKeyPath>,
  certPath: <YourCertificatePath>,
    caPath: <YourRootCACertificatePath>,
  clientId: <YourUniqueClientIdentifier>,
      host: <YourCustomEndpoint>
});
var clientTokenUpdate;
thingShadows.on('connect', function() {
    thingShadows.register( 'IoTTestThing', {}, function() {
       var shadowState = {"state":{"desired":{"property": property}}};
       clientTokenUpdate = thingShadows.update('IoTTestThing', shadowState  );
       if (clientTokenUpdate === null)
       {
          console.log('update shadow failed, operation still in progress');
       }
    });
});
thingShadows.on('status', 
    function('IoTTestThing', stat, clientToken, stateObject) {
       console.log('received '+stat+' on '+thingName+': '+
                   JSON.stringify(stateObject));
       return 'IoT status updated';
    });
thingShadows.on('delta', 
    function('IoTTestThing', stateObject) {
       console.log('received delta on '+thingName+': '+
                   JSON.stringify(stateObject));
       return 'IoT delta updated';
    });
 }
I run the API, nothing happens, I know the reason that I didn't implement the Promise in my code yet. But I don't know how to do it in AWS IoT SDK though AWS SDK supported Promise(https://aws.amazon.com/blogs/developer/support-for-promises-in-the-sdk/)
Any suggestion is very appreciated.