Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aws-iot-device-sdk-v2

Package Overview
Dependencies
Maintainers
4
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-iot-device-sdk-v2 - npm Package Compare versions

Comparing version 1.8.11 to 1.9.0

dist/service_client_mqtt_adapter.d.ts

4

dist/browser.d.ts

@@ -7,3 +7,3 @@ /**

*/
import { mqtt, http, io, iot, auth } from 'aws-crt/dist.browser/browser';
export { mqtt, http, io, iot, auth };
import { auth, http, io, iot, mqtt, mqtt5 } from 'aws-crt/dist.browser/browser';
export { auth, http, io, iot, mqtt, mqtt5 };

@@ -7,3 +7,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.auth = exports.iot = exports.io = exports.http = exports.mqtt = void 0;
exports.mqtt5 = exports.mqtt = exports.iot = exports.io = exports.http = exports.auth = void 0;
/**

@@ -16,7 +16,8 @@ * Browser entry point for AWS IoT SDK.

const browser_1 = require("aws-crt/dist.browser/browser");
Object.defineProperty(exports, "mqtt", { enumerable: true, get: function () { return browser_1.mqtt; } });
Object.defineProperty(exports, "auth", { enumerable: true, get: function () { return browser_1.auth; } });
Object.defineProperty(exports, "http", { enumerable: true, get: function () { return browser_1.http; } });
Object.defineProperty(exports, "io", { enumerable: true, get: function () { return browser_1.io; } });
Object.defineProperty(exports, "iot", { enumerable: true, get: function () { return browser_1.iot; } });
Object.defineProperty(exports, "auth", { enumerable: true, get: function () { return browser_1.auth; } });
Object.defineProperty(exports, "mqtt", { enumerable: true, get: function () { return browser_1.mqtt; } });
Object.defineProperty(exports, "mqtt5", { enumerable: true, get: function () { return browser_1.mqtt5; } });
//# sourceMappingURL=browser.js.map
/**
* @packageDocumentation
* @module aws-iot-device-sdk
* @module greengrass
* @mergeTarget
*/

@@ -5,0 +6,0 @@ import { io } from 'aws-crt';

@@ -42,3 +42,4 @@ "use strict";

* @packageDocumentation
* @module aws-iot-device-sdk
* @module greengrass
* @mergeTarget
*/

@@ -45,0 +46,0 @@ const aws_crt_1 = require("aws-crt");

@@ -10,3 +10,3 @@ "use strict";

* @packageDocumentation
* @module aws-iot-device-sdk
* @module greengrass
*/

@@ -13,0 +13,0 @@ const util_1 = require("util");

@@ -9,4 +9,2 @@ /**

* @packageDocumentation
* @module aws-iot-device-sdk
* @mergeTarget
*/

@@ -17,3 +15,3 @@ import * as iotidentity from './iotidentity/iotidentityclient';

import * as iotshadow from './iotshadow/iotshadowclient';
import { mqtt, auth, http, io, iot } from 'aws-crt';
export { iotidentity, greengrass, iotjobs, iotshadow, mqtt, auth, http, io, iot };
import { auth, http, io, iot, mqtt, mqtt5 } from 'aws-crt';
export { auth, greengrass, http, io, iot, iotidentity, iotjobs, iotshadow, mqtt, mqtt5 };

@@ -31,3 +31,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.iot = exports.io = exports.http = exports.auth = exports.mqtt = exports.iotshadow = exports.iotjobs = exports.greengrass = exports.iotidentity = void 0;
exports.mqtt5 = exports.mqtt = exports.iotshadow = exports.iotjobs = exports.iotidentity = exports.iot = exports.io = exports.http = exports.greengrass = exports.auth = void 0;
/**

@@ -41,4 +41,2 @@ * Service clients and data models for interacting with AWS Iot services:

* @packageDocumentation
* @module aws-iot-device-sdk
* @mergeTarget
*/

@@ -54,3 +52,2 @@ const iotidentity = __importStar(require("./iotidentity/iotidentityclient"));

const aws_crt_1 = require("aws-crt");
Object.defineProperty(exports, "mqtt", { enumerable: true, get: function () { return aws_crt_1.mqtt; } });
Object.defineProperty(exports, "auth", { enumerable: true, get: function () { return aws_crt_1.auth; } });

@@ -60,2 +57,4 @@ Object.defineProperty(exports, "http", { enumerable: true, get: function () { return aws_crt_1.http; } });

