@webex/internal-plugin-dss 2.60.0-next.8 → 2.60.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/dist/constants.js CHANGED
@@ -4,24 +4,27 @@ var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/defi
4
4
  _Object$defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.SEARCH_TYPES = exports.SEARCH_DATA_PATH = exports.LOOKUP_REQUEST_KEY = exports.LOOKUP_NOT_FOUND_PATH = exports.LOOKUP_FOUND_PATH = exports.LOOKUP_DATA_PATH = exports.DSS_UNREGISTERED = exports.DSS_SERVICE_NAME = exports.DSS_SEARCH_MERCURY_EVENT = exports.DSS_RESULT = exports.DSS_REGISTERED = exports.DSS_LOOKUP_RESULT = exports.DSS_LOOKUP_MERCURY_EVENT = void 0;
8
- var DSS_REGISTERED = exports.DSS_REGISTERED = 'dss:registered';
9
- var DSS_UNREGISTERED = exports.DSS_UNREGISTERED = 'dss:unregistered';
10
- var DSS_LOOKUP_MERCURY_EVENT = exports.DSS_LOOKUP_MERCURY_EVENT = 'event:directory.lookup';
11
- var DSS_SEARCH_MERCURY_EVENT = exports.DSS_SEARCH_MERCURY_EVENT = 'event:directory.search';
12
- var DSS_LOOKUP_RESULT = exports.DSS_LOOKUP_RESULT = 'dss:lookup.result';
13
- var DSS_RESULT = exports.DSS_RESULT = 'dss:result';
14
- var DSS_SERVICE_NAME = exports.DSS_SERVICE_NAME = 'directorySearch';
15
- var SEARCH_TYPES = exports.SEARCH_TYPES = {
7
+ exports.SEARCH_TYPES = exports.DSS_UNREGISTERED = exports.DSS_SERVICE_NAME = exports.DSS_SEARCH_MERCURY_EVENT = exports.DSS_RESULT = exports.DSS_REGISTERED = exports.DSS_LOOKUP_RESULT = exports.DSS_LOOKUP_MERCURY_EVENT = void 0;
8
+ var DSS_REGISTERED = 'dss:registered';
9
+ exports.DSS_REGISTERED = DSS_REGISTERED;
10
+ var DSS_UNREGISTERED = 'dss:unregistered';
11
+ exports.DSS_UNREGISTERED = DSS_UNREGISTERED;
12
+ var DSS_LOOKUP_MERCURY_EVENT = 'event:directory.lookup';
13
+ exports.DSS_LOOKUP_MERCURY_EVENT = DSS_LOOKUP_MERCURY_EVENT;
14
+ var DSS_SEARCH_MERCURY_EVENT = 'event:directory.search';
15
+ exports.DSS_SEARCH_MERCURY_EVENT = DSS_SEARCH_MERCURY_EVENT;
16
+ var DSS_LOOKUP_RESULT = 'dss:lookup.result';
17
+ exports.DSS_LOOKUP_RESULT = DSS_LOOKUP_RESULT;
18
+ var DSS_RESULT = 'dss:result';
19
+ exports.DSS_RESULT = DSS_RESULT;
20
+ var DSS_SERVICE_NAME = 'directorySearch';
21
+ exports.DSS_SERVICE_NAME = DSS_SERVICE_NAME;
22
+ var SEARCH_TYPES = {
16
23
  PERSON: 'PERSON',
17
24
  CALLING_SERVICE: 'CALLING_SERVICE',
18
25
  EXTERNAL_CALLING: 'EXTERNAL_CALLING',
19
26
  ROOM: 'ROOM',
20
27
  ROBOT: 'ROBOT'
21
28
  };
22
- var LOOKUP_DATA_PATH = exports.LOOKUP_DATA_PATH = 'lookupResult.entities';
23
- var LOOKUP_FOUND_PATH = exports.LOOKUP_FOUND_PATH = 'lookupResult.entitiesFound';
24
- var LOOKUP_NOT_FOUND_PATH = exports.LOOKUP_NOT_FOUND_PATH = 'lookupResult.entitiesNotFound';
25
- var LOOKUP_REQUEST_KEY = exports.LOOKUP_REQUEST_KEY = 'lookupValues';
26
- var SEARCH_DATA_PATH = exports.SEARCH_DATA_PATH = 'directoryEntities';
29
+ exports.SEARCH_TYPES = SEARCH_TYPES;
27
30
  //# sourceMappingURL=constants.js.map
@@ -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","LOOKUP_DATA_PATH","LOOKUP_FOUND_PATH","LOOKUP_NOT_FOUND_PATH","LOOKUP_REQUEST_KEY","SEARCH_DATA_PATH"],"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};\nexport const LOOKUP_DATA_PATH = 'lookupResult.entities';\nexport const LOOKUP_FOUND_PATH = 'lookupResult.entitiesFound';\nexport const LOOKUP_NOT_FOUND_PATH = 'lookupResult.entitiesNotFound';\nexport const LOOKUP_REQUEST_KEY = 'lookupValues';\nexport const SEARCH_DATA_PATH = 'directoryEntities';\n"],"mappings":";;;;;;;AAAO,IAAMA,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,gBAAgB;AACvC,IAAME,gBAAgB,GAAAD,OAAA,CAAAC,gBAAA,GAAG,kBAAkB;AAC3C,IAAMC,wBAAwB,GAAAF,OAAA,CAAAE,wBAAA,GAAG,wBAAwB;AACzD,IAAMC,wBAAwB,GAAAH,OAAA,CAAAG,wBAAA,GAAG,wBAAwB;AACzD,IAAMC,iBAAiB,GAAAJ,OAAA,CAAAI,iBAAA,GAAG,mBAAmB;AAC7C,IAAMC,UAAU,GAAAL,OAAA,CAAAK,UAAA,GAAG,YAAY;AAC/B,IAAMC,gBAAgB,GAAAN,OAAA,CAAAM,gBAAA,GAAG,iBAAiB;AAC1C,IAAMC,YAAY,GAAAP,OAAA,CAAAO,YAAA,GAAG;EAC1BC,MAAM,EAAE,QAAQ;EAChBC,eAAe,EAAE,iBAAiB;EAClCC,gBAAgB,EAAE,kBAAkB;EACpCC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE;AACT,CAAC;AACM,IAAMC,gBAAgB,GAAAb,OAAA,CAAAa,gBAAA,GAAG,uBAAuB;AAChD,IAAMC,iBAAiB,GAAAd,OAAA,CAAAc,iBAAA,GAAG,4BAA4B;AACtD,IAAMC,qBAAqB,GAAAf,OAAA,CAAAe,qBAAA,GAAG,+BAA+B;AAC7D,IAAMC,kBAAkB,GAAAhB,OAAA,CAAAgB,kBAAA,GAAG,cAAc;AACzC,IAAMC,gBAAgB,GAAAjB,OAAA,CAAAiB,gBAAA,GAAG,mBAAmB"}
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,23 +11,19 @@ _Object$defineProperty(exports, "__esModule", {
11
11
  value: true
12
12
  });
