kwikdesk-partner-node
Advanced tools
Comparing version 0.0.0 to 0.0.1
@@ -17,10 +17,10 @@ /* Copyright (c) 2014 Chico Charlesworth, MIT License */ | ||
Kwikdesk.message = function (token, content, ttl, secure, cb) { | ||
Kwikdesk.message = function (token, participantToken, content, ttl, secure, cb) { | ||
var message = new Message({'content': content, 'delete': ttl, 'private': secure}); | ||
message.save(token, cb); | ||
message.save(token, participantToken, cb); | ||
}; | ||
Kwikdesk.channel = function (token, cb) { | ||
Kwikdesk.channel = function (token, participantToken, cb) { | ||
var channel = new Channel(); | ||
channel.execute(token, cb); | ||
channel.execute(token, participantToken, cb); | ||
}; | ||
@@ -27,0 +27,0 @@ |
@@ -57,3 +57,3 @@ /* Copyright (c) 2014 Chico Charlesworth, MIT License */ | ||
Message.prototype.save = function (token, cb) { | ||
Message.prototype.save = function (token, participantToken, cb) { | ||
cb = cb || noop; | ||
@@ -65,3 +65,3 @@ | ||
url: 'https://platform.kwikdesk.com/messages', | ||
headers: {"X-API-Token": token}, | ||
headers: {"X-API-Token": token, "X-Participant-Token": participantToken}, | ||
body: serialize(this), | ||
@@ -68,0 +68,0 @@ json: true |
{ | ||
"name": "kwikdesk-partner-node", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"description": "KwikDesk Partner API Node Client Library", | ||
@@ -5,0 +5,0 @@ "main": "lib/client.js", |
@@ -26,3 +26,3 @@ # KwikDesk Partner API Node Client | ||
```javascript | ||
Kwikdesk.message(token, "This is a private message on a secure channel", 1440, true, function (err, response) { | ||
Kwikdesk.message(token, participantToken, "This is a private message on a secure channel", 1440, true, function (err, response) { | ||
console.log(response.message); | ||
@@ -35,3 +35,3 @@ }); | ||
```javascript | ||
Kwikdesk.channel(token, function (err, results) { | ||
Kwikdesk.channel(token, participantToken, function (err, results) { | ||
console.dir(results); | ||
@@ -38,0 +38,0 @@ }); |
@@ -15,7 +15,7 @@ /* Copyright (c) 2014 Chico Charlesworth, MIT License */ | ||
console.log("\nGet token"); | ||
Kwikdesk.token("my-app", function (err, token) { | ||
Kwikdesk.token("my-app", function (err, token, participantToken) { | ||
if (err) {return done(err);} | ||
console.log("Posting message with token " + token); | ||
Kwikdesk.message(token, "This is a private message on a secure channel #random" + Math.floor(Math.random()*100000001), 1440, true, function (err, response) { | ||
console.log("Posting message with token " + token + " and participant token " + participantToken); | ||
Kwikdesk.message(token, participantToken, "This is a private message on a secure channel #random" + Math.floor(Math.random()*100000001), 1440, true, function (err, response) { | ||
if (err) {return done(err);} | ||
@@ -25,3 +25,3 @@ console.log(response.message); | ||
console.log("Channel messages:"); | ||
Kwikdesk.channel(token, function (err, results) { | ||
Kwikdesk.channel(token, participantToken, function (err, results) { | ||
if (err) {return done(err);} | ||
@@ -28,0 +28,0 @@ console.dir(results); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8090