Object.defineProperty(exports, "iot", { enumerable: true, get: function () { return aws_crt_1.iot; } });
Object.defineProperty(exports, "mqtt", { enumerable: true, get: function () { return aws_crt_1.mqtt; } });
Object.defineProperty(exports, "mqtt5", { enumerable: true, get: function () { return aws_crt_1.mqtt5; } });
//# sourceMappingURL=index.js.map
/**
* @packageDocumentation
* @module aws-iot-device-sdk
* @module identity
*/
import * as model from "./model";
import { mqtt } from "aws-crt";
import { mqtt, mqtt5 } from "aws-crt";
export { model };

@@ -26,8 +26,25 @@ /**

export declare class IotIdentityClient {
private connection;
private mqttAdapter;
private decoder;
private static INVALID_PAYLOAD_PARSING_ERROR;
private static createClientError;
constructor(connection: mqtt.MqttClientConnection);
constructor(connection?: mqtt.MqttClientConnection);
/**
* Creates a new IotIdentityClient that uses the SDK Mqtt5 client internally.
*
* The pre-existing constructor that is bound to the MQTT311 client makes this awkward since we
* must support
*
* ```
* new IotIdentityClient(mqtt311connection);
* ```
*
* for backwards compatibility, but still want to be able to inject an MQTT5 client as well.
*
* @param client the MQTT5 client to use with this service client
*
* @returns a new IotIdentityClient instance
*/
static newFromMqtt5Client(client: mqtt5.Mqtt5Client): IotIdentityClient;
/**
* Creates new keys and a certificate. AWS IoT provides client certificates that are signed by the Amazon Root certificate authority (CA). The new certificate has a PENDING_ACTIVATION status. When you call RegisterThing to provision a thing with this certificate, the certificate status changes to ACTIVE or INACTIVE as described in the template.

@@ -34,0 +51,0 @@ *

@@ -44,3 +44,3 @@ "use strict";

* @packageDocumentation
* @module aws-iot-device-sdk
* @module identity
*/

@@ -50,2 +50,3 @@ const model = __importStar(require("./model"));

const util_1 = require("util");
const service_client_mqtt_adapter = __importStar(require("../service_client_mqtt_adapter"));
/**

@@ -81,4 +82,6 @@ * Error subclass for IotIdentity service errors

constructor(connection) {
this.connection = connection;
this.decoder = new util_1.TextDecoder('utf-8');
if (connection !== undefined) {
this.mqttAdapter = new service_client_mqtt_adapter.ServiceClientMqtt311Adapter(connection);
}
}

@@ -94,2 +97,23 @@ static createClientError(err, payload) {

/**
* Creates a new IotIdentityClient that uses the SDK Mqtt5 client internally.
*
* The pre-existing constructor that is bound to the MQTT311 client makes this awkward since we
* must support
*
* ```
* new IotIdentityClient(mqtt311connection);
* ```
*
* for backwards compatibility, but still want to be able to inject an MQTT5 client as well.
*
* @param client the MQTT5 client to use with this service client
*
* @returns a new IotIdentityClient instance
*/
static newFromMqtt5Client(client) {
let serviceClient = new IotIdentityClient();
serviceClient.mqttAdapter = new service_client_mqtt_adapter.ServiceClientMqtt5Adapter(client);
return serviceClient;
}
/**
* Creates new keys and a certificate. AWS IoT provides client certificates that are signed by the Amazon Root certificate authority (CA). The new certificate has a PENDING_ACTIVATION status. When you call RegisterThing to provision a thing with this certificate, the certificate status changes to ACTIVE or INACTIVE as described in the template.

@@ -115,3 +139,3 @@ *

let topic = "$aws/certificates/create/json";
return this.connection.publish(topic, JSON.stringify(request), qos);
return this.mqttAdapter.publish(topic, JSON.stringify(request), qos);
});

@@ -159,3 +183,3 @@ }

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -203,3 +227,3 @@ }

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -248,3 +272,3 @@ }

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -292,3 +316,3 @@ }

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -318,3 +342,3 @@ }

topic = topic.replace("{templateName}", request.templateName);
return this.connection.publish(topic, JSON.stringify(request), qos);
return this.mqttAdapter.publish(topic, JSON.stringify(request), qos);
});

@@ -363,3 +387,3 @@ }

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -407,3 +431,3 @@ }

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -432,3 +456,3 @@ }

let topic = "$aws/certificates/create-from-csr/json";
return this.connection.publish(topic, JSON.stringify(request), qos);
return this.mqttAdapter.publish(topic, JSON.stringify(request), qos);
});

@@ -435,0 +459,0 @@ }

/**
* @packageDocumentation
* @module aws-iot-device-sdk
*/
/**
* Data needed to perform a CreateCertificateFromCsr operation.

@@ -7,0 +3,0 @@ *

/**
* @packageDocumentation
* @module aws-iot-device-sdk
* @module jobs
*/
import * as model from "./model";
import { mqtt } from "aws-crt";
import { mqtt, mqtt5 } from "aws-crt";
export { model };

