@webex/plugin-people 3.10.0 → 3.11.0
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/config.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/people-batcher.js.map +1 -1
- package/dist/people.js +3 -2
- package/dist/people.js.map +1 -1
- package/package.json +8 -8
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_default","exports","default","people","batcherWait","batcherMaxCalls","batcherMaxWait","showAllTypes"],"sources":["config.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nexport default {\n people: {\n batcherWait: 100,\n batcherMaxCalls: 10,\n batcherMaxWait: 1500,\n /**\n * optional flag that requires Hydra to send every type field,\n * even if the type is not \"person\" (e.g.: SX10, webhook_integration, etc.)\n * @private\n */\n showAllTypes: false,\n },\n};\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAFA,IAAAA,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAIe;EACbC,MAAM,EAAE;IACNC,WAAW,EAAE,GAAG;IAChBC,eAAe,EAAE,EAAE;IACnBC,cAAc,EAAE,IAAI;IACpB;AACJ;AACA;AACA;AACA;IACIC,YAAY,EAAE;EAChB;AACF,CAAC"}
|
|
1
|
+
{"version":3,"names":["_default","exports","default","people","batcherWait","batcherMaxCalls","batcherMaxWait","showAllTypes"],"sources":["config.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nexport default {\n people: {\n batcherWait: 100,\n batcherMaxCalls: 10,\n batcherMaxWait: 1500,\n /**\n * optional flag that requires Hydra to send every type field,\n * even if the type is not \"person\" (e.g.: SX10, webhook_integration, etc.)\n * @private\n */\n showAllTypes: false,\n },\n};\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAFA,IAAAA,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAIe;EACbC,MAAM,EAAE;IACNC,WAAW,EAAE,GAAG;IAChBC,eAAe,EAAE,EAAE;IACnBC,cAAc,EAAE,IAAI;IACpB;AACJ;AACA;AACA;AACA;IACIC,YAAY,EAAE;EAChB;AACF,CAAC","ignoreList":[]}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_webexCore","require","_people","_interopRequireDefault","_config","registerPlugin","People","config"],"sources":["index.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {registerPlugin} from '@webex/webex-core';\n\nimport People from './people';\nimport config from './config';\n\nregisterPlugin('people', People, {\n config,\n});\n\nexport {default} from './people';\n"],"mappings":";;;;;;;;;;;;;AAIA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAD,sBAAA,CAAAF,OAAA;AAPA;AACA;AACA;;AAOA,IAAAI,yBAAc,EAAC,QAAQ,EAAEC,eAAM,EAAE;EAC/BC,MAAM,EAANA;AACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"names":["_webexCore","require","_people","_interopRequireDefault","_config","registerPlugin","People","config"],"sources":["index.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {registerPlugin} from '@webex/webex-core';\n\nimport People from './people';\nimport config from './config';\n\nregisterPlugin('people', People, {\n config,\n});\n\nexport {default} from './people';\n"],"mappings":";;;;;;;;;;;;;AAIA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAD,sBAAA,CAAAF,OAAA;AAPA;AACA;AACA;;AAOA,IAAAI,yBAAc,EAAC,QAAQ,EAAEC,eAAM,EAAE;EAC/BC,MAAM,EAANA;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_webexCore","require","PersonUUIDRequestBatcher","Batcher","extend","namespace","handleHttpSuccess","res","_this","promises","body","items","map","personResponse","handleItemSuccess","id","notFoundIds","concat","handleItemFailure","_promise","default","all","getDeferredForResponse","then","defer","reject","email","response","resolve","fingerprintRequest","uuidOrHydraId","hydraId","webex","people","inferPersonIdFromUuid","fingerprintResponse","prepareRequest","ids","join","submitHttpRequest","request","service","resource","config","showAllTypes","_default","exports"],"sources":["people-batcher.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {Batcher} from '@webex/webex-core';\n\n/**\n * @class\n * @ignore\n */\nconst PersonUUIDRequestBatcher = Batcher.extend({\n namespace: 'People',\n\n /**\n * @instance\n * @memberof PersonUUIDRequestBatcher\n * @param {HttpResponseObject} res\n * @returns {Promise}\n */\n handleHttpSuccess(res) {\n const promises = res.body.items.map((personResponse) =>\n this.handleItemSuccess(personResponse.id, personResponse)\n );\n\n if (res.body.notFoundIds) {\n promises.concat(res.body.notFoundIds.map((id) => this.handleItemFailure(id)));\n }\n\n return Promise.all(promises);\n },\n\n handleItemFailure(id) {\n return this.getDeferredForResponse(id).then((defer) => {\n defer.reject(id);\n });\n },\n\n /**\n * @instance\n * @memberof PersonUUIDRequestBatcher\n * @param {string} email\n * @param {Object} response\n * @returns {Promise}\n */\n handleItemSuccess(email, response) {\n return this.getDeferredForResponse(email).then((defer) => {\n defer.resolve(response);\n });\n },\n\n /**\n * @instance\n * @memberof PersonUUIDRequestBatcher\n * @param {string} uuidOrHydraId\n * @returns {Promise<string>}\n */\n fingerprintRequest(uuidOrHydraId) {\n const hydraId = this.webex.people.inferPersonIdFromUuid(uuidOrHydraId);\n\n return Promise.resolve(hydraId);\n },\n\n /**\n * @instance\n * @memberof PersonUUIDRequestBatcher\n * @param {string} hydraId\n * @returns {Promise<string>}\n */\n fingerprintResponse(hydraId) {\n return Promise.resolve(hydraId);\n },\n\n prepareRequest(ids) {\n return Promise.resolve(ids.join());\n },\n\n /**\n * @instance\n * @memberof PersonUUIDRequestBatcher\n * @param {Object} ids\n * @returns {Promise<HttpResponseObject>}\n */\n submitHttpRequest(ids) {\n return this.webex.request({\n service: 'hydra',\n resource: `people/?id=${ids}&showAllTypes=${this.config.showAllTypes}`,\n });\n },\n});\n\nexport default PersonUUIDRequestBatcher;\n"],"mappings":";;;;;;;;;AAIA,IAAAA,UAAA,GAAAC,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA,IAAMC,wBAAwB,GAAGC,kBAAO,CAACC,MAAM,CAAC;EAC9CC,SAAS,EAAE,QAAQ;EAEnB;AACF;AACA;AACA;AACA;AACA;EACEC,iBAAiB,
|
|
1
|
+
{"version":3,"names":["_webexCore","require","PersonUUIDRequestBatcher","Batcher","extend","namespace","handleHttpSuccess","res","_this","promises","body","items","map","personResponse","handleItemSuccess","id","notFoundIds","concat","handleItemFailure","_promise","default","all","getDeferredForResponse","then","defer","reject","email","response","resolve","fingerprintRequest","uuidOrHydraId","hydraId","webex","people","inferPersonIdFromUuid","fingerprintResponse","prepareRequest","ids","join","submitHttpRequest","request","service","resource","config","showAllTypes","_default","exports"],"sources":["people-batcher.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {Batcher} from '@webex/webex-core';\n\n/**\n * @class\n * @ignore\n */\nconst PersonUUIDRequestBatcher = Batcher.extend({\n namespace: 'People',\n\n /**\n * @instance\n * @memberof PersonUUIDRequestBatcher\n * @param {HttpResponseObject} res\n * @returns {Promise}\n */\n handleHttpSuccess(res) {\n const promises = res.body.items.map((personResponse) =>\n this.handleItemSuccess(personResponse.id, personResponse)\n );\n\n if (res.body.notFoundIds) {\n promises.concat(res.body.notFoundIds.map((id) => this.handleItemFailure(id)));\n }\n\n return Promise.all(promises);\n },\n\n handleItemFailure(id) {\n return this.getDeferredForResponse(id).then((defer) => {\n defer.reject(id);\n });\n },\n\n /**\n * @instance\n * @memberof PersonUUIDRequestBatcher\n * @param {string} email\n * @param {Object} response\n * @returns {Promise}\n */\n handleItemSuccess(email, response) {\n return this.getDeferredForResponse(email).then((defer) => {\n defer.resolve(response);\n });\n },\n\n /**\n * @instance\n * @memberof PersonUUIDRequestBatcher\n * @param {string} uuidOrHydraId\n * @returns {Promise<string>}\n */\n fingerprintRequest(uuidOrHydraId) {\n const hydraId = this.webex.people.inferPersonIdFromUuid(uuidOrHydraId);\n\n return Promise.resolve(hydraId);\n },\n\n /**\n * @instance\n * @memberof PersonUUIDRequestBatcher\n * @param {string} hydraId\n * @returns {Promise<string>}\n */\n fingerprintResponse(hydraId) {\n return Promise.resolve(hydraId);\n },\n\n prepareRequest(ids) {\n return Promise.resolve(ids.join());\n },\n\n /**\n * @instance\n * @memberof PersonUUIDRequestBatcher\n * @param {Object} ids\n * @returns {Promise<HttpResponseObject>}\n */\n submitHttpRequest(ids) {\n return this.webex.request({\n service: 'hydra',\n resource: `people/?id=${ids}&showAllTypes=${this.config.showAllTypes}`,\n });\n },\n});\n\nexport default PersonUUIDRequestBatcher;\n"],"mappings":";;;;;;;;;AAIA,IAAAA,UAAA,GAAAC,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA,IAAMC,wBAAwB,GAAGC,kBAAO,CAACC,MAAM,CAAC;EAC9CC,SAAS,EAAE,QAAQ;EAEnB;AACF;AACA;AACA;AACA;AACA;EACEC,iBAAiB,WAAjBA,iBAAiBA,CAACC,GAAG,EAAE;IAAA,IAAAC,KAAA;IACrB,IAAMC,QAAQ,GAAGF,GAAG,CAACG,IAAI,CAACC,KAAK,CAACC,GAAG,CAAC,UAACC,cAAc;MAAA,OACjDL,KAAI,CAACM,iBAAiB,CAACD,cAAc,CAACE,EAAE,EAAEF,cAAc,CAAC;IAAA,CAC3D,CAAC;IAED,IAAIN,GAAG,CAACG,IAAI,CAACM,WAAW,EAAE;MACxBP,QAAQ,CAACQ,MA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AC,CAAC;EACpC,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;EACEC,iBAAiB,WAAjBA,iBAAiBA,CAACF,GAAG,EAAE;IACrB,OAAO,IAAI,CAACL,KAAK,CAACQ,OAAO,CAAC;MACxBC,OAAO,EAAE,OAAO;MAChBC,QAAQ,gBAAAzB,MAAA,CAAgBoB,GAAG,oBAAApB,MAAA,CAAiB,IAAI,CAAC0B,MAAM,CAACC,YAAY;IACtE,CAAC,CAAC;EACJ;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA1B,OAAA,GAEYlB,wBAAwB","ignoreList":[]}
|
package/dist/people.js
CHANGED
|
@@ -24,6 +24,7 @@ var _obj;
|
|
|
24
24
|
* @property {string} displayName - Display name of the person
|
|
25
25
|
* @property {isoDate} created - (server generated) The date and time that the person was created
|
|
26
26
|
*/
|
|
27
|
+
|
|
27
28
|
/**
|
|
28
29
|
* @class
|
|
29
30
|
*/
|
|
@@ -193,7 +194,7 @@ var People = _webexCore.WebexPlugin.extend((_obj = {
|
|
|
193
194
|
return res.body;
|
|
194
195
|
});
|
|
195
196
|
},
|
|
196
|
-
version: "
|
|
197
|
-
}, (
|
|
197
|
+
version: "0.0.0"
|
|
198
|
+
}, (0, _applyDecoratedDescriptor2.default)(_obj, "_getMe", [_common.oneFlight], (0, _getOwnPropertyDescriptor.default)(_obj, "_getMe"), _obj), _obj));
|
|
198
199
|
var _default = exports.default = People;
|
|
199
200
|
//# sourceMappingURL=people.js.map
|
package/dist/people.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_webexCore","require","_common","_peopleBatcher","_interopRequireDefault","_obj","People","WebexPlugin","extend","namespace","children","batcher","PeopleBatcher","get","person","_promise","default","reject","Error","_getMe","id","personId","request","list","options","_this","_isArray","peopleIds","all","map","service","resource","qs","then","res","Page","webex","inferPersonIdFromUuid","base64","decode","includes","err","encode","concat","body","version","_applyDecoratedDescriptor2","oneFlight","_getOwnPropertyDescriptor","_default","exports"],"sources":["people.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {WebexPlugin, Page} from '@webex/webex-core';\nimport {base64, oneFlight} from '@webex/common';\n\nimport PeopleBatcher from './people-batcher';\n\n/**\n * @typedef {Object} PersonObject\n * @property {string} id - (server generated) Unique identifier for the person\n * @property {Array<email>} emails - Email addresses of the person\n * @property {string} displayName - Display name of the person\n * @property {isoDate} created - (server generated) The date and time that the person was created\n */\n\n/**\n * @class\n */\nconst People = WebexPlugin.extend({\n namespace: 'People',\n\n children: {\n batcher: PeopleBatcher,\n },\n /**\n * Returns a single person by ID\n * @instance\n * @memberof People\n * @param {PersonObject|uuid|string} person\n * @returns {Promise<PersonObject>}\n * @example\n * webex.rooms.create({title: 'Get Person Example'})\n * .then(function(room) {\n * return webex.memberships.create({\n * personEmail: 'alice@example.com',\n * roomId: room.id\n * });\n * })\n * .then(function(membership) {\n * return webex.people.get(membership.personId);\n * })\n * .then(function(alice) {\n * var assert = require('assert');\n * assert(alice.id);\n * assert(Array.isArray(alice.emails));\n * assert.equal(alice.emails.filter(function(email) {\n * return email === 'alice@example.com';\n * }).length, 1);\n * assert(alice.displayName);\n * assert(alice.created);\n * return 'success';\n * });\n * // => success\n */\n get(person) {\n if (!person) {\n return Promise.reject(new Error('A person with an id is required'));\n }\n if (person === 'me') {\n return this._getMe();\n }\n const id = person.personId || person.id || person;\n\n return this.batcher.request(id);\n },\n\n /**\n * Returns a list of people\n * @instance\n * @memberof People\n * @param {Object | uuid[]} options or array of uuids\n * @param {email} options.email - Returns people with an email that contains this string\n * @param {string} options.displayName - Returns people with a name that contains this string\n * @param {bool} showAllTypes optional flag that requires Hydra to send every type field,\n * even if the type is not \"person\" (e.g.: SX10, webhook_integration, etc.)\n * @returns {Promise<Page<PersonObject>>}\n * @example\n * var room;\n * webex.rooms.create({title: 'List People Example'})\n * .then(function(r) {\n * room = r;\n * return webex.memberships.create({\n * personEmail: 'alice@example.com',\n * roomId: room.id\n * });\n * })\n * .then(function() {\n * return webex.memberships.create({\n * personEmail: 'bob@example.com',\n * roomId: room.id\n * });\n * })\n * .then(function() {\n * return webex.people.list({email: 'alice@example.com'});\n * })\n * .then(function(people) {\n * var assert = require('assert');\n * assert.equal(people.length, 1);\n * var person = people.items[0];\n * assert(person.id);\n * assert(Array.isArray(person.emails));\n * assert(person.displayName);\n * assert(person.created);\n * return 'success';\n * });\n * // => success\n * @example <caption>Example usage of array method</caption>\n * var room;\n * var aliceId;\n * var bobId;\n * webex.rooms.create({title: 'List People Array Example'})\n * .then(function(r) {\n * room = r;\n * return webex.memberships.create({\n * personEmail: 'alice@example.com',\n * roomId: room.id\n * });\n * })\n * .then(function(membership) {\n * aliceId = membership.personId;\n * })\n * .then(function() {\n * return webex.memberships.create({\n * personEmail: 'bob@example.com',\n * roomId: room.id\n * });\n * })\n * .then(function(membership) {\n * bobId = membership.personId;\n * })\n * .then(function() {\n * return webex.people.list([aliceId, bobId]);\n * })\n * .then(function(people) {\n * var assert = require('assert');\n * assert.equal(people.length, 2);\n * var person = people.items[0];\n * assert(person.id);\n * assert(Array.isArray(person.emails));\n * assert(person.displayName);\n * assert(person.created);\n * return 'success';\n * });\n * // => success\n */\n list(options) {\n if (Array.isArray(options)) {\n const peopleIds = options;\n\n return Promise.all(peopleIds.map((personId) => this.batcher.request(personId)));\n }\n\n return this.request({\n service: 'hydra',\n resource: 'people',\n qs: options,\n }).then((res) => new Page(res, this.webex));\n },\n\n /**\n * Converts a uuid to a hydra id without a network dip.\n * @param {string} id\n * @private\n * @returns {string}\n */\n inferPersonIdFromUuid(id) {\n // base64.validate seems to return true for uuids, so we need a different\n // check\n try {\n if (base64.decode(id).includes('ciscospark://')) {\n return id;\n }\n } catch (err) {\n // ignore\n }\n\n return base64.encode(`ciscospark://us/PEOPLE/${id}`);\n },\n\n /**\n * Fetches the current user from the /people/me endpoint\n * @instance\n * @memberof People\n * @private\n * @returns {Promise<PersonObject>}\n */\n @oneFlight\n _getMe() {\n return this.webex\n .request({\n service: 'hydra',\n resource: 'people/me',\n })\n .then((res) => res.body);\n },\n});\n\nexport default People;\n"],"mappings":";;;;;;;;;;;;AAIA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,cAAA,GAAAC,sBAAA,CAAAH,OAAA;AAA6C,IAAAI,IAAA;AAP7C;AACA;AACA;AAOA;AACA;AACA;AACA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"names":["_webexCore","require","_common","_peopleBatcher","_interopRequireDefault","_obj","People","WebexPlugin","extend","namespace","children","batcher","PeopleBatcher","get","person","_promise","default","reject","Error","_getMe","id","personId","request","list","options","_this","_isArray","peopleIds","all","map","service","resource","qs","then","res","Page","webex","inferPersonIdFromUuid","base64","decode","includes","err","encode","concat","body","version","_applyDecoratedDescriptor2","oneFlight","_getOwnPropertyDescriptor","_default","exports"],"sources":["people.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {WebexPlugin, Page} from '@webex/webex-core';\nimport {base64, oneFlight} from '@webex/common';\n\nimport PeopleBatcher from './people-batcher';\n\n/**\n * @typedef {Object} PersonObject\n * @property {string} id - (server generated) Unique identifier for the person\n * @property {Array<email>} emails - Email addresses of the person\n * @property {string} displayName - Display name of the person\n * @property {isoDate} created - (server generated) The date and time that the person was created\n */\n\n/**\n * @class\n */\nconst People = WebexPlugin.extend({\n namespace: 'People',\n\n children: {\n batcher: PeopleBatcher,\n },\n /**\n * Returns a single person by ID\n * @instance\n * @memberof People\n * @param {PersonObject|uuid|string} person\n * @returns {Promise<PersonObject>}\n * @example\n * webex.rooms.create({title: 'Get Person Example'})\n * .then(function(room) {\n * return webex.memberships.create({\n * personEmail: 'alice@example.com',\n * roomId: room.id\n * });\n * })\n * .then(function(membership) {\n * return webex.people.get(membership.personId);\n * })\n * .then(function(alice) {\n * var assert = require('assert');\n * assert(alice.id);\n * assert(Array.isArray(alice.emails));\n * assert.equal(alice.emails.filter(function(email) {\n * return email === 'alice@example.com';\n * }).length, 1);\n * assert(alice.displayName);\n * assert(alice.created);\n * return 'success';\n * });\n * // => success\n */\n get(person) {\n if (!person) {\n return Promise.reject(new Error('A person with an id is required'));\n }\n if (person === 'me') {\n return this._getMe();\n }\n const id = person.personId || person.id || person;\n\n return this.batcher.request(id);\n },\n\n /**\n * Returns a list of people\n * @instance\n * @memberof People\n * @param {Object | uuid[]} options or array of uuids\n * @param {email} options.email - Returns people with an email that contains this string\n * @param {string} options.displayName - Returns people with a name that contains this string\n * @param {bool} showAllTypes optional flag that requires Hydra to send every type field,\n * even if the type is not \"person\" (e.g.: SX10, webhook_integration, etc.)\n * @returns {Promise<Page<PersonObject>>}\n * @example\n * var room;\n * webex.rooms.create({title: 'List People Example'})\n * .then(function(r) {\n * room = r;\n * return webex.memberships.create({\n * personEmail: 'alice@example.com',\n * roomId: room.id\n * });\n * })\n * .then(function() {\n * return webex.memberships.create({\n * personEmail: 'bob@example.com',\n * roomId: room.id\n * });\n * })\n * .then(function() {\n * return webex.people.list({email: 'alice@example.com'});\n * })\n * .then(function(people) {\n * var assert = require('assert');\n * assert.equal(people.length, 1);\n * var person = people.items[0];\n * assert(person.id);\n * assert(Array.isArray(person.emails));\n * assert(person.displayName);\n * assert(person.created);\n * return 'success';\n * });\n * // => success\n * @example <caption>Example usage of array method</caption>\n * var room;\n * var aliceId;\n * var bobId;\n * webex.rooms.create({title: 'List People Array Example'})\n * .then(function(r) {\n * room = r;\n * return webex.memberships.create({\n * personEmail: 'alice@example.com',\n * roomId: room.id\n * });\n * })\n * .then(function(membership) {\n * aliceId = membership.personId;\n * })\n * .then(function() {\n * return webex.memberships.create({\n * personEmail: 'bob@example.com',\n * roomId: room.id\n * });\n * })\n * .then(function(membership) {\n * bobId = membership.personId;\n * })\n * .then(function() {\n * return webex.people.list([aliceId, bobId]);\n * })\n * .then(function(people) {\n * var assert = require('assert');\n * assert.equal(people.length, 2);\n * var person = people.items[0];\n * assert(person.id);\n * assert(Array.isArray(person.emails));\n * assert(person.displayName);\n * assert(person.created);\n * return 'success';\n * });\n * // => success\n */\n list(options) {\n if (Array.isArray(options)) {\n const peopleIds = options;\n\n return Promise.all(peopleIds.map((personId) => this.batcher.request(personId)));\n }\n\n return this.request({\n service: 'hydra',\n resource: 'people',\n qs: options,\n }).then((res) => new Page(res, this.webex));\n },\n\n /**\n * Converts a uuid to a hydra id without a network dip.\n * @param {string} id\n * @private\n * @returns {string}\n */\n inferPersonIdFromUuid(id) {\n // base64.validate seems to return true for uuids, so we need a different\n // check\n try {\n if (base64.decode(id).includes('ciscospark://')) {\n return id;\n }\n } catch (err) {\n // ignore\n }\n\n return base64.encode(`ciscospark://us/PEOPLE/${id}`);\n },\n\n /**\n * Fetches the current user from the /people/me endpoint\n * @instance\n * @memberof People\n * @private\n * @returns {Promise<PersonObject>}\n */\n @oneFlight\n _getMe() {\n return this.webex\n .request({\n service: 'hydra',\n resource: 'people/me',\n })\n .then((res) => res.body);\n },\n});\n\nexport default People;\n"],"mappings":";;;;;;;;;;;;AAIA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,cAAA,GAAAC,sBAAA,CAAAH,OAAA;AAA6C,IAAAI,IAAA;AAP7C;AACA;AACA;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAMC,MAAM,GAAGC,sBAAW,CAACC,MAAM,EAAAH,IAAA,GAAC;EAChCI,SAAS,EAAE,QAAQ;EAEnBC,QAAQ,EAAE;IACRC,OAAO,EAAEC;EACX,CAAC;EACD;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,GAAG,WAAHA,GAAGA,CAACC,MAAM,EAA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,UAACC,GAAG;MAAA,OAAK,IAAIC,eAAI,CAACD,GAAG,EAAET,KAAI,CAACW,KAAK,CAAC;IAAA,EAAC;EAC7C,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;EACEC,qBAAqB,WAArBA,qBAAqBA,CAACjB,EAAE,EAAE;IACxB;IACA;IACA,IAAI;MACF,IAAIkB,cAAM,CAACC,MAAM,CAACnB,EAAE,CAAC,CAACoB,QAAQ,CAAC,eAAe,CAAC,EAAE;QAC/C,OAAOpB,EAAE;MACX;IACF,CAAC,CAAC,OAAOqB,GAAG,EAAE;MACZ;IAAA;IAGF,OAAOH,cAAM,CAACI,MAAM,2BAAAC,MAAA,CAA2BvB,EAAE,CAAE,CAAC;EACtD,CAAC;EAUDD,MAAM,WAANA,MAAMA,CAAA,EAAG;IACP,OAAO,IAAI,CAACiB,KAAK,CACdd,OAAO,CAAC;MACPQ,OAAO,EAAE,OAAO;MAChBC,QAAQ,EAAE;IACZ,CAAC,CAAC,CACDE,IAAI,CAAC,UAACC,GAAG;MAAA,OAAKA,GAAG,CAACU,IAAI;IAAA,EAAC;EAC5B,CAAC;EAAAC,OAAA;AACH,CAAC,MAAAC,0BAAA,CAAA9B,OAAA,EAAAX,IAAA,aATE0C,iBAAS,OAAAC,yBAAA,CAAAhC,OAAA,EAAAX,IAAA,aAAAA,IAAA,GAAAA,IAAA,CASX,CAAC;AAAC,IAAA4C,QAAA,GAAAC,OAAA,CAAAlC,OAAA,GAEYV,MAAM","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -24,18 +24,18 @@
|
|
|
24
24
|
"@webex/eslint-config-legacy": "0.0.0",
|
|
25
25
|
"@webex/jest-config-legacy": "0.0.0",
|
|
26
26
|
"@webex/legacy-tools": "0.0.0",
|
|
27
|
-
"@webex/test-helper-chai": "3.
|
|
28
|
-
"@webex/test-helper-mocha": "3.
|
|
29
|
-
"@webex/test-helper-mock-webex": "3.
|
|
30
|
-
"@webex/test-helper-test-users": "3.
|
|
27
|
+
"@webex/test-helper-chai": "3.11.0",
|
|
28
|
+
"@webex/test-helper-mocha": "3.11.0",
|
|
29
|
+
"@webex/test-helper-mock-webex": "3.11.0",
|
|
30
|
+
"@webex/test-helper-test-users": "3.11.0",
|
|
31
31
|
"eslint": "^8.24.0",
|
|
32
32
|
"prettier": "^2.7.1",
|
|
33
33
|
"sinon": "^9.2.4"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@webex/common": "3.
|
|
37
|
-
"@webex/internal-plugin-mercury": "3.
|
|
38
|
-
"@webex/webex-core": "3.
|
|
36
|
+
"@webex/common": "3.11.0",
|
|
37
|
+
"@webex/internal-plugin-mercury": "3.11.0",
|
|
38
|
+
"@webex/webex-core": "3.11.0"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "yarn build:src",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"test:style": "eslint ./src/**/*.*",
|
|
47
47
|
"test:unit": "webex-legacy-tools test --unit --runner jest"
|
|
48
48
|
},
|
|
49
|
-
"version": "3.
|
|
49
|
+
"version": "3.11.0"
|
|
50
50
|
}
|