@webex/internal-plugin-dss 2.59.3-next.1 → 2.59.4-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 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,80 +1,80 @@
1
- # @webex/internal-plugin-dss
2
-
3
- [![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
4
-
5
- > Plugin for Directory Search Service (DSS)
6
-
7
- This is an internal Cisco Webex plugin. As such, it does not strictly adhere to semantic versioning. Use at your own risk. If you're not working on one of our first party clients, please look at our [developer api](https://developer.webex.com/) and stick to our public plugins.
8
-
9
- - [Install](#install)
10
- - [Usage](#usage)
11
- - [Maintainers](#maintainers)
12
- - [Contribute](#contribute)
13
- - [License](#license)
14
-
15
- ## Install
16
-
17
- ```bash
18
- npm install --save @webex/internal-plugin-dss
19
- ```
20
-
21
- ## Usage
22
-
23
- ```js
24
- import '@webex/internal-plugin-dss';
25
-
26
- import WebexCore from '@webex/webex-core';
27
-
28
- const webex = new WebexCore();
29
-
30
- // Namespace.
31
- webex.internal.dss
32
-
33
- // Register the plugin (connects to mercury).
34
- webex.internal.dss.register()
35
- .then(() => {}) // On successful registration.
36
- .catch(() => {}); // On failed registration.
37
-
38
- // Unregister the plugin (disconnects from mercury).
39
- webex.internal.dss.unregister()
40
- .then(() => {}) // On successful unregistration.
41
- .catch(() => {}); // On failed unregistration.
42
-
43
- // Methods
44
-
45
- // Get detailed information on an entity
46
- webex.internal.dss.lookupDetail({id: <entity-uuid>}).then((results) => {})
47
-
48
- // Get information on multiple identities
49
- webex.internal.dss.lookup({ids: [<entity-uuid-1>, <entity-uuid-2>]}).then((results) => {})
50
-
51
- // If you know the entity provider, you can speed up the query
52
- webex.internal.dss.lookup({
53
- ids: [<entity-uuid-1>, <entity-uuid-2>],
54
- entityProviderType: 'CI_USER'
55
- }).then((results) => {})
56
-
57
- // Get information on entities by querying their email addresses
58
- webex.internal.dss.lookupByEmail(
59
- {emails: ['email1@example.com', 'email2@example.com']}
60
- ).then((results) => {})
61
-
62
- // Search for information on certain type(s)
63
- webex.internal.dss.search({
64
- requestedTypes: [PERSON],
65
- queryString: 'a name',
66
- resultSize: 10,
67
- }).then((results) => {})
68
- ```
69
-
70
- ## Maintainers
71
-
72
- This package is maintained by [Cisco Webex for Developers](https://developer.webex.com/).
73
-
74
- ## Contribute
75
-
76
- Pull requests welcome. Please see [CONTRIBUTING.md](https://github.com/webex/webex-js-sdk/blob/master/CONTRIBUTING.md) for more details.
77
-
78
- ## License
79
-
80
- © 2016-2022 Cisco and/or its affiliates. All Rights Reserved.
1
+ # @webex/internal-plugin-dss
2
+
3
+ [![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
4
+
5
+ > Plugin for Directory Search Service (DSS)
6
+
7
+ This is an internal Cisco Webex plugin. As such, it does not strictly adhere to semantic versioning. Use at your own risk. If you're not working on one of our first party clients, please look at our [developer api](https://developer.webex.com/) and stick to our public plugins.
8
+
9
+ - [Install](#install)
10
+ - [Usage](#usage)
11
+ - [Maintainers](#maintainers)
12
+ - [Contribute](#contribute)
13
+ - [License](#license)
14
+
15
+ ## Install
16
+
17
+ ```bash
18
+ npm install --save @webex/internal-plugin-dss
19
+ ```
20
+
21
+ ## Usage
22
+
23
+ ```js
24
+ import '@webex/internal-plugin-dss';
25
+
26
+ import WebexCore from '@webex/webex-core';
27
+
28
+ const webex = new WebexCore();
29
+
30
+ // Namespace.
31
+ webex.internal.dss
32
+
33
+ // Register the plugin (connects to mercury).
34
+ webex.internal.dss.register()
35
+ .then(() => {}) // On successful registration.
36
+ .catch(() => {}); // On failed registration.
37
+
38
+ // Unregister the plugin (disconnects from mercury).
39
+ webex.internal.dss.unregister()
40
+ .then(() => {}) // On successful unregistration.
41
+ .catch(() => {}); // On failed unregistration.
42
+
43
+ // Methods
44
+
45
+ // Get detailed information on an entity
46
+ webex.internal.dss.lookupDetail({id: <entity-uuid>}).then((results) => {})
47
+
48
+ // Get information on multiple identities
49
+ webex.internal.dss.lookup({ids: [<entity-uuid-1>, <entity-uuid-2>]}).then((results) => {})
50
+
51
+ // If you know the entity provider, you can speed up the query
52
+ webex.internal.dss.lookup({
53
+ ids: [<entity-uuid-1>, <entity-uuid-2>],
54
+ entityProviderType: 'CI_USER'
55
+ }).then((results) => {})
56
+
57
+ // Get information on entities by querying their email addresses
58
+ webex.internal.dss.lookupByEmail(
59
+ {emails: ['email1@example.com', 'email2@example.com']}
60
+ ).then((results) => {})
61
+
62
+ // Search for information on certain type(s)
63
+ webex.internal.dss.search({
64
+ requestedTypes: [PERSON],
65
+ queryString: 'a name',
66
+ resultSize: 10,
67
+ }).then((results) => {})
68
+ ```
69
+
70
+ ## Maintainers
71
+
72
+ This package is maintained by [Cisco Webex for Developers](https://developer.webex.com/).
73
+
74
+ ## Contribute
75
+
76
+ Pull requests welcome. Please see [CONTRIBUTING.md](https://github.com/webex/webex-js-sdk/blob/master/CONTRIBUTING.md) for more details.
77
+
78
+ ## License
79
+
80
+ © 2016-2022 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;
@@ -1 +1 @@
1
- {"version":3,"names":["DSS_REGISTERED","exports","DSS_UNREGISTERED","DSS_LOOKUP_MERCURY_EVENT","DSS_SEARCH_MERCURY_EVENT","DSS_LOOKUP_RESULT","DSS_RESULT","DSS_SERVICE_NAME","SEARCH_TYPES","PERSON","CALLING_SERVICE","EXTERNAL_CALLING","ROOM","ROBOT"],"sources":["constants.ts"],"sourcesContent":["export const DSS_REGISTERED = 'dss:registered';\r\nexport const DSS_UNREGISTERED = 'dss:unregistered';\r\nexport const DSS_LOOKUP_MERCURY_EVENT = 'event:directory.lookup';\r\nexport const DSS_SEARCH_MERCURY_EVENT = 'event:directory.search';\r\nexport const DSS_LOOKUP_RESULT = 'dss:lookup.result';\r\nexport const DSS_RESULT = 'dss:result';\r\nexport const DSS_SERVICE_NAME = 'directorySearch';\r\nexport const SEARCH_TYPES = {\r\n PERSON: 'PERSON',\r\n CALLING_SERVICE: 'CALLING_SERVICE',\r\n EXTERNAL_CALLING: 'EXTERNAL_CALLING',\r\n ROOM: 'ROOM',\r\n ROBOT: 'ROBOT',\r\n};\r\n"],"mappings":";;;;;;;AAAO,IAAMA,cAAc,GAAG,gBAAgB;AAACC,OAAA,CAAAD,cAAA,GAAAA,cAAA;AACxC,IAAME,gBAAgB,GAAG,kBAAkB;AAACD,OAAA,CAAAC,gBAAA,GAAAA,gBAAA;AAC5C,IAAMC,wBAAwB,GAAG,wBAAwB;AAACF,OAAA,CAAAE,wBAAA,GAAAA,wBAAA;AAC1D,IAAMC,wBAAwB,GAAG,wBAAwB;AAACH,OAAA,CAAAG,wBAAA,GAAAA,wBAAA;AAC1D,IAAMC,iBAAiB,GAAG,mBAAmB;AAACJ,OAAA,CAAAI,iBAAA,GAAAA,iBAAA;AAC9C,IAAMC,UAAU,GAAG,YAAY;AAACL,OAAA,CAAAK,UAAA,GAAAA,UAAA;AAChC,IAAMC,gBAAgB,GAAG,iBAAiB;AAACN,OAAA,CAAAM,gBAAA,GAAAA,gBAAA;AAC3C,IAAMC,YAAY,GAAG;EAC1BC,MAAM,EAAE,QAAQ;EAChBC,eAAe,EAAE,iBAAiB;EAClCC,gBAAgB,EAAE,kBAAkB;EACpCC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE;AACT,CAAC;AAACZ,OAAA,CAAAO,YAAA,GAAAA,YAAA"}
1
+ {"version":3,"names":["DSS_REGISTERED","exports","DSS_UNREGISTERED","DSS_LOOKUP_MERCURY_EVENT","DSS_SEARCH_MERCURY_EVENT","DSS_LOOKUP_RESULT","DSS_RESULT","DSS_SERVICE_NAME","SEARCH_TYPES","PERSON","CALLING_SERVICE","EXTERNAL_CALLING","ROOM","ROBOT"],"sources":["constants.ts"],"sourcesContent":["export const DSS_REGISTERED = 'dss:registered';\nexport const DSS_UNREGISTERED = 'dss:unregistered';\nexport const DSS_LOOKUP_MERCURY_EVENT = 'event:directory.lookup';\nexport const DSS_SEARCH_MERCURY_EVENT = 'event:directory.search';\nexport const DSS_LOOKUP_RESULT = 'dss:lookup.result';\nexport const DSS_RESULT = 'dss:result';\nexport const DSS_SERVICE_NAME = 'directorySearch';\nexport const SEARCH_TYPES = {\n PERSON: 'PERSON',\n CALLING_SERVICE: 'CALLING_SERVICE',\n EXTERNAL_CALLING: 'EXTERNAL_CALLING',\n ROOM: 'ROOM',\n ROBOT: 'ROBOT',\n};\n"],"mappings":";;;;;;;AAAO,IAAMA,cAAc,GAAG,gBAAgB;AAACC,OAAA,CAAAD,cAAA,GAAAA,cAAA;AACxC,IAAME,gBAAgB,GAAG,kBAAkB;AAACD,OAAA,CAAAC,gBAAA,GAAAA,gBAAA;AAC5C,IAAMC,wBAAwB,GAAG,wBAAwB;AAACF,OAAA,CAAAE,wBAAA,GAAAA,wBAAA;AAC1D,IAAMC,wBAAwB,GAAG,wBAAwB;AAACH,OAAA,CAAAG,wBAAA,GAAAA,wBAAA;AAC1D,IAAMC,iBAAiB,GAAG,mBAAmB;AAACJ,OAAA,CAAAI,iBAAA,GAAAA,iBAAA;AAC9C,IAAMC,UAAU,GAAG,YAAY;AAACL,OAAA,CAAAK,UAAA,GAAAA,UAAA;AAChC,IAAMC,gBAAgB,GAAG,iBAAiB;AAACN,OAAA,CAAAM,gBAAA,GAAAA,gBAAA;AAC3C,IAAMC,YAAY,GAAG;EAC1BC,MAAM,EAAE,QAAQ;EAChBC,eAAe,EAAE,iBAAiB;EAClCC,gBAAgB,EAAE,kBAAkB;EACpCC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE;AACT,CAAC;AAACZ,OAAA,CAAAO,YAAA,GAAAA,YAAA"}
package/dist/dss.js CHANGED
@@ -11,33 +11,31 @@ _Object$defineProperty(exports, "__esModule", {
11
11
  value: true
12
12
  });
13
13
  exports.default = void 0;
14
- var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
15
- var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
16
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
17
15
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/toConsumableArray"));
18
- var _get2 = _interopRequireDefault(require("lodash/get"));
19
- var _isEqual2 = _interopRequireDefault(require("lodash/isEqual"));
20
- var _range2 = _interopRequireDefault(require("lodash/range"));
16
+ var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
17
+ var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
21
18
  var _uuid = _interopRequireDefault(require("uuid"));
22
19
  var _webexCore = require("@webex/webex-core");
23
20
  require("@webex/internal-plugin-mercury");
21
+ var _lodash = require("lodash");
24
22
  var _constants = require("./constants");
25
23
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys2(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
26
24
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
27
25
  var DSS = _webexCore.WebexPlugin.extend({
28
26
  namespace: 'DSS',
29
- /**
30
- * registered value indicating events registration is successful
31
- * @instance
32
- * @type {Boolean}
33
- * @memberof DSS
27
+ /**
28
+ * registered value indicating events registration is successful
29
+ * @instance
30
+ * @type {Boolean}
31
+ * @memberof DSS
34
32
  */
35
33
  registered: false,
36
- /**
37
- * Explicitly sets up the DSS plugin by connecting to mercury, and listening for DSS events.
38
- * @returns {Promise}
39
- * @public
40
- * @memberof DSS
34
+ /**
35
+ * Explicitly sets up the DSS plugin by connecting to mercury, and listening for DSS events.
36
+ * @returns {Promise}
37
+ * @public
38
+ * @memberof DSS
41
39
  */
42
40
  register: function register() {
43
41
  var _this = this;
@@ -58,11 +56,11 @@ var DSS = _webexCore.WebexPlugin.extend({
58
56
  return _promise.default.reject(error);
59
57
  });
60
58
  },
61
- /**
62
- * Explicitly tears down the DSS plugin by disconnecting from mercury, and stops listening to DSS events
63
- * @returns {Promise}
64
- * @public
65
- * @memberof DSS
59
+ /**
60
+ * Explicitly tears down the DSS plugin by disconnecting from mercury, and stops listening to DSS events
61
+ * @returns {Promise}
62
+ * @public
63
+ * @memberof DSS
66
64
  */
67
65
  unregister: function unregister() {
68
66
  var _this2 = this;
@@ -76,10 +74,10 @@ var DSS = _webexCore.WebexPlugin.extend({
76
74
  _this2.registered = false;
77
75
  });
78
76
  },
79
- /**
80
- * registers for DSS events through mercury
81
- * @returns {undefined}
82
- * @private
77
+ /**
78
+ * registers for DSS events through mercury
79
+ * @returns {undefined}
80
+ * @private
83
81
  */
84
82
  listenForEvents: function listenForEvents() {
85
83
  var _this3 = this;
@@ -90,37 +88,37 @@ var DSS = _webexCore.WebexPlugin.extend({
90
88
  _this3._handleEvent(envelope.data);
91
89
  });
92
90
  },
93
- /**
94
- * unregisteres all the DSS events from mercury
95
- * @returns {undefined}
96
- * @private
91
+ /**
92
+ * unregisteres all the DSS events from mercury
93
+ * @returns {undefined}
94
+ * @private
97
95
  */
98
96
  stopListeningForEvents: function stopListeningForEvents() {
99
97
  this.webex.internal.mercury.off(_constants.DSS_LOOKUP_MERCURY_EVENT);
100
98
  this.webex.internal.mercury.off(_constants.DSS_SEARCH_MERCURY_EVENT);
101
99
  },
102
- /**
103
- * @param {UUID} requestId the id of the request
104
- * @returns {string}
100
+ /**
101
+ * @param {UUID} requestId the id of the request
102
+ * @returns {string}
105
103
  */
106
104
  _getResultEventName: function _getResultEventName(requestId) {
107
105
  return "".concat(_constants.DSS_RESULT).concat(requestId);
108
106
  },
109
- /**
110
- * @param {Object} data the event data
111
- * @returns {undefined}
107
+ /**
108
+ * @param {Object} data the event data
109
+ * @returns {undefined}
112
110
  */
113
111
  _handleEvent: function _handleEvent(data) {
114
112
  this.trigger(this._getResultEventName(data.requestId), data);
115
113
  this.trigger(_constants.DSS_LOOKUP_RESULT, data);
116
114
  },
117
- /**
118
- * Makes the request to the directory service
119
- * @param {Object} options
120
- * @param {string} options.resource the URL to query
121
- * @param {string} options.params additional params for the body of the request
122
- * @param {string} options.dataPath to path to get the data in the result object
123
- * @returns {Promise} Resolves with an array of entities found
115
+ /**
116
+ * Makes the request to the directory service
117
+ * @param {Object} options
118
+ * @param {string} options.resource the URL to query
119
+ * @param {string} options.params additional params for the body of the request
120
+ * @param {string} options.dataPath to path to get the data in the result object
121
+ * @returns {Promise} Resolves with an array of entities found
124
122
  */
125
123
  _request: function _request(options) {
126
124
  var _this4 = this;
@@ -133,12 +131,12 @@ var DSS = _webexCore.WebexPlugin.extend({
133
131
  var expectedSeqNums;
134
132
  return new _promise.default(function (resolve) {
135
133
  _this4.listenTo(_this4, eventName, function (data) {
136
- var resultData = (0, _get2.default)(data, dataPath);
134
+ var resultData = (0, _lodash.get)(data, dataPath);
137
135
  result[data.sequence] = resultData;
138
136
  if (data.finished) {
139
- expectedSeqNums = (0, _range2.default)(data.sequence + 1).map(String);
137
+ expectedSeqNums = (0, _lodash.range)(data.sequence + 1).map(String);
140
138
  }
141
- var done = (0, _isEqual2.default)(expectedSeqNums, (0, _keys.default)(result));
139
+ var done = (0, _lodash.isEqual)(expectedSeqNums, (0, _keys.default)(result));
142
140
  if (done) {
143
141
  var resultArray = [];
144
142
  expectedSeqNums.forEach(function (index) {
@@ -162,11 +160,11 @@ var DSS = _webexCore.WebexPlugin.extend({
162
160
  });
163
161
  });
164
162
  },
165
- /**
166
- * Retrieves detailed information about an entity
167
- * @param {Object} options
168
- * @param {UUID} options.id the id of the entity to lookup
169
- * @returns {Promise} Resolves with an array of entities found
163
+ /**
164
+ * Retrieves detailed information about an entity
165
+ * @param {Object} options
166
+ * @param {UUID} options.id the id of the entity to lookup
167
+ * @returns {Promise} Resolves with an array of entities found
170
168
  */
171
169
  lookupDetail: function lookupDetail(options) {
172
170
  var id = options.id;
@@ -175,12 +173,12 @@ var DSS = _webexCore.WebexPlugin.extend({
175
173
  resource: "/lookup/orgid/".concat(this.webex.internal.device.orgId, "/identity/").concat(id, "/detail")
176
174
  });
177
175
  },
178
- /**
179
- * Retrieves basic information about a list entities within an organization
180
- * @param {Object} options
181
- * @param {UUID} options.ids the id of the entity to lookup
182
- * @param {UUID} options.entityProviderType the provider to query (optional)
183
- * @returns {Promise} Resolves with an array of entities found
176
+ /**
177
+ * Retrieves basic information about a list entities within an organization
178
+ * @param {Object} options
179
+ * @param {UUID} options.ids the id of the entity to lookup
180
+ * @param {UUID} options.entityProviderType the provider to query (optional)
181
+ * @returns {Promise} Resolves with an array of entities found
184
182
  */
185
183
  lookup: function lookup(options) {
186
184
  var ids = options.ids,
@@ -194,11 +192,11 @@ var DSS = _webexCore.WebexPlugin.extend({
194
192
  }
195
193
  });
196
194
  },
197
- /**
198
- * Retrieves basic information about a list entities within an organization
199
- * @param {Object} options
200
- * @param {UUID} options.emails the emails of the entities to lookup
201
- * @returns {Promise} Resolves with an array of entities found
195
+ /**
196
+ * Retrieves basic information about a list entities within an organization
197
+ * @param {Object} options
198
+ * @param {UUID} options.emails the emails of the entities to lookup
199
+ * @returns {Promise} Resolves with an array of entities found
202
200
  */
203
201
  lookupByEmail: function lookupByEmail(options) {
204
202
  var emails = options.emails;
@@ -210,13 +208,13 @@ var DSS = _webexCore.WebexPlugin.extend({
210
208
  }
211
209
  });
212
210
  },
213
- /**
214
- * Search for information about entities
215
- * @param {Object} options
216
- * @param {SearchType[]} options.requestedTypes an array of search types from: PERSON, CALLING_SERVICE, EXTERNAL_CALLING, ROOM, ROBOT
217
- * @param {string[]} options.queryString A query string that will be transformed into a Directory search filter query. It is used to search the following fields: username, givenName, familyName, displayName and email
218
- * @param {number} options.resultSize The maximum number of results returned from each provider
219
- * @returns {Promise} Resolves with an array of entities found
211
+ /**
212
+ * Search for information about entities
213
+ * @param {Object} options
214
+ * @param {SearchType[]} options.requestedTypes an array of search types from: PERSON, CALLING_SERVICE, EXTERNAL_CALLING, ROOM, ROBOT
215
+ * @param {string[]} options.queryString A query string that will be transformed into a Directory search filter query. It is used to search the following fields: username, givenName, familyName, displayName and email
216
+ * @param {number} options.resultSize The maximum number of results returned from each provider
217
+ * @returns {Promise} Resolves with an array of entities found
220
218
  */
221
219
  search: function search(options) {
222
220
  var requestedTypes = options.requestedTypes,
@@ -232,12 +230,12 @@ var DSS = _webexCore.WebexPlugin.extend({
232
230
  }
233
231
  });
234
232
  },
235
- /**
236
- * Search for information about places
237
- * @param {Object} options
238
- * @param {string} options.queryString A query string that will be transformed into a Directory search filter query. It is used to search the following fields: placeName, displayName.
239
- * @param {number} options.resultSize The maximum number of results returned from each provider
240
- * @returns {Promise} Resolves with an array of entities found
233
+ /**
234
+ * Search for information about places
235
+ * @param {Object} options
236
+ * @param {string} options.queryString A query string that will be transformed into a Directory search filter query. It is used to search the following fields: placeName, displayName.
237
+ * @param {number} options.resultSize The maximum number of results returned from each provider
238
+ * @returns {Promise} Resolves with an array of entities found
241
239
  */
242
240
  searchPlaces: function searchPlaces(options) {
243
241
  var _this5 = this;
@@ -257,7 +255,7 @@ var DSS = _webexCore.WebexPlugin.extend({
257
255
  return _promise.default.reject(error);
258
256
  });
259
257
  },
260
- version: "2.59.0"
258
+ version: "2.59.4-next.1"
261
259
  });
262
260
  var _default = DSS;
263
261
  exports.default = _default;
package/dist/dss.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["_uuid","_interopRequireDefault","require","_webexCore","_constants","ownKeys","object","enumerableOnly","keys","_Object$keys2","_Object$getOwnPropertySymbols","symbols","filter","sym","_Object$getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","Object","forEach","key","_defineProperty2","default","_Object$getOwnPropertyDescriptors","_Object$defineProperties","_Object$defineProperty","DSS","WebexPlugin","extend","namespace","registered","register","_this","webex","canAuthorize","logger","error","_promise","reject","Error","info","resolve","internal","mercury","connect","then","listenForEvents","trigger","DSS_REGISTERED","catch","concat","message","unregister","_this2","stopListeningForEvents","disconnect","DSS_UNREGISTERED","_this3","on","DSS_LOOKUP_MERCURY_EVENT","envelope","_handleEvent","data","DSS_SEARCH_MERCURY_EVENT","off","_getResultEventName","requestId","DSS_RESULT","DSS_LOOKUP_RESULT","_request","options","_this4","resource","params","dataPath","uuid","v4","eventName","result","expectedSeqNums","listenTo","resultData","_get2","sequence","finished","_range2","map","String","done","_isEqual2","_keys","resultArray","index","seqResult","_toConsumableArray2","stopListening","request","service","DSS_SERVICE_NAME","method","contentType","body","lookupDetail","id","device","orgId","lookup","ids","entityProviderType","lookupValues","lookupByEmail","emails","search","requestedTypes","resultSize","queryString","searchPlaces","_this5","isOnlySchedulableRooms","version","_default","exports"],"sources":["dss.ts"],"sourcesContent":["/* eslint-disable no-underscore-dangle */\r\n/*!\r\n * Copyright (c) 2015-2022 Cisco Systems, Inc. See LICENSE file.\r\n */\r\nimport uuid from 'uuid';\r\nimport {WebexPlugin} from '@webex/webex-core';\r\nimport '@webex/internal-plugin-mercury';\r\nimport {range, isEqual, get} from 'lodash';\r\nimport type {\r\n SearchOptions,\r\n LookupDetailOptions,\r\n LookupOptions,\r\n LookupByEmailOptions,\r\n SearchPlaceOptions,\r\n} from './types';\r\n\r\nimport {\r\n DSS_REGISTERED,\r\n DSS_UNREGISTERED,\r\n DSS_LOOKUP_MERCURY_EVENT,\r\n DSS_LOOKUP_RESULT,\r\n DSS_SERVICE_NAME,\r\n DSS_SEARCH_MERCURY_EVENT,\r\n DSS_RESULT,\r\n} from './constants';\r\n\r\nconst DSS = WebexPlugin.extend({\r\n namespace: 'DSS',\r\n\r\n /**\r\n * registered value indicating events registration is successful\r\n * @instance\r\n * @type {Boolean}\r\n * @memberof DSS\r\n */\r\n registered: false,\r\n\r\n /**\r\n * Explicitly sets up the DSS plugin by connecting to mercury, and listening for DSS events.\r\n * @returns {Promise}\r\n * @public\r\n * @memberof DSS\r\n */\r\n register() {\r\n if (!this.webex.canAuthorize) {\r\n this.logger.error('DSS->register#ERROR, Unable to register, SDK cannot authorize');\r\n\r\n return Promise.reject(new Error('SDK cannot authorize'));\r\n }\r\n\r\n if (this.registered) {\r\n this.logger.info('dss->register#INFO, DSS plugin already registered');\r\n\r\n return Promise.resolve();\r\n }\r\n\r\n return this.webex.internal.mercury\r\n .connect()\r\n .then(() => {\r\n this.listenForEvents();\r\n this.trigger(DSS_REGISTERED);\r\n this.registered = true;\r\n })\r\n .catch((error) => {\r\n this.logger.error(`DSS->register#ERROR, Unable to register, ${error.message}`);\r\n\r\n return Promise.reject(error);\r\n });\r\n },\r\n\r\n /**\r\n * Explicitly tears down the DSS plugin by disconnecting from mercury, and stops listening to DSS events\r\n * @returns {Promise}\r\n * @public\r\n * @memberof DSS\r\n */\r\n unregister() {\r\n if (!this.registered) {\r\n this.logger.info('DSS->unregister#INFO, DSS plugin already unregistered');\r\n\r\n return Promise.resolve();\r\n }\r\n\r\n this.stopListeningForEvents();\r\n\r\n return this.webex.internal.mercury.disconnect().then(() => {\r\n this.trigger(DSS_UNREGISTERED);\r\n this.registered = false;\r\n });\r\n },\r\n\r\n /**\r\n * registers for DSS events through mercury\r\n * @returns {undefined}\r\n * @private\r\n */\r\n listenForEvents() {\r\n this.webex.internal.mercury.on(DSS_LOOKUP_MERCURY_EVENT, (envelope) => {\r\n this._handleEvent(envelope.data);\r\n });\r\n this.webex.internal.mercury.on(DSS_SEARCH_MERCURY_EVENT, (envelope) => {\r\n this._handleEvent(envelope.data);\r\n });\r\n },\r\n\r\n /**\r\n * unregisteres all the DSS events from mercury\r\n * @returns {undefined}\r\n * @private\r\n */\r\n stopListeningForEvents() {\r\n this.webex.internal.mercury.off(DSS_LOOKUP_MERCURY_EVENT);\r\n this.webex.internal.mercury.off(DSS_SEARCH_MERCURY_EVENT);\r\n },\r\n\r\n /**\r\n * @param {UUID} requestId the id of the request\r\n * @returns {string}\r\n */\r\n _getResultEventName(requestId) {\r\n return `${DSS_RESULT}${requestId}`;\r\n },\r\n\r\n /**\r\n * @param {Object} data the event data\r\n * @returns {undefined}\r\n */\r\n _handleEvent(data) {\r\n this.trigger(this._getResultEventName(data.requestId), data);\r\n this.trigger(DSS_LOOKUP_RESULT, data);\r\n },\r\n\r\n /**\r\n * Makes the request to the directory service\r\n * @param {Object} options\r\n * @param {string} options.resource the URL to query\r\n * @param {string} options.params additional params for the body of the request\r\n * @param {string} options.dataPath to path to get the data in the result object\r\n * @returns {Promise} Resolves with an array of entities found\r\n */\r\n _request(options) {\r\n const {resource, params, dataPath} = options;\r\n\r\n const requestId = uuid.v4();\r\n const eventName = this._getResultEventName(requestId);\r\n const result = {};\r\n let expectedSeqNums;\r\n\r\n return new Promise((resolve) => {\r\n this.listenTo(this, eventName, (data) => {\r\n const resultData = get(data, dataPath);\r\n\r\n result[data.sequence] = resultData;\r\n\r\n if (data.finished) {\r\n expectedSeqNums = range(data.sequence + 1).map(String);\r\n }\r\n\r\n const done = isEqual(expectedSeqNums, Object.keys(result));\r\n\r\n if (done) {\r\n const resultArray = [];\r\n expectedSeqNums.forEach((index) => {\r\n const seqResult = result[index];\r\n if (seqResult) {\r\n resultArray.push(...seqResult);\r\n }\r\n });\r\n\r\n resolve(resultArray);\r\n this.stopListening(this, eventName);\r\n }\r\n });\r\n this.webex.request({\r\n service: DSS_SERVICE_NAME,\r\n resource,\r\n method: 'POST',\r\n contentType: 'application/json',\r\n body: {requestId, ...params},\r\n });\r\n });\r\n },\r\n\r\n /**\r\n * Retrieves detailed information about an entity\r\n * @param {Object} options\r\n * @param {UUID} options.id the id of the entity to lookup\r\n * @returns {Promise} Resolves with an array of entities found\r\n */\r\n lookupDetail(options: LookupDetailOptions) {\r\n const {id} = options;\r\n\r\n return this._request({\r\n dataPath: 'lookupResult.entities',\r\n resource: `/lookup/orgid/${this.webex.internal.device.orgId}/identity/${id}/detail`,\r\n });\r\n },\r\n\r\n /**\r\n * Retrieves basic information about a list entities within an organization\r\n * @param {Object} options\r\n * @param {UUID} options.ids the id of the entity to lookup\r\n * @param {UUID} options.entityProviderType the provider to query (optional)\r\n * @returns {Promise} Resolves with an array of entities found\r\n */\r\n lookup(options: LookupOptions) {\r\n const {ids, entityProviderType} = options;\r\n\r\n const resource = entityProviderType\r\n ? `/lookup/orgid/${this.webex.internal.device.orgId}/entityprovidertype/${entityProviderType}`\r\n : `/lookup/orgid/${this.webex.internal.device.orgId}/identities`;\r\n\r\n return this._request({\r\n dataPath: 'lookupResult.entities',\r\n resource,\r\n params: {\r\n lookupValues: ids,\r\n },\r\n });\r\n },\r\n\r\n /**\r\n * Retrieves basic information about a list entities within an organization\r\n * @param {Object} options\r\n * @param {UUID} options.emails the emails of the entities to lookup\r\n * @returns {Promise} Resolves with an array of entities found\r\n */\r\n lookupByEmail(options: LookupByEmailOptions) {\r\n const {emails} = options;\r\n\r\n return this._request({\r\n dataPath: 'lookupResult.entities',\r\n resource: `/lookup/orgid/${this.webex.internal.device.orgId}/emails`,\r\n params: {\r\n lookupValues: emails,\r\n },\r\n });\r\n },\r\n\r\n /**\r\n * Search for information about entities\r\n * @param {Object} options\r\n * @param {SearchType[]} options.requestedTypes an array of search types from: PERSON, CALLING_SERVICE, EXTERNAL_CALLING, ROOM, ROBOT\r\n * @param {string[]} options.queryString A query string that will be transformed into a Directory search filter query. It is used to search the following fields: username, givenName, familyName, displayName and email\r\n * @param {number} options.resultSize The maximum number of results returned from each provider\r\n * @returns {Promise} Resolves with an array of entities found\r\n */\r\n search(options: SearchOptions) {\r\n const {requestedTypes, resultSize, queryString} = options;\r\n\r\n return this._request({\r\n dataPath: 'directoryEntities',\r\n resource: `/search/orgid/${this.webex.internal.device.orgId}/entities`,\r\n params: {\r\n queryString,\r\n resultSize,\r\n requestedTypes,\r\n },\r\n });\r\n },\r\n\r\n /**\r\n * Search for information about places\r\n * @param {Object} options\r\n * @param {string} options.queryString A query string that will be transformed into a Directory search filter query. It is used to search the following fields: placeName, displayName.\r\n * @param {number} options.resultSize The maximum number of results returned from each provider\r\n * @returns {Promise} Resolves with an array of entities found\r\n */\r\n searchPlaces(options: SearchPlaceOptions) {\r\n const {resultSize, queryString, isOnlySchedulableRooms} = options;\r\n\r\n return this._request({\r\n dataPath: 'directoryEntities',\r\n resource: `/search/orgid/${this.webex.internal.device.orgId}/places`,\r\n params: {\r\n queryString,\r\n resultSize,\r\n isOnlySchedulableRooms,\r\n },\r\n }).catch((error) => {\r\n this.logger.error(`DSS->search place#ERROR, search place failure, ${error.message}`);\r\n\r\n return Promise.reject(error);\r\n });\r\n },\r\n});\r\n\r\nexport default DSS;\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAIA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACAA,OAAA;AAUA,IAAAE,UAAA,GAAAF,OAAA;AAQqB,SAAAG,QAAAC,MAAA,EAAAC,cAAA,QAAAC,IAAA,GAAAC,aAAA,CAAAH,MAAA,OAAAI,6BAAA,QAAAC,OAAA,GAAAD,6BAAA,CAAAJ,MAAA,G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KAAK,EAAK;MAClBiF,MAAI,CAAClF,MAAM,CAACC,KAAK,mDAAAc,MAAA,CAAmDd,KAAK,CAACe,OAAO,EAAG;MAEpF,OAAOd,QAAA,CAAAf,OAAA,CAAQgB,MAAM,CAACF,KAAK,CAAC;IAC9B,CAAC,CAAC;EACJ,CAAC;EAAAmF,OAAA;AACH,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEY9F,GAAG;AAAA+F,OAAA,CAAAnG,OAAA,GAAAkG,QAAA"}
1
+ {"version":3,"names":["_uuid","_interopRequireDefault","require","_webexCore","_lodash","_constants","ownKeys","object","enumerableOnly","keys","_Object$keys2","_Object$getOwnPropertySymbols","symbols","filter","sym","_Object$getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","Object","forEach","key","_defineProperty2","default","_Object$getOwnPropertyDescriptors","_Object$defineProperties","_Object$defineProperty","DSS","WebexPlugin","extend","namespace","registered","register","_this","webex","canAuthorize","logger","error","_promise","reject","Error","info","resolve","internal","mercury","connect","then","listenForEvents","trigger","DSS_REGISTERED","catch","concat","message","unregister","_this2","stopListeningForEvents","disconnect","DSS_UNREGISTERED","_this3","on","DSS_LOOKUP_MERCURY_EVENT","envelope","_handleEvent","data","DSS_SEARCH_MERCURY_EVENT","off","_getResultEventName","requestId","DSS_RESULT","DSS_LOOKUP_RESULT","_request","options","_this4","resource","params","dataPath","uuid","v4","eventName","result","expectedSeqNums","listenTo","resultData","get","sequence","finished","range","map","String","done","isEqual","_keys","resultArray","index","seqResult","_toConsumableArray2","stopListening","request","service","DSS_SERVICE_NAME","method","contentType","body","lookupDetail","id","device","orgId","lookup","ids","entityProviderType","lookupValues","lookupByEmail","emails","search","requestedTypes","resultSize","queryString","searchPlaces","_this5","isOnlySchedulableRooms","version","_default","exports"],"sources":["dss.ts"],"sourcesContent":["/* eslint-disable no-underscore-dangle */\n/*!\n * Copyright (c) 2015-2022 Cisco Systems, Inc. See LICENSE file.\n */\nimport uuid from 'uuid';\nimport {WebexPlugin} from '@webex/webex-core';\nimport '@webex/internal-plugin-mercury';\nimport {range, isEqual, get} from 'lodash';\nimport type {\n SearchOptions,\n LookupDetailOptions,\n LookupOptions,\n LookupByEmailOptions,\n SearchPlaceOptions,\n} from './types';\n\nimport {\n DSS_REGISTERED,\n DSS_UNREGISTERED,\n DSS_LOOKUP_MERCURY_EVENT,\n DSS_LOOKUP_RESULT,\n DSS_SERVICE_NAME,\n DSS_SEARCH_MERCURY_EVENT,\n DSS_RESULT,\n} from './constants';\n\nconst DSS = WebexPlugin.extend({\n namespace: 'DSS',\n\n /**\n * registered value indicating events registration is successful\n * @instance\n * @type {Boolean}\n * @memberof DSS\n */\n registered: false,\n\n /**\n * Explicitly sets up the DSS plugin by connecting to mercury, and listening for DSS events.\n * @returns {Promise}\n * @public\n * @memberof DSS\n */\n register() {\n if (!this.webex.canAuthorize) {\n this.logger.error('DSS->register#ERROR, Unable to register, SDK cannot authorize');\n\n return Promise.reject(new Error('SDK cannot authorize'));\n }\n\n if (this.registered) {\n this.logger.info('dss->register#INFO, DSS plugin already registered');\n\n return Promise.resolve();\n }\n\n return this.webex.internal.mercury\n .connect()\n .then(() => {\n this.listenForEvents();\n this.trigger(DSS_REGISTERED);\n this.registered = true;\n })\n .catch((error) => {\n this.logger.error(`DSS->register#ERROR, Unable to register, ${error.message}`);\n\n return Promise.reject(error);\n });\n },\n\n /**\n * Explicitly tears down the DSS plugin by disconnecting from mercury, and stops listening to DSS events\n * @returns {Promise}\n * @public\n * @memberof DSS\n */\n unregister() {\n if (!this.registered) {\n this.logger.info('DSS->unregister#INFO, DSS plugin already unregistered');\n\n return Promise.resolve();\n }\n\n this.stopListeningForEvents();\n\n return this.webex.internal.mercury.disconnect().then(() => {\n this.trigger(DSS_UNREGISTERED);\n this.registered = false;\n });\n },\n\n /**\n * registers for DSS events through mercury\n * @returns {undefined}\n * @private\n */\n listenForEvents() {\n this.webex.internal.mercury.on(DSS_LOOKUP_MERCURY_EVENT, (envelope) => {\n this._handleEvent(envelope.data);\n });\n this.webex.internal.mercury.on(DSS_SEARCH_MERCURY_EVENT, (envelope) => {\n this._handleEvent(envelope.data);\n });\n },\n\n /**\n * unregisteres all the DSS events from mercury\n * @returns {undefined}\n * @private\n */\n stopListeningForEvents() {\n this.webex.internal.mercury.off(DSS_LOOKUP_MERCURY_EVENT);\n this.webex.internal.mercury.off(DSS_SEARCH_MERCURY_EVENT);\n },\n\n /**\n * @param {UUID} requestId the id of the request\n * @returns {string}\n */\n _getResultEventName(requestId) {\n return `${DSS_RESULT}${requestId}`;\n },\n\n /**\n * @param {Object} data the event data\n * @returns {undefined}\n */\n _handleEvent(data) {\n this.trigger(this._getResultEventName(data.requestId), data);\n this.trigger(DSS_LOOKUP_RESULT, data);\n },\n\n /**\n * Makes the request to the directory service\n * @param {Object} options\n * @param {string} options.resource the URL to query\n * @param {string} options.params additional params for the body of the request\n * @param {string} options.dataPath to path to get the data in the result object\n * @returns {Promise} Resolves with an array of entities found\n */\n _request(options) {\n const {resource, params, dataPath} = options;\n\n const requestId = uuid.v4();\n const eventName = this._getResultEventName(requestId);\n const result = {};\n let expectedSeqNums;\n\n return new Promise((resolve) => {\n this.listenTo(this, eventName, (data) => {\n const resultData = get(data, dataPath);\n\n result[data.sequence] = resultData;\n\n if (data.finished) {\n expectedSeqNums = range(data.sequence + 1).map(String);\n }\n\n const done = isEqual(expectedSeqNums, Object.keys(result));\n\n if (done) {\n const resultArray = [];\n expectedSeqNums.forEach((index) => {\n const seqResult = result[index];\n if (seqResult) {\n resultArray.push(...seqResult);\n }\n });\n\n resolve(resultArray);\n this.stopListening(this, eventName);\n }\n });\n this.webex.request({\n service: DSS_SERVICE_NAME,\n resource,\n method: 'POST',\n contentType: 'application/json',\n body: {requestId, ...params},\n });\n });\n },\n\n /**\n * Retrieves detailed information about an entity\n * @param {Object} options\n * @param {UUID} options.id the id of the entity to lookup\n * @returns {Promise} Resolves with an array of entities found\n */\n lookupDetail(options: LookupDetailOptions) {\n const {id} = options;\n\n return this._request({\n dataPath: 'lookupResult.entities',\n resource: `/lookup/orgid/${this.webex.internal.device.orgId}/identity/${id}/detail`,\n });\n },\n\n /**\n * Retrieves basic information about a list entities within an organization\n * @param {Object} options\n * @param {UUID} options.ids the id of the entity to lookup\n * @param {UUID} options.entityProviderType the provider to query (optional)\n * @returns {Promise} Resolves with an array of entities found\n */\n lookup(options: LookupOptions) {\n const {ids, entityProviderType} = options;\n\n const resource = entityProviderType\n ? `/lookup/orgid/${this.webex.internal.device.orgId}/entityprovidertype/${entityProviderType}`\n : `/lookup/orgid/${this.webex.internal.device.orgId}/identities`;\n\n return this._request({\n dataPath: 'lookupResult.entities',\n resource,\n params: {\n lookupValues: ids,\n },\n });\n },\n\n /**\n * Retrieves basic information about a list entities within an organization\n * @param {Object} options\n * @param {UUID} options.emails the emails of the entities to lookup\n * @returns {Promise} Resolves with an array of entities found\n */\n lookupByEmail(options: LookupByEmailOptions) {\n const {emails} = options;\n\n return this._request({\n dataPath: 'lookupResult.entities',\n resource: `/lookup/orgid/${this.webex.internal.device.orgId}/emails`,\n params: {\n lookupValues: emails,\n },\n });\n },\n\n /**\n * Search for information about entities\n * @param {Object} options\n * @param {SearchType[]} options.requestedTypes an array of search types from: PERSON, CALLING_SERVICE, EXTERNAL_CALLING, ROOM, ROBOT\n * @param {string[]} options.queryString A query string that will be transformed into a Directory search filter query. It is used to search the following fields: username, givenName, familyName, displayName and email\n * @param {number} options.resultSize The maximum number of results returned from each provider\n * @returns {Promise} Resolves with an array of entities found\n */\n search(options: SearchOptions) {\n const {requestedTypes, resultSize, queryString} = options;\n\n return this._request({\n dataPath: 'directoryEntities',\n resource: `/search/orgid/${this.webex.internal.device.orgId}/entities`,\n params: {\n queryString,\n resultSize,\n requestedTypes,\n },\n });\n },\n\n /**\n * Search for information about places\n * @param {Object} options\n * @param {string} options.queryString A query string that will be transformed into a Directory search filter query. It is used to search the following fields: placeName, displayName.\n * @param {number} options.resultSize The maximum number of results returned from each provider\n * @returns {Promise} Resolves with an array of entities found\n */\n searchPlaces(options: SearchPlaceOptions) {\n const {resultSize, queryString, isOnlySchedulableRooms} = options;\n\n return this._request({\n dataPath: 'directoryEntities',\n resource: `/search/orgid/${this.webex.internal.device.orgId}/places`,\n params: {\n queryString,\n resultSize,\n isOnlySchedulableRooms,\n },\n }).catch((error) => {\n this.logger.error(`DSS->search place#ERROR, search place failure, ${error.message}`);\n\n return Promise.reject(error);\n });\n },\n});\n\nexport default DSS;\n"],"mappings":";;;;;;;;;;;;;;;;;AAIA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACAA,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AASA,IAAAG,UAAA,GAAAH,OAAA;AAQqB,SAAAI,QAAAC,MAAA,EAAAC,cAAA,QAAAC,IAAA,GAAAC,aAAA,CAAAH,MAAA,OAAAI,6BAAA,QAAAC,OAAA,GAAAD,6BAAA,CAAAJ,MAAA,GAAAC,cAAA,KAAAI,OAAA,GAAAA,OAAA,CAAAC,MAAA,WAAAC,GAAA,WAAAC,gCAAA,CAAAR,MAAA,EAAAO,GAAA,EAAAE,UAAA,OAAAP,IAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,IAAA,EAAAG,OAAA,YAAAH,IAAA;AAAA,SAAAU,cAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,WAAAF,SAAA,CAAAD,CAAA,IAAAC,SAAA,CAAAD,CAAA,QAAAA,CAAA,OAAAf,OAAA,CAAAmB,MAAA,CAAAD,MAAA,OAAAE,OAAA,WAAAC,GAAA,QAAAC,gBAAA,CAAAC,OAAA,EAAAT,MAAA,EAAAO,GAAA,EAAAH,MAAA,CAAAG,GAAA,SAAAG,iCAAA,GAAAC,wBAAA,CAAAX,MAAA,EAAAU,iCAAA,CAAAN,MAAA,KAAAlB,OAAA,CAAAmB,MAAA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C;EACJ,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;AACA;EACEG,YAAY,WAAAA,aAAC9C,OAA2B,EAAE;IAAA,IAAA+C,MAAA;IACxC,IAAOH,UAAU,GAAyC5C,OAAO,CAA1D4C,UAAU;MAAEC,WAAW,GAA4B7C,OAAO,CAA9C6C,WAAW;MAAEG,sBAAsB,GAAIhD,OAAO,CAAjCgD,sBAAsB;IAEtD,OAAO,IAAI,CAACjD,QAAQ,CAAC;MACnBK,QAAQ,EAAE,mBAAmB;MAC7BF,QAAQ,mBAAAtB,MAAA,CAAmB,IAAI,CAACjB,KAAK,CAACS,QAAQ,CAAC8D,MAAM,CAACC,KAAK,YAAS;MACpEhC,MAAM,EAAE;QACN0C,WAAW,EAAXA,WAAW;QACXD,UAAU,EAAVA,UAAU;QACVI,sBAAsB,EAAtBA;MACF;IACF,CAAC,CAAC,CAACrE,KAAK,CAAC,UAACb,KAAK,EAAK;MAClBiF,MAAI,CAAClF,MAAM,CAACC,KAAK,mDAAAc,MAAA,CAAmDd,KAAK,CAACe,OAAO,EAAG;MAEpF,OAAOd,QAAA,CAAAf,OAAA,CAAQgB,MAAM,CAACF,KAAK,CAAC;IAC9B,CAAC,CAAC;EACJ,CAAC;EAAAmF,OAAA;AACH,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEY9F,GAAG;AAAA+F,OAAA,CAAAnG,OAAA,GAAAkG,QAAA"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["_webexCore","require","_dss","_interopRequireDefault","registerInternalPlugin","DSS"],"sources":["index.ts"],"sourcesContent":["import {registerInternalPlugin} from '@webex/webex-core';\r\n\r\nimport DSS from './dss';\r\n\r\nregisterInternalPlugin('dss', DSS);\r\n\r\nexport {default} from './dss';\r\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,IAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,iCAAsB,EAAC,KAAK,EAAEC,YAAG,CAAC"}
1
+ {"version":3,"names":["_webexCore","require","_dss","_interopRequireDefault","registerInternalPlugin","DSS"],"sources":["index.ts"],"sourcesContent":["import {registerInternalPlugin} from '@webex/webex-core';\n\nimport DSS from './dss';\n\nregisterInternalPlugin('dss', DSS);\n\nexport {default} from './dss';\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,IAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,iCAAsB,EAAC,KAAK,EAAEC,YAAG,CAAC"}
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["EntityProviderType","exports","SearchType"],"sources":["types.ts"],"sourcesContent":["export interface LookupDetailOptions {\r\n id: string;\r\n}\r\n\r\nexport enum EntityProviderType {\r\n CI_USER = 'CI_USER',\r\n CI_MACHINE = 'CI_MACHINE',\r\n CONTACTS = 'CONTACTS',\r\n CSDM = 'CSDM',\r\n}\r\n\r\nexport interface LookupOptions {\r\n ids: string[];\r\n entityProviderType?: EntityProviderType;\r\n}\r\n\r\nexport interface LookupByEmailOptions {\r\n emails: string[];\r\n}\r\n\r\nexport enum SearchType {\r\n PERSON = 'PERSON',\r\n CALLING_SERVICE = 'CALLING_SERVICE',\r\n EXTERNAL_CALLING = 'EXTERNAL_CALLING',\r\n ROOM = 'ROOM',\r\n ROBOT = 'ROBOT',\r\n}\r\n\r\nexport interface SearchOptions {\r\n requestedTypes: SearchType[];\r\n resultSize: number;\r\n queryString: string;\r\n}\r\n\r\nexport interface SearchPlaceOptions {\r\n resultSize: number;\r\n queryString: string;\r\n isOnlySchedulableRooms: boolean;\r\n}\r\n"],"mappings":";;;;;;;IAIYA,kBAAkB;AAAAC,OAAA,CAAAD,kBAAA,GAAAA,kBAAA;AAAA,WAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;AAAA,GAAlBA,kBAAkB,KAAAC,OAAA,CAAAD,kBAAA,GAAlBA,kBAAkB;AAAA,IAgBlBE,UAAU;AAAAD,OAAA,CAAAC,UAAA,GAAAA,UAAA;AAAA,WAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;AAAA,GAAVA,UAAU,KAAAD,OAAA,CAAAC,UAAA,GAAVA,UAAU"}
1
+ {"version":3,"names":["EntityProviderType","exports","SearchType"],"sources":["types.ts"],"sourcesContent":["export interface LookupDetailOptions {\n id: string;\n}\n\nexport enum EntityProviderType {\n CI_USER = 'CI_USER',\n CI_MACHINE = 'CI_MACHINE',\n CONTACTS = 'CONTACTS',\n CSDM = 'CSDM',\n}\n\nexport interface LookupOptions {\n ids: string[];\n entityProviderType?: EntityProviderType;\n}\n\nexport interface LookupByEmailOptions {\n emails: string[];\n}\n\nexport enum SearchType {\n PERSON = 'PERSON',\n CALLING_SERVICE = 'CALLING_SERVICE',\n EXTERNAL_CALLING = 'EXTERNAL_CALLING',\n ROOM = 'ROOM',\n ROBOT = 'ROBOT',\n}\n\nexport interface SearchOptions {\n requestedTypes: SearchType[];\n resultSize: number;\n queryString: string;\n}\n\nexport interface SearchPlaceOptions {\n resultSize: number;\n queryString: string;\n isOnlySchedulableRooms: boolean;\n}\n"],"mappings":";;;;;;;IAIYA,kBAAkB;AAAAC,OAAA,CAAAD,kBAAA,GAAAA,kBAAA;AAAA,WAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;AAAA,GAAlBA,kBAAkB,KAAAC,OAAA,CAAAD,kBAAA,GAAlBA,kBAAkB;AAAA,IAgBlBE,UAAU;AAAAD,OAAA,CAAAC,UAAA,GAAAA,UAAA;AAAA,WAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;AAAA,GAAVA,UAAU,KAAAD,OAAA,CAAAC,UAAA,GAAVA,UAAU"}
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
@@ -20,8 +20,8 @@
20
20
  ]
21
21
  },
22
22
  "dependencies": {
23
- "@webex/internal-plugin-mercury": "^2.59.3-next.1",
24
- "@webex/webex-core": "^2.59.3-next.1",
23
+ "@webex/internal-plugin-mercury": "^2.59.4-next.1",
24
+ "@webex/webex-core": "^2.59.4-next.1",
25
25
  "lodash": "^4.17.21",
26
26
  "uuid": "^3.3.2"
27
27
  },
@@ -31,10 +31,10 @@
31
31
  "@webex/eslint-config-legacy": "^0.0.0",
32
32
  "@webex/jest-config-legacy": "^0.0.0",
33
33
  "@webex/legacy-tools": "^0.0.0",
34
- "@webex/test-helper-chai": "^2.59.3-next.1",
35
- "@webex/test-helper-mocha": "^2.59.3-next.1",
36
- "@webex/test-helper-mock-webex": "^2.59.3-next.1",
37
- "@webex/test-helper-test-users": "^2.59.3-next.1",
34
+ "@webex/test-helper-chai": "^2.59.4-next.1",
35
+ "@webex/test-helper-mocha": "^2.59.4-next.1",
36
+ "@webex/test-helper-mock-webex": "^2.59.4-next.1",
37
+ "@webex/test-helper-test-users": "^2.59.4-next.1",
38
38
  "eslint": "^8.24.0",
39
39
  "prettier": "^2.7.1"
40
40
  },
@@ -48,5 +48,5 @@
48
48
  "test:style": "eslint ./src/**/*.*",
49
49
  "test:unit": "webex-legacy-tools test --unit --runner jest"
50
50
  },
51
- "version": "2.59.3-next.1"
51
+ "version": "2.59.4-next.1"
52
52
  }
package/process CHANGED
@@ -1 +1 @@
1
- module.exports = {browser: true};
1
+ module.exports = {browser: true};
package/src/constants.ts CHANGED
@@ -1,14 +1,14 @@
1
- export const DSS_REGISTERED = 'dss:registered';
2
- export const DSS_UNREGISTERED = 'dss:unregistered';
3
- export const DSS_LOOKUP_MERCURY_EVENT = 'event:directory.lookup';
4
- export const DSS_SEARCH_MERCURY_EVENT = 'event:directory.search';
5
- export const DSS_LOOKUP_RESULT = 'dss:lookup.result';
6
- export const DSS_RESULT = 'dss:result';
7
- export const DSS_SERVICE_NAME = 'directorySearch';
8
- export const SEARCH_TYPES = {
9
- PERSON: 'PERSON',
10
- CALLING_SERVICE: 'CALLING_SERVICE',
11
- EXTERNAL_CALLING: 'EXTERNAL_CALLING',
12
- ROOM: 'ROOM',
13
- ROBOT: 'ROBOT',
14
- };
1
+ export const DSS_REGISTERED = 'dss:registered';
2
+ export const DSS_UNREGISTERED = 'dss:unregistered';
3
+ export const DSS_LOOKUP_MERCURY_EVENT = 'event:directory.lookup';
4
+ export const DSS_SEARCH_MERCURY_EVENT = 'event:directory.search';
5
+ export const DSS_LOOKUP_RESULT = 'dss:lookup.result';
6
+ export const DSS_RESULT = 'dss:result';
7
+ export const DSS_SERVICE_NAME = 'directorySearch';
8
+ export const SEARCH_TYPES = {
9
+ PERSON: 'PERSON',
10
+ CALLING_SERVICE: 'CALLING_SERVICE',
11
+ EXTERNAL_CALLING: 'EXTERNAL_CALLING',
12
+ ROOM: 'ROOM',
13
+ ROBOT: 'ROBOT',
14
+ };