@@ -26,8 +26,25 @@ /**

export declare class IotJobsClient {
private connection;
private mqttAdapter;
private decoder;
private static INVALID_PAYLOAD_PARSING_ERROR;
private static createClientError;
constructor(connection: mqtt.MqttClientConnection);
constructor(connection?: mqtt.MqttClientConnection);
/**
* Creates a new IotJobsClient that uses the SDK Mqtt5 client internally.
*
* The pre-existing constructor that is bound to the MQTT311 client makes this awkward since we
* must support
*
* ```
* new IotJobsClient(mqtt311connection);
* ```
*
* for backwards compatibility, but still want to be able to inject an MQTT5 client as well.
*
* @param client the MQTT5 client to use with this service client
*
* @returns a new IotJobsClient instance
*/
static newFromMqtt5Client(client: mqtt5.Mqtt5Client): IotJobsClient;
/**
* Subscribes to JobExecutionsChanged notifications for a given IoT thing.

@@ -34,0 +51,0 @@ *

@@ -44,3 +44,3 @@ "use strict";

* @packageDocumentation
* @module aws-iot-device-sdk
* @module jobs
*/

@@ -50,2 +50,3 @@ const model = __importStar(require("./model"));

const util_1 = require("util");
const service_client_mqtt_adapter = __importStar(require("../service_client_mqtt_adapter"));
/**

@@ -81,4 +82,6 @@ * Error subclass for IotJobs service errors

constructor(connection) {
this.connection = connection;
this.decoder = new util_1.TextDecoder('utf-8');
if (connection !== undefined) {
this.mqttAdapter = new service_client_mqtt_adapter.ServiceClientMqtt311Adapter(connection);
}
}

@@ -94,2 +97,23 @@ static createClientError(err, payload) {

/**
* Creates a new IotJobsClient that uses the SDK Mqtt5 client internally.
*
* The pre-existing constructor that is bound to the MQTT311 client makes this awkward since we
* must support
*
* ```
* new IotJobsClient(mqtt311connection);
* ```
*
* for backwards compatibility, but still want to be able to inject an MQTT5 client as well.
*
* @param client the MQTT5 client to use with this service client
*
* @returns a new IotJobsClient instance
*/
static newFromMqtt5Client(client) {
let serviceClient = new IotJobsClient();
serviceClient.mqttAdapter = new service_client_mqtt_adapter.ServiceClientMqtt5Adapter(client);
return serviceClient;
}
/**
* Subscribes to JobExecutionsChanged notifications for a given IoT thing.

@@ -135,3 +159,3 @@ *

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -180,3 +204,3 @@ }

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -226,3 +250,3 @@ }

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -271,3 +295,3 @@ }

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -317,3 +341,3 @@ }

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -363,3 +387,3 @@ }

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -390,3 +414,3 @@ }

topic = topic.replace("{jobId}", request.jobId);
return this.connection.publish(topic, JSON.stringify(request), qos);
return this.mqttAdapter.publish(topic, JSON.stringify(request), qos);
});

@@ -436,3 +460,3 @@ }

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -462,3 +486,3 @@ }

topic = topic.replace("{thingName}", request.thingName);
return this.connection.publish(topic, JSON.stringify(request), qos);
return this.mqttAdapter.publish(topic, JSON.stringify(request), qos);
});

@@ -507,3 +531,3 @@ }

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -552,3 +576,3 @@ }

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -597,3 +621,3 @@ }

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -623,3 +647,3 @@ }

topic = topic.replace("{thingName}", request.thingName);
return this.connection.publish(topic, JSON.stringify(request), qos);
return this.mqttAdapter.publish(topic, JSON.stringify(request), qos);
});

@@ -650,3 +674,3 @@ }

topic = topic.replace("{jobId}", request.jobId);
return this.connection.publish(topic, JSON.stringify(request), qos);
return this.mqttAdapter.publish(topic, JSON.stringify(request), qos);
});

@@ -653,0 +677,0 @@ }

/**
* @packageDocumentation
* @module aws-iot-device-sdk
*/
/**
* A value indicating the kind of error encountered while processing an AWS IoT Jobs request

@@ -7,0 +3,0 @@ *

@@ -11,6 +11,2 @@ "use strict";

/**
* @packageDocumentation
* @module aws-iot-device-sdk
*/
/**
* A value indicating the kind of error encountered while processing an AWS IoT Jobs request

@@ -17,0 +13,0 @@ *

/**
* @packageDocumentation
* @module aws-iot-device-sdk
* @module shadow
*/
import * as model from "./model";
import { mqtt } from "aws-crt";
import { mqtt, mqtt5 } from "aws-crt";
export { model };

