diff --git a/README.md b/README.md index 3c92448..200fcbb 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ const { EventHubClient } = require('azure-event-hubs'); const client = EventHubClient.createFromConnectionString(process.env["EVENTHUB_CONNECTION_STRING"], process.env["EVENTHUB_NAME"]); -function async main() { +async function main() { const partitionIds = await client.getPartitionIds(); } @@ -69,16 +69,16 @@ const { EventHubClient, EventPosition } = require('azure-event-hubs'); const client = EventHubClient.createFromConnectionString(process.env["EVENTHUB_CONNECTION_STRING"], process.env["EVENTHUB_NAME"]); -function async main() { +async function main() { const onError = (err) => { console.log("An error occurred on the receiver ", err); - }); + }; const onMessage = (eventData) => { console.log(eventData.body); const enqueuedTime = eventData.annotations["x-opt-enqueued-time"]; console.log("Enqueued Time: ", enqueuedTime); - }); + }; const receiveHandler = client.receive("1", onMessage, onError, { eventPosition: EventPosition.fromEnqueuedTime(Date.now()) }); @@ -100,7 +100,7 @@ const { EventHubClient, EventPosition } = require('azure-event-hubs'); const client = EventHubClient.createFromConnectionString(process.env["EVENTHUB_CONNECTION_STRING"], process.env["EVENTHUB_NAME"]); -function async main() { +async function main() { const datas = await receiver.receiveBatch("1", 100 /*number of events*/, 20 /*amount of time in seconds the receiver should run. Default 60 seconds.*/, { eventPosition: EventPosition.fromEnqueuedTime(Date.now()) }); console.log("Array of EventData objects", datas); } @@ -119,7 +119,7 @@ const { EventHubClient, EventPosition } = require('azure-event-hubs'); const client = EventHubClient.createFromConnectionString(process.env["EVENTHUB_CONNECTION_STRING"], process.env["EVENTHUB_NAME"]); -function async main() { +async function main() { const eventData: EventData = { body: "Hello World", partitionKey: "pk12345"}; const delivery = await client.send(eventData); console.log("message sent successfully."); @@ -139,7 +139,7 @@ const { EventHubClient, EventPosition } = require('azure-event-hubs'); const client = EventHubClient.createFromConnectionString(process.env["EVENTHUB_CONNECTION_STRING"], process.env["EVENTHUB_NAME"]); -function async main() { +async function main() { const data: EventData = { body: "Hello World 1", message_id: "343-0909-5454-23423-54543" }; const delivery = await client.send(data, "1"); console.log("message sent successfully."); @@ -159,7 +159,7 @@ const { EventHubClient, EventPosition } = require('azure-event-hubs'); const client = EventHubClient.createFromConnectionString(process.env["EVENTHUB_CONNECTION_STRING"], process.env["EVENTHUB_NAME"]); -function async main() { +async function main() { const datas = [ { body: "Hello World 1", applicationProperties: { id: "Some id" }, partitionKey: "pk786" }, { body: "Hello World 2" }, diff --git a/changelog.md b/changelog.md index e54af6b..dc82310 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,6 @@ +## 2018-04-26 0.1.2 +- Added missing dependency for `uuid` package and nit fixes in the README.md + ## 2018-04-24 0.1.1 - Changing `client.receiveOnMessage()` to `client.receive()` as that is a better naming convention and is in sync with other language sdks. diff --git a/package-lock.json b/package-lock.json index 43efe89..e4c2b13 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "azure-event-hubs", - "version": "0.1.1", + "version": "0.1.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f234d17..ecd3aec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "azure-event-hubs", - "version": "0.1.1", + "version": "0.1.2", "description": "Azure Event Hubs SDK for Node.js", "author": "Microsoft Corporation", "license": "MIT", @@ -12,9 +12,11 @@ "debug": "^3.1.0", "ms-rest": "^2.3.3", "ms-rest-azure": "^2.5.5", - "rhea": "^0.2.12" + "rhea": "^0.2.12", + "uuid": "^3.2.1" }, "devDependencies": { + "@types/uuid": "^3.4.3", "@types/async-lock": "^1.1.0", "@types/debug": "^0.0.30", "@types/node": "^8.0.37",