13
13
  exports.default = void 0;
14
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
15
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/toConsumableArray"));
16
- var _apply = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/reflect/apply"));
17
14
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
18
15
  var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
16
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
17
+ 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"));
19
21
  var _uuid = _interopRequireDefault(require("uuid"));
20
22
  var _webexCore = require("@webex/webex-core");
21
23
  require("@webex/internal-plugin-mercury");
22
- var _lodash = require("lodash");
23
- var _commonTimers = require("@webex/common-timers");
24
24
  var _constants = require("./constants");
25
- var _dssBatcher = _interopRequireDefault(require("./dss-batcher"));
26
- var _dssErrors = require("./dss-errors");
27
- function ownKeys(e, r) { var t = _Object$keys2(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
28
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; } /* eslint-disable no-underscore-dangle */ /*!
29
- * Copyright (c) 2015-2022 Cisco Systems, Inc. See LICENSE file.
30
- */ /* eslint-disable no-underscore-dangle */
25
+ 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
+ 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; }
31
27
  var DSS = _webexCore.WebexPlugin.extend({
32
28
  namespace: 'DSS',
33
29
  /**
@@ -37,20 +33,6 @@ var DSS = _webexCore.WebexPlugin.extend({
37
33
  * @memberof DSS
38
34
  */
39
35
  registered: false,
40
- /**
41
- * Initializer
42
- * @private
43
- * @param {Object} attrs
44
- * @param {Object} options
45
- * @returns {undefined}
46
- */
47
- initialize: function initialize() {
48
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
49
- args[_key] = arguments[_key];
50
- }
51
- (0, _apply.default)(_webexCore.WebexPlugin.prototype.initialize, this, args);
52
- this.batchers = {};
53
- },
54
36
  /**
55
37
  * Explicitly sets up the DSS plugin by connecting to mercury, and listening for DSS events.
56
38
  * @returns {Promise}
@@ -118,7 +100,6 @@ var DSS = _webexCore.WebexPlugin.extend({
118
100
  this.webex.internal.mercury.off(_constants.DSS_SEARCH_MERCURY_EVENT);
119
101
  },
120
102
  /**
121
- * constructs the event name based on request id
122
103
  * @param {UUID} requestId the id of the request
123
104
  * @returns {string}
124
105
  */
@@ -126,7 +107,6 @@ var DSS = _webexCore.WebexPlugin.extend({
126
107
  return "".concat(_constants.DSS_RESULT).concat(requestId);
127
108
  },
128
109
  /**
129
- * Takes incoming data and triggers correct events
130
110
  * @param {Object} data the event data
131
111
  * @returns {undefined}
132
112
  */
@@ -138,82 +118,36 @@ var DSS = _webexCore.WebexPlugin.extend({
138
118
  * Makes the request to the directory service
139
119
  * @param {Object} options
140
120
  * @param {string} options.resource the URL to query
141
- * @param {Mixed} options.params additional params for the body of the request
142
- * @param {string} options.dataPath the path to get the data in the result object
143
- * @param {string} [options.foundPath] the path to get the lookups of the found data
144
- * @param {string} [options.notFoundPath] the path to get the lookups of the not found data
145
- * @returns {Promise<Object>} result Resolves with an object
146
- * @returns {Array} result.resultArray an array of entities found
147
- * @returns {Array} result.foundArray an array of the lookups of the found entities (if foundPath provided)
148
- * @returns {Array} result.notFoundArray an array of the lookups of the not found entities (if notFoundPath provided)
149
- * @throws {DssTimeoutError} when server does not respond in the specified timeframe
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
150
124
  */
151
125
  _request: function _request(options) {
152
126
  var _this4 = this;
153
127
  var resource = options.resource,
154
128
  params = options.params,
155
- dataPath = options.dataPath,
156
- foundPath = options.foundPath,
157
- notFoundPath = options.notFoundPath;
158
- var timeout = this.config.requestTimeout;
129
+ dataPath = options.dataPath;
159
130
  var requestId = _uuid.default.v4();
160
131
  var eventName = this._getResultEventName(requestId);
161
132
  var result = {};
162
133
  var expectedSeqNums;
163
- var notFoundArray;
164
- return new _promise.default(function (resolve, reject) {
165
- var timer = new _commonTimers.Timer(function () {
166
- _this4.stopListening(_this4, eventName);
167
- reject(new _dssErrors.DssTimeoutError({
168
- requestId: requestId,
169
- timeout: timeout,
170
- resource: resource,
171
- params: params
172
- }));
173
- }, timeout);
134
+ return new _promise.default(function (resolve) {
174
135
  _this4.listenTo(_this4, eventName, function (data) {
175
- timer.reset();
176
- var resultData = (0, _lodash.get)(data, dataPath, []);
177
- var found;
178
- if (foundPath) {
179
- found = (0, _lodash.get)(data, foundPath, []);
180
- }
181
- result[data.sequence] = foundPath ? {
182
- resultData: resultData,
183
- found: found
184
- } : {
185
- resultData: resultData
186
- };
136
+ var resultData = (0, _get2.default)(data, dataPath);
137
+ result[data.sequence] = resultData;
187
138
  if (data.finished) {
188
- expectedSeqNums = (0, _lodash.range)(data.sequence + 1).map(String);
189
- if (notFoundPath) {
190
- notFoundArray = (0, _lodash.get)(data, notFoundPath, []);
191
- }
139
+ expectedSeqNums = (0, _range2.default)(data.sequence + 1).map(String);
192
140
  }
193
- var done = (0, _lodash.isEqual)(expectedSeqNums, (0, _keys.default)(result));
141
+ var done = (0, _isEqual2.default)(expectedSeqNums, (0, _keys.default)(result));
194
142
  if (done) {
195
- timer.cancel();
196
143
  var resultArray = [];
197
- var foundArray = [];
198
144
  expectedSeqNums.forEach(function (index) {
199
145
  var seqResult = result[index];
200
146
  if (seqResult) {
201
- resultArray.push.apply(resultArray, (0, _toConsumableArray2.default)(seqResult.resultData));
202
- if (foundPath) {
203
- foundArray.push.apply(foundArray, (0, _toConsumableArray2.default)(seqResult.found));
204
- }
147
+ resultArray.push.apply(resultArray, (0, _toConsumableArray2.default)(seqResult));
205
148
  }
206
149
  });
207
- var resolveValue = {
208
- resultArray: resultArray
209
- };
210
- if (foundPath) {
211
- resolveValue.foundArray = foundArray;
212
- }
213
- if (notFoundPath) {
214
- resolveValue.notFoundArray = notFoundArray;
215
- }
216
- resolve(resolveValue);
150
+ resolve(resultArray);
217
151
  _this4.stopListening(_this4, eventName);
218
152
  }
219
153
  });
@@ -226,115 +160,54 @@ var DSS = _webexCore.WebexPlugin.extend({
226
160
  requestId: requestId
227
161
  }, params)
228
162
  });
229
- timer.start();
230
- });
231
- },
232
- /**
233
- * Uses a batcher to make the request to the directory service
234
- * @param {Object} options
235
- * @param {string} options.resource the URL to query
236
- * @param {string} options.value the id or email to lookup
237
- * @returns {Promise} Resolves with an array of entities found
238
- * @throws {DssTimeoutError} when server does not respond in the specified timeframe
239
- */
240
- _batchedLookup: function _batchedLookup(options) {
241
- var resource = options.resource,
242
- lookupValue = options.lookupValue;
243
- var dataPath = _constants.LOOKUP_DATA_PATH;
244
- var entitiesFoundPath = _constants.LOOKUP_FOUND_PATH;
245
- var entitiesNotFoundPath = _constants.LOOKUP_NOT_FOUND_PATH;
246
- var requestKey = _constants.LOOKUP_REQUEST_KEY;
247
- this.batchers[resource] = this.batchers[resource] || new _dssBatcher.default({
248
- resource: resource,
249
- dataPath: dataPath,
250
- entitiesFoundPath: entitiesFoundPath,
251
- entitiesNotFoundPath: entitiesNotFoundPath,
252
- requestKey: requestKey,
253
- parent: this
254
163
  });
255
- return this.batchers[resource].request(lookupValue);
256
164
  },
257
165
  /**
258
166
  * Retrieves detailed information about an entity
259
167
  * @param {Object} options
260
168
  * @param {UUID} options.id the id of the entity to lookup
261
- * @returns {Promise} Resolves with the entity found or null if not found
262
- * @throws {DssTimeoutError} when server does not respond in the specified timeframe
169
+ * @returns {Promise} Resolves with an array of entities found
263
170
  */
264
171
  lookupDetail: function lookupDetail(options) {
265
172
  var id = options.id;
266
- var resource = "/lookup/orgid/".concat(this.webex.internal.device.orgId, "/identity/").concat(id, "/detail");
267
173
  return this._request({
268
- dataPath: _constants.LOOKUP_DATA_PATH,
269
- foundPath: _constants.LOOKUP_FOUND_PATH,
270
- resource: resource
271
- }).then(function (_ref) {
272
- var resultArray = _ref.resultArray,
273
- foundArray = _ref.foundArray;
274
- // TODO: find out what is actually returned!
275
- if (foundArray[0] === id) {
276
- return resultArray[0];
277
- }
278
- return null;
174
+ dataPath: 'lookupResult.entities',
175
+ resource: "/lookup/orgid/".concat(this.webex.internal.device.orgId, "/identity/").concat(id, "/detail")
279
176
  });
280
177
  },
281
178
  /**
282
- * Retrieves basic information about an entity within an organization
179
+ * Retrieves basic information about a list entities within an organization
283
180
  * @param {Object} options
284
- * @param {UUID} options.id the id of the entity to lookup
285
- * @param {UUID} [options.entityProviderType] the provider to query
286
- * @param {Boolean} options.shouldBatch whether to batch the query, set to false for single immediate result (defaults to true)
287
- * @returns {Promise} Resolves with the entity found or null if not found
288
- * @throws {DssTimeoutError} when server does not respond in the specified timeframe
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
289
184
  */
290
185
  lookup: function lookup(options) {
291
- var id = options.id,
292
- entityProviderType = options.entityProviderType,
293
- _options$shouldBatch = options.shouldBatch,
294
- shouldBatch = _options$shouldBatch === void 0 ? true : _options$shouldBatch;
186
+ var ids = options.ids,
187
+ entityProviderType = options.entityProviderType;
295
188
  var resource = entityProviderType ? "/lookup/orgid/".concat(this.webex.internal.device.orgId, "/entityprovidertype/").concat(entityProviderType) : "/lookup/orgid/".concat(this.webex.internal.device.orgId, "/identities");
296
- if (shouldBatch) {
297
- return this._batchedLookup({
298
- resource: resource,
299
- lookupValue: id
300
- });
301
- }
302
189
  return this._request({
303
- dataPath: _constants.LOOKUP_DATA_PATH,
304
- foundPath: _constants.LOOKUP_FOUND_PATH,
190
+ dataPath: 'lookupResult.entities',
305
191
  resource: resource,
306
- params: (0, _defineProperty2.default)({}, _constants.LOOKUP_REQUEST_KEY, [id])
307
- }).then(function (_ref2) {
308
- var resultArray = _ref2.resultArray,
309
- foundArray = _ref2.foundArray;
310
- if (foundArray[0] === id) {
311
- return resultArray[0];
192
+ params: {
193
+ lookupValues: ids
312
194
  }
313
- return null;
314
195
  });
315
196
  },
316
197
  /**
317
- * Retrieves basic information about an enitity within an organization
198
+ * Retrieves basic information about a list entities within an organization
318
199
  * @param {Object} options
319
- * @param {UUID} options.email the email of the entity to lookup
320
- * @returns {Promise} Resolves with the entity found or rejects if not found
321
- * @throws {DssTimeoutError} when server does not respond in the specified timeframe
200
+ * @param {UUID} options.emails the emails of the entities to lookup
201
+ * @returns {Promise} Resolves with an array of entities found
322
202
  */
323
203
  lookupByEmail: function lookupByEmail(options) {
324
- var email = options.email;
325
- var resource = "/lookup/orgid/".concat(this.webex.internal.device.orgId, "/emails");
204
+ var emails = options.emails;
326
205
  return this._request({
327
- dataPath: _constants.LOOKUP_DATA_PATH,
328
- foundPath: _constants.LOOKUP_FOUND_PATH,
329
- resource: resource,
330
- params: (0, _defineProperty2.default)({}, _constants.LOOKUP_REQUEST_KEY, [email])
331
- }).then(function (_ref3) {
332
- var resultArray = _ref3.resultArray,
333
- foundArray = _ref3.foundArray;
334
- if (foundArray[0] === email) {
335
- return resultArray[0];
206
+ dataPath: 'lookupResult.entities',
207
+ resource: "/lookup/orgid/".concat(this.webex.internal.device.orgId, "/emails"),
208
+ params: {
209
+ lookupValues: emails
336
210
  }
337
- return null;
338
211
  });
339
212
  },
340
213
  /**
@@ -344,23 +217,19 @@ var DSS = _webexCore.WebexPlugin.extend({
344
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
345
218
  * @param {number} options.resultSize The maximum number of results returned from each provider
346
219
  * @returns {Promise} Resolves with an array of entities found
347
- * @throws {DssTimeoutError} when server does not respond in the specified timeframe
348
220
  */
349
221
  search: function search(options) {
350
222
  var requestedTypes = options.requestedTypes,
351
223
  resultSize = options.resultSize,
352
224
  queryString = options.queryString;
353
225
  return this._request({
354
- dataPath: _constants.SEARCH_DATA_PATH,
226
+ dataPath: 'directoryEntities',
355
227
  resource: "/search/orgid/".concat(this.webex.internal.device.orgId, "/entities"),
356
228
  params: {
357
229
  queryString: queryString,
358
230
  resultSize: resultSize,
359
231
  requestedTypes: requestedTypes
360
232
  }
361
- }).then(function (_ref4) {
362
- var resultArray = _ref4.resultArray;
363
- return resultArray;
364
233
  });
365
234
  },
366
235
  /**
@@ -388,7 +257,8 @@ var DSS = _webexCore.WebexPlugin.extend({
388
257
  return _promise.default.reject(error);
389
258
  });
390
259
  },
391
- version: "2.60.0-next.8"
260
+ version: "2.60.1"
392
261
  });
393
- var _default = exports.default = DSS;
262
+ var _default = DSS;
263
+ exports.default = _default;
394
264
  //# sourceMappingURL=dss.js.map
package/dist/dss.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["_uuid","_interopRequireDefault","require","_webexCore","_lodash","_commonTimers","_constants","_dssBatcher","_dssErrors","ownKeys","e","r","t","_Object$keys2","_Object$getOwnPropertySymbols","o","filter","_Object$getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","Object","forEach","_defineProperty2","default","_Object$getOwnPropertyDescriptors","_Object$defineProperties","_Object$defineProperty","DSS","WebexPlugin","extend","namespace","registered","initialize","_len","args","Array","_key","_apply","prototype","batchers","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","foundPath","notFoundPath","timeout","config","requestTimeout","uuid","v4","eventName","result","expectedSeqNums","notFoundArray","timer","Timer","stopListening","DssTimeoutError","listenTo","reset","resultData","get","found","sequence","finished","range","map","String","done","isEqual","_keys","cancel","resultArray","foundArray","index","seqResult","_toConsumableArray2","resolveValue","request","service","DSS_SERVICE_NAME","method","contentType","body","start","_batchedLookup","lookupValue","LOOKUP_DATA_PATH","entitiesFoundPath","LOOKUP_FOUND_PATH","entitiesNotFoundPath","LOOKUP_NOT_FOUND_PATH","requestKey","LOOKUP_REQUEST_KEY","DssBatcher","parent","lookupDetail","id","device","orgId","_ref","lookup","entityProviderType","_options$shouldBatch","shouldBatch","_ref2","lookupByEmail","email","_ref3","search","requestedTypes","resultSize","queryString","SEARCH_DATA_PATH","_ref4","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 */\n/* eslint-disable no-underscore-dangle */\nimport uuid from 'uuid';\nimport {WebexPlugin} from '@webex/webex-core';\nimport '@webex/internal-plugin-mercury';\nimport {range, isEqual, get} from 'lodash';\n\nimport {Timer} from '@webex/common-timers';\nimport type {\n SearchOptions,\n LookupDetailOptions,\n LookupOptions,\n LookupByEmailOptions,\n SearchPlaceOptions,\n} from './types';\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 LOOKUP_DATA_PATH,\n LOOKUP_FOUND_PATH,\n LOOKUP_NOT_FOUND_PATH,\n LOOKUP_REQUEST_KEY,\n SEARCH_DATA_PATH,\n} from './constants';\nimport DssBatcher from './dss-batcher';\nimport {DssTimeoutError} from './dss-errors';\nimport {BatcherOptions, RequestOptions, RequestResult} from './types';\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 * Initializer\n * @private\n * @param {Object} attrs\n * @param {Object} options\n * @returns {undefined}\n */\n initialize(...args) {\n Reflect.apply(WebexPlugin.prototype.initialize, this, args);\n this.batchers = {};\n },\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 * constructs the event name based on request id\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 * Takes incoming data and triggers correct events\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 {Mixed} options.params additional params for the body of the request\n * @param {string} options.dataPath the path to get the data in the result object\n * @param {string} [options.foundPath] the path to get the lookups of the found data\n * @param {string} [options.notFoundPath] the path to get the lookups of the not found data\n * @returns {Promise<Object>} result Resolves with an object\n * @returns {Array} result.resultArray an array of entities found\n * @returns {Array} result.foundArray an array of the lookups of the found entities (if foundPath provided)\n * @returns {Array} result.notFoundArray an array of the lookups of the not found entities (if notFoundPath provided)\n * @throws {DssTimeoutError} when server does not respond in the specified timeframe\n */\n _request(options: RequestOptions): Promise<RequestResult> {\n const {resource, params, dataPath, foundPath, notFoundPath} = options;\n\n const timeout = this.config.requestTimeout;\n const requestId = uuid.v4();\n const eventName = this._getResultEventName(requestId);\n const result = {};\n let expectedSeqNums: string[];\n let notFoundArray: unknown[];\n\n return new Promise((resolve, reject) => {\n const timer = new Timer(() => {\n this.stopListening(this, eventName);\n reject(new DssTimeoutError({requestId, timeout, resource, params}));\n }, timeout);\n\n this.listenTo(this, eventName, (data) => {\n timer.reset();\n const resultData = get(data, dataPath, []);\n let found;\n\n if (foundPath) {\n found = get(data, foundPath, []);\n }\n result[data.sequence] = foundPath ? {resultData, found} : {resultData};\n\n if (data.finished) {\n expectedSeqNums = range(data.sequence + 1).map(String);\n if (notFoundPath) {\n notFoundArray = get(data, notFoundPath, []);\n }\n }\n\n const done = isEqual(expectedSeqNums, Object.keys(result));\n\n if (done) {\n timer.cancel();\n\n const resultArray: any[] = [];\n const foundArray: any[] = [];\n\n expectedSeqNums.forEach((index) => {\n const seqResult = result[index];\n\n if (seqResult) {\n resultArray.push(...seqResult.resultData);\n if (foundPath) {\n foundArray.push(...seqResult.found);\n }\n }\n });\n const resolveValue: RequestResult = {\n resultArray,\n };\n\n if (foundPath) {\n resolveValue.foundArray = foundArray;\n }\n if (notFoundPath) {\n resolveValue.notFoundArray = notFoundArray;\n }\n resolve(resolveValue);\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 timer.start();\n });\n },\n\n /**\n * Uses a batcher to make the request to the directory service\n * @param {Object} options\n * @param {string} options.resource the URL to query\n * @param {string} options.value the id or email to lookup\n * @returns {Promise} Resolves with an array of entities found\n * @throws {DssTimeoutError} when server does not respond in the specified timeframe\n */\n _batchedLookup(options: BatcherOptions) {\n const {resource, lookupValue} = options;\n const dataPath = LOOKUP_DATA_PATH;\n const entitiesFoundPath = LOOKUP_FOUND_PATH;\n const entitiesNotFoundPath = LOOKUP_NOT_FOUND_PATH;\n const requestKey = LOOKUP_REQUEST_KEY;\n\n this.batchers[resource] =\n this.batchers[resource] ||\n new DssBatcher({\n resource,\n dataPath,\n entitiesFoundPath,\n entitiesNotFoundPath,\n requestKey,\n parent: this,\n });\n\n return this.batchers[resource].request(lookupValue);\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 the entity found or null if not found\n * @throws {DssTimeoutError} when server does not respond in the specified timeframe\n */\n lookupDetail(options: LookupDetailOptions) {\n const {id} = options;\n\n const resource = `/lookup/orgid/${this.webex.internal.device.orgId}/identity/${id}/detail`;\n\n return this._request({\n dataPath: LOOKUP_DATA_PATH,\n foundPath: LOOKUP_FOUND_PATH,\n resource,\n }).then(({resultArray, foundArray}) => {\n // TODO: find out what is actually returned!\n if (foundArray[0] === id) {\n return resultArray[0];\n }\n\n return null;\n });\n },\n\n /**\n * Retrieves basic information about an entity within an organization\n * @param {Object} options\n * @param {UUID} options.id the id of the entity to lookup\n * @param {UUID} [options.entityProviderType] the provider to query\n * @param {Boolean} options.shouldBatch whether to batch the query, set to false for single immediate result (defaults to true)\n * @returns {Promise} Resolves with the entity found or null if not found\n * @throws {DssTimeoutError} when server does not respond in the specified timeframe\n */\n lookup(options: LookupOptions) {\n const {id, entityProviderType, shouldBatch = true} = 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 if (shouldBatch) {\n return this._batchedLookup({\n resource,\n lookupValue: id,\n });\n }\n\n return this._request({\n dataPath: LOOKUP_DATA_PATH,\n foundPath: LOOKUP_FOUND_PATH,\n resource,\n params: {\n [LOOKUP_REQUEST_KEY]: [id],\n },\n }).then(({resultArray, foundArray}) => {\n if (foundArray[0] === id) {\n return resultArray[0];\n }\n\n return null;\n });\n },\n\n /**\n * Retrieves basic information about an enitity within an organization\n * @param {Object} options\n * @param {UUID} options.email the email of the entity to lookup\n * @returns {Promise} Resolves with the entity found or rejects if not found\n * @throws {DssTimeoutError} when server does not respond in the specified timeframe\n */\n lookupByEmail(options: LookupByEmailOptions) {\n const {email} = options;\n const resource = `/lookup/orgid/${this.webex.internal.device.orgId}/emails`;\n\n return this._request({\n dataPath: LOOKUP_DATA_PATH,\n foundPath: LOOKUP_FOUND_PATH,\n resource,\n params: {\n [LOOKUP_REQUEST_KEY]: [email],\n },\n }).then(({resultArray, foundArray}) => {\n if (foundArray[0] === email) {\n return resultArray[0];\n }\n\n return null;\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 * @throws {DssTimeoutError} when server does not respond in the specified timeframe\n */\n search(options: SearchOptions) {\n const {requestedTypes, resultSize, queryString} = options;\n\n return this._request({\n dataPath: SEARCH_DATA_PATH,\n resource: `/search/orgid/${this.webex.internal.device.orgId}/entities`,\n params: {\n queryString,\n resultSize,\n requestedTypes,\n },\n }).then(({resultArray}) => resultArray);\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":";;;;;;;;;;;;;;;;;;AAKA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACAA,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAEA,IAAAG,aAAA,GAAAH,OAAA;AAQA,IAAAI,UAAA,GAAAJ,OAAA;AAcA,IAAAK,WAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AAA6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Y,WAAAA,aAAC7E,OAA2B,EAAE;IAAA,IAAA8E,MAAA;IACxC,IAAOL,UAAU,GAAyCzE,OAAO,CAA1DyE,UAAU;MAAEC,WAAW,GAA4B1E,OAAO,CAA9C0E,WAAW;MAAEK,sBAAsB,GAAI/E,OAAO,CAAjC+E,sBAAsB;IAEtD,OAAO,IAAI,CAAChF,QAAQ,CAAC;MACnBK,QAAQ,EAAE,mBAAmB;MAC7BF,QAAQ,mBAAAtB,MAAA,CAAmB,IAAI,CAACjB,KAAK,CAACS,QAAQ,CAACwF,MAAM,CAACC,KAAK,YAAS;MACpE1D,MAAM,EAAE;QACNuE,WAAW,EAAXA,WAAW;QACXD,UAAU,EAAVA,UAAU;QACVM,sBAAsB,EAAtBA;MACF;IACF,CAAC,CAAC,CAACpG,KAAK,CAAC,UAACb,KAAK,EAAK;MAClBgH,MAAI,CAACjH,MAAM,CAACC,KAAK,mDAAAc,MAAA,CAAmDd,KAAK,CAACe,OAAO,CAAE,CAAC;MAEpF,OAAOd,QAAA,CAAAvB,OAAA,CAAQwB,MAAM,CAACF,KAAK,CAAC;IAC9B,CAAC,CAAC;EACJ,CAAC;EAAAkH,OAAA;AACH,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA1I,OAAA,GAEYI,GAAG"}
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,IAA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M,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 CHANGED
@@ -13,8 +13,5 @@ _Object$defineProperty(exports, "default", {
13
13
  });
14
14
  var _webexCore = require("@webex/webex-core");
15
15
  var _dss = _interopRequireDefault(require("./dss"));
16
- var _config = _interopRequireDefault(require("./config"));
17
- (0, _webexCore.registerInternalPlugin)('dss', _dss.default, {
18
- config: _config.default
19
- });
16
+ (0, _webexCore.registerInternalPlugin)('dss', _dss.default);
20
17
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["_webexCore","require","_dss","_interopRequireDefault","_config","registerInternalPlugin","DSS","config"],"sources":["index.ts"],"sourcesContent":["import {registerInternalPlugin} from '@webex/webex-core';\n\nimport DSS from './dss';\nimport config from './config';\n\nregisterInternalPlugin('dss', DSS, {config});\n\nexport {default} from './dss';\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,IAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAD,sBAAA,CAAAF,OAAA;AAEA,IAAAI,iCAAsB,EAAC,KAAK,EAAEC,YAAG,EAAE;EAACC,MAAM,EAANA;AAAM,CAAC,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 CHANGED
@@ -5,20 +5,21 @@ _Object$defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.SearchType = exports.EntityProviderType = void 0;
8
- var EntityProviderType = exports.EntityProviderType = /*#__PURE__*/function (EntityProviderType) {
8
+ var EntityProviderType;
9
+ exports.EntityProviderType = EntityProviderType;
10
+ (function (EntityProviderType) {
9
11
  EntityProviderType["CI_USER"] = "CI_USER";
10
12
  EntityProviderType["CI_MACHINE"] = "CI_MACHINE";
11
13
  EntityProviderType["CONTACTS"] = "CONTACTS";
12
14
  EntityProviderType["CSDM"] = "CSDM";
13
- return EntityProviderType;
14
- }({});
15
- // eslint-disable-next-line no-shadow
16
- var SearchType = exports.SearchType = /*#__PURE__*/function (SearchType) {
15
+ })(EntityProviderType || (exports.EntityProviderType = EntityProviderType = {}));
16
+ var SearchType;
17
+ exports.SearchType = SearchType;
18
+ (function (SearchType) {
17
19
  SearchType["PERSON"] = "PERSON";
18
20
  SearchType["CALLING_SERVICE"] = "CALLING_SERVICE";
19
21
  SearchType["EXTERNAL_CALLING"] = "EXTERNAL_CALLING";
20
22
  SearchType["ROOM"] = "ROOM";
21
23
  SearchType["ROBOT"] = "ROBOT";
22
- return SearchType;
23
- }({});
24
+ })(SearchType || (exports.SearchType = SearchType = {}));
24
25
  //# sourceMappingURL=types.js.map
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["EntityProviderType","exports","SearchType"],"sources":["types.ts"],"sourcesContent":["export interface RequestOptions {\n resource: string;\n dataPath: string;\n foundPath?: string;\n notFoundPath?: string;\n params?: Record<string, unknown>;\n}\n\nexport interface RequestResult {\n foundArray?: any[];\n notFoundArray?: any[];\n resultArray: any[];\n}\n\nexport 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 id: string;\n entityProviderType?: EntityProviderType;\n shouldBatch?: boolean;\n}\n\nexport interface LookupByEmailOptions {\n email: string;\n}\n\n// eslint-disable-next-line no-shadow\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 BatcherOptions {\n resource: string;\n lookupValue: string;\n}\n\nexport interface SearchPlaceOptions {\n resultSize: number;\n queryString: string;\n isOnlySchedulableRooms: boolean;\n}\n"],"mappings":";;;;;;;IAkBYA,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,0BAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA;AAiB9B;AAAA,IACYE,UAAU,GAAAD,OAAA,CAAAC,UAAA,0BAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA"}
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/package.json CHANGED
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "name": "@webex/internal-plugin-dss",
3
+ "version": "2.60.1",
3
4
  "description": "",
4
5
  "license": "MIT",
5
6
  "author": "Colin Read <coread@cisco.com>",
@@ -11,7 +12,7 @@
11
12
  "directory": "packages/@webex/internal-plugin-dss"
12
13
  },
13
14
  "engines": {
14
- "node": ">=16"
15
+ "node": ">=14"
15
16
  },
16
17
  "browserify": {
17
18
  "transform": [
@@ -20,35 +21,31 @@
20
21
  ]
21
22
  },
22
23
  "dependencies": {
23
- "@webex/common": "2.60.0-next.8",
24
- "@webex/common-timers": "2.60.0-next.8",
25
- "@webex/internal-plugin-mercury": "2.60.0-next.8",
26
- "@webex/webex-core": "2.60.0-next.8",
24
+ "@webex/internal-plugin-mercury": "2.60.1",
25
+ "@webex/webex-core": "2.60.1",
27
26
  "lodash": "^4.17.21",
28
27
  "uuid": "^3.3.2"
29
28
  },
30
29
  "devDependencies": {
31
30
  "@babel/core": "^7.17.10",
32
- "@webex/babel-config-legacy": "0.0.0",
33
- "@webex/eslint-config-legacy": "0.0.0",
34
- "@webex/jest-config-legacy": "0.0.0",
35
- "@webex/legacy-tools": "0.0.0",
36
- "@webex/test-helper-chai": "2.60.0-next.8",
37
- "@webex/test-helper-mock-webex": "2.60.0-next.8",
38
- "@webex/test-helper-test-users": "2.60.0-next.8",
31
+ "@webex/babel-config-legacy": "2.60.1",
32
+ "@webex/eslint-config-legacy": "2.60.1",
33
+ "@webex/jest-config-legacy": "2.60.1",
34
+ "@webex/legacy-tools": "2.60.1",
35
+ "@webex/test-helper-chai": "2.60.1",
36
+ "@webex/test-helper-mocha": "2.60.1",
37
+ "@webex/test-helper-mock-webex": "2.60.1",
38
+ "@webex/test-helper-test-users": "2.60.1",
39
39
  "eslint": "^8.24.0",
40
- "prettier": "^2.7.1",
41
- "sinon": "^9.2.4"
40
+ "prettier": "^2.7.1"
42
41
  },
43
42
  "scripts": {
44
43
  "build": "yarn build:src",
45
44
  "build:src": "webex-legacy-tools build -dest \"./dist\" -src \"./src\" -js -ts -maps",
46
- "deploy:npm": "yarn npm publish",
47
45
  "test": "yarn test:style && yarn test:unit && yarn test:integration && yarn test:browser",
48
46
  "test:browser:broken": "webex-legacy-tools test --integration --unit --runner karma",
49
47
  "test:integration": "webex-legacy-tools test --integration --runner mocha",
50
48
  "test:style": "eslint ./src/**/*.*",
51
49
  "test:unit": "webex-legacy-tools test --unit --runner jest"
52
- },
53
- "version": "2.60.0-next.8"
54
- }
50
+ }
51
+ }
package/src/constants.ts CHANGED
@@ -12,8 +12,3 @@ export const SEARCH_TYPES = {
12
12
  ROOM: 'ROOM',
13
13
  ROBOT: 'ROBOT',
14
14
  };
15
- export const LOOKUP_DATA_PATH = 'lookupResult.entities';
16
- export const LOOKUP_FOUND_PATH = 'lookupResult.entitiesFound';
17
- export const LOOKUP_NOT_FOUND_PATH = 'lookupResult.entitiesNotFound';
18
- export const LOOKUP_REQUEST_KEY = 'lookupValues';
19
- export const SEARCH_DATA_PATH = 'directoryEntities';