@@ -26,8 +26,25 @@ /**

export declare class IotShadowClient {
private connection;
private mqttAdapter;
private decoder;
private static INVALID_PAYLOAD_PARSING_ERROR;
private static createClientError;
constructor(connection: mqtt.MqttClientConnection);
constructor(connection?: mqtt.MqttClientConnection);
/**
* Creates a new IotShadowClient that uses the SDK Mqtt5 client internally.
*
* The pre-existing constructor that is bound to the MQTT311 client makes this awkward since we
* must support
*
* ```
* new IotShadowClient(mqtt311connection);
* ```
*
* for backwards compatibility, but still want to be able to inject an MQTT5 client as well.
*
* @param client the MQTT5 client to use with this service client
*
* @returns a new IotShadowClient instance
*/
static newFromMqtt5Client(client: mqtt5.Mqtt5Client): IotShadowClient;
/**
* Subscribes to the rejected topic for the UpdateShadow operation

@@ -34,0 +51,0 @@ *

@@ -44,3 +44,3 @@ "use strict";

* @packageDocumentation
* @module aws-iot-device-sdk
* @module shadow
*/

@@ -50,2 +50,3 @@ const model = __importStar(require("./model"));

const util_1 = require("util");
const service_client_mqtt_adapter = __importStar(require("../service_client_mqtt_adapter"));
/**

@@ -81,4 +82,6 @@ * Error subclass for IotShadow service errors

constructor(connection) {
this.connection = connection;
this.decoder = new util_1.TextDecoder('utf-8');
if (connection !== undefined) {
this.mqttAdapter = new service_client_mqtt_adapter.ServiceClientMqtt311Adapter(connection);
}
}

@@ -94,2 +97,23 @@ static createClientError(err, payload) {

/**
* Creates a new IotShadowClient that uses the SDK Mqtt5 client internally.
*
* The pre-existing constructor that is bound to the MQTT311 client makes this awkward since we
* must support
*
* ```
* new IotShadowClient(mqtt311connection);
* ```
*
* for backwards compatibility, but still want to be able to inject an MQTT5 client as well.
*
* @param client the MQTT5 client to use with this service client
*
* @returns a new IotShadowClient instance
*/
static newFromMqtt5Client(client) {
let serviceClient = new IotShadowClient();
serviceClient.mqttAdapter = new service_client_mqtt_adapter.ServiceClientMqtt5Adapter(client);
return serviceClient;
}
/**
* Subscribes to the rejected topic for the UpdateShadow operation

@@ -135,3 +159,3 @@ *

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -180,3 +204,3 @@ }

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -226,3 +250,3 @@ }

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -272,3 +296,3 @@ }

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -298,3 +322,3 @@ }

topic = topic.replace("{thingName}", request.thingName);
return this.connection.publish(topic, JSON.stringify(request), qos);
return this.mqttAdapter.publish(topic, JSON.stringify(request), qos);
});

@@ -325,3 +349,3 @@ }

topic = topic.replace("{thingName}", request.thingName);
return this.connection.publish(topic, JSON.stringify(request), qos);
return this.mqttAdapter.publish(topic, JSON.stringify(request), qos);
});

@@ -370,3 +394,3 @@ }

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -415,3 +439,3 @@ }

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -461,3 +485,3 @@ }

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -507,3 +531,3 @@ }

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -552,3 +576,3 @@ }

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -579,3 +603,3 @@ }

topic = topic.replace("{thingName}", request.thingName);
return this.connection.publish(topic, JSON.stringify(request), qos);
return this.mqttAdapter.publish(topic, JSON.stringify(request), qos);
});

@@ -625,3 +649,3 @@ }

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -670,3 +694,3 @@ }

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -715,3 +739,3 @@ }

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -741,3 +765,3 @@ }

topic = topic.replace("{thingName}", request.thingName);
return this.connection.publish(topic, JSON.stringify(request), qos);
return this.mqttAdapter.publish(topic, JSON.stringify(request), qos);
});

@@ -767,3 +791,3 @@ }

topic = topic.replace("{thingName}", request.thingName);
return this.connection.publish(topic, JSON.stringify(request), qos);
return this.mqttAdapter.publish(topic, JSON.stringify(request), qos);
});

@@ -812,3 +836,3 @@ }

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -858,3 +882,3 @@ }

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -885,3 +909,3 @@ }

topic = topic.replace("{thingName}", request.thingName);
return this.connection.publish(topic, JSON.stringify(request), qos);
return this.mqttAdapter.publish(topic, JSON.stringify(request), qos);
});

@@ -931,3 +955,3 @@ }

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -977,3 +1001,3 @@ }

};
return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
});

@@ -980,0 +1004,0 @@ }

/**
* @packageDocumentation
* @module aws-iot-device-sdk
*/
/**
* Data needed to make a DeleteNamedShadow request.

@@ -7,0 +3,0 @@ *

{
"entryPoints": [
"../lib/browser.ts",
"../lib/greengrass/discoveryclient.ts",
"../lib/iotidentity/iotidentityclient.ts",
"../lib/iotjobs/iotjobsclient.ts",
"../lib/iotshadow/iotshadowclient.ts",
"../build/docs/aws-crt-nodejs/lib/browser/auth.ts",
"../build/docs/aws-crt-nodejs/lib/browser/aws_iot.ts",
"../build/docs/aws-crt-nodejs/lib/browser/crypto.ts",
"../build/docs/aws-crt-nodejs/lib/browser/error.ts",
"../build/docs/aws-crt-nodejs/lib/browser/http.ts",
"../build/docs/aws-crt-nodejs/lib/browser/io.ts",
"../build/docs/aws-crt-nodejs/lib/browser/iot.ts",
"../build/docs/aws-crt-nodejs/lib/browser/mqtt.ts",
"../build/docs/aws-crt-nodejs/lib/browser/mqtt5.ts",
"../build/docs/aws-crt-nodejs/lib/browser/ws.ts",
"../build/docs/aws-crt-nodejs/lib/common/auth.ts",
"../build/docs/aws-crt-nodejs/lib/common/crypto.ts",
"../build/docs/aws-crt-nodejs/lib/common/event.ts",

@@ -15,0 +17,0 @@ "../build/docs/aws-crt-nodejs/lib/common/http.ts",

{
"entryPoints": [
"../lib/index.ts",
"../lib/greengrass/discoveryclient.ts",
"../lib/iotidentity/iotidentityclient.ts",
"../lib/iotjobs/iotjobsclient.ts",
"../lib/iotshadow/iotshadowclient.ts",
"../build/docs/aws-crt-nodejs/lib/native/auth.ts",
"../build/docs/aws-crt-nodejs/lib/native/aws_iot.ts",
"../build/docs/aws-crt-nodejs/lib/native/checksums.ts",
"../build/docs/aws-crt-nodejs/lib/native/crt.ts",
"../build/docs/aws-crt-nodejs/lib/native/crypto.ts",
"../build/docs/aws-crt-nodejs/lib/native/binding.d.ts",
"../build/docs/aws-crt-nodejs/lib/native/error.ts",
"../build/docs/aws-crt-nodejs/lib/native/http.ts",
"../build/docs/aws-crt-nodejs/lib/native/io.ts",
"../build/docs/aws-crt-nodejs/lib/native/iot.ts",
"../build/docs/aws-crt-nodejs/lib/native/mqtt.ts",
"../build/docs/aws-crt-nodejs/lib/native/binding.d.ts",
"../build/docs/aws-crt-nodejs/lib/common/auth.ts",
"../build/docs/aws-crt-nodejs/lib/common/crypto.ts",
"../build/docs/aws-crt-nodejs/lib/native/mqtt5.ts",
"../build/docs/aws-crt-nodejs/lib/common/event.ts",
"../build/docs/aws-crt-nodejs/lib/common/http.ts",
"../build/docs/aws-crt-nodejs/lib/common/mqtt.ts",
"../build/docs/aws-crt-nodejs/lib/common/resource_safety.ts"

@@ -32,2 +30,1 @@ ],

}

@@ -13,10 +13,18 @@ /*

import { mqtt, http, io, iot, auth } from 'aws-crt/dist.browser/browser';
import {
auth,
http,
io,
iot,
mqtt,
mqtt5
} from 'aws-crt/dist.browser/browser';
export {
mqtt,
auth,
http,
io,
iot,
auth
mqtt,
mqtt5
}

@@ -8,3 +8,4 @@ /*

* @packageDocumentation
* @module aws-iot-device-sdk
* @module greengrass
* @mergeTarget
*/

