@webex/internal-plugin-dss 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 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';\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"}
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"}
package/dist/dss.js CHANGED
@@ -26,18 +26,18 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys2(object); if
26
26
  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
27
  var DSS = _webexCore.WebexPlugin.extend({
28
28
  namespace: 'DSS',
29
- /**
30
- * registered value indicating events registration is successful
31
- * @instance
32
- * @type {Boolean}
33
- * @memberof DSS
29
+ /**
30
+ * registered value indicating events registration is successful
31
+ * @instance
32
+ * @type {Boolean}
33
+ * @memberof DSS
34
34
  */
35
35
  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
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
41
41
  */
42
42
  register: function register() {
43
43
  var _this = this;
@@ -58,11 +58,11 @@ var DSS = _webexCore.WebexPlugin.extend({
58
58
  return _promise.default.reject(error);
59
59
  });
60
60
  },
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
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
66
66
  */
67
67
  unregister: function unregister() {
68
68
  var _this2 = this;
@@ -76,10 +76,10 @@ var DSS = _webexCore.WebexPlugin.extend({
76
76
  _this2.registered = false;
77
77
  });
78
78
  },
79
- /**
80
- * registers for DSS events through mercury
81
- * @returns {undefined}
82
- * @private
79
+ /**
80
+ * registers for DSS events through mercury
81
+ * @returns {undefined}
82
+ * @private
83
83
  */
84
84
  listenForEvents: function listenForEvents() {
85
85
  var _this3 = this;
@@ -90,37 +90,37 @@ var DSS = _webexCore.WebexPlugin.extend({
90
90
  _this3._handleEvent(envelope.data);
91
91
  });
92
92
  },
93
- /**
94
- * unregisteres all the DSS events from mercury
95
- * @returns {undefined}
96
- * @private
93
+ /**
94
+ * unregisteres all the DSS events from mercury
95
+ * @returns {undefined}
96
+ * @private
97
97
  */
98
98
  stopListeningForEvents: function stopListeningForEvents() {
99
99
  this.webex.internal.mercury.off(_constants.DSS_LOOKUP_MERCURY_EVENT);
100
100
  this.webex.internal.mercury.off(_constants.DSS_SEARCH_MERCURY_EVENT);
101
101
  },
102
- /**
103
- * @param {UUID} requestId the id of the request
104
- * @returns {string}
102
+ /**
103
+ * @param {UUID} requestId the id of the request
104
+ * @returns {string}
105
105
  */
106
106
  _getResultEventName: function _getResultEventName(requestId) {
107
107
  return "".concat(_constants.DSS_RESULT).concat(requestId);
108
108
  },
109
- /**
110
- * @param {Object} data the event data
111
- * @returns {undefined}
109
+ /**
110
+ * @param {Object} data the event data
111
+ * @returns {undefined}
112
112
  */
113
113
  _handleEvent: function _handleEvent(data) {
114
114
  this.trigger(this._getResultEventName(data.requestId), data);
115
115
  this.trigger(_constants.DSS_LOOKUP_RESULT, data);
116
116
  },
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
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
124
124
  */
125
125
  _request: function _request(options) {
126
126
  var _this4 = this;
@@ -162,11 +162,11 @@ var DSS = _webexCore.WebexPlugin.extend({
162
162
  });
163
163
  });
164
164
  },
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
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
170
170
  */
171
171
  lookupDetail: function lookupDetail(options) {
172
172
  var id = options.id;
@@ -175,12 +175,12 @@ var DSS = _webexCore.WebexPlugin.extend({
175
175
  resource: "/lookup/orgid/".concat(this.webex.internal.device.orgId, "/identity/").concat(id, "/detail")
176
176
  });
177
177
  },
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
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
184
184
  */
185
185
  lookup: function lookup(options) {
186
186
  var ids = options.ids,
@@ -194,11 +194,11 @@ var DSS = _webexCore.WebexPlugin.extend({
194
194
  }
195
195
  });
196
196
  },
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
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
202
202
  */
203
203
  lookupByEmail: function lookupByEmail(options) {
204
204
  var emails = options.emails;
@@ -210,13 +210,13 @@ var DSS = _webexCore.WebexPlugin.extend({
210
210
  }
211
211
  });
212
212
  },
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
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
220
220
  */
221
221
  search: function search(options) {
222
222
  var requestedTypes = options.requestedTypes,
@@ -232,12 +232,12 @@ var DSS = _webexCore.WebexPlugin.extend({
232
232
  }
233
233
  });
234
234
  },
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
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
241
241
  */
242
242
  searchPlaces: function searchPlaces(options) {
243
243
  var _this5 = this;
@@ -257,7 +257,7 @@ var DSS = _webexCore.WebexPlugin.extend({
257
257
  return _promise.default.reject(error);
258
258
  });
259
259
  },
260
- version: "2.59.2"
260
+ version: "2.59.0"
261
261
  });
262
262
  var _default = DSS;
263
263
  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 */\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;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,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,CAAAD,MAAA,GAAAE,OAAA,WAAAC,GAAA,IAAAK,sBAAA,CAAAZ,MAAA,EAAAO,GAAA,EAAAZ,gCAAA,CAAAS,MAAA,EAAAG,GAAA,iBAAAP,MA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;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"}
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,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,CAAAD,MAAA,GAAAE,OAAA,WAAAC,GAAA,IAAAK,sBAAA,CAAAZ,MAAA,EAAAO,GAAA,EA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;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';\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"}
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"}
package/dist/types.js.map CHANGED
@@ -1 +1 @@
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"}
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"}
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/internal-plugin-dss",
3
- "version": "2.59.2",
4
3
  "description": "",
5
4
  "license": "MIT",
6
5
  "author": "Colin Read <coread@cisco.com>",
@@ -21,31 +20,33 @@
21
20
  ]
22
21
  },
23
22
  "dependencies": {
24
- "@webex/internal-plugin-mercury": "2.59.2",
25
- "@webex/webex-core": "2.59.2",
23
+ "@webex/internal-plugin-mercury": "^2.59.3-next.1",
24
+ "@webex/webex-core": "^2.59.3-next.1",
26
25
  "lodash": "^4.17.21",
27
26
  "uuid": "^3.3.2"
28
27
  },
29
28
  "devDependencies": {
30
29
  "@babel/core": "^7.17.10",
31
- "@webex/babel-config-legacy": "2.59.2",
32
- "@webex/eslint-config-legacy": "2.59.2",
33
- "@webex/jest-config-legacy": "2.59.2",
34
- "@webex/legacy-tools": "2.59.2",
35
- "@webex/test-helper-chai": "2.59.2",
36
- "@webex/test-helper-mocha": "2.59.2",
37
- "@webex/test-helper-mock-webex": "2.59.2",
38
- "@webex/test-helper-test-users": "2.59.2",
30
+ "@webex/babel-config-legacy": "^0.0.0",
31
+ "@webex/eslint-config-legacy": "^0.0.0",
32
+ "@webex/jest-config-legacy": "^0.0.0",
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",
39
38
  "eslint": "^8.24.0",
40
39
  "prettier": "^2.7.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": "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};
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
+ };