@webex/webex-core 3.12.0-next.64 → 3.12.0-next.65
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 +7 -0
- package/dist/config.js.map +1 -1
- package/dist/lib/batcher.js +1 -1
- package/dist/lib/credentials/credentials.js +1 -1
- package/dist/lib/credentials/token.js +1 -1
- package/dist/lib/services/services.js +11 -5
- package/dist/lib/services/services.js.map +1 -1
- package/dist/lib/services-v2/services-v2.js +11 -5
- package/dist/lib/services-v2/services-v2.js.map +1 -1
- package/dist/plugins/logger.js +1 -1
- package/dist/webex-core.js +2 -2
- package/package.json +3 -3
- package/src/config.js +7 -0
- package/src/lib/services/services.js +12 -2
- package/src/lib/services-v2/services-v2.ts +12 -2
- package/test/unit/spec/services/services.js +26 -0
- package/test/unit/spec/services-v2/services-v2.ts +26 -0
package/dist/config.js
CHANGED
|
@@ -22,6 +22,13 @@ var _default = exports.default = {
|
|
|
22
22
|
trackingIdSuffix: '',
|
|
23
23
|
AlternateLogger: undefined,
|
|
24
24
|
credentials: new _credentialsConfig.default(),
|
|
25
|
+
/**
|
|
26
|
+
* Explicitly selects the Webex environment. When omitted, the environment is inferred from the
|
|
27
|
+
* U2C discovery URL.
|
|
28
|
+
*
|
|
29
|
+
* @type {'integration'|'production'|undefined}
|
|
30
|
+
*/
|
|
31
|
+
environment: undefined,
|
|
25
32
|
fedramp: process.env.ENABLE_FEDRAMP || false,
|
|
26
33
|
services: {
|
|
27
34
|
/**
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_storage","require","_credentialsConfig","_interopRequireDefault","_default","exports","default","maxAppLevelRedirects","maxLocusRedirects","maxAuthenticationReplays","maxReconnectAttempts","onBeforeLogout","trackingIdPrefix","trackingIdSuffix","AlternateLogger","undefined","credentials","CredentialsConfig","fedramp","process","env","ENABLE_FEDRAMP","services","useUserOnboardingServiceForActivations","useCatalogOverride","skipPreauthCatalogOnUnauthenticated","catalogInitTimeout","discovery","hydra","HYDRA_SERVICE_URL","sqdiscovery","SQDISCOVERY_SERVICE_URL","u2c","U2C_SERVICE_URL","validateDomains","validateCatalogUrls","servicesNotNeedValidation","allowedDomains","device","preDiscoveryServices","hydraServiceUrl","metrics","type","calling","cacheU2C","payloadTransformer","skipRepeatedInboundTransforms","predicates","transforms","storage","boundedAdapter","MemoryStoreAdapter","unboundedAdapter"],"sources":["config.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/* eslint camelcase: [0] */\n\nimport {MemoryStoreAdapter} from './lib/storage';\nimport CredentialsConfig from './credentials-config';\n\nexport default {\n maxAppLevelRedirects: 10,\n maxLocusRedirects: 5,\n maxAuthenticationReplays: 1,\n maxReconnectAttempts: 1,\n onBeforeLogout: [],\n trackingIdPrefix: 'webex-js-sdk',\n trackingIdSuffix: '',\n AlternateLogger: undefined,\n credentials: new CredentialsConfig(),\n fedramp: process.env.ENABLE_FEDRAMP || false,\n services: {\n /**\n * When true, uses the user-onboarding service for user activation.\n * When false (default), uses the license service.\n *\n * @type {boolean}\n */\n useUserOnboardingServiceForActivations: false,\n\n /**\n * When true, requests the U2C catalog override.\n *\n * @type {boolean}\n */\n useCatalogOverride: false,\n\n /**\n * When true, skips fetching the preauth catalog during initialization\n * while the user is unauthenticated (no existing token). The catalog is\n * expected to be collected manually later instead. When false (default),\n * the preauth catalog is collected automatically during init.\n *\n * @type {boolean}\n */\n skipPreauthCatalogOnUnauthenticated: false,\n\n /**\n * Maximum time (in milliseconds) to wait for the initial service catalog\n * collection when `waitForCatalogInit` is enabled, before letting\n * `services.ready` (and therefore `webex.ready`) fire anyway. Prevents a\n * hung catalog request from leaving the app on a permanent spinner.\n *\n * @type {number}\n */\n catalogInitTimeout: 15000,\n\n /**\n * A list of services that are available prior to catalog collection.\n *\n * @type {Object}\n */\n discovery: {\n /**\n * The hydra discovery url.\n *\n * @type {string}\n */\n hydra: process.env.HYDRA_SERVICE_URL || 'https://api.ciscospark.com/v1',\n\n /**\n * load balanced region info url\n */\n sqdiscovery: process.env.SQDISCOVERY_SERVICE_URL || 'https://ds.ciscospark.com/v1/region',\n\n /**\n * The u2c discovery url\n *\n * @type {string}\n */\n u2c: process.env.U2C_SERVICE_URL || 'https://u2c.wbx2.com/u2c/api/v1',\n },\n\n /**\n * When true, considers all urls in `allowedDomains` as safe for auth tokens\n *\n * @type {boolean}\n */\n validateDomains: true,\n\n /**\n * When true, enables the CatalogUrlInterceptor which validates that all\n * outbound request URLs are in the service catalog or allowed domains.\n * This prevents SSRF attacks where attacker-controlled URLs could be\n * sent to the SDK.\n *\n * @type {boolean}\n */\n validateCatalogUrls: false,\n\n /**\n * services that don't need auth validation\n */\n\n servicesNotNeedValidation: ['webex-appapi-service'],\n\n /**\n * Contains a list of allowed domain host addresses.\n *\n * @type {Array<string>}\n */\n allowedDomains: [],\n },\n device: {\n preDiscoveryServices: {\n hydra: process.env.HYDRA_SERVICE_URL || 'https://api.ciscospark.com/v1',\n hydraServiceUrl: process.env.HYDRA_SERVICE_URL || 'https://api.ciscospark.com/v1',\n },\n validateDomains: true,\n },\n metrics: {\n type: ['behavioral', 'operational'],\n },\n calling: {\n /**\n * Controls whether U2C service catalogs should be cached and warmed from cache.\n * When false, the services layer will skip reading and writing the U2C cache.\n */\n cacheU2C: false,\n },\n payloadTransformer: {\n /**\n * When true, inbound payload transforms run at most once for the same successful response object.\n * This supports request flows that pass a response through more than one interceptor pipeline.\n */\n skipRepeatedInboundTransforms: false,\n predicates: [],\n transforms: [],\n },\n storage: {\n boundedAdapter: MemoryStoreAdapter,\n unboundedAdapter: MemoryStoreAdapter,\n },\n};\n"],"mappings":";;;;;;;;AAMA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAPA;AACA;AACA;AAEA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAKe;EACbC,oBAAoB,EAAE,EAAE;EACxBC,iBAAiB,EAAE,CAAC;EACpBC,wBAAwB,EAAE,CAAC;EAC3BC,oBAAoB,EAAE,CAAC;EACvBC,cAAc,EAAE,EAAE;EAClBC,gBAAgB,EAAE,cAAc;EAChCC,gBAAgB,EAAE,EAAE;EACpBC,eAAe,EAAEC,SAAS;EAC1BC,WAAW,EAAE,IAAIC,0BAAiB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"names":["_storage","require","_credentialsConfig","_interopRequireDefault","_default","exports","default","maxAppLevelRedirects","maxLocusRedirects","maxAuthenticationReplays","maxReconnectAttempts","onBeforeLogout","trackingIdPrefix","trackingIdSuffix","AlternateLogger","undefined","credentials","CredentialsConfig","environment","fedramp","process","env","ENABLE_FEDRAMP","services","useUserOnboardingServiceForActivations","useCatalogOverride","skipPreauthCatalogOnUnauthenticated","catalogInitTimeout","discovery","hydra","HYDRA_SERVICE_URL","sqdiscovery","SQDISCOVERY_SERVICE_URL","u2c","U2C_SERVICE_URL","validateDomains","validateCatalogUrls","servicesNotNeedValidation","allowedDomains","device","preDiscoveryServices","hydraServiceUrl","metrics","type","calling","cacheU2C","payloadTransformer","skipRepeatedInboundTransforms","predicates","transforms","storage","boundedAdapter","MemoryStoreAdapter","unboundedAdapter"],"sources":["config.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/* eslint camelcase: [0] */\n\nimport {MemoryStoreAdapter} from './lib/storage';\nimport CredentialsConfig from './credentials-config';\n\nexport default {\n maxAppLevelRedirects: 10,\n maxLocusRedirects: 5,\n maxAuthenticationReplays: 1,\n maxReconnectAttempts: 1,\n onBeforeLogout: [],\n trackingIdPrefix: 'webex-js-sdk',\n trackingIdSuffix: '',\n AlternateLogger: undefined,\n credentials: new CredentialsConfig(),\n /**\n * Explicitly selects the Webex environment. When omitted, the environment is inferred from the\n * U2C discovery URL.\n *\n * @type {'integration'|'production'|undefined}\n */\n environment: undefined,\n fedramp: process.env.ENABLE_FEDRAMP || false,\n services: {\n /**\n * When true, uses the user-onboarding service for user activation.\n * When false (default), uses the license service.\n *\n * @type {boolean}\n */\n useUserOnboardingServiceForActivations: false,\n\n /**\n * When true, requests the U2C catalog override.\n *\n * @type {boolean}\n */\n useCatalogOverride: false,\n\n /**\n * When true, skips fetching the preauth catalog during initialization\n * while the user is unauthenticated (no existing token). The catalog is\n * expected to be collected manually later instead. When false (default),\n * the preauth catalog is collected automatically during init.\n *\n * @type {boolean}\n */\n skipPreauthCatalogOnUnauthenticated: false,\n\n /**\n * Maximum time (in milliseconds) to wait for the initial service catalog\n * collection when `waitForCatalogInit` is enabled, before letting\n * `services.ready` (and therefore `webex.ready`) fire anyway. Prevents a\n * hung catalog request from leaving the app on a permanent spinner.\n *\n * @type {number}\n */\n catalogInitTimeout: 15000,\n\n /**\n * A list of services that are available prior to catalog collection.\n *\n * @type {Object}\n */\n discovery: {\n /**\n * The hydra discovery url.\n *\n * @type {string}\n */\n hydra: process.env.HYDRA_SERVICE_URL || 'https://api.ciscospark.com/v1',\n\n /**\n * load balanced region info url\n */\n sqdiscovery: process.env.SQDISCOVERY_SERVICE_URL || 'https://ds.ciscospark.com/v1/region',\n\n /**\n * The u2c discovery url\n *\n * @type {string}\n */\n u2c: process.env.U2C_SERVICE_URL || 'https://u2c.wbx2.com/u2c/api/v1',\n },\n\n /**\n * When true, considers all urls in `allowedDomains` as safe for auth tokens\n *\n * @type {boolean}\n */\n validateDomains: true,\n\n /**\n * When true, enables the CatalogUrlInterceptor which validates that all\n * outbound request URLs are in the service catalog or allowed domains.\n * This prevents SSRF attacks where attacker-controlled URLs could be\n * sent to the SDK.\n *\n * @type {boolean}\n */\n validateCatalogUrls: false,\n\n /**\n * services that don't need auth validation\n */\n\n servicesNotNeedValidation: ['webex-appapi-service'],\n\n /**\n * Contains a list of allowed domain host addresses.\n *\n * @type {Array<string>}\n */\n allowedDomains: [],\n },\n device: {\n preDiscoveryServices: {\n hydra: process.env.HYDRA_SERVICE_URL || 'https://api.ciscospark.com/v1',\n hydraServiceUrl: process.env.HYDRA_SERVICE_URL || 'https://api.ciscospark.com/v1',\n },\n validateDomains: true,\n },\n metrics: {\n type: ['behavioral', 'operational'],\n },\n calling: {\n /**\n * Controls whether U2C service catalogs should be cached and warmed from cache.\n * When false, the services layer will skip reading and writing the U2C cache.\n */\n cacheU2C: false,\n },\n payloadTransformer: {\n /**\n * When true, inbound payload transforms run at most once for the same successful response object.\n * This supports request flows that pass a response through more than one interceptor pipeline.\n */\n skipRepeatedInboundTransforms: false,\n predicates: [],\n transforms: [],\n },\n storage: {\n boundedAdapter: MemoryStoreAdapter,\n unboundedAdapter: MemoryStoreAdapter,\n },\n};\n"],"mappings":";;;;;;;;AAMA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAPA;AACA;AACA;AAEA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAKe;EACbC,oBAAoB,EAAE,EAAE;EACxBC,iBAAiB,EAAE,CAAC;EACpBC,wBAAwB,EAAE,CAAC;EAC3BC,oBAAoB,EAAE,CAAC;EACvBC,cAAc,EAAE,EAAE;EAClBC,gBAAgB,EAAE,cAAc;EAChCC,gBAAgB,EAAE,EAAE;EACpBC,eAAe,EAAEC,SAAS;EAC1BC,WAAW,EAAE,IAAIC,0BAAiB,CAAC,CAAC;EACpC;AACF;AACA;AACA;AACA;AACA;EACEC,WAAW,EAAEH,SAAS;EACtBI,OAAO,EAAEC,OAAO,CAACC,GAAG,CAACC,cAAc,IAAI,KAAK;EAC5CC,QAAQ,EAAE;IACR;AACJ;AACA;AACA;AACA;AACA;IACIC,sCAAsC,EAAE,KAAK;IAE7C;AACJ;AACA;AACA;AACA;IACIC,kBAAkB,EAAE,KAAK;IAEzB;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;IACIC,mCAAmC,EAAE,KAAK;IAE1C;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;IACIC,kBAAkB,EAAE,KAAK;IAEzB;AACJ;AACA;AACA;AACA;IACIC,SAAS,EAAE;MACT;AACN;AACA;AACA;AACA;MACMC,KAAK,EAAET,OAAO,CAACC,GAAG,CAACS,iBAAiB,IAAI,+BAA+B;MAEvE;AACN;AACA;MACMC,WAAW,EAAEX,OAAO,CAACC,GAAG,CAACW,uBAAuB,IAAI,qCAAqC;MAEzF;AACN;AACA;AACA;AACA;MACMC,GAAG,EAAEb,OAAO,CAACC,GAAG,CAACa,eAAe,IAAI;IACtC,CAAC;IAED;AACJ;AACA;AACA;AACA;IACIC,eAAe,EAAE,IAAI;IAErB;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;IACIC,mBAAmB,EAAE,KAAK;IAE1B;AACJ;AACA;;IAEIC,yBAAyB,EAAE,CAAC,sBAAsB,CAAC;IAEnD;AACJ;AACA;AACA;AACA;IACIC,cAAc,EAAE;EAClB,CAAC;EACDC,MAAM,EAAE;IACNC,oBAAoB,EAAE;MACpBX,KAAK,EAAET,OAAO,CAACC,GAAG,CAACS,iBAAiB,IAAI,+BAA+B;MACvEW,eAAe,EAAErB,OAAO,CAACC,GAAG,CAACS,iBAAiB,IAAI;IACpD,CAAC;IACDK,eAAe,EAAE;EACnB,CAAC;EACDO,OAAO,EAAE;IACPC,IAAI,EAAE,CAAC,YAAY,EAAE,aAAa;EACpC,CAAC;EACDC,OAAO,EAAE;IACP;AACJ;AACA;AACA;IACIC,QAAQ,EAAE;EACZ,CAAC;EACDC,kBAAkB,EAAE;IAClB;AACJ;AACA;AACA;IACIC,6BAA6B,EAAE,KAAK;IACpCC,UAAU,EAAE,EAAE;IACdC,UAAU,EAAE;EACd,CAAC;EACDC,OAAO,EAAE;IACPC,cAAc,EAAEC,2BAAkB;IAClCC,gBAAgB,EAAED;EACpB;AACF,CAAC","ignoreList":[]}
|
package/dist/lib/batcher.js
CHANGED
|
@@ -302,7 +302,7 @@ var Batcher = _webexPlugin.default.extend({
|
|
|
302
302
|
fingerprintResponse: function fingerprintResponse(item) {
|
|
303
303
|
throw new Error('fingerprintResponse() must be implemented');
|
|
304
304
|
},
|
|
305
|
-
version: "3.12.0-next.
|
|
305
|
+
version: "3.12.0-next.65"
|
|
306
306
|
});
|
|
307
307
|
var _default2 = exports.default = Batcher;
|
|
308
308
|
//# sourceMappingURL=batcher.js.map
|
|
@@ -655,7 +655,7 @@ var Credentials = _webexPlugin.default.extend((_dec = (0, _common.oneFlight)({
|
|
|
655
655
|
this.refresh();
|
|
656
656
|
}
|
|
657
657
|
},
|
|
658
|
-
version: "3.12.0-next.
|
|
658
|
+
version: "3.12.0-next.65"
|
|
659
659
|
}, (0, _applyDecoratedDescriptor2.default)(_obj, "getUserToken", [_dec, _dec2], (0, _getOwnPropertyDescriptor.default)(_obj, "getUserToken"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "initialize", [_dec3], (0, _getOwnPropertyDescriptor.default)(_obj, "initialize"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "invalidate", [_common.oneFlight, _dec4], (0, _getOwnPropertyDescriptor.default)(_obj, "invalidate"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "refresh", [_common.oneFlight, _dec5, _dec6], (0, _getOwnPropertyDescriptor.default)(_obj, "refresh"), _obj), _obj));
|
|
660
660
|
var _default = exports.default = Credentials;
|
|
661
661
|
//# sourceMappingURL=credentials.js.map
|
|
@@ -532,7 +532,7 @@ var Token = _webexPlugin.default.extend((_dec = (0, _common.oneFlight)({
|
|
|
532
532
|
return res.body;
|
|
533
533
|
});
|
|
534
534
|
},
|
|
535
|
-
version: "3.12.0-next.
|
|
535
|
+
version: "3.12.0-next.65"
|
|
536
536
|
}, (0, _applyDecoratedDescriptor2.default)(_obj, "downscope", [_dec], (0, _getOwnPropertyDescriptor.default)(_obj, "downscope"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "refresh", [_common.oneFlight], (0, _getOwnPropertyDescriptor.default)(_obj, "refresh"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "revoke", [_common.oneFlight], (0, _getOwnPropertyDescriptor.default)(_obj, "revoke"), _obj), _obj));
|
|
537
537
|
var _default = exports.default = Token;
|
|
538
538
|
//# sourceMappingURL=token.js.map
|
|
@@ -259,15 +259,21 @@ var Services = _webexPlugin.default.extend({
|
|
|
259
259
|
return !!((_hostCatalog$host = hostCatalog[host]) !== null && _hostCatalog$host !== void 0 && _hostCatalog$host.length);
|
|
260
260
|
},
|
|
261
261
|
/**
|
|
262
|
-
* Checks if the current environment is an integration (INT) environment
|
|
263
|
-
*
|
|
262
|
+
* Checks if the current environment is an integration (INT) environment.
|
|
263
|
+
* Uses the explicit environment config when set, otherwise examines the u2c discovery URL.
|
|
264
264
|
* INT environments use discovery URLs containing 'intb' (e.g., u2c-intb.ciscospark.com).
|
|
265
265
|
* @returns {boolean} True if INT environment, false otherwise
|
|
266
266
|
*/
|
|
267
267
|
isIntegrationEnvironment: function isIntegrationEnvironment() {
|
|
268
268
|
try {
|
|
269
|
-
var _this$webex, _this$webex$config, _this$
|
|
270
|
-
var
|
|
269
|
+
var _this$webex, _this$webex$config, _this$webex2, _this$webex2$config, _this$webex2$config$s, _this$webex2$config$s2;
|
|
270
|
+
var configuredEnvironment = (_this$webex = this.webex) === null || _this$webex === void 0 ? void 0 : (_this$webex$config = _this$webex.config) === null || _this$webex$config === void 0 ? void 0 : _this$webex$config.environment;
|
|
271
|
+
if (configuredEnvironment !== undefined) {
|
|
272
|
+
var isIntFromConfig = configuredEnvironment === 'integration';
|
|
273
|
+
this.logger.info("services: isIntegrationEnvironment: ".concat(isIntFromConfig, " (config)"));
|
|
274
|
+
return isIntFromConfig;
|
|
275
|
+
}
|
|
276
|
+
var u2cUrl = ((_this$webex2 = this.webex) === null || _this$webex2 === void 0 ? void 0 : (_this$webex2$config = _this$webex2.config) === null || _this$webex2$config === void 0 ? void 0 : (_this$webex2$config$s = _this$webex2$config.services) === null || _this$webex2$config$s === void 0 ? void 0 : (_this$webex2$config$s2 = _this$webex2$config$s.discovery) === null || _this$webex2$config$s2 === void 0 ? void 0 : _this$webex2$config$s2.u2c) || '';
|
|
271
277
|
var isInt = u2cUrl.includes('intb');
|
|
272
278
|
this.logger.info("services: isIntegrationEnvironment: ".concat(isInt));
|
|
273
279
|
return isInt;
|
|
@@ -1641,7 +1647,7 @@ var Services = _webexPlugin.default.extend({
|
|
|
1641
1647
|
}, _callee6);
|
|
1642
1648
|
})));
|
|
1643
1649
|
},
|
|
1644
|
-
version: "3.12.0-next.
|
|
1650
|
+
version: "3.12.0-next.65"
|
|
1645
1651
|
});
|
|
1646
1652
|
/* eslint-enable no-underscore-dangle */
|
|
1647
1653
|
var _default = exports.default = Services;
|