@@ -11,0 +12,0 @@

@@ -8,3 +8,3 @@ /*

* @packageDocumentation
* @module aws-iot-device-sdk
* @module greengrass
*/

@@ -11,0 +11,0 @@

@@ -15,4 +15,2 @@ /*

* @packageDocumentation
* @module aws-iot-device-sdk
* @mergeTarget
*/

@@ -25,14 +23,22 @@

import { mqtt, auth, http, io, iot } from 'aws-crt';
import {
auth,
http,
io,
iot,
mqtt,
mqtt5
} from 'aws-crt';
export {
auth,
greengrass,
http,
io,
iot,
iotidentity,
greengrass,
iotjobs,
iotshadow,
mqtt,
auth,
http,
io,
iot
mqtt5
}

@@ -10,8 +10,10 @@ /*

* @packageDocumentation
* @module aws-iot-device-sdk
* @module identity
*/
import * as model from "./model";
import { mqtt } from "aws-crt";
import { mqtt, mqtt5 } from "aws-crt";
import { TextDecoder } from "util";
import * as service_client_mqtt_adapter from "../service_client_mqtt_adapter";
export { model };

@@ -48,2 +50,5 @@

// @ts-ignore
private mqttAdapter: service_client_mqtt_adapter.IServiceClientMqttAdapter;
private decoder = new TextDecoder('utf-8');

