@webex/plugin-webhooks 3.10.0-next.2 → 3.10.0-next.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js.map +1 -1
- package/dist/webhooks.js +2 -1
- package/dist/webhooks.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_webexCore","require","_webhooks","_interopRequireDefault","registerPlugin","Webhooks","_default","exports","default"],"sources":["index.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {registerPlugin} from '@webex/webex-core';\n\nimport Webhooks from './webhooks';\n\nregisterPlugin('webhooks', Webhooks);\n\nexport default Webhooks;\n"],"mappings":";;;;;;;;AAIA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AANA;AACA;AACA;;AAMA,IAAAG,yBAAc,EAAC,UAAU,EAAEC,iBAAQ,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEtBH,iBAAQ"}
|
|
1
|
+
{"version":3,"names":["_webexCore","require","_webhooks","_interopRequireDefault","registerPlugin","Webhooks","_default","exports","default"],"sources":["index.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {registerPlugin} from '@webex/webex-core';\n\nimport Webhooks from './webhooks';\n\nregisterPlugin('webhooks', Webhooks);\n\nexport default Webhooks;\n"],"mappings":";;;;;;;;AAIA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AANA;AACA;AACA;;AAMA,IAAAG,yBAAc,EAAC,UAAU,EAAEC,iBAAQ,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEtBH,iBAAQ","ignoreList":[]}
|
package/dist/webhooks.js
CHANGED
|
@@ -20,6 +20,7 @@ var _webexCore = require("@webex/webex-core");
|
|
|
20
20
|
* @property {string} name - A user-friendly name for this webhook
|
|
21
21
|
* @property {string} created - (server generated) The date and time that the webhook was created
|
|
22
22
|
*/
|
|
23
|
+
|
|
23
24
|
/**
|
|
24
25
|
* Webhooks allow your app to be notified via HTTP when a specific event
|
|
25
26
|
* occurs on Webex. For example, your app can register a webhook to be
|
|
@@ -241,7 +242,7 @@ var Webhooks = _webexCore.WebexPlugin.extend({
|
|
|
241
242
|
return res.body;
|
|
242
243
|
});
|
|
243
244
|
},
|
|
244
|
-
version: "3.10.0-next.
|
|
245
|
+
version: "3.10.0-next.4"
|
|
245
246
|
});
|
|
246
247
|
var _default = exports.default = Webhooks;
|
|
247
248
|
//# sourceMappingURL=webhooks.js.map
|
package/dist/webhooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_webexCore","require","Webhooks","WebexPlugin","extend","create","webhook","request","method","service","resource","body","then","res","get","id","concat","items","list","options","_this","qs","Page","webex","remove","statusCode","undefined","update","version","_default","exports","default"],"sources":["webhooks.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {WebexPlugin, Page} from '@webex/webex-core';\n\n/**\n * @typedef {Object} WebhookObject\n * @property {string} id - (server generated) Unique identifier for the webhook\n * @property {string} resource - The resource type for the webhook\n * @property {string} event - The event type for the webhook\n * @property {string} filter - The filter that defines the webhook scope\n * @property {string} targetUrl - The URL that receives POST requests for each event\n * @property {string} name - A user-friendly name for this webhook\n * @property {string} created - (server generated) The date and time that the webhook was created\n */\n\n/**\n * Webhooks allow your app to be notified via HTTP when a specific event\n * occurs on Webex. For example, your app can register a webhook to be\n * notified when a new message is posted into a specific room.\n * @class\n */\nconst Webhooks = WebexPlugin.extend({\n /**\n * Posts a webhook.\n * @instance\n * @memberof Webhooks\n * @param {WebhookObject} webhook\n * @returns {Promise<Webhook>}\n * @example\n * webex.rooms.create({title: 'Create Webhook Example'})\n * .then(function(room) {\n * return webex.webhooks.create({\n * resource: 'messages',\n * event: 'created',\n * filter: 'roomId=' + room.id,\n * targetUrl: 'https://example.com/webhook',\n * name: 'Test Webhook'\n * });\n * })\n * .then(function(webhook) {\n * var assert = require('assert');\n * assert(webhook.id);\n * assert(webhook.resource);\n * assert(webhook.event);\n * assert(webhook.filter);\n * assert(webhook.targetUrl);\n * assert(webhook.name);\n * return 'success';\n * });\n * // => success\n */\n create(webhook) {\n return this.request({\n method: 'POST',\n service: 'hydra',\n resource: 'webhooks',\n body: webhook,\n }).then((res) => res.body);\n },\n\n /**\n * Shows details for a webhook.\n * @instance\n * @memberof Webhooks\n * @param {Webhook|string} webhook\n * @returns {Promise<Webhook>}\n * @example\n * var webhook;\n * webex.rooms.create({title: 'Get Webhook Example'})\n * .then(function(room) {\n * return webex.webhooks.create({\n * resource: 'messages',\n * event: 'created',\n * filter: 'roomId=' + room.id,\n * targetUrl: 'https://example.com/webhook',\n * name: 'Test Webhook'\n * });\n * })\n * .then(function(w) {\n * webhook = w;\n * return webex.webhooks.get(webhook.id);\n * })\n * .then(function(webhook2) {\n * var assert = require('assert');\n * assert.deepEqual(webhook2, webhook);\n * return 'success';\n * });\n * // => success\n */\n get(webhook) {\n const id = webhook.id || webhook;\n\n return this.request({\n service: 'hydra',\n resource: `webhooks/${id}`,\n }).then((res) => res.body.items || res.body);\n },\n\n /**\n * Lists all webhooks.\n * @instance\n * @memberof Webhooks\n * @param {Object} options\n * @param {integer} options.max Limit the maximum number of webhooks in the response.\n * @returns {Promise<Array<Webhook>>}\n * @example\n * var room, webhook;\n * webex.rooms.create({title: 'List Webhooks Example'})\n * .then(function(r) {\n * room = r;\n * return webex.webhooks.create({\n * resource: 'messages',\n * event: 'created',\n * filter: 'roomId=' + room.id,\n * targetUrl: 'https://example.com/webhook',\n * name: 'Test Webhook'\n * });\n * })\n * .then(function(w) {\n * webhook = w;\n * return webex.webhooks.list();\n * })\n * .then(function(webhooks) {\n * var assert = require('assert');\n * assert.equal(webhooks.items.filter(function(w) {\n * return w.id === webhook.id;\n * }).length, 1);\n * return 'success';\n * });\n * // => success\n */\n list(options) {\n return this.request({\n service: 'hydra',\n resource: 'webhooks/',\n qs: options,\n }).then((res) => new Page(res, this.webex));\n },\n\n /**\n * Delete a webhook.\n * @instance\n * @memberof Webhooks\n * @param {Webhook|string} webhook\n * @returns {Promise}\n * @example\n * var room, webhook;\n * webex.rooms.create({title: 'Remove Webhook Example'})\n * .then(function(r) {\n * room = r;\n * return webex.webhooks.create({\n * resource: 'messages',\n * event: 'created',\n * filter: 'roomId=' + room.id,\n * targetUrl: 'https://example.com/webhook',\n * name: 'Test Webhook'\n * });\n * })\n * .then(function(w) {\n * webhook = w;\n * return webex.webhooks.remove(webhook);\n * })\n * .then(function() {\n * return webex.webhooks.list();\n * })\n * .then(function(webhooks) {\n * var assert = require('assert');\n * assert.equal(webhooks.items.filter(function(w) {\n * return w.id === webhook.id;\n * }).length, 0);\n * return 'success';\n * });\n * // => success\n */\n remove(webhook) {\n const id = webhook.id || webhook;\n\n return this.request({\n method: 'DELETE',\n service: 'hydra',\n resource: `webhooks/${id}`,\n }).then((res) => {\n // Firefox has some issues with 204s and/or DELETE. This should move to\n // http-core\n if (res.statusCode === 204) {\n return undefined;\n }\n\n return res.body;\n });\n },\n\n /**\n * Update a webhook.\n * @instance\n * @memberof Webhooks\n * @param {Webhook} webhook\n * @returns {Promise<Webhook>}\n * @example\n * var webhook;\n * webex.rooms.create({title: 'Webhook Example'})\n * .then(function(room) {\n * return webex.webhooks.create({\n * resource: 'messages',\n * event: 'created',\n * filter: 'roomId=' + room.id,\n * targetUrl: 'https://example.com/webhook',\n * name: 'Test Webhook'\n * });\n * })\n * .then(function(w) {\n * webhook = w;\n * webhook.targetUrl = 'https://example.com/webhook/newtarget';\n * return webex.webhooks.update(webhook);\n * })\n * .then(function() {\n * return webex.webhooks.get(webhook);\n * })\n * .then(function(webhook) {\n * var assert = require('assert');\n * assert.equal(webhook.targetUrl, 'https://example.com/webhook/newtarget');\n * return 'success';\n * });\n * // => success\n */\n update(webhook) {\n const {id} = webhook;\n\n return this.request({\n method: 'PUT',\n service: 'hydra',\n resource: `webhooks/${id}`,\n body: webhook,\n }).then((res) => res.body);\n },\n});\n\nexport default Webhooks;\n"],"mappings":";;;;;;;AAIA,IAAAA,UAAA,GAAAC,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"names":["_webexCore","require","Webhooks","WebexPlugin","extend","create","webhook","request","method","service","resource","body","then","res","get","id","concat","items","list","options","_this","qs","Page","webex","remove","statusCode","undefined","update","version","_default","exports","default"],"sources":["webhooks.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {WebexPlugin, Page} from '@webex/webex-core';\n\n/**\n * @typedef {Object} WebhookObject\n * @property {string} id - (server generated) Unique identifier for the webhook\n * @property {string} resource - The resource type for the webhook\n * @property {string} event - The event type for the webhook\n * @property {string} filter - The filter that defines the webhook scope\n * @property {string} targetUrl - The URL that receives POST requests for each event\n * @property {string} name - A user-friendly name for this webhook\n * @property {string} created - (server generated) The date and time that the webhook was created\n */\n\n/**\n * Webhooks allow your app to be notified via HTTP when a specific event\n * occurs on Webex. For example, your app can register a webhook to be\n * notified when a new message is posted into a specific room.\n * @class\n */\nconst Webhooks = WebexPlugin.extend({\n /**\n * Posts a webhook.\n * @instance\n * @memberof Webhooks\n * @param {WebhookObject} webhook\n * @returns {Promise<Webhook>}\n * @example\n * webex.rooms.create({title: 'Create Webhook Example'})\n * .then(function(room) {\n * return webex.webhooks.create({\n * resource: 'messages',\n * event: 'created',\n * filter: 'roomId=' + room.id,\n * targetUrl: 'https://example.com/webhook',\n * name: 'Test Webhook'\n * });\n * })\n * .then(function(webhook) {\n * var assert = require('assert');\n * assert(webhook.id);\n * assert(webhook.resource);\n * assert(webhook.event);\n * assert(webhook.filter);\n * assert(webhook.targetUrl);\n * assert(webhook.name);\n * return 'success';\n * });\n * // => success\n */\n create(webhook) {\n return this.request({\n method: 'POST',\n service: 'hydra',\n resource: 'webhooks',\n body: webhook,\n }).then((res) => res.body);\n },\n\n /**\n * Shows details for a webhook.\n * @instance\n * @memberof Webhooks\n * @param {Webhook|string} webhook\n * @returns {Promise<Webhook>}\n * @example\n * var webhook;\n * webex.rooms.create({title: 'Get Webhook Example'})\n * .then(function(room) {\n * return webex.webhooks.create({\n * resource: 'messages',\n * event: 'created',\n * filter: 'roomId=' + room.id,\n * targetUrl: 'https://example.com/webhook',\n * name: 'Test Webhook'\n * });\n * })\n * .then(function(w) {\n * webhook = w;\n * return webex.webhooks.get(webhook.id);\n * })\n * .then(function(webhook2) {\n * var assert = require('assert');\n * assert.deepEqual(webhook2, webhook);\n * return 'success';\n * });\n * // => success\n */\n get(webhook) {\n const id = webhook.id || webhook;\n\n return this.request({\n service: 'hydra',\n resource: `webhooks/${id}`,\n }).then((res) => res.body.items || res.body);\n },\n\n /**\n * Lists all webhooks.\n * @instance\n * @memberof Webhooks\n * @param {Object} options\n * @param {integer} options.max Limit the maximum number of webhooks in the response.\n * @returns {Promise<Array<Webhook>>}\n * @example\n * var room, webhook;\n * webex.rooms.create({title: 'List Webhooks Example'})\n * .then(function(r) {\n * room = r;\n * return webex.webhooks.create({\n * resource: 'messages',\n * event: 'created',\n * filter: 'roomId=' + room.id,\n * targetUrl: 'https://example.com/webhook',\n * name: 'Test Webhook'\n * });\n * })\n * .then(function(w) {\n * webhook = w;\n * return webex.webhooks.list();\n * })\n * .then(function(webhooks) {\n * var assert = require('assert');\n * assert.equal(webhooks.items.filter(function(w) {\n * return w.id === webhook.id;\n * }).length, 1);\n * return 'success';\n * });\n * // => success\n */\n list(options) {\n return this.request({\n service: 'hydra',\n resource: 'webhooks/',\n qs: options,\n }).then((res) => new Page(res, this.webex));\n },\n\n /**\n * Delete a webhook.\n * @instance\n * @memberof Webhooks\n * @param {Webhook|string} webhook\n * @returns {Promise}\n * @example\n * var room, webhook;\n * webex.rooms.create({title: 'Remove Webhook Example'})\n * .then(function(r) {\n * room = r;\n * return webex.webhooks.create({\n * resource: 'messages',\n * event: 'created',\n * filter: 'roomId=' + room.id,\n * targetUrl: 'https://example.com/webhook',\n * name: 'Test Webhook'\n * });\n * })\n * .then(function(w) {\n * webhook = w;\n * return webex.webhooks.remove(webhook);\n * })\n * .then(function() {\n * return webex.webhooks.list();\n * })\n * .then(function(webhooks) {\n * var assert = require('assert');\n * assert.equal(webhooks.items.filter(function(w) {\n * return w.id === webhook.id;\n * }).length, 0);\n * return 'success';\n * });\n * // => success\n */\n remove(webhook) {\n const id = webhook.id || webhook;\n\n return this.request({\n method: 'DELETE',\n service: 'hydra',\n resource: `webhooks/${id}`,\n }).then((res) => {\n // Firefox has some issues with 204s and/or DELETE. This should move to\n // http-core\n if (res.statusCode === 204) {\n return undefined;\n }\n\n return res.body;\n });\n },\n\n /**\n * Update a webhook.\n * @instance\n * @memberof Webhooks\n * @param {Webhook} webhook\n * @returns {Promise<Webhook>}\n * @example\n * var webhook;\n * webex.rooms.create({title: 'Webhook Example'})\n * .then(function(room) {\n * return webex.webhooks.create({\n * resource: 'messages',\n * event: 'created',\n * filter: 'roomId=' + room.id,\n * targetUrl: 'https://example.com/webhook',\n * name: 'Test Webhook'\n * });\n * })\n * .then(function(w) {\n * webhook = w;\n * webhook.targetUrl = 'https://example.com/webhook/newtarget';\n * return webex.webhooks.update(webhook);\n * })\n * .then(function() {\n * return webex.webhooks.get(webhook);\n * })\n * .then(function(webhook) {\n * var assert = require('assert');\n * assert.equal(webhook.targetUrl, 'https://example.com/webhook/newtarget');\n * return 'success';\n * });\n * // => success\n */\n update(webhook) {\n const {id} = webhook;\n\n return this.request({\n method: 'PUT',\n service: 'hydra',\n resource: `webhooks/${id}`,\n body: webhook,\n }).then((res) => res.body);\n },\n});\n\nexport default Webhooks;\n"],"mappings":";;;;;;;AAIA,IAAAA,UAAA,GAAAC,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMC,QAAQ,GAAGC,sBAAW,CAACC,MAAM,CAAC;EAClC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,MAAM,WAANA,MAAMA,CAACC,OAAO,EAAE;IACd,OAAO,IAAI,CAACC,OAAO,CAAC;MAClBC,MAAM,EAAE,MAAM;MACdC,OAAO,EAAE,OAAO;MAChBC,QAAQ,EAAE,UAAU;MACpBC,IAAI,EAAEL;IACR,CAAC,CAAC,CAACM,IAAI,CAAC,UAACC,GAAG;MAAA,OAAKA,GAAG,CAACF,IAAI;IAAA,EAAC;EAC5B,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEG,GAAG,WAAHA,GAAGA,CAACR,OAAO,EAAE;IACX,IAAMS,EAAE,GAAGT,OAAO,CAACS,EAAE,IAAIT,OAAO;IAEhC,OAAO,IAAI,CAACC,OAAO,CAAC;MAClBE,OAAO,EAAE,OAAO;MAChBC,QAAQ,cAAAM,MAAA,CAAcD,EAAE;IAC1B,CAAC,CAAC,CAACH,IAAI,CAAC,UAACC,GAAG;MAAA,OAAKA,GAAG,CAACF,IAAI,CAACM,KAAK,IAAIJ,GAAG,CAACF,IAAI;IAAA,EAAC;EAC9C,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEO,IAAI,WAAJA,IAAIA,CAACC,OAAO,EAAE;IAAA,IAAAC,KAAA;IACZ,OAAO,IAAI,CAACb,OAAO,CAAC;MAClBE,OAAO,EAAE,OAAO;MAChBC,QAAQ,EAAE,WAAW;MACrBW,EAAE,EAAEF;IACN,CAAC,CAAC,CAACP,IAAI,CAAC,UAACC,GAAG;MAAA,OAAK,IAAIS,eAAI,CAACT,GAAG,EAAEO,KAAI,CAACG,KAAK,CAAC;IAAA,EAAC;EAC7C,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,MAAM,WAANA,MAAMA,CAAClB,OAAO,EAAE;IACd,IAAMS,EAAE,GAAGT,OAAO,CAACS,EAAE,IAAIT,OAAO;IAEhC,OAAO,IAAI,CAACC,OAAO,CAAC;MAClBC,MAAM,EAAE,QAAQ;MAChBC,OAAO,EAAE,OAAO;MAChBC,QAAQ,cAAAM,MAAA,CAAcD,EAAE;IAC1B,CAAC,CAAC,CAACH,IAAI,CAAC,UAACC,GAAG,EAAK;MACf;MACA;MACA,IAAIA,GAAG,CAACY,UAAU,KAAK,GAAG,EAAE;QAC1B,OAAOC,SAAS;MAClB;MAEA,OAAOb,GAAG,CAACF,IAAI;IACjB,CAAC,CAAC;EACJ,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEgB,MAAM,WAANA,MAAMA,CAACrB,OAAO,EAAE;IACd,IAAOS,EAAE,GAAIT,OAAO,CAAbS,EAAE;IAET,OAAO,IAAI,CAACR,OAAO,CAAC;MAClBC,MAAM,EAAE,KAAK;MACbC,OAAO,EAAE,OAAO;MAChBC,QAAQ,cAAAM,MAAA,CAAcD,EAAE,CAAE;MAC1BJ,IAAI,EAAEL;IACR,CAAC,CAAC,CAACM,IAAI,CAAC,UAACC,GAAG;MAAA,OAAKA,GAAG,CAACF,IAAI;IAAA,EAAC;EAC5B,CAAC;EAAAiB,OAAA;AACH,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEY7B,QAAQ","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"sinon": "^9.2.4"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@webex/internal-plugin-device": "3.10.0-next.
|
|
37
|
-
"@webex/webex-core": "3.10.0-next.
|
|
36
|
+
"@webex/internal-plugin-device": "3.10.0-next.4",
|
|
37
|
+
"@webex/webex-core": "3.10.0-next.4"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@webex/plugin-logger": "3.10.0-next.
|
|
41
|
-
"@webex/plugin-rooms": "3.10.0-next.
|
|
40
|
+
"@webex/plugin-logger": "3.10.0-next.4",
|
|
41
|
+
"@webex/plugin-rooms": "3.10.0-next.4"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "yarn build:src",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"test:browser": "webex-legacy-tools test --integration --runner karma",
|
|
49
49
|
"test:style": "eslint ./src/**/*.*"
|
|
50
50
|
},
|
|
51
|
-
"version": "3.10.0-next.
|
|
51
|
+
"version": "3.10.0-next.4"
|
|
52
52
|
}
|