Permalink
Browse files

add sendTile/Toast, add test, udpate mocks

  • Loading branch information...
tjanczuk committed Feb 20, 2013
1 parent b1ff948 commit 42a5aa282bdead8016d13702d3f647428bcacc8d
Showing with 665 additions and 528 deletions.
  1. +50 −0 lib/wns.js
  2. +9 −9 test/nock/Badge-success.js
  3. +9 −9 test/nock/Raw-success.js
  4. +9 −9 test/nock/Send-success.js
  5. +9 −9 test/nock/SendToastText01WithAudioAndToastOptions-success.js
  6. +9 −9 test/nock/TileSquareBlock-success.js
  7. +9 −9 test/nock/TileSquareImage-success.js
  8. +9 −9 test/nock/TileSquarePeekImageAndText01-success.js
  9. +9 −9 test/nock/TileSquarePeekImageAndText02-success.js
  10. +9 −9 test/nock/TileSquarePeekImageAndText03-success.js
  11. +9 −9 test/nock/TileSquarePeekImageAndText04-success.js
  12. +9 −9 test/nock/TileSquareText01-success.js
  13. +9 −9 test/nock/TileSquareText02-success.js
  14. +9 −9 test/nock/TileSquareText03-success.js
  15. +9 −9 test/nock/TileSquareText04-success.js
  16. +9 −9 test/nock/TileWideBlockAndText01-success.js
  17. +9 −9 test/nock/TileWideBlockAndText02-success.js
  18. +9 −9 test/nock/TileWideImage-success.js
  19. +9 −9 test/nock/TileWideImageAndText01-success.js
  20. +9 −9 test/nock/TileWideImageAndText02-success.js
  21. +9 −9 test/nock/TileWideImageCollection-success.js
  22. +9 −9 test/nock/TileWidePeekImage01-success.js
  23. +9 −9 test/nock/TileWidePeekImage02-success.js
  24. +9 −9 test/nock/TileWidePeekImage03-success.js
  25. +9 −9 test/nock/TileWidePeekImage04-success.js
  26. +9 −9 test/nock/TileWidePeekImage05-success.js
  27. +9 −9 test/nock/TileWidePeekImage06-success.js
  28. +9 −9 test/nock/TileWidePeekImageAndText01-success.js
  29. +9 −9 test/nock/TileWidePeekImageAndText02-success.js
  30. +9 −9 test/nock/TileWidePeekImageCollection01-success.js
  31. +9 −9 test/nock/TileWidePeekImageCollection02-success.js
  32. +9 −9 test/nock/TileWidePeekImageCollection03-success.js
  33. +9 −9 test/nock/TileWidePeekImageCollection04-success.js
  34. +9 −9 test/nock/TileWidePeekImageCollection05-success.js
  35. +9 −9 test/nock/TileWidePeekImageCollection06-success.js
  36. +9 −9 test/nock/TileWideSmallImageAndText01-success.js
  37. +9 −9 test/nock/TileWideSmallImageAndText02-success.js
  38. +9 −9 test/nock/TileWideSmallImageAndText03-success.js
  39. +9 −9 test/nock/TileWideSmallImageAndText04-success.js
  40. +9 −9 test/nock/TileWideSmallImageAndText05-success.js
  41. +9 −9 test/nock/TileWideText01-success.js
  42. +9 −9 test/nock/TileWideText02-success.js
  43. +9 −9 test/nock/TileWideText03-success.js
  44. +9 −9 test/nock/TileWideText04-success.js
  45. +9 −9 test/nock/TileWideText05-success.js
  46. +9 −9 test/nock/TileWideText06-success.js
  47. +9 −9 test/nock/TileWideText07-success.js
  48. +9 −9 test/nock/TileWideText08-success.js
  49. +9 −9 test/nock/TileWideText09-success.js
  50. +9 −9 test/nock/TileWideText10-success.js
  51. +9 −9 test/nock/TileWideText11-success.js
  52. +9 −9 test/nock/ToastImageAndText01-success.js
  53. +9 −9 test/nock/ToastImageAndText02-success.js
  54. +9 −9 test/nock/ToastImageAndText03-success.js
  55. +9 −9 test/nock/ToastImageAndText04-success.js
  56. +9 −9 test/nock/ToastText01-success.js
  57. +9 −9 test/nock/ToastText02-success.js
  58. +9 −9 test/nock/ToastText03-success.js
  59. +9 −9 test/nock/ToastText04-success.js
  60. +19 −0 test/nock/sendTile-success.js
  61. +19 −0 test/nock/sendToast-success.js
  62. +3 −3 test/notify_success.js
  63. +52 −3 test/success.js