@@ -61,6 +66,32 @@

constructor(private connection: mqtt.MqttClientConnection) {
constructor(connection?: mqtt.MqttClientConnection) {
if (connection !== undefined) {
this.mqttAdapter = new service_client_mqtt_adapter.ServiceClientMqtt311Adapter(connection);
}
}
/**
* Creates a new IotIdentityClient that uses the SDK Mqtt5 client internally.
*
* The pre-existing constructor that is bound to the MQTT311 client makes this awkward since we
* must support
*
* ```
* new IotIdentityClient(mqtt311connection);
* ```
*
* for backwards compatibility, but still want to be able to inject an MQTT5 client as well.
*
* @param client the MQTT5 client to use with this service client
*
* @returns a new IotIdentityClient instance
*/
static newFromMqtt5Client(client: mqtt5.Mqtt5Client) : IotIdentityClient {
let serviceClient: IotIdentityClient = new IotIdentityClient();
serviceClient.mqttAdapter = new service_client_mqtt_adapter.ServiceClientMqtt5Adapter(client);
return serviceClient;
}
/**
* Creates new keys and a certificate. AWS IoT provides client certificates that are signed by the Amazon Root certificate authority (CA). The new certificate has a PENDING_ACTIVATION status. When you call RegisterThing to provision a thing with this certificate, the certificate status changes to ACTIVE or INACTIVE as described in the template.

@@ -89,3 +120,3 @@ *

let topic: string = "$aws/certificates/create/json";
return this.connection.publish(topic, JSON.stringify(request), qos);
return this.mqttAdapter.publish(topic, JSON.stringify(request), qos);
}

@@ -137,3 +168,3 @@

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}

@@ -185,3 +216,3 @@

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}

@@ -234,3 +265,3 @@

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}

@@ -282,3 +313,3 @@

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}

@@ -311,3 +342,3 @@

topic = topic.replace("{templateName}", request.templateName);
return this.connection.publish(topic, JSON.stringify(request), qos);
return this.mqttAdapter.publish(topic, JSON.stringify(request), qos);
}

@@ -360,3 +391,3 @@

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}

@@ -408,3 +439,3 @@

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}

@@ -436,5 +467,5 @@

let topic: string = "$aws/certificates/create-from-csr/json";
return this.connection.publish(topic, JSON.stringify(request), qos);
return this.mqttAdapter.publish(topic, JSON.stringify(request), qos);
}
}

@@ -8,8 +8,3 @@ /*

/**
* @packageDocumentation
* @module aws-iot-device-sdk
*/
/**

@@ -16,0 +11,0 @@ * Data needed to perform a CreateCertificateFromCsr operation.

@@ -10,8 +10,10 @@ /*

* @packageDocumentation
* @module aws-iot-device-sdk
* @module jobs
*/
import * as model from "./model";
import { mqtt } from "aws-crt";
import { mqtt, mqtt5 } from "aws-crt";
import { TextDecoder } from "util";
import * as service_client_mqtt_adapter from "../service_client_mqtt_adapter";
export { model };

@@ -48,2 +50,5 @@

// @ts-ignore
private mqttAdapter: service_client_mqtt_adapter.IServiceClientMqttAdapter;
private decoder = new TextDecoder('utf-8');

@@ -61,6 +66,32 @@

constructor(private connection: mqtt.MqttClientConnection) {
constructor(connection?: mqtt.MqttClientConnection) {
if (connection !== undefined) {
this.mqttAdapter = new service_client_mqtt_adapter.ServiceClientMqtt311Adapter(connection);
}
}
/**
* Creates a new IotJobsClient that uses the SDK Mqtt5 client internally.
*
* The pre-existing constructor that is bound to the MQTT311 client makes this awkward since we
* must support
*
* ```
* new IotJobsClient(mqtt311connection);
* ```
*
* for backwards compatibility, but still want to be able to inject an MQTT5 client as well.
*
* @param client the MQTT5 client to use with this service client
*
* @returns a new IotJobsClient instance
*/
static newFromMqtt5Client(client: mqtt5.Mqtt5Client) : IotJobsClient {
let serviceClient: IotJobsClient = new IotJobsClient();
serviceClient.mqttAdapter = new service_client_mqtt_adapter.ServiceClientMqtt5Adapter(client);
return serviceClient;
}
/**
* Subscribes to JobExecutionsChanged notifications for a given IoT thing.

@@ -110,3 +141,3 @@ *

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}

@@ -159,3 +190,3 @@

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}

@@ -209,3 +240,3 @@

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}

@@ -258,3 +289,3 @@

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}

@@ -308,3 +339,3 @@

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}

@@ -358,3 +389,3 @@

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}

@@ -388,3 +419,3 @@

topic = topic.replace("{jobId}", request.jobId);
return this.connection.publish(topic, JSON.stringify(request), qos);
return this.mqttAdapter.publish(topic, JSON.stringify(request), qos);
}

@@ -438,3 +469,3 @@

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}

@@ -467,3 +498,3 @@

topic = topic.replace("{thingName}", request.thingName);
return this.connection.publish(topic, JSON.stringify(request), qos);
return this.mqttAdapter.publish(topic, JSON.stringify(request), qos);
}

@@ -516,3 +547,3 @@

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}

@@ -565,3 +596,3 @@

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}

@@ -614,3 +645,3 @@

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}

@@ -643,3 +674,3 @@

topic = topic.replace("{thingName}", request.thingName);
return this.connection.publish(topic, JSON.stringify(request), qos);
return this.mqttAdapter.publish(topic, JSON.stringify(request), qos);
}

@@ -673,5 +704,5 @@

topic = topic.replace("{jobId}", request.jobId);
return this.connection.publish(topic, JSON.stringify(request), qos);
return this.mqttAdapter.publish(topic, JSON.stringify(request), qos);
}
}

@@ -9,7 +9,2 @@ /*

/**
* @packageDocumentation
* @module aws-iot-device-sdk
*/
/**
* A value indicating the kind of error encountered while processing an AWS IoT Jobs request

@@ -16,0 +11,0 @@ *

@@ -10,8 +10,10 @@ /*

* @packageDocumentation
* @module aws-iot-device-sdk
* @module shadow
*/
import * as model from "./model";
import { mqtt } from "aws-crt";
import { mqtt, mqtt5 } from "aws-crt";
import { TextDecoder } from "util";
import * as service_client_mqtt_adapter from "../service_client_mqtt_adapter";
export { model };

@@ -48,2 +50,5 @@

// @ts-ignore
private mqttAdapter: service_client_mqtt_adapter.IServiceClientMqttAdapter;
private decoder = new TextDecoder('utf-8');

@@ -61,6 +66,32 @@

constructor(private connection: mqtt.MqttClientConnection) {
constructor(connection?: mqtt.MqttClientConnection) {
if (connection !== undefined) {
this.mqttAdapter = new service_client_mqtt_adapter.ServiceClientMqtt311Adapter(connection);
}
}
/**
* Creates a new IotShadowClient that uses the SDK Mqtt5 client internally.
*
* The pre-existing constructor that is bound to the MQTT311 client makes this awkward since we
* must support
*
* ```
* new IotShadowClient(mqtt311connection);
* ```
*
* for backwards compatibility, but still want to be able to inject an MQTT5 client as well.
*
* @param client the MQTT5 client to use with this service client
*
* @returns a new IotShadowClient instance
*/
static newFromMqtt5Client(client: mqtt5.Mqtt5Client) : IotShadowClient {
let serviceClient: IotShadowClient = new IotShadowClient();
serviceClient.mqttAdapter = new service_client_mqtt_adapter.ServiceClientMqtt5Adapter(client);
return serviceClient;
}
/**
* Subscribes to the rejected topic for the UpdateShadow operation

@@ -110,3 +141,3 @@ *

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}

@@ -159,3 +190,3 @@

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}

@@ -209,3 +240,3 @@

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}

@@ -259,3 +290,3 @@

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}

@@ -288,3 +319,3 @@

topic = topic.replace("{thingName}", request.thingName);
return this.connection.publish(topic, JSON.stringify(request), qos);
return this.mqttAdapter.publish(topic, JSON.stringify(request), qos);
}

@@ -318,3 +349,3 @@

topic = topic.replace("{thingName}", request.thingName);
return this.connection.publish(topic, JSON.stringify(request), qos);
return this.mqttAdapter.publish(topic, JSON.stringify(request), qos);
}

@@ -367,3 +398,3 @@

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}

@@ -416,3 +447,3 @@

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}

@@ -466,3 +497,3 @@

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}

@@ -516,3 +547,3 @@

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}

@@ -565,3 +596,3 @@

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}

@@ -595,3 +626,3 @@

topic = topic.replace("{thingName}", request.thingName);
return this.connection.publish(topic, JSON.stringify(request), qos);
return this.mqttAdapter.publish(topic, JSON.stringify(request), qos);
}

@@ -645,3 +676,3 @@

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}

@@ -694,3 +725,3 @@

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}

@@ -743,3 +774,3 @@

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}

@@ -772,3 +803,3 @@

topic = topic.replace("{thingName}", request.thingName);
return this.connection.publish(topic, JSON.stringify(request), qos);
return this.mqttAdapter.publish(topic, JSON.stringify(request), qos);
}

@@ -801,3 +832,3 @@

topic = topic.replace("{thingName}", request.thingName);
return this.connection.publish(topic, JSON.stringify(request), qos);
return this.mqttAdapter.publish(topic, JSON.stringify(request), qos);
}

@@ -850,3 +881,3 @@

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}

@@ -900,3 +931,3 @@

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}

@@ -930,3 +961,3 @@

topic = topic.replace("{thingName}", request.thingName);
return this.connection.publish(topic, JSON.stringify(request), qos);
return this.mqttAdapter.publish(topic, JSON.stringify(request), qos);
}

@@ -980,3 +1011,3 @@

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}

@@ -1030,5 +1061,5 @@

return this.connection.subscribe(topic, qos, on_message);
return this.mqttAdapter.subscribe(topic, qos, on_message);
}
}

@@ -8,8 +8,3 @@ /*

/**
* @packageDocumentation
* @module aws-iot-device-sdk
*/
/**

@@ -20,3 +15,3 @@ * Data needed to make a DeleteNamedShadow request.

*/
export interface DeleteNamedShadowRequest {
export interface DeleteNamedShadowRequest {

@@ -642,3 +637,3 @@ /**

/**
* The time the response was generated by AWS IoT.
* The time the response was generated by AWS IoT.
*

@@ -664,1 +659,2 @@ */

}
{
"name": "aws-iot-device-sdk-v2",
"version": "1.8.11",
"version": "1.9.0",
"description": "NodeJS API for the AWS IoT service",

@@ -34,4 +34,4 @@ "homepage": "https://github.com/aws/aws-iot-device-sdk-js-v2",

"dependencies": {
"aws-crt": "^1.14.8"
"aws-crt": "^1.15.5"
}
}

@@ -23,2 +23,11 @@ # AWS IoT Device SDK for JavaScript v2

## What's New
The SDK now supports MQTT5. See the [MQTT5 User Guide](https://github.com/awslabs/aws-crt-nodejs/blob/main/MQTT5-UserGuide.md)
or the API Documentation for [NodeJS](https://awslabs.github.io/aws-crt-nodejs/node/modules/mqtt5.html) or
the [browser](https://awslabs.github.io/aws-crt-nodejs/browser/modules/mqtt5.html) for more information.
MQTT5 samples can also be found for [NodeJS](https://github.com/aws/aws-iot-device-sdk-js-v2/blob/main/samples/node/pub_sub_mqtt5)
and the [browser](https://github.com/aws/aws-iot-device-sdk-js-v2/blob/main/samples/browser/pub_sub_mqtt5).
## Installation

@@ -32,3 +41,2 @@

* CMake 3.1+
* `libssl-dev` or `openssl-dev` (on Linux)

@@ -53,9 +61,10 @@ [Step-by-step instructions](./documents/PREREQUISITES.md)

cd sdk-workspace
# Clone the repository to access the samples.
git clone --recursive https://github.com/aws/aws-iot-device-sdk-js-v2.git
# Ensure all submodules are properly updated.
git clone https://github.com/aws/aws-iot-device-sdk-js-v2.git
# Install the SDK.
cd aws-iot-device-sdk-js-v2
git submodule update --init --recursive
# Install the SDK.
npm install
# Then you can run the samples following the instructions in the samples README.

@@ -91,3 +100,3 @@ ```

[Samples README](samples)
[Samples README](samples/README.md)

@@ -103,2 +112,3 @@ ## Getting Help

* Our [Developer Guide](https://docs.aws.amazon.com/iot/latest/developerguide/what-is-aws-iot.html) ([source](https://github.com/awsdocs/aws-iot-docs))
* [MQTT5 User Guide](https://github.com/awslabs/aws-crt-nodejs/blob/main/MQTT5-UserGuide.md)
* Check for similar [Issues](https://github.com/aws/aws-iot-device-sdk-js-v2/issues)

@@ -105,0 +115,0 @@ * [AWS IoT Core Documentation](https://docs.aws.amazon.com/iot/)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc