From 8070b91d39ebe0806fecade887797788163d503d Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Wed, 15 Feb 2017 09:41:04 -0800 Subject: [PATCH] WIP --- ably/ably-tests.ts | 14 +++++++------- amplify/amplify-tests.ts | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ably/ably-tests.ts b/ably/ably-tests.ts index cdc0db5ef3..0f84e533a7 100644 --- a/ably/ably-tests.ts +++ b/ably/ably-tests.ts @@ -47,7 +47,7 @@ channel.publish('greeting', 'Hello World!', function(err) { } else { console.log('publish succeeded'); } -}) +}); // Publish several messages at once channel.publish([{name: 'greeting', data: 'Hello World!'}], function() { }); @@ -64,7 +64,7 @@ channel.history(function(err, messagesPage) { }); // Can optionally take an options param, see https://www.ably.io/documentation/rest-api/#message-history -channel.history({ start: Date.now()-10000, end: Date.now(), limit: 100, direction: 'forwards'}, function(err, messagesPage) { +channel.history({ start: Date.now() - 10000, end: Date.now(), limit: 100, direction: 'forwards'}, function(err, messagesPage) { console.log(messagesPage.items.length); }); @@ -108,7 +108,7 @@ channel.presence.history(function(err, messagesPage) { // PaginatedResult }); // Can optionally take an options param, see https://www.ably.io/documentation/rest-api/#message-history -channel.history({ start: Date.now()-10000, end: Date.now(), limit: 100, direction: 'forwards' }, function(err, messagesPage) {}); +channel.history({ start: Date.now() - 10000, end: Date.now(), limit: 100, direction: 'forwards' }, function(err, messagesPage) {}); // Symmetrical end-to-end encrypted payloads on a channel @@ -117,7 +117,7 @@ channel.history({ start: Date.now()-10000, end: Date.now(), limit: 100, directio // Generate a random 256-bit key for demonstration purposes (in // practice you need to create one and distribute it to clients yourselves) Ably.Realtime.Crypto.generateRandomKey(function(err, key) { - var channel = client.channels.get('channelName', { cipher: { key: key } }); + var channel = client.channels.get('channelName', { cipher: { key } }); channel.subscribe(function(message) { message.name; // 'name is not encrypted' @@ -149,7 +149,7 @@ restChannel.publish('greeting', 'Hello World!', function(err) { } else { console.log('publish succeeded'); } -}) +}); // Publish several messages at once restChannel.publish([{name: 'greeting', data: 'Hello World!'}], function() {}); @@ -167,7 +167,7 @@ restChannel.history(function(err, messagesPage) { }); // Can optionally take an options param, see https://www.ably.io/documentation/rest-api/#message-history -restChannel.history({ start: Date.now()-10000, end: Date.now(), limit: 100, direction: 'forwards' }, function(err, messagesPage) {}); +restChannel.history({ start: Date.now() - 10000, end: Date.now(), limit: 100, direction: 'forwards' }, function(err, messagesPage) {}); // Presence on a channel @@ -192,7 +192,7 @@ restChannel.presence.history(function(err, messagesPage) { // PaginatedResult }); // Can optionally take an options param, see https://www.ably.io/documentation/rest-api/#message-history -restChannel.history({ start: Date.now()-10000, end: Date.now(), limit: 100, direction: 'forwards' }, function(err, messagesPage) {}); +restChannel.history({ start: Date.now() - 10000, end: Date.now(), limit: 100, direction: 'forwards' }, function(err, messagesPage) {}); // Generate Token and Token Request diff --git a/amplify/amplify-tests.ts b/amplify/amplify-tests.ts index f844642b8e..64e1f4791b 100644 --- a/amplify/amplify-tests.ts +++ b/amplify/amplify-tests.ts @@ -108,14 +108,14 @@ amplify.request("ajaxExample2", function (data) { // a second call will result in pulling from the cache amplify.request("ajaxExample2", function (data) { data.baz; // qux -}) +}); // Set up and use a RESTful request utilizing Ajax amplify.request.define("ajaxRESTFulExample", "ajax", { url: "/myRestFulApi/{type}/{id}", type: "GET" -}) +}); // later in code amplify.request("ajaxRESTFulExample", @@ -132,9 +132,9 @@ amplify.request("ajaxRESTFulExample", // POST data with Ajax amplify.request.define("ajaxPostExample", "ajax", { - url: "/myRestFulApi", - type: "POST" - }) + url: "/myRestFulApi", + type: "POST" +}); // later in code amplify.request("ajaxPostExample",