View
@@ -365,6 +365,56 @@ exports.sendRaw = function () {
return exports.send(channel, payload, 'wns/raw', options, callback);
}
+// Send a tile or toast with multiple bindings to a WNS channel
+// signature: (type, channel, payload+, [options], [callback])
+// type - [required] 'tile' or 'toast'
+// channel - [required] channel URI to send notification to
+// payload - [required] one or more bindings specified as XML strings or JSON objects
+// options - [optional] same as options for wns.send and wns.createTile combined into one object
+// callback - [optional] same as callback for wns.send
+var sendTileOrToast = function () {
+ var type = Array.prototype.shift.apply(arguments);
+ var channel = Array.prototype.shift.apply(arguments);
+ var callback;
+ if (arguments.length > 0 && typeof arguments[arguments.length - 1] === 'function'){
+ callback = arguments[arguments.length - 1];
+ Array.prototype.splice.call(arguments, -1, 1);
+ }
+
+ var options;
+ if (arguments.length > 0 && typeof arguments[arguments.length - 1] === 'object'
+ && arguments[arguments.length - 1].type === undefined) {
+ options = arguments[arguments.length - 1];
+ }
+
+ Array.prototype.unshift.call(arguments, type);
+ var payload = createTileOrToast.apply(this, arguments);
+
+ return exports.send(channel, payload, 'wns/' + type, options, callback);
+};
+
+// Send a tile with multiple bindings to a WNS channel
+// signature: (channel, payload+, [options], [callback])
+// channel - [required] channel URI to send notification to
+// payload - [required] one or more bindings specified as XML strings or JSON objects
+// options - [optional] same as options for wns.send and wns.createTile combined into one object
+// callback - [optional] same as callback for wns.send
+exports.sendTile = function () {
+ Array.prototype.unshift.call(arguments, 'tile');
+ return sendTileOrToast.apply(this, arguments);
+};
+
+// Send a toast with multiple bindings to a WNS channel
+// signature: (channel, payload+, [options], [callback])
+// channel - [required] channel URI to send notification to
+// payload - [required] one or more bindings specified as XML strings or JSON objects
+// options - [optional] same as options for wns.send and wns.createTile combined into one object
+// callback - [optional] same as callback for wns.send
+exports.sendToast = function () {
+ Array.prototype.unshift.call(arguments, 'toast');
+ return sendTileOrToast.apply(this, arguments);
+};
+
// Low level API to send any pre-formatted string notification payload to a WNS channel
// signature: (channel, payload, type, [options], [callback])
// channel - [required] channel URI to send notification to
View
@@ -1,19 +1,19 @@
exports.setupMockScopes = function (nock) { var scopes = []; var scope; scope =
nock('https://login.live.com:443')
- .post('/accesstoken.srf', "grant_type=client_credentials&client_id=ms-app%3A%2F%2Fs-1-15-2-3004590818-3540041580-1964567292-460813795-2327965118-1902784169-2945106848&client_secret=N3icDsX5JXArJJR6AdTQZ86RITXQnMmA&scope=notify.windows.com")
- .reply(200, "{\"token_type\":\"bearer\",\"access_token\":\"EgAfAQMAAAAEgAAACoAA+qnPqIaSGmBQGEypjXNAXkDNsEhg+TDHJkrOlM+ARbP37FrpvMV8pk7O1QNwzDZJsHpfKqtBMUyHjfaGwBUtK5KmMH9O2An4tnGuqt6PNur6Fc0PnkieVlfYM3bUgJN3TC26FRFx9Q1fZqtyMNB4hqmtbvXRsDFIFEUMnTXrvQWOAFoAjgAAAAAAys8LTInz4E+J8+BP60gEABAAMTMxLjEwNy4xNzQuMjQ4AAAAAABeAG1zLWFwcDovL3MtMS0xNS0yLTMwMDQ1OTA4MTgtMzU0MDA0MTU4MC0xOTY0NTY3MjkyLTQ2MDgxMzc5NS0yMzI3OTY1MTE4LTE5MDI3ODQxNjktMjk0NTEwNjg0OAA=\"}", { 'cache-control': 'no-store',
- 'content-length': '425',
+ .post('/accesstoken.srf', "grant_type=client_credentials&client_id=ms-app%3A%2F%2Fs-1-15-2-145565886-1510793020-2797717260-1526195933-3912359816-44086043-2211002316&client_secret=FF9yfJLxSH3uI32wNKGye643bAZ4zBz7&scope=notify.windows.com")
+ .reply(200, "{\"token_type\":\"bearer\",\"access_token\":\"EgAaAQMAAAAEgAAACoAA+Ays5tUe06g0m6+HyN0KSOp/ljf7BUTsqyKNPvYo0XLl29h5s/bm55aJOcS4RkUQFrWINYMVEqABeH9J9HcVtDCjisZnDCBhh9P+3vc9R+k09eM2bdlt90b8oq5MAafzv5BvHN66jFykHb/1HZutczxffmhsY6GpzO15yKj+w0SJAFoAiQAAAAAAaoEORM1JJFHNSSRR60gEAA0ANjcuMTg1LjE0OC44AAAAAABcAG1zLWFwcDovL3MtMS0xNS0yLTE0NTU2NTg4Ni0xNTEwNzkzMDIwLTI3OTc3MTcyNjAtMTUyNjE5NTkzMy0zOTEyMzU5ODE2LTQ0MDg2MDQzLTIyMTEwMDIzMTYA\",\"expires_in\":86400}", { 'cache-control': 'no-store',
+ 'content-length': '436',
'content-type': 'application/json',
server: 'Microsoft-IIS/7.5',
- ppserver: 'PPV: 30 H: BAYIDSLGN1E28 V: 0',
- date: 'Tue, 19 Jun 2012 21:47:52 GMT',
+ ppserver: 'PPV: 30 H: BAYIDSLGN1F01 V: 0',
+ date: 'Wed, 20 Feb 2013 03:58:05 GMT',
connection: 'close' });
scopes.push(scope);scope =
nock('https://bn1.notify.windows.com:443')
- .post('/?token=AgUAAACQRWJECxiyMVoNBsJefU%2bZypA7bASncWnSeSP9WA2zBXKnyb1%2fWUCg%2bTr7%2fspFEBK0b25eCDYgxdjVq%2bCoqqz6P68y6uLsnlnDtRbig9dzDWM30D5BNI7PmG7H7vsgCSU%3d', "<badge value=\"alert\" version=\"1\"/>")
+ .post('/?token=AgYAAACFGdWBiRCTypHebfvngI7DuNBXWuGjdiczDOZ7bSgkbCRrD2M1b10CpzCmipzknHbU4nLzapQbooXzJ%2fVwHAfSl%2fWMk8OsetohEVMlsIicoLP99rDg7g2AdENA99DZoAU%3d', "<badge value=\"alert\" version=\"1\"/>")
.reply(200, "", { 'content-length': '0',
'x-wns-notificationstatus': 'received',
- 'x-wns-msg-id': '23C925E76874C018',
- 'x-wns-debug-trace': 'BN1WNS1011834',
- date: 'Tue, 19 Jun 2012 21:47:53 GMT' });
+ 'x-wns-msg-id': '239010302BCD93DF',
+ 'x-wns-debug-trace': 'BN1WNS2011532',
+ date: 'Wed, 20 Feb 2013 03:58:05 GMT' });
scopes.push(scope);return scopes; };
View
@@ -1,19 +1,19 @@
exports.setupMockScopes = function (nock) { var scopes = []; var scope; scope =
nock('https://login.live.com:443')
- .post('/accesstoken.srf', "grant_type=client_credentials&client_id=ms-app%3A%2F%2Fs-1-15-2-3004590818-3540041580-1964567292-460813795-2327965118-1902784169-2945106848&client_secret=N3icDsX5JXArJJR6AdTQZ86RITXQnMmA&scope=notify.windows.com")
- .reply(200, "{\"token_type\":\"bearer\",\"access_token\":\"EgAfAQMAAAAEgAAACoAAUj1knmBqI7AlWv9cbjrta9pN068UVLSaZ3mQaf46gdQgMEsMhwL51665N7gesqhKPfKPEVV4eaaR2dcaX8Kcl6UfAkYsCCfHRnq8L9bB79N9m5avQrNNrx1cTUS8KVg1vxsbeiCeC3gUFtuGz+P45BltJlfL/ooYaGmwA2Mxq2KOAFoAjgAAAAAAys8LTFD24E9Q9uBP60gEABAAMTMxLjEwNy4xNzQuMjQ4AAAAAABeAG1zLWFwcDovL3MtMS0xNS0yLTMwMDQ1OTA4MTgtMzU0MDA0MTU4MC0xOTY0NTY3MjkyLTQ2MDgxMzc5NS0yMzI3OTY1MTE4LTE5MDI3ODQxNjktMjk0NTEwNjg0OAA=\"}", { 'cache-control': 'no-store',
- 'content-length': '425',
+ .post('/accesstoken.srf', "grant_type=client_credentials&client_id=ms-app%3A%2F%2Fs-1-15-2-145565886-1510793020-2797717260-1526195933-3912359816-44086043-2211002316&client_secret=FF9yfJLxSH3uI32wNKGye643bAZ4zBz7&scope=notify.windows.com")
+ .reply(200, "{\"token_type\":\"bearer\",\"access_token\":\"EgAaAQMAAAAEgAAACoAAOrNVOV8gBykbF0V1rYpuU8D0+h5feuJIX1iHI9YC8b3Oqs/nPVR4duootcLOct3elJjwrJ+PpRQ1ckueVKSgBqUZnfeRqKwFXSRXLMEkHM9YzCR8oCNLCX4iEaBuwRYRrWDCJpSRvFPQuZHlCxw/bHstZIIe8nMOsuZ2ja6hZQuJAFoAiQAAAAAAaoEOROJJJFHiSSRR60gEAA0ANjcuMTg1LjE0OC44AAAAAABcAG1zLWFwcDovL3MtMS0xNS0yLTE0NTU2NTg4Ni0xNTEwNzkzMDIwLTI3OTc3MTcyNjAtMTUyNjE5NTkzMy0zOTEyMzU5ODE2LTQ0MDg2MDQzLTIyMTEwMDIzMTYA\",\"expires_in\":86400}", { 'cache-control': 'no-store',
+ 'content-length': '436',
'content-type': 'application/json',
server: 'Microsoft-IIS/7.5',
- ppserver: 'PPV: 30 H: BAYIDSLGN1F16 V: 0',
- date: 'Tue, 19 Jun 2012 21:59:43 GMT',
+ ppserver: 'PPV: 30 H: BAYIDSLGN1F23 V: 0',
+ date: 'Wed, 20 Feb 2013 03:58:25 GMT',
connection: 'close' });
scopes.push(scope);scope =
nock('https://bn1.notify.windows.com:443')
- .post('/?token=AgUAAACQRWJECxiyMVoNBsJefU%2bZypA7bASncWnSeSP9WA2zBXKnyb1%2fWUCg%2bTr7%2fspFEBK0b25eCDYgxdjVq%2bCoqqz6P68y6uLsnlnDtRbig9dzDWM30D5BNI7PmG7H7vsgCSU%3d', "abc", { 'Content-Type': 'application/octet-stream', 'X-WNS-Type': 'wns/raw'})
+ .post('/?token=AgYAAACFGdWBiRCTypHebfvngI7DuNBXWuGjdiczDOZ7bSgkbCRrD2M1b10CpzCmipzknHbU4nLzapQbooXzJ%2fVwHAfSl%2fWMk8OsetohEVMlsIicoLP99rDg7g2AdENA99DZoAU%3d', "abc")
.reply(200, "", { 'content-length': '0',
'x-wns-notificationstatus': 'received',
- 'x-wns-msg-id': '7828E60359D06CDC',
- 'x-wns-debug-trace': 'BN1WNS1011131',
- date: 'Tue, 19 Jun 2012 21:59:44 GMT' });
+ 'x-wns-msg-id': '3BE4E575385F67FE',
+ 'x-wns-debug-trace': 'BN1WNS2011532',
+ date: 'Wed, 20 Feb 2013 03:58:25 GMT' });
scopes.push(scope);return scopes; };
View
@@ -1,19 +1,19 @@
exports.setupMockScopes = function (nock) { var scopes = []; var scope; scope =
nock('https://login.live.com:443')
- .post('/accesstoken.srf', "grant_type=client_credentials&client_id=ms-app%3A%2F%2Fs-1-15-2-3004590818-3540041580-1964567292-460813795-2327965118-1902784169-2945106848&client_secret=N3icDsX5JXArJJR6AdTQZ86RITXQnMmA&scope=notify.windows.com")
- .reply(200, "{\"token_type\":\"bearer\",\"access_token\":\"EgAfAQMAAAAEgAAACoAAUj1knmBqI7AlWv9cbjrta9pN068UVLSaZ3mQaf46gdQgMEsMhwL51665N7gesqhKPfKPEVV4eaaR2dcaX8Kcl6UfAkYsCCfHRnq8L9bB79N9m5avQrNNrx1cTUS8KVg1vxsbeiCeC3gUFtuGz+P45BltJlfL/ooYaGmwA2Mxq2KOAFoAjgAAAAAAys8LTFD24E9Q9uBP60gEABAAMTMxLjEwNy4xNzQuMjQ4AAAAAABeAG1zLWFwcDovL3MtMS0xNS0yLTMwMDQ1OTA4MTgtMzU0MDA0MTU4MC0xOTY0NTY3MjkyLTQ2MDgxMzc5NS0yMzI3OTY1MTE4LTE5MDI3ODQxNjktMjk0NTEwNjg0OAA=\"}", { 'cache-control': 'no-store',
- 'content-length': '425',
+ .post('/accesstoken.srf', "grant_type=client_credentials&client_id=ms-app%3A%2F%2Fs-1-15-2-145565886-1510793020-2797717260-1526195933-3912359816-44086043-2211002316&client_secret=FF9yfJLxSH3uI32wNKGye643bAZ4zBz7&scope=notify.windows.com")
+ .reply(200, "{\"token_type\":\"bearer\",\"access_token\":\"EgAaAQMAAAAEgAAACoAA2j5nv50/LmqoVgh1PLNB5R4VrcKRi7KXUIjORdcUFGa/nlVslWjuJBhF9Tu4l8vvAI5icJaVqjORqZsMwBO7ga5OpTBNvcNtG7bJ0DShrr7ZTzRnA96aLFVC2imwh8cRFPjp0GPsmmqeolSqkm1JeGWPSyW8V5Mz/kIgdfGIEH+JAFoAiQAAAAAAaoEORPVJJFH1SSRR60gEAA0ANjcuMTg1LjE0OC44AAAAAABcAG1zLWFwcDovL3MtMS0xNS0yLTE0NTU2NTg4Ni0xNTEwNzkzMDIwLTI3OTc3MTcyNjAtMTUyNjE5NTkzMy0zOTEyMzU5ODE2LTQ0MDg2MDQzLTIyMTEwMDIzMTYA\",\"expires_in\":86400}", { 'cache-control': 'no-store',
+ 'content-length': '436',
'content-type': 'application/json',
server: 'Microsoft-IIS/7.5',
- ppserver: 'PPV: 30 H: BAYIDSLGN1F16 V: 0',
- date: 'Tue, 19 Jun 2012 21:59:43 GMT',
+ ppserver: 'PPV: 30 H: BAYIDSLGN1F37 V: 0',
+ date: 'Wed, 20 Feb 2013 03:58:45 GMT',
connection: 'close' });
scopes.push(scope);scope =
nock('https://bn1.notify.windows.com:443')
- .post('/?token=AgUAAACQRWJECxiyMVoNBsJefU%2bZypA7bASncWnSeSP9WA2zBXKnyb1%2fWUCg%2bTr7%2fspFEBK0b25eCDYgxdjVq%2bCoqqz6P68y6uLsnlnDtRbig9dzDWM30D5BNI7PmG7H7vsgCSU%3d', "<tile><visual><binding template=\"TileSquareBlock\"><text id=\"1\">http://textParam1.com</text><text id=\"2\">http://textParam2.com</text></binding></visual></tile>")
+ .post('/?token=AgYAAACFGdWBiRCTypHebfvngI7DuNBXWuGjdiczDOZ7bSgkbCRrD2M1b10CpzCmipzknHbU4nLzapQbooXzJ%2fVwHAfSl%2fWMk8OsetohEVMlsIicoLP99rDg7g2AdENA99DZoAU%3d', "<tile><visual><binding template=\"TileSquareBlock\"><text id=\"1\">http://textParam1.com</text><text id=\"2\">http://textParam2.com</text></binding></visual></tile>")
.reply(200, "", { 'content-length': '0',
'x-wns-notificationstatus': 'received',
- 'x-wns-msg-id': '7828E60359D06CDC',
- 'x-wns-debug-trace': 'BN1WNS1011131',
- date: 'Tue, 19 Jun 2012 21:59:44 GMT' });
+ 'x-wns-msg-id': '45DC47913C88B26E',
+ 'x-wns-debug-trace': 'BN1WNS2011530',
+ date: 'Wed, 20 Feb 2013 03:58:45 GMT' });
scopes.push(scope);return scopes; };
@@ -1,19 +1,19 @@
exports.setupMockScopes = function (nock) { var scopes = []; var scope; scope =
nock('https://login.live.com:443')
- .post('/accesstoken.srf', "grant_type=client_credentials&client_id=ms-app%3A%2F%2Fs-1-15-2-3004590818-3540041580-1964567292-460813795-2327965118-1902784169-2945106848&client_secret=N3icDsX5JXArJJR6AdTQZ86RITXQnMmA&scope=notify.windows.com")
- .reply(200, "{\"token_type\":\"bearer\",\"access_token\":\"EgAfAQMAAAAEgAAACoAATfd5j9D1pkXsVybLNJx71pgoIlbl2teVxIXzOHJjJbulDrrDieBPc+1Wu49ewv81bAiPako5cLhp87wLzBSiGPIN0Aj3+mckRaSguNcKkCzPJ4O5YmoLxSwFKVpQcw5r5+dSAXxvnWtv2P3a3eB/1+mOeQeHCbWFmgmT8vbQkdWOAFoAjgAAAAAAys8LTEBy4k9AcuJP60gEABAAMTMxLjEwNy4xNzQuMjQ4AAAAAABeAG1zLWFwcDovL3MtMS0xNS0yLTMwMDQ1OTA4MTgtMzU0MDA0MTU4MC0xOTY0NTY3MjkyLTQ2MDgxMzc5NS0yMzI3OTY1MTE4LTE5MDI3ODQxNjktMjk0NTEwNjg0OAA=\"}", { 'cache-control': 'no-store',
- 'content-length': '425',
+ .post('/accesstoken.srf', "grant_type=client_credentials&client_id=ms-app%3A%2F%2Fs-1-15-2-145565886-1510793020-2797717260-1526195933-3912359816-44086043-2211002316&client_secret=FF9yfJLxSH3uI32wNKGye643bAZ4zBz7&scope=notify.windows.com")
+ .reply(200, "{\"token_type\":\"bearer\",\"access_token\":\"EgAaAQMAAAAEgAAACoAAthLhpiAnq28mv/cy7eyJOn6G2hUkhuCvrVB93anVYpnsltQ6MEvv6Xr/nXW5AIR27b+IyF/KYedDEE+2NOBgMAVAlnYMoPg+DI1OmtP/Eu4fowNZF9p/ME76OEAE1vy7IybdYYsj8cF7gnxgckg+uLH3oDrz6qM21WZRoSREGlGJAFoAiQAAAAAAaoEORCVKJFElSiRR60gEAA0ANjcuMTg1LjE0OC44AAAAAABcAG1zLWFwcDovL3MtMS0xNS0yLTE0NTU2NTg4Ni0xNTEwNzkzMDIwLTI3OTc3MTcyNjAtMTUyNjE5NTkzMy0zOTEyMzU5ODE2LTQ0MDg2MDQzLTIyMTEwMDIzMTYA\",\"expires_in\":86400}", { 'cache-control': 'no-store',
+ 'content-length': '436',
'content-type': 'application/json',
server: 'Microsoft-IIS/7.5',
- ppserver: 'PPV: 30 H: BAYIDSLGN1Q29 V: 0',
- date: 'Thu, 21 Jun 2012 01:00:48 GMT',
+ ppserver: 'PPV: 30 H: BAYIDSLGN2G030 V: 0',
+ date: 'Wed, 20 Feb 2013 03:59:32 GMT',
connection: 'close' });
scopes.push(scope);scope =
nock('https://bn1.notify.windows.com:443')
- .post('/?token=AgUAAACQRWJECxiyMVoNBsJefU%2bZypA7bASncWnSeSP9WA2zBXKnyb1%2fWUCg%2bTr7%2fspFEBK0b25eCDYgxdjVq%2bCoqqz6P68y6uLsnlnDtRbig9dzDWM30D5BNI7PmG7H7vsgCSU%3d', "<toast duration=\"long\" launch=\"some random parameter passed to the application\"><visual><binding template=\"ToastText01\"><text id=\"1\">A toast!</text></binding></visual><audio src=\"ms-winsoundevent:Notification.Alarm\" loop=\"true\"/></toast>")
+ .post('/?token=AgYAAACFGdWBiRCTypHebfvngI7DuNBXWuGjdiczDOZ7bSgkbCRrD2M1b10CpzCmipzknHbU4nLzapQbooXzJ%2fVwHAfSl%2fWMk8OsetohEVMlsIicoLP99rDg7g2AdENA99DZoAU%3d', "<toast duration=\"long\" launch=\"some random parameter passed to the application\"><visual><binding template=\"ToastText01\"><text id=\"1\">A toast!</text></binding></visual><audio src=\"ms-winsoundevent:Notification.Alarm\" loop=\"true\"/></toast>")
.reply(200, "", { 'content-length': '0',
'x-wns-notificationstatus': 'received',
- 'x-wns-msg-id': '33F71B204DAA6CF0',
- 'x-wns-debug-trace': 'BN1WNS1011838',
- date: 'Thu, 21 Jun 2012 01:00:49 GMT' });
+ 'x-wns-msg-id': '7CFCFDFF27001588',
+ 'x-wns-debug-trace': 'BN1WNS1011735',
+ date: 'Wed, 20 Feb 2013 03:59:34 GMT' });
scopes.push(scope);return scopes; };
@@ -1,19 +1,19 @@
exports.setupMockScopes = function (nock) { var scopes = []; var scope; scope =
nock('https://login.live.com:443')
- .post('/accesstoken.srf', "grant_type=client_credentials&client_id=ms-app%3A%2F%2Fs-1-15-2-3004590818-3540041580-1964567292-460813795-2327965118-1902784169-2945106848&client_secret=N3icDsX5JXArJJR6AdTQZ86RITXQnMmA&scope=notify.windows.com")
- .reply(200, "{\"token_type\":\"bearer\",\"access_token\":\"EgAfAQMAAAAEgAAACoAAJyqEhdhvwx7KEYHgzMdnCsmhuA9rH1/Yi5unfMzUTjicY0e5o8fopC2m6RYFMo9ovW97vxvj/lt1eAHW/3ksxQ+92Jo0HfnzUu2ZST43Bf641gXRMGTi67BvA0PaVgKI5hjVvhYgWmIwqICvfFP/Tqy+EyjCA4QWxES2ffP5TlmOAFoAjgAAAAAAys8LTKPl4E+j5eBP60gEABAAMTMxLjEwNy4xNzQuMjQ4AAAAAABeAG1zLWFwcDovL3MtMS0xNS0yLTMwMDQ1OTA4MTgtMzU0MDA0MTU4MC0xOTY0NTY3MjkyLTQ2MDgxMzc5NS0yMzI3OTY1MTE4LTE5MDI3ODQxNjktMjk0NTEwNjg0OAA=\"}", { 'cache-control': 'no-store',
- 'content-length': '425',
+ .post('/accesstoken.srf', "grant_type=client_credentials&client_id=ms-app%3A%2F%2Fs-1-15-2-145565886-1510793020-2797717260-1526195933-3912359816-44086043-2211002316&client_secret=FF9yfJLxSH3uI32wNKGye643bAZ4zBz7&scope=notify.windows.com")
+ .reply(200, "{\"token_type\":\"bearer\",\"access_token\":\"EgAaAQMAAAAEgAAACoAAjIbTx8h986szWfACFJaf51smKCHFAazqH2ucwlVKy1UK+6Hep4IEvkQ912/EJWr6OurgHBUvFQEJXs+OoU5fU5aFNwvtu68MG3LaayAEojC56WbdMYQbUz12qxHN2wjLSoFm+qAwIvEkOajC/DjLVwnADXjWTUhsH8EJBo0DMmCJAFoAiQAAAAAAaoEORNRKJFHUSiRR60gEAA0ANjcuMTg1LjE0OC44AAAAAABcAG1zLWFwcDovL3MtMS0xNS0yLTE0NTU2NTg4Ni0xNTEwNzkzMDIwLTI3OTc3MTcyNjAtMTUyNjE5NTkzMy0zOTEyMzU5ODE2LTQ0MDg2MDQzLTIyMTEwMDIzMTYA\",\"expires_in\":86400}", { 'cache-control': 'no-store',
+ 'content-length': '436',
'content-type': 'application/json',
server: 'Microsoft-IIS/7.5',
- ppserver: 'PPV: 30 H: BAYIDSLGN1K58 V: 0',
- date: 'Tue, 19 Jun 2012 20:48:35 GMT',
+ ppserver: 'PPV: 30 H: BAYIDSLGN1P52 V: 0',
+ date: 'Wed, 20 Feb 2013 04:02:28 GMT',
connection: 'close' });
scopes.push(scope);scope =
nock('https://bn1.notify.windows.com:443')
- .post('/?token=AgUAAACQRWJECxiyMVoNBsJefU%2bZypA7bASncWnSeSP9WA2zBXKnyb1%2fWUCg%2bTr7%2fspFEBK0b25eCDYgxdjVq%2bCoqqz6P68y6uLsnlnDtRbig9dzDWM30D5BNI7PmG7H7vsgCSU%3d', "<tile><visual><binding template=\"TileSquareBlock\"><text id=\"1\">http://textParam1.com</text><text id=\"2\">http://textParam2.com</text></binding></visual></tile>")
+ .post('/?token=AgYAAACFGdWBiRCTypHebfvngI7DuNBXWuGjdiczDOZ7bSgkbCRrD2M1b10CpzCmipzknHbU4nLzapQbooXzJ%2fVwHAfSl%2fWMk8OsetohEVMlsIicoLP99rDg7g2AdENA99DZoAU%3d', "<tile><visual><binding template=\"TileSquareBlock\"><text id=\"1\">http://textParam1.com</text><text id=\"2\">http://textParam2.com</text></binding></visual></tile>")
.reply(200, "", { 'content-length': '0',
'x-wns-notificationstatus': 'received',
- 'x-wns-msg-id': '5CC9F1F72FA4A370',
- 'x-wns-debug-trace': 'BN1WNS1011329',
- date: 'Tue, 19 Jun 2012 20:48:36 GMT' });
+ 'x-wns-msg-id': '25DA1E3768E556C3',
+ 'x-wns-debug-trace': 'BN1WNS2011733',
+ date: 'Wed, 20 Feb 2013 04:02:29 GMT' });
scopes.push(scope);return scopes; };
Oops, something went wrong.

0 comments on commit 42a5aa2

Please sign in to comment.