@webex/plugin-webhooks 2.59.2 → 2.59.3-next.1
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/.eslintrc.js +6 -6
- package/README.md +50 -50
- package/babel.config.js +3 -3
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/webhooks.js +171 -171
- package/dist/webhooks.js.map +1 -1
- package/jest.config.js +3 -3
- package/package.json +16 -15
- package/process +1 -1
- package/src/index.js +11 -11
- package/src/webhooks.js +240 -240
- package/test/integration/spec/webhooks.js +163 -163
package/.eslintrc.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const config = {
|
|
2
|
-
root: true,
|
|
3
|
-
extends: ['@webex/eslint-config-legacy'],
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
module.exports = config;
|
|
1
|
+
const config = {
|
|
2
|
+
root: true,
|
|
3
|
+
extends: ['@webex/eslint-config-legacy'],
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
module.exports = config;
|
package/README.md
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
# @webex/plugin-webhooks
|
|
2
|
-
|
|
3
|
-
[](https://github.com/RichardLitt/standard-readme)
|
|
4
|
-
|
|
5
|
-
> Webhooks plugin for the Cisco Webex JS SDK.
|
|
6
|
-
|
|
7
|
-
- [Install](#install)
|
|
8
|
-
- [Usage](#usage)
|
|
9
|
-
- [Contribute](#contribute)
|
|
10
|
-
- [Maintainers](#maintainers)
|
|
11
|
-
- [License](#license)
|
|
12
|
-
|
|
13
|
-
## Install
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
npm install --save @webex/plugin-webhooks
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Usage
|
|
20
|
-
|
|
21
|
-
This is a plugin for the Cisco Webex JS SDK . Please see our [developer portal](https://developer.webex.com/) and the [API docs](https://webex.github.io/webex-js-sdk/api/) for full details.
|
|
22
|
-
|
|
23
|
-
## Install
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
npm install --save @webex/plugin-webhooks
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## Usage
|
|
30
|
-
|
|
31
|
-
```js
|
|
32
|
-
const Webex = require('webex');
|
|
33
|
-
|
|
34
|
-
const webex = Webex.init();
|
|
35
|
-
webex.webhooks.get(id).then((webhook) => {
|
|
36
|
-
console.log(webhook);
|
|
37
|
-
});
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## Maintainers
|
|
41
|
-
|
|
42
|
-
This package is maintained by [Cisco Webex for Developers](https://developer.webex.com/).
|
|
43
|
-
|
|
44
|
-
## Contribute
|
|
45
|
-
|
|
46
|
-
Pull requests welcome. Please see [CONTRIBUTING.md](https://github.com/webex/webex-js-sdk/blob/master/CONTRIBUTING.md) for more details.
|
|
47
|
-
|
|
48
|
-
## License
|
|
49
|
-
|
|
50
|
-
© 2016-2020 Cisco and/or its affiliates. All Rights Reserved.
|
|
1
|
+
# @webex/plugin-webhooks
|
|
2
|
+
|
|
3
|
+
[](https://github.com/RichardLitt/standard-readme)
|
|
4
|
+
|
|
5
|
+
> Webhooks plugin for the Cisco Webex JS SDK.
|
|
6
|
+
|
|
7
|
+
- [Install](#install)
|
|
8
|
+
- [Usage](#usage)
|
|
9
|
+
- [Contribute](#contribute)
|
|
10
|
+
- [Maintainers](#maintainers)
|
|
11
|
+
- [License](#license)
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install --save @webex/plugin-webhooks
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
This is a plugin for the Cisco Webex JS SDK . Please see our [developer portal](https://developer.webex.com/) and the [API docs](https://webex.github.io/webex-js-sdk/api/) for full details.
|
|
22
|
+
|
|
23
|
+
## Install
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install --save @webex/plugin-webhooks
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
```js
|
|
32
|
+
const Webex = require('webex');
|
|
33
|
+
|
|
34
|
+
const webex = Webex.init();
|
|
35
|
+
webex.webhooks.get(id).then((webhook) => {
|
|
36
|
+
console.log(webhook);
|
|
37
|
+
});
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Maintainers
|
|
41
|
+
|
|
42
|
+
This package is maintained by [Cisco Webex for Developers](https://developer.webex.com/).
|
|
43
|
+
|
|
44
|
+
## Contribute
|
|
45
|
+
|
|
46
|
+
Pull requests welcome. Please see [CONTRIBUTING.md](https://github.com/webex/webex-js-sdk/blob/master/CONTRIBUTING.md) for more details.
|
|
47
|
+
|
|
48
|
+
## License
|
|
49
|
+
|
|
50
|
+
© 2016-2020 Cisco and/or its affiliates. All Rights Reserved.
|
package/babel.config.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const babelConfigLegacy = require('@webex/babel-config-legacy');
|
|
2
|
-
|
|
3
|
-
module.exports = babelConfigLegacy;
|
|
1
|
+
const babelConfigLegacy = require('@webex/babel-config-legacy');
|
|
2
|
+
|
|
3
|
+
module.exports = babelConfigLegacy;
|
package/dist/index.js
CHANGED
|
@@ -8,8 +8,8 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _webexCore = require("@webex/webex-core");
|
|
10
10
|
var _webhooks = _interopRequireDefault(require("./webhooks"));
|
|
11
|
-
/*!
|
|
12
|
-
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
11
|
+
/*!
|
|
12
|
+
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
(0, _webexCore.registerPlugin)('webhooks', _webhooks.default);
|
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,GAEtBD,iBAAQ;AAAAE,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
1
|
+
{"version":3,"names":["_webexCore","require","_webhooks","_interopRequireDefault","registerPlugin","Webhooks","_default","exports","default"],"sources":["index.js"],"sourcesContent":["/*!\r\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\r\n */\r\n\r\nimport {registerPlugin} from '@webex/webex-core';\r\n\r\nimport Webhooks from './webhooks';\r\n\r\nregisterPlugin('webhooks', Webhooks);\r\n\r\nexport default Webhooks;\r\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,GAEtBD,iBAAQ;AAAAE,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
package/dist/webhooks.js
CHANGED
|
@@ -6,56 +6,56 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _webexCore = require("@webex/webex-core");
|
|
9
|
-
/*!
|
|
10
|
-
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
9
|
+
/*!
|
|
10
|
+
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
/**
|
|
14
|
-
* @typedef {Object} WebhookObject
|
|
15
|
-
* @property {string} id - (server generated) Unique identifier for the webhook
|
|
16
|
-
* @property {string} resource - The resource type for the webhook
|
|
17
|
-
* @property {string} event - The event type for the webhook
|
|
18
|
-
* @property {string} filter - The filter that defines the webhook scope
|
|
19
|
-
* @property {string} targetUrl - The URL that receives POST requests for each event
|
|
20
|
-
* @property {string} name - A user-friendly name for this webhook
|
|
21
|
-
* @property {string} created - (server generated) The date and time that the webhook was created
|
|
13
|
+
/**
|
|
14
|
+
* @typedef {Object} WebhookObject
|
|
15
|
+
* @property {string} id - (server generated) Unique identifier for the webhook
|
|
16
|
+
* @property {string} resource - The resource type for the webhook
|
|
17
|
+
* @property {string} event - The event type for the webhook
|
|
18
|
+
* @property {string} filter - The filter that defines the webhook scope
|
|
19
|
+
* @property {string} targetUrl - The URL that receives POST requests for each event
|
|
20
|
+
* @property {string} name - A user-friendly name for this webhook
|
|
21
|
+
* @property {string} created - (server generated) The date and time that the webhook was created
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
-
/**
|
|
25
|
-
* Webhooks allow your app to be notified via HTTP when a specific event
|
|
26
|
-
* occurs on Webex. For example, your app can register a webhook to be
|
|
27
|
-
* notified when a new message is posted into a specific room.
|
|
28
|
-
* @class
|
|
24
|
+
/**
|
|
25
|
+
* Webhooks allow your app to be notified via HTTP when a specific event
|
|
26
|
+
* occurs on Webex. For example, your app can register a webhook to be
|
|
27
|
+
* notified when a new message is posted into a specific room.
|
|
28
|
+
* @class
|
|
29
29
|
*/
|
|
30
30
|
var Webhooks = _webexCore.WebexPlugin.extend({
|
|
31
|
-
/**
|
|
32
|
-
* Posts a webhook.
|
|
33
|
-
* @instance
|
|
34
|
-
* @memberof Webhooks
|
|
35
|
-
* @param {WebhookObject} webhook
|
|
36
|
-
* @returns {Promise<Webhook>}
|
|
37
|
-
* @example
|
|
38
|
-
* webex.rooms.create({title: 'Create Webhook Example'})
|
|
39
|
-
* .then(function(room) {
|
|
40
|
-
* return webex.webhooks.create({
|
|
41
|
-
* resource: 'messages',
|
|
42
|
-
* event: 'created',
|
|
43
|
-
* filter: 'roomId=' + room.id,
|
|
44
|
-
* targetUrl: 'https://example.com/webhook',
|
|
45
|
-
* name: 'Test Webhook'
|
|
46
|
-
* });
|
|
47
|
-
* })
|
|
48
|
-
* .then(function(webhook) {
|
|
49
|
-
* var assert = require('assert');
|
|
50
|
-
* assert(webhook.id);
|
|
51
|
-
* assert(webhook.resource);
|
|
52
|
-
* assert(webhook.event);
|
|
53
|
-
* assert(webhook.filter);
|
|
54
|
-
* assert(webhook.targetUrl);
|
|
55
|
-
* assert(webhook.name);
|
|
56
|
-
* return 'success';
|
|
57
|
-
* });
|
|
58
|
-
* // => success
|
|
31
|
+
/**
|
|
32
|
+
* Posts a webhook.
|
|
33
|
+
* @instance
|
|
34
|
+
* @memberof Webhooks
|
|
35
|
+
* @param {WebhookObject} webhook
|
|
36
|
+
* @returns {Promise<Webhook>}
|
|
37
|
+
* @example
|
|
38
|
+
* webex.rooms.create({title: 'Create Webhook Example'})
|
|
39
|
+
* .then(function(room) {
|
|
40
|
+
* return webex.webhooks.create({
|
|
41
|
+
* resource: 'messages',
|
|
42
|
+
* event: 'created',
|
|
43
|
+
* filter: 'roomId=' + room.id,
|
|
44
|
+
* targetUrl: 'https://example.com/webhook',
|
|
45
|
+
* name: 'Test Webhook'
|
|
46
|
+
* });
|
|
47
|
+
* })
|
|
48
|
+
* .then(function(webhook) {
|
|
49
|
+
* var assert = require('assert');
|
|
50
|
+
* assert(webhook.id);
|
|
51
|
+
* assert(webhook.resource);
|
|
52
|
+
* assert(webhook.event);
|
|
53
|
+
* assert(webhook.filter);
|
|
54
|
+
* assert(webhook.targetUrl);
|
|
55
|
+
* assert(webhook.name);
|
|
56
|
+
* return 'success';
|
|
57
|
+
* });
|
|
58
|
+
* // => success
|
|
59
59
|
*/
|
|
60
60
|
create: function create(webhook) {
|
|
61
61
|
return this.request({
|
|
@@ -67,34 +67,34 @@ var Webhooks = _webexCore.WebexPlugin.extend({
|
|
|
67
67
|
return res.body;
|
|
68
68
|
});
|
|
69
69
|
},
|
|
70
|
-
/**
|
|
71
|
-
* Shows details for a webhook.
|
|
72
|
-
* @instance
|
|
73
|
-
* @memberof Webhooks
|
|
74
|
-
* @param {Webhook|string} webhook
|
|
75
|
-
* @returns {Promise<Webhook>}
|
|
76
|
-
* @example
|
|
77
|
-
* var webhook;
|
|
78
|
-
* webex.rooms.create({title: 'Get Webhook Example'})
|
|
79
|
-
* .then(function(room) {
|
|
80
|
-
* return webex.webhooks.create({
|
|
81
|
-
* resource: 'messages',
|
|
82
|
-
* event: 'created',
|
|
83
|
-
* filter: 'roomId=' + room.id,
|
|
84
|
-
* targetUrl: 'https://example.com/webhook',
|
|
85
|
-
* name: 'Test Webhook'
|
|
86
|
-
* });
|
|
87
|
-
* })
|
|
88
|
-
* .then(function(w) {
|
|
89
|
-
* webhook = w;
|
|
90
|
-
* return webex.webhooks.get(webhook.id);
|
|
91
|
-
* })
|
|
92
|
-
* .then(function(webhook2) {
|
|
93
|
-
* var assert = require('assert');
|
|
94
|
-
* assert.deepEqual(webhook2, webhook);
|
|
95
|
-
* return 'success';
|
|
96
|
-
* });
|
|
97
|
-
* // => success
|
|
70
|
+
/**
|
|
71
|
+
* Shows details for a webhook.
|
|
72
|
+
* @instance
|
|
73
|
+
* @memberof Webhooks
|
|
74
|
+
* @param {Webhook|string} webhook
|
|
75
|
+
* @returns {Promise<Webhook>}
|
|
76
|
+
* @example
|
|
77
|
+
* var webhook;
|
|
78
|
+
* webex.rooms.create({title: 'Get Webhook Example'})
|
|
79
|
+
* .then(function(room) {
|
|
80
|
+
* return webex.webhooks.create({
|
|
81
|
+
* resource: 'messages',
|
|
82
|
+
* event: 'created',
|
|
83
|
+
* filter: 'roomId=' + room.id,
|
|
84
|
+
* targetUrl: 'https://example.com/webhook',
|
|
85
|
+
* name: 'Test Webhook'
|
|
86
|
+
* });
|
|
87
|
+
* })
|
|
88
|
+
* .then(function(w) {
|
|
89
|
+
* webhook = w;
|
|
90
|
+
* return webex.webhooks.get(webhook.id);
|
|
91
|
+
* })
|
|
92
|
+
* .then(function(webhook2) {
|
|
93
|
+
* var assert = require('assert');
|
|
94
|
+
* assert.deepEqual(webhook2, webhook);
|
|
95
|
+
* return 'success';
|
|
96
|
+
* });
|
|
97
|
+
* // => success
|
|
98
98
|
*/
|
|
99
99
|
get: function get(webhook) {
|
|
100
100
|
var id = webhook.id || webhook;
|
|
@@ -105,38 +105,38 @@ var Webhooks = _webexCore.WebexPlugin.extend({
|
|
|
105
105
|
return res.body.items || res.body;
|
|
106
106
|
});
|
|
107
107
|
},
|
|
108
|
-
/**
|
|
109
|
-
* Lists all webhooks.
|
|
110
|
-
* @instance
|
|
111
|
-
* @memberof Webhooks
|
|
112
|
-
* @param {Object} options
|
|
113
|
-
* @param {integer} options.max Limit the maximum number of webhooks in the response.
|
|
114
|
-
* @returns {Promise<Array<Webhook>>}
|
|
115
|
-
* @example
|
|
116
|
-
* var room, webhook;
|
|
117
|
-
* webex.rooms.create({title: 'List Webhooks Example'})
|
|
118
|
-
* .then(function(r) {
|
|
119
|
-
* room = r;
|
|
120
|
-
* return webex.webhooks.create({
|
|
121
|
-
* resource: 'messages',
|
|
122
|
-
* event: 'created',
|
|
123
|
-
* filter: 'roomId=' + room.id,
|
|
124
|
-
* targetUrl: 'https://example.com/webhook',
|
|
125
|
-
* name: 'Test Webhook'
|
|
126
|
-
* });
|
|
127
|
-
* })
|
|
128
|
-
* .then(function(w) {
|
|
129
|
-
* webhook = w;
|
|
130
|
-
* return webex.webhooks.list();
|
|
131
|
-
* })
|
|
132
|
-
* .then(function(webhooks) {
|
|
133
|
-
* var assert = require('assert');
|
|
134
|
-
* assert.equal(webhooks.items.filter(function(w) {
|
|
135
|
-
* return w.id === webhook.id;
|
|
136
|
-
* }).length, 1);
|
|
137
|
-
* return 'success';
|
|
138
|
-
* });
|
|
139
|
-
* // => success
|
|
108
|
+
/**
|
|
109
|
+
* Lists all webhooks.
|
|
110
|
+
* @instance
|
|
111
|
+
* @memberof Webhooks
|
|
112
|
+
* @param {Object} options
|
|
113
|
+
* @param {integer} options.max Limit the maximum number of webhooks in the response.
|
|
114
|
+
* @returns {Promise<Array<Webhook>>}
|
|
115
|
+
* @example
|
|
116
|
+
* var room, webhook;
|
|
117
|
+
* webex.rooms.create({title: 'List Webhooks Example'})
|
|
118
|
+
* .then(function(r) {
|
|
119
|
+
* room = r;
|
|
120
|
+
* return webex.webhooks.create({
|
|
121
|
+
* resource: 'messages',
|
|
122
|
+
* event: 'created',
|
|
123
|
+
* filter: 'roomId=' + room.id,
|
|
124
|
+
* targetUrl: 'https://example.com/webhook',
|
|
125
|
+
* name: 'Test Webhook'
|
|
126
|
+
* });
|
|
127
|
+
* })
|
|
128
|
+
* .then(function(w) {
|
|
129
|
+
* webhook = w;
|
|
130
|
+
* return webex.webhooks.list();
|
|
131
|
+
* })
|
|
132
|
+
* .then(function(webhooks) {
|
|
133
|
+
* var assert = require('assert');
|
|
134
|
+
* assert.equal(webhooks.items.filter(function(w) {
|
|
135
|
+
* return w.id === webhook.id;
|
|
136
|
+
* }).length, 1);
|
|
137
|
+
* return 'success';
|
|
138
|
+
* });
|
|
139
|
+
* // => success
|
|
140
140
|
*/
|
|
141
141
|
list: function list(options) {
|
|
142
142
|
var _this = this;
|
|
@@ -148,40 +148,40 @@ var Webhooks = _webexCore.WebexPlugin.extend({
|
|
|
148
148
|
return new _webexCore.Page(res, _this.webex);
|
|
149
149
|
});
|
|
150
150
|
},
|
|
151
|
-
/**
|
|
152
|
-
* Delete a webhook.
|
|
153
|
-
* @instance
|
|
154
|
-
* @memberof Webhooks
|
|
155
|
-
* @param {Webhook|string} webhook
|
|
156
|
-
* @returns {Promise}
|
|
157
|
-
* @example
|
|
158
|
-
* var room, webhook;
|
|
159
|
-
* webex.rooms.create({title: 'Remove Webhook Example'})
|
|
160
|
-
* .then(function(r) {
|
|
161
|
-
* room = r;
|
|
162
|
-
* return webex.webhooks.create({
|
|
163
|
-
* resource: 'messages',
|
|
164
|
-
* event: 'created',
|
|
165
|
-
* filter: 'roomId=' + room.id,
|
|
166
|
-
* targetUrl: 'https://example.com/webhook',
|
|
167
|
-
* name: 'Test Webhook'
|
|
168
|
-
* });
|
|
169
|
-
* })
|
|
170
|
-
* .then(function(w) {
|
|
171
|
-
* webhook = w;
|
|
172
|
-
* return webex.webhooks.remove(webhook);
|
|
173
|
-
* })
|
|
174
|
-
* .then(function() {
|
|
175
|
-
* return webex.webhooks.list();
|
|
176
|
-
* })
|
|
177
|
-
* .then(function(webhooks) {
|
|
178
|
-
* var assert = require('assert');
|
|
179
|
-
* assert.equal(webhooks.items.filter(function(w) {
|
|
180
|
-
* return w.id === webhook.id;
|
|
181
|
-
* }).length, 0);
|
|
182
|
-
* return 'success';
|
|
183
|
-
* });
|
|
184
|
-
* // => success
|
|
151
|
+
/**
|
|
152
|
+
* Delete a webhook.
|
|
153
|
+
* @instance
|
|
154
|
+
* @memberof Webhooks
|
|
155
|
+
* @param {Webhook|string} webhook
|
|
156
|
+
* @returns {Promise}
|
|
157
|
+
* @example
|
|
158
|
+
* var room, webhook;
|
|
159
|
+
* webex.rooms.create({title: 'Remove Webhook Example'})
|
|
160
|
+
* .then(function(r) {
|
|
161
|
+
* room = r;
|
|
162
|
+
* return webex.webhooks.create({
|
|
163
|
+
* resource: 'messages',
|
|
164
|
+
* event: 'created',
|
|
165
|
+
* filter: 'roomId=' + room.id,
|
|
166
|
+
* targetUrl: 'https://example.com/webhook',
|
|
167
|
+
* name: 'Test Webhook'
|
|
168
|
+
* });
|
|
169
|
+
* })
|
|
170
|
+
* .then(function(w) {
|
|
171
|
+
* webhook = w;
|
|
172
|
+
* return webex.webhooks.remove(webhook);
|
|
173
|
+
* })
|
|
174
|
+
* .then(function() {
|
|
175
|
+
* return webex.webhooks.list();
|
|
176
|
+
* })
|
|
177
|
+
* .then(function(webhooks) {
|
|
178
|
+
* var assert = require('assert');
|
|
179
|
+
* assert.equal(webhooks.items.filter(function(w) {
|
|
180
|
+
* return w.id === webhook.id;
|
|
181
|
+
* }).length, 0);
|
|
182
|
+
* return 'success';
|
|
183
|
+
* });
|
|
184
|
+
* // => success
|
|
185
185
|
*/
|
|
186
186
|
remove: function remove(webhook) {
|
|
187
187
|
var id = webhook.id || webhook;
|
|
@@ -198,38 +198,38 @@ var Webhooks = _webexCore.WebexPlugin.extend({
|
|
|
198
198
|
return res.body;
|
|
199
199
|
});
|
|
200
200
|
},
|
|
201
|
-
/**
|
|
202
|
-
* Update a webhook.
|
|
203
|
-
* @instance
|
|
204
|
-
* @memberof Webhooks
|
|
205
|
-
* @param {Webhook} webhook
|
|
206
|
-
* @returns {Promise<Webhook>}
|
|
207
|
-
* @example
|
|
208
|
-
* var webhook;
|
|
209
|
-
* webex.rooms.create({title: 'Webhook Example'})
|
|
210
|
-
* .then(function(room) {
|
|
211
|
-
* return webex.webhooks.create({
|
|
212
|
-
* resource: 'messages',
|
|
213
|
-
* event: 'created',
|
|
214
|
-
* filter: 'roomId=' + room.id,
|
|
215
|
-
* targetUrl: 'https://example.com/webhook',
|
|
216
|
-
* name: 'Test Webhook'
|
|
217
|
-
* });
|
|
218
|
-
* })
|
|
219
|
-
* .then(function(w) {
|
|
220
|
-
* webhook = w;
|
|
221
|
-
* webhook.targetUrl = 'https://example.com/webhook/newtarget';
|
|
222
|
-
* return webex.webhooks.update(webhook);
|
|
223
|
-
* })
|
|
224
|
-
* .then(function() {
|
|
225
|
-
* return webex.webhooks.get(webhook);
|
|
226
|
-
* })
|
|
227
|
-
* .then(function(webhook) {
|
|
228
|
-
* var assert = require('assert');
|
|
229
|
-
* assert.equal(webhook.targetUrl, 'https://example.com/webhook/newtarget');
|
|
230
|
-
* return 'success';
|
|
231
|
-
* });
|
|
232
|
-
* // => success
|
|
201
|
+
/**
|
|
202
|
+
* Update a webhook.
|
|
203
|
+
* @instance
|
|
204
|
+
* @memberof Webhooks
|
|
205
|
+
* @param {Webhook} webhook
|
|
206
|
+
* @returns {Promise<Webhook>}
|
|
207
|
+
* @example
|
|
208
|
+
* var webhook;
|
|
209
|
+
* webex.rooms.create({title: 'Webhook Example'})
|
|
210
|
+
* .then(function(room) {
|
|
211
|
+
* return webex.webhooks.create({
|
|
212
|
+
* resource: 'messages',
|
|
213
|
+
* event: 'created',
|
|
214
|
+
* filter: 'roomId=' + room.id,
|
|
215
|
+
* targetUrl: 'https://example.com/webhook',
|
|
216
|
+
* name: 'Test Webhook'
|
|
217
|
+
* });
|
|
218
|
+
* })
|
|
219
|
+
* .then(function(w) {
|
|
220
|
+
* webhook = w;
|
|
221
|
+
* webhook.targetUrl = 'https://example.com/webhook/newtarget';
|
|
222
|
+
* return webex.webhooks.update(webhook);
|
|
223
|
+
* })
|
|
224
|
+
* .then(function() {
|
|
225
|
+
* return webex.webhooks.get(webhook);
|
|
226
|
+
* })
|
|
227
|
+
* .then(function(webhook) {
|
|
228
|
+
* var assert = require('assert');
|
|
229
|
+
* assert.equal(webhook.targetUrl, 'https://example.com/webhook/newtarget');
|
|
230
|
+
* return 'success';
|
|
231
|
+
* });
|
|
232
|
+
* // => success
|
|
233
233
|
*/
|
|
234
234
|
update: function update(webhook) {
|
|
235
235
|
var id = webhook.id;
|
|
@@ -242,7 +242,7 @@ var Webhooks = _webexCore.WebexPlugin.extend({
|
|
|
242
242
|
return res.body;
|
|
243
243
|
});
|
|
244
244
|
},
|
|
245
|
-
version: "2.59.
|
|
245
|
+
version: "2.59.0"
|
|
246
246
|
});
|
|
247
247
|
var _default = Webhooks;
|
|
248
248
|
exports.default = _default;
|
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;;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,WAAAA,OAACC,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,WAAAA,IAACR,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,WAAAA,KAACC,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,WAAAA,OAAClB,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,WAAAA,OAACrB,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,GAEY3B,QAAQ;AAAA4B,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
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":["/*!\r\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\r\n */\r\n\r\nimport {WebexPlugin, Page} from '@webex/webex-core';\r\n\r\n/**\r\n * @typedef {Object} WebhookObject\r\n * @property {string} id - (server generated) Unique identifier for the webhook\r\n * @property {string} resource - The resource type for the webhook\r\n * @property {string} event - The event type for the webhook\r\n * @property {string} filter - The filter that defines the webhook scope\r\n * @property {string} targetUrl - The URL that receives POST requests for each event\r\n * @property {string} name - A user-friendly name for this webhook\r\n * @property {string} created - (server generated) The date and time that the webhook was created\r\n */\r\n\r\n/**\r\n * Webhooks allow your app to be notified via HTTP when a specific event\r\n * occurs on Webex. For example, your app can register a webhook to be\r\n * notified when a new message is posted into a specific room.\r\n * @class\r\n */\r\nconst Webhooks = WebexPlugin.extend({\r\n /**\r\n * Posts a webhook.\r\n * @instance\r\n * @memberof Webhooks\r\n * @param {WebhookObject} webhook\r\n * @returns {Promise<Webhook>}\r\n * @example\r\n * webex.rooms.create({title: 'Create Webhook Example'})\r\n * .then(function(room) {\r\n * return webex.webhooks.create({\r\n * resource: 'messages',\r\n * event: 'created',\r\n * filter: 'roomId=' + room.id,\r\n * targetUrl: 'https://example.com/webhook',\r\n * name: 'Test Webhook'\r\n * });\r\n * })\r\n * .then(function(webhook) {\r\n * var assert = require('assert');\r\n * assert(webhook.id);\r\n * assert(webhook.resource);\r\n * assert(webhook.event);\r\n * assert(webhook.filter);\r\n * assert(webhook.targetUrl);\r\n * assert(webhook.name);\r\n * return 'success';\r\n * });\r\n * // => success\r\n */\r\n create(webhook) {\r\n return this.request({\r\n method: 'POST',\r\n service: 'hydra',\r\n resource: 'webhooks',\r\n body: webhook,\r\n }).then((res) => res.body);\r\n },\r\n\r\n /**\r\n * Shows details for a webhook.\r\n * @instance\r\n * @memberof Webhooks\r\n * @param {Webhook|string} webhook\r\n * @returns {Promise<Webhook>}\r\n * @example\r\n * var webhook;\r\n * webex.rooms.create({title: 'Get Webhook Example'})\r\n * .then(function(room) {\r\n * return webex.webhooks.create({\r\n * resource: 'messages',\r\n * event: 'created',\r\n * filter: 'roomId=' + room.id,\r\n * targetUrl: 'https://example.com/webhook',\r\n * name: 'Test Webhook'\r\n * });\r\n * })\r\n * .then(function(w) {\r\n * webhook = w;\r\n * return webex.webhooks.get(webhook.id);\r\n * })\r\n * .then(function(webhook2) {\r\n * var assert = require('assert');\r\n * assert.deepEqual(webhook2, webhook);\r\n * return 'success';\r\n * });\r\n * // => success\r\n */\r\n get(webhook) {\r\n const id = webhook.id || webhook;\r\n\r\n return this.request({\r\n service: 'hydra',\r\n resource: `webhooks/${id}`,\r\n }).then((res) => res.body.items || res.body);\r\n },\r\n\r\n /**\r\n * Lists all webhooks.\r\n * @instance\r\n * @memberof Webhooks\r\n * @param {Object} options\r\n * @param {integer} options.max Limit the maximum number of webhooks in the response.\r\n * @returns {Promise<Array<Webhook>>}\r\n * @example\r\n * var room, webhook;\r\n * webex.rooms.create({title: 'List Webhooks Example'})\r\n * .then(function(r) {\r\n * room = r;\r\n * return webex.webhooks.create({\r\n * resource: 'messages',\r\n * event: 'created',\r\n * filter: 'roomId=' + room.id,\r\n * targetUrl: 'https://example.com/webhook',\r\n * name: 'Test Webhook'\r\n * });\r\n * })\r\n * .then(function(w) {\r\n * webhook = w;\r\n * return webex.webhooks.list();\r\n * })\r\n * .then(function(webhooks) {\r\n * var assert = require('assert');\r\n * assert.equal(webhooks.items.filter(function(w) {\r\n * return w.id === webhook.id;\r\n * }).length, 1);\r\n * return 'success';\r\n * });\r\n * // => success\r\n */\r\n list(options) {\r\n return this.request({\r\n service: 'hydra',\r\n resource: 'webhooks/',\r\n qs: options,\r\n }).then((res) => new Page(res, this.webex));\r\n },\r\n\r\n /**\r\n * Delete a webhook.\r\n * @instance\r\n * @memberof Webhooks\r\n * @param {Webhook|string} webhook\r\n * @returns {Promise}\r\n * @example\r\n * var room, webhook;\r\n * webex.rooms.create({title: 'Remove Webhook Example'})\r\n * .then(function(r) {\r\n * room = r;\r\n * return webex.webhooks.create({\r\n * resource: 'messages',\r\n * event: 'created',\r\n * filter: 'roomId=' + room.id,\r\n * targetUrl: 'https://example.com/webhook',\r\n * name: 'Test Webhook'\r\n * });\r\n * })\r\n * .then(function(w) {\r\n * webhook = w;\r\n * return webex.webhooks.remove(webhook);\r\n * })\r\n * .then(function() {\r\n * return webex.webhooks.list();\r\n * })\r\n * .then(function(webhooks) {\r\n * var assert = require('assert');\r\n * assert.equal(webhooks.items.filter(function(w) {\r\n * return w.id === webhook.id;\r\n * }).length, 0);\r\n * return 'success';\r\n * });\r\n * // => success\r\n */\r\n remove(webhook) {\r\n const id = webhook.id || webhook;\r\n\r\n return this.request({\r\n method: 'DELETE',\r\n service: 'hydra',\r\n resource: `webhooks/${id}`,\r\n }).then((res) => {\r\n // Firefox has some issues with 204s and/or DELETE. This should move to\r\n // http-core\r\n if (res.statusCode === 204) {\r\n return undefined;\r\n }\r\n\r\n return res.body;\r\n });\r\n },\r\n\r\n /**\r\n * Update a webhook.\r\n * @instance\r\n * @memberof Webhooks\r\n * @param {Webhook} webhook\r\n * @returns {Promise<Webhook>}\r\n * @example\r\n * var webhook;\r\n * webex.rooms.create({title: 'Webhook Example'})\r\n * .then(function(room) {\r\n * return webex.webhooks.create({\r\n * resource: 'messages',\r\n * event: 'created',\r\n * filter: 'roomId=' + room.id,\r\n * targetUrl: 'https://example.com/webhook',\r\n * name: 'Test Webhook'\r\n * });\r\n * })\r\n * .then(function(w) {\r\n * webhook = w;\r\n * webhook.targetUrl = 'https://example.com/webhook/newtarget';\r\n * return webex.webhooks.update(webhook);\r\n * })\r\n * .then(function() {\r\n * return webex.webhooks.get(webhook);\r\n * })\r\n * .then(function(webhook) {\r\n * var assert = require('assert');\r\n * assert.equal(webhook.targetUrl, 'https://example.com/webhook/newtarget');\r\n * return 'success';\r\n * });\r\n * // => success\r\n */\r\n update(webhook) {\r\n const {id} = webhook;\r\n\r\n return this.request({\r\n method: 'PUT',\r\n service: 'hydra',\r\n resource: `webhooks/${id}`,\r\n body: webhook,\r\n }).then((res) => res.body);\r\n },\r\n});\r\n\r\nexport default Webhooks;\r\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,WAAAA,OAACC,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,WAAAA,IAACR,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,WAAAA,KAACC,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,WAAAA,OAAClB,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,WAAAA,OAACrB,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,GAEY3B,QAAQ;AAAA4B,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
package/jest.config.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const config = require('@webex/jest-config-legacy');
|
|
2
|
-
|
|
3
|
-
module.exports = config;
|
|
1
|
+
const config = require('@webex/jest-config-legacy');
|
|
2
|
+
|
|
3
|
+
module.exports = config;
|
package/package.json
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/plugin-webhooks",
|
|
3
|
-
"version": "2.59.2",
|
|
4
3
|
"description": "",
|
|
5
4
|
"license": "MIT",
|
|
6
5
|
"main": "dist/index.js",
|
|
@@ -21,31 +20,33 @@
|
|
|
21
20
|
},
|
|
22
21
|
"devDependencies": {
|
|
23
22
|
"@babel/core": "^7.17.10",
|
|
24
|
-
"@webex/babel-config-legacy": "
|
|
25
|
-
"@webex/eslint-config-legacy": "
|
|
26
|
-
"@webex/jest-config-legacy": "
|
|
27
|
-
"@webex/legacy-tools": "
|
|
28
|
-
"@webex/test-helper-chai": "2.59.
|
|
29
|
-
"@webex/test-helper-mocha": "2.59.
|
|
30
|
-
"@webex/test-helper-mock-webex": "2.59.
|
|
31
|
-
"@webex/test-helper-test-users": "2.59.
|
|
23
|
+
"@webex/babel-config-legacy": "^0.0.0",
|
|
24
|
+
"@webex/eslint-config-legacy": "^0.0.0",
|
|
25
|
+
"@webex/jest-config-legacy": "^0.0.0",
|
|
26
|
+
"@webex/legacy-tools": "^0.0.0",
|
|
27
|
+
"@webex/test-helper-chai": "^2.59.3-next.1",
|
|
28
|
+
"@webex/test-helper-mocha": "^2.59.3-next.1",
|
|
29
|
+
"@webex/test-helper-mock-webex": "^2.59.3-next.1",
|
|
30
|
+
"@webex/test-helper-test-users": "^2.59.3-next.1",
|
|
32
31
|
"eslint": "^8.24.0",
|
|
33
32
|
"prettier": "^2.7.1",
|
|
34
33
|
"sinon": "^9.2.4"
|
|
35
34
|
},
|
|
36
35
|
"dependencies": {
|
|
37
|
-
"@webex/internal-plugin-device": "2.59.
|
|
38
|
-
"@webex/plugin-logger": "2.59.
|
|
39
|
-
"@webex/plugin-rooms": "2.59.
|
|
40
|
-
"@webex/webex-core": "2.59.
|
|
36
|
+
"@webex/internal-plugin-device": "^2.59.3-next.1",
|
|
37
|
+
"@webex/plugin-logger": "^2.59.3-next.1",
|
|
38
|
+
"@webex/plugin-rooms": "^2.59.3-next.1",
|
|
39
|
+
"@webex/webex-core": "^2.59.3-next.1"
|
|
41
40
|
},
|
|
42
41
|
"scripts": {
|
|
43
42
|
"build": "yarn build:src",
|
|
44
43
|
"build:src": "webex-legacy-tools build -dest \"./dist\" -src \"./src\" -js -ts -maps",
|
|
44
|
+
"deploy:npm": "yarn npm publish",
|
|
45
45
|
"test": "yarn test:style && yarn test:unit && yarn test:integration && yarn test:browser",
|
|
46
46
|
"test:browser:broken": "webex-legacy-tools test --integration --unit --runner karma",
|
|
47
47
|
"test:integration:broken": "webex-legacy-tools test --integration --runner mocha",
|
|
48
48
|
"test:style": "eslint ./src/**/*.*",
|
|
49
49
|
"test:unit": "webex-legacy-tools test --unit --runner jest"
|
|
50
|
-
}
|
|
51
|
-
|
|
50
|
+
},
|
|
51
|
+
"version": "2.59.3-next.1"
|
|
52
|
+
}
|
package/process
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
module.exports = {browser: true};
|
|
1
|
+
module.exports = {browser: true};
|