@webex/internal-plugin-dss 3.0.0-beta.214 → 3.0.0-beta.216
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/dss.js +26 -1
- package/dist/dss.js.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +8 -8
- package/src/dss.ts +26 -0
- package/src/types.ts +6 -0
- package/test/unit/spec/dss.ts +42 -0
package/dist/dss.js
CHANGED
|
@@ -363,7 +363,32 @@ var DSS = _webexCore.WebexPlugin.extend({
|
|
|
363
363
|
return resultArray;
|
|
364
364
|
});
|
|
365
365
|
},
|
|
366
|
-
|
|
366
|
+
/**
|
|
367
|
+
* Search for information about places
|
|
368
|
+
* @param {Object} options
|
|
369
|
+
* @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.
|
|
370
|
+
* @param {number} options.resultSize The maximum number of results returned from each provider
|
|
371
|
+
* @returns {Promise} Resolves with an array of entities found
|
|
372
|
+
*/
|
|
373
|
+
searchPlaces: function searchPlaces(options) {
|
|
374
|
+
var _this5 = this;
|
|
375
|
+
var resultSize = options.resultSize,
|
|
376
|
+
queryString = options.queryString,
|
|
377
|
+
isOnlySchedulableRooms = options.isOnlySchedulableRooms;
|
|
378
|
+
return this._request({
|
|
379
|
+
dataPath: 'directoryEntities',
|
|
380
|
+
resource: "/search/orgid/".concat(this.webex.internal.device.orgId, "/places"),
|
|
381
|
+
params: {
|
|
382
|
+
queryString: queryString,
|
|
383
|
+
resultSize: resultSize,
|
|
384
|
+
isOnlySchedulableRooms: isOnlySchedulableRooms
|
|
385
|
+
}
|
|
386
|
+
}).catch(function (error) {
|
|
387
|
+
_this5.logger.error("DSS->search place#ERROR, search place failure, ".concat(error.message));
|
|
388
|
+
return _promise.default.reject(error);
|
|
389
|
+
});
|
|
390
|
+
},
|
|
391
|
+
version: "3.0.0-beta.216"
|
|
367
392
|
});
|
|
368
393
|
var _default = DSS;
|
|
369
394
|
exports.default = _default;
|
package/dist/dss.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DSS","WebexPlugin","extend","namespace","registered","initialize","args","prototype","batchers","register","webex","canAuthorize","logger","error","reject","Error","info","resolve","internal","mercury","connect","then","listenForEvents","trigger","DSS_REGISTERED","catch","message","unregister","stopListeningForEvents","disconnect","DSS_UNREGISTERED","on","DSS_LOOKUP_MERCURY_EVENT","envelope","_handleEvent","data","DSS_SEARCH_MERCURY_EVENT","off","_getResultEventName","requestId","DSS_RESULT","DSS_LOOKUP_RESULT","_request","options","resource","params","dataPath","foundPath","notFoundPath","timeout","config","requestTimeout","uuid","v4","eventName","result","expectedSeqNums","notFoundArray","timer","Timer","stopListening","DssTimeoutError","listenTo","reset","resultData","found","sequence","finished","map","String","done","cancel","resultArray","foundArray","forEach","index","seqResult","push","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","lookup","entityProviderType","shouldBatch","lookupByEmail","email","search","requestedTypes","resultSize","queryString","SEARCH_DATA_PATH"],"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} 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\nexport default DSS;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAKA;AACA;AACA;AAGA;AAOA;AAcA;AACA;AAA6C;AAAA;AAG7C,IAAMA,GAAG,GAAGC,sBAAW,CAACC,MAAM,CAAC;EAC7BC,SAAS,EAAE,KAAK;EAEhB;AACF;AACA;AACA;AACA;AACA;EACEC,UAAU,EAAE,KAAK;EAEjB;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,UAAU,wBAAU;IAAA,kCAANC,IAAI;MAAJA,IAAI;IAAA;IAChB,oBAAcL,sBAAW,CAACM,SAAS,CAACF,UAAU,EAAE,IAAI,EAAEC,IAAI,CAAC;IAC3D,IAAI,CAACE,QAAQ,GAAG,CAAC,CAAC;EACpB,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;EACEC,QAAQ,sBAAG;IAAA;IACT,IAAI,CAAC,IAAI,CAACC,KAAK,CAACC,YAAY,EAAE;MAC5B,IAAI,CAACC,MAAM,CAACC,KAAK,CAAC,+DAA+D,CAAC;MAElF,OAAO,iBAAQC,MAAM,CAA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C1D,QAAQ,CAAC;MACnBI,QAAQ,EAAE0C,2BAAgB;MAC1BzC,SAAS,EAAE2C,4BAAiB;MAC5B9C,QAAQ,EAARA,QAAQ;MACRC,MAAM,oCACHiD,6BAAkB,EAAG,CAACW,KAAK,CAAC;IAEjC,CAAC,CAAC,CAACpF,IAAI,CAAC,iBAA+B;MAAA,IAA7BmD,WAAW,SAAXA,WAAW;QAAEC,UAAU,SAAVA,UAAU;MAC/B,IAAIA,UAAU,CAAC,CAAC,CAAC,KAAKgC,KAAK,EAAE;QAC3B,OAAOjC,WAAW,CAAC,CAAC,CAAC;MACvB;MAEA,OAAO,IAAI;IACb,CAAC,CAAC;EACJ,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEkC,MAAM,kBAAC/D,OAAsB,EAAE;IAC7B,IAAOgE,cAAc,GAA6BhE,OAAO,CAAlDgE,cAAc;MAAEC,UAAU,GAAiBjE,OAAO,CAAlCiE,UAAU;MAAEC,WAAW,GAAIlE,OAAO,CAAtBkE,WAAW;IAE9C,OAAO,IAAI,CAACnE,QAAQ,CAAC;MACnBI,QAAQ,EAAEgE,2BAAgB;MAC1BlE,QAAQ,0BAAmB,IAAI,CAAClC,KAAK,CAACQ,QAAQ,CAACiF,MAAM,CAACC,KAAK,cAAW;MACtEvD,MAAM,EAAE;QACNgE,WAAW,EAAXA,WAAW;QACXD,UAAU,EAAVA,UAAU;QACVD,cAAc,EAAdA;MACF;IACF,CAAC,CAAC,CAACtF,IAAI,CAAC;MAAA,IAAEmD,WAAW,SAAXA,WAAW;MAAA,OAAMA,WAAW;IAAA,EAAC;EACzC,CAAC;EAAA;AACH,CAAC,CAAC;AAAC,eAEYxE,GAAG;AAAA"}
|
|
1
|
+
{"version":3,"names":["DSS","WebexPlugin","extend","namespace","registered","initialize","args","prototype","batchers","register","webex","canAuthorize","logger","error","reject","Error","info","resolve","internal","mercury","connect","then","listenForEvents","trigger","DSS_REGISTERED","catch","message","unregister","stopListeningForEvents","disconnect","DSS_UNREGISTERED","on","DSS_LOOKUP_MERCURY_EVENT","envelope","_handleEvent","data","DSS_SEARCH_MERCURY_EVENT","off","_getResultEventName","requestId","DSS_RESULT","DSS_LOOKUP_RESULT","_request","options","resource","params","dataPath","foundPath","notFoundPath","timeout","config","requestTimeout","uuid","v4","eventName","result","expectedSeqNums","notFoundArray","timer","Timer","stopListening","DssTimeoutError","listenTo","reset","resultData","found","sequence","finished","map","String","done","cancel","resultArray","foundArray","forEach","index","seqResult","push","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","lookup","entityProviderType","shouldBatch","lookupByEmail","email","search","requestedTypes","resultSize","queryString","SEARCH_DATA_PATH","searchPlaces","isOnlySchedulableRooms"],"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;AACA;AACA;AAGA;AAQA;AAcA;AACA;AAA6C;AAAA;AAG7C,IAAMA,GAAG,GAAGC,sBAAW,CAACC,MAAM,CAAC;EAC7BC,SAAS,EAAE,KAAK;EAEhB;AACF;AACA;AACA;AACA;AACA;EACEC,UAAU,EAAE,KAAK;EAEjB;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,UAAU,wBAAU;IAAA,kCAANC,IAAI;MAAJA,IAAI;IAAA;IAChB,oBAAcL,sBAAW,CAACM,SAAS,CAACF,UAAU,EAAE,IAAI,EAAEC,IAAI,CAAC;IAC3D,IAAI,CAACE,QAA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;EACzC,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;AACA;EACEuC,YAAY,wBAACpE,OAA2B,EAAE;IAAA;IACxC,IAAOiE,UAAU,GAAyCjE,OAAO,CAA1DiE,UAAU;MAAEC,WAAW,GAA4BlE,OAAO,CAA9CkE,WAAW;MAAEG,sBAAsB,GAAIrE,OAAO,CAAjCqE,sBAAsB;IAEtD,OAAO,IAAI,CAACtE,QAAQ,CAAC;MACnBI,QAAQ,EAAE,mBAAmB;MAC7BF,QAAQ,0BAAmB,IAAI,CAAClC,KAAK,CAACQ,QAAQ,CAACiF,MAAM,CAACC,KAAK,YAAS;MACpEvD,MAAM,EAAE;QACNgE,WAAW,EAAXA,WAAW;QACXD,UAAU,EAAVA,UAAU;QACVI,sBAAsB,EAAtBA;MACF;IACF,CAAC,CAAC,CAACvF,KAAK,CAAC,UAACZ,KAAK,EAAK;MAClB,MAAI,CAACD,MAAM,CAACC,KAAK,0DAAmDA,KAAK,CAACa,OAAO,EAAG;MAEpF,OAAO,iBAAQZ,MAAM,CAACD,KAAK,CAAC;IAC9B,CAAC,CAAC;EACJ,CAAC;EAAA;AACH,CAAC,CAAC;AAAC,eAEYb,GAAG;AAAA"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["EntityProviderType","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"],"mappings":";;;;;;;IAkBYA,kBAAkB;AAAA;AAAA,WAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;AAAA,GAAlBA,kBAAkB,kCAAlBA,kBAAkB;AAiB9B;AAAA,IACYC,UAAU;AAAA;AAAA,WAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;AAAA,GAAVA,UAAU,0BAAVA,UAAU"}
|
|
1
|
+
{"version":3,"names":["EntityProviderType","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;AAAA;AAAA,WAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;AAAA,GAAlBA,kBAAkB,kCAAlBA,kBAAkB;AAiB9B;AAAA,IACYC,UAAU;AAAA;AAAA,WAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;AAAA,GAAVA,UAAU,0BAAVA,UAAU"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/internal-plugin-dss",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.216",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Colin Read <coread@cisco.com>",
|
|
@@ -21,17 +21,17 @@
|
|
|
21
21
|
]
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@webex/common": "3.0.0-beta.
|
|
25
|
-
"@webex/common-timers": "3.0.0-beta.
|
|
26
|
-
"@webex/internal-plugin-mercury": "3.0.0-beta.
|
|
27
|
-
"@webex/webex-core": "3.0.0-beta.
|
|
24
|
+
"@webex/common": "3.0.0-beta.216",
|
|
25
|
+
"@webex/common-timers": "3.0.0-beta.216",
|
|
26
|
+
"@webex/internal-plugin-mercury": "3.0.0-beta.216",
|
|
27
|
+
"@webex/webex-core": "3.0.0-beta.216",
|
|
28
28
|
"lodash": "^4.17.21",
|
|
29
29
|
"uuid": "^3.3.2"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@webex/internal-plugin-dss": "3.0.0-beta.
|
|
33
|
-
"@webex/test-helper-chai": "3.0.0-beta.
|
|
34
|
-
"@webex/test-helper-mock-webex": "3.0.0-beta.
|
|
32
|
+
"@webex/internal-plugin-dss": "3.0.0-beta.216",
|
|
33
|
+
"@webex/test-helper-chai": "3.0.0-beta.216",
|
|
34
|
+
"@webex/test-helper-mock-webex": "3.0.0-beta.216",
|
|
35
35
|
"sinon": "^9.2.4"
|
|
36
36
|
}
|
|
37
37
|
}
|
package/src/dss.ts
CHANGED
|
@@ -14,6 +14,7 @@ import type {
|
|
|
14
14
|
LookupDetailOptions,
|
|
15
15
|
LookupOptions,
|
|
16
16
|
LookupByEmailOptions,
|
|
17
|
+
SearchPlaceOptions,
|
|
17
18
|
} from './types';
|
|
18
19
|
import {
|
|
19
20
|
DSS_REGISTERED,
|
|
@@ -386,6 +387,31 @@ const DSS = WebexPlugin.extend({
|
|
|
386
387
|
},
|
|
387
388
|
}).then(({resultArray}) => resultArray);
|
|
388
389
|
},
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* Search for information about places
|
|
393
|
+
* @param {Object} options
|
|
394
|
+
* @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.
|
|
395
|
+
* @param {number} options.resultSize The maximum number of results returned from each provider
|
|
396
|
+
* @returns {Promise} Resolves with an array of entities found
|
|
397
|
+
*/
|
|
398
|
+
searchPlaces(options: SearchPlaceOptions) {
|
|
399
|
+
const {resultSize, queryString, isOnlySchedulableRooms} = options;
|
|
400
|
+
|
|
401
|
+
return this._request({
|
|
402
|
+
dataPath: 'directoryEntities',
|
|
403
|
+
resource: `/search/orgid/${this.webex.internal.device.orgId}/places`,
|
|
404
|
+
params: {
|
|
405
|
+
queryString,
|
|
406
|
+
resultSize,
|
|
407
|
+
isOnlySchedulableRooms,
|
|
408
|
+
},
|
|
409
|
+
}).catch((error) => {
|
|
410
|
+
this.logger.error(`DSS->search place#ERROR, search place failure, ${error.message}`);
|
|
411
|
+
|
|
412
|
+
return Promise.reject(error);
|
|
413
|
+
});
|
|
414
|
+
},
|
|
389
415
|
});
|
|
390
416
|
|
|
391
417
|
export default DSS;
|
package/src/types.ts
CHANGED
package/test/unit/spec/dss.ts
CHANGED
|
@@ -1246,5 +1246,47 @@ describe('plugin-dss', () => {
|
|
|
1246
1246
|
]);
|
|
1247
1247
|
});
|
|
1248
1248
|
});
|
|
1249
|
+
|
|
1250
|
+
describe('#searchPlaces', () => {
|
|
1251
|
+
it('calls _request correctly', async () => {
|
|
1252
|
+
webex.internal.device.orgId = 'userOrgId';
|
|
1253
|
+
webex.internal.dss._request = sinon.stub().returns(Promise.resolve('some return value'));
|
|
1254
|
+
|
|
1255
|
+
const result = await webex.internal.dss.searchPlaces({
|
|
1256
|
+
resultSize: 100,
|
|
1257
|
+
queryString: 'query',
|
|
1258
|
+
isOnlySchedulableRooms: true,
|
|
1259
|
+
});
|
|
1260
|
+
expect(webex.internal.dss._request.getCall(0).args).to.deep.equal([
|
|
1261
|
+
{
|
|
1262
|
+
dataPath: 'directoryEntities',
|
|
1263
|
+
resource: '/search/orgid/userOrgId/places',
|
|
1264
|
+
params: {
|
|
1265
|
+
queryString: 'query',
|
|
1266
|
+
resultSize: 100,
|
|
1267
|
+
isOnlySchedulableRooms: true,
|
|
1268
|
+
},
|
|
1269
|
+
},
|
|
1270
|
+
]);
|
|
1271
|
+
expect(result).to.equal('some return value');
|
|
1272
|
+
});
|
|
1273
|
+
|
|
1274
|
+
it('works correctly', async () => {
|
|
1275
|
+
await testMakeRequest({
|
|
1276
|
+
method: 'searchPlaces',
|
|
1277
|
+
resource: '/search/orgid/userOrgId/places',
|
|
1278
|
+
params: {
|
|
1279
|
+
isOnlySchedulableRooms: true,
|
|
1280
|
+
resultSize: 100,
|
|
1281
|
+
queryString: 'query',
|
|
1282
|
+
},
|
|
1283
|
+
bodyParams: {
|
|
1284
|
+
isOnlySchedulableRooms: true,
|
|
1285
|
+
resultSize: 100,
|
|
1286
|
+
queryString: 'query',
|
|
1287
|
+
},
|
|
1288
|
+
});
|
|
1289
|
+
});
|
|
1290
|
+
});
|
|
1249
1291
|
});
|
|
1250
1292
|
});
|