@webex/plugin-meetings 3.12.0-next.7 → 3.12.0-next.71
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/AGENTS.md +9 -0
- package/dist/aiEnableRequest/index.js +15 -2
- package/dist/aiEnableRequest/index.js.map +1 -1
- package/dist/breakouts/breakout.js +8 -3
- package/dist/breakouts/breakout.js.map +1 -1
- package/dist/breakouts/index.js +26 -2
- package/dist/breakouts/index.js.map +1 -1
- package/dist/config.js +2 -0
- package/dist/config.js.map +1 -1
- package/dist/constants.js +30 -7
- package/dist/constants.js.map +1 -1
- package/dist/controls-options-manager/constants.js +11 -1
- package/dist/controls-options-manager/constants.js.map +1 -1
- package/dist/controls-options-manager/index.js +38 -24
- package/dist/controls-options-manager/index.js.map +1 -1
- package/dist/controls-options-manager/util.js +91 -0
- package/dist/controls-options-manager/util.js.map +1 -1
- package/dist/hashTree/constants.js +13 -1
- package/dist/hashTree/constants.js.map +1 -1
- package/dist/hashTree/hashTreeParser.js +880 -382
- package/dist/hashTree/hashTreeParser.js.map +1 -1
- package/dist/hashTree/utils.js +42 -0
- package/dist/hashTree/utils.js.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/interceptors/dataChannelAuthToken.js +75 -15
- package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
- package/dist/interceptors/locusRetry.js +23 -8
- package/dist/interceptors/locusRetry.js.map +1 -1
- package/dist/interpretation/index.js +10 -1
- package/dist/interpretation/index.js.map +1 -1
- package/dist/interpretation/interpretation.types.js +7 -0
- package/dist/interpretation/interpretation.types.js.map +1 -0
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/controlsUtils.js +4 -1
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/index.js +298 -87
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/types.js +19 -0
- package/dist/locus-info/types.js.map +1 -1
- package/dist/media/index.js +3 -1
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +1 -0
- package/dist/media/properties.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +3 -1
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +1046 -689
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/muteState.js +10 -1
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +5 -2
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/util.js +20 -2
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +2 -2
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meetings/index.js +231 -78
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/meetings.types.js +6 -1
- package/dist/meetings/meetings.types.js.map +1 -1
- package/dist/meetings/request.js +39 -0
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +79 -5
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +10 -0
- package/dist/member/index.js.map +1 -1
- package/dist/member/types.js.map +1 -1
- package/dist/member/util.js +3 -0
- package/dist/member/util.js.map +1 -1
- package/dist/metrics/constants.js +4 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/multistream/codec/constants.js +63 -0
- package/dist/multistream/codec/constants.js.map +1 -0
- package/dist/multistream/mediaRequestManager.js +62 -15
- package/dist/multistream/mediaRequestManager.js.map +1 -1
- package/dist/multistream/receiveSlot.js +9 -0
- package/dist/multistream/receiveSlot.js.map +1 -1
- package/dist/reactions/reactions.type.js.map +1 -1
- package/dist/recording-controller/index.js +1 -3
- package/dist/recording-controller/index.js.map +1 -1
- package/dist/types/config.d.ts +2 -0
- package/dist/types/constants.d.ts +9 -1
- package/dist/types/controls-options-manager/constants.d.ts +6 -1
- package/dist/types/controls-options-manager/index.d.ts +10 -0
- package/dist/types/hashTree/constants.d.ts +2 -0
- package/dist/types/hashTree/hashTreeParser.d.ts +146 -17
- package/dist/types/hashTree/utils.d.ts +18 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/interceptors/locusRetry.d.ts +4 -4
- package/dist/types/interpretation/interpretation.types.d.ts +10 -0
- package/dist/types/locus-info/index.d.ts +50 -6
- package/dist/types/locus-info/types.d.ts +21 -1
- package/dist/types/media/properties.d.ts +1 -0
- package/dist/types/meeting/in-meeting-actions.d.ts +2 -0
- package/dist/types/meeting/index.d.ts +78 -5
- package/dist/types/meeting/request.d.ts +1 -0
- package/dist/types/meeting/util.d.ts +8 -0
- package/dist/types/meetings/index.d.ts +30 -2
- package/dist/types/meetings/meetings.types.d.ts +15 -0
- package/dist/types/meetings/request.d.ts +14 -0
- package/dist/types/member/index.d.ts +1 -0
- package/dist/types/member/types.d.ts +1 -0
- package/dist/types/member/util.d.ts +1 -0
- package/dist/types/metrics/constants.d.ts +3 -0
- package/dist/types/multistream/codec/constants.d.ts +7 -0
- package/dist/types/multistream/mediaRequestManager.d.ts +22 -5
- package/dist/types/reactions/reactions.type.d.ts +3 -0
- package/dist/webinar/index.js +305 -159
- package/dist/webinar/index.js.map +1 -1
- package/package.json +22 -22
- package/src/aiEnableRequest/index.ts +16 -0
- package/src/breakouts/breakout.ts +3 -1
- package/src/breakouts/index.ts +31 -0
- package/src/config.ts +2 -0
- package/src/constants.ts +13 -2
- package/src/controls-options-manager/constants.ts +14 -1
- package/src/controls-options-manager/index.ts +47 -24
- package/src/controls-options-manager/util.ts +81 -1
- package/src/hashTree/constants.ts +16 -0
- package/src/hashTree/hashTreeParser.ts +580 -196
- package/src/hashTree/utils.ts +36 -0
- package/src/index.ts +6 -0
- package/src/interceptors/dataChannelAuthToken.ts +88 -12
- package/src/interceptors/locusRetry.ts +25 -4
- package/src/interpretation/index.ts +27 -9
- package/src/interpretation/interpretation.types.ts +11 -0
- package/src/locus-info/controlsUtils.ts +3 -1
- package/src/locus-info/index.ts +293 -97
- package/src/locus-info/types.ts +25 -1
- package/src/media/index.ts +3 -0
- package/src/media/properties.ts +1 -0
- package/src/meeting/in-meeting-actions.ts +4 -0
- package/src/meeting/index.ts +386 -48
- package/src/meeting/muteState.ts +10 -1
- package/src/meeting/request.ts +11 -0
- package/src/meeting/util.ts +21 -2
- package/src/meeting-info/meeting-info-v2.ts +4 -2
- package/src/meetings/index.ts +134 -44
- package/src/meetings/meetings.types.ts +19 -0
- package/src/meetings/request.ts +43 -0
- package/src/meetings/util.ts +97 -1
- package/src/member/index.ts +10 -0
- package/src/member/types.ts +1 -0
- package/src/member/util.ts +3 -0
- package/src/metrics/constants.ts +3 -0
- package/src/multistream/codec/constants.ts +58 -0
- package/src/multistream/mediaRequestManager.ts +119 -28
- package/src/multistream/receiveSlot.ts +18 -0
- package/src/reactions/reactions.type.ts +3 -0
- package/src/recording-controller/index.ts +1 -2
- package/src/webinar/index.ts +214 -36
- package/test/unit/spec/aiEnableRequest/index.ts +86 -0
- package/test/unit/spec/breakouts/breakout.ts +9 -3
- package/test/unit/spec/breakouts/index.ts +49 -0
- package/test/unit/spec/controls-options-manager/index.js +140 -29
- package/test/unit/spec/controls-options-manager/util.js +165 -0
- package/test/unit/spec/hashTree/hashTreeParser.ts +1838 -180
- package/test/unit/spec/hashTree/utils.ts +125 -1
- package/test/unit/spec/interceptors/dataChannelAuthToken.ts +196 -0
- package/test/unit/spec/interceptors/locusRetry.ts +205 -4
- package/test/unit/spec/interpretation/index.ts +26 -4
- package/test/unit/spec/locus-info/controlsUtils.js +172 -57
- package/test/unit/spec/locus-info/index.js +487 -81
- package/test/unit/spec/media/index.ts +31 -0
- package/test/unit/spec/meeting/in-meeting-actions.ts +2 -0
- package/test/unit/spec/meeting/index.js +1240 -37
- package/test/unit/spec/meeting/muteState.js +81 -0
- package/test/unit/spec/meeting/request.js +12 -0
- package/test/unit/spec/meeting/utils.js +33 -0
- package/test/unit/spec/meeting-info/meetinginfov2.js +19 -10
- package/test/unit/spec/meetings/index.js +360 -10
- package/test/unit/spec/meetings/request.js +141 -0
- package/test/unit/spec/meetings/utils.js +189 -0
- package/test/unit/spec/member/index.js +7 -0
- package/test/unit/spec/member/util.js +24 -0
- package/test/unit/spec/multistream/mediaRequestManager.ts +501 -37
- package/test/unit/spec/recording-controller/index.js +9 -8
- package/test/unit/spec/webinar/index.ts +329 -28
package/dist/hashTree/utils.js
CHANGED
|
@@ -8,8 +8,12 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.deleteNestedObjectsWithHtMeta = void 0;
|
|
9
9
|
exports.isMetadata = isMetadata;
|
|
10
10
|
exports.isSelf = isSelf;
|
|
11
|
+
exports.sleep = sleep;
|
|
12
|
+
exports.sortByInitPriority = sortByInitPriority;
|
|
11
13
|
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/array/is-array"));
|
|
12
14
|
var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
|
|
15
|
+
var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
|
|
16
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/toConsumableArray"));
|
|
13
17
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/typeof"));
|
|
14
18
|
var _types = require("./types");
|
|
15
19
|
/* eslint-disable import/prefer-default-export */
|
|
@@ -66,4 +70,42 @@ var _deleteNestedObjectsWithHtMeta = exports.deleteNestedObjectsWithHtMeta = fun
|
|
|
66
70
|
}
|
|
67
71
|
}
|
|
68
72
|
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Reorders items so that those matching the given priority list come first (in priority order),
|
|
76
|
+
* followed by everything else in their original order.
|
|
77
|
+
*
|
|
78
|
+
* @param {Array<T>} items - The items to reorder
|
|
79
|
+
* @param {string[]} priority - Ordered list of names that should come first
|
|
80
|
+
* @returns {Array<T>} A new array with prioritized items first
|
|
81
|
+
*/
|
|
82
|
+
function sortByInitPriority(items, priority) {
|
|
83
|
+
var prioritized = priority.map(function (name) {
|
|
84
|
+
return items.find(function (item) {
|
|
85
|
+
return item.name === name;
|
|
86
|
+
});
|
|
87
|
+
}).filter(Boolean);
|
|
88
|
+
var rest = items.filter(function (item) {
|
|
89
|
+
return !priority.includes(item.name);
|
|
90
|
+
});
|
|
91
|
+
return [].concat((0, _toConsumableArray2.default)(prioritized), (0, _toConsumableArray2.default)(rest));
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Sleeps for the specified amount of milliseconds
|
|
96
|
+
*
|
|
97
|
+
* @param {number} ms amount of milliseconds to sleep
|
|
98
|
+
* @returns {Promise<void>} A promise that resolves after the specified delay
|
|
99
|
+
*/
|
|
100
|
+
function sleep(ms) {
|
|
101
|
+
if (ms <= 0) {
|
|
102
|
+
return _promise.default.resolve();
|
|
103
|
+
}
|
|
104
|
+
return new _promise.default(function (resolve) {
|
|
105
|
+
// start a timer that will resolve the promise after the specified delay
|
|
106
|
+
setTimeout(function () {
|
|
107
|
+
resolve();
|
|
108
|
+
}, ms);
|
|
109
|
+
});
|
|
110
|
+
}
|
|
69
111
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_types","require","isSelf","object","htMeta","elementId","type","toLowerCase","ObjectType","self","isMetadata","metadata","deleteNestedObjectsWithHtMeta","exports","currentLocusPart","parent","currentKey","_typeof2","default","undefined","_isArray","splice","Number","i","length","_i","_Object$keys","_keys","key","Object","prototype","hasOwnProperty","call"],"sources":["utils.ts"],"sourcesContent":["/* eslint-disable import/prefer-default-export */\n\nimport {ObjectType, HashTreeObject} from './types';\n\n/**\n * Checks if the given hash tree object is of type \"self\"\n * @param {HashTreeObject} object object to check\n * @returns {boolean} True if the object is of type \"self\", false otherwise\n */\nexport function isSelf(object: HashTreeObject) {\n return object.htMeta.elementId.type.toLowerCase() === ObjectType.self;\n}\n\n/**\n * Checks if the given hash tree object is of type \"Metadata\"\n * @param {HashTreeObject} object object to check\n * @returns {boolean} True if the object is of type \"Metadata\", false otherwise\n */\nexport function isMetadata(object: HashTreeObject) {\n return object.htMeta.elementId.type.toLowerCase() === ObjectType.metadata;\n}\n\n/**\n * Analyzes given part of Locus DTO recursively and delete any nested objects that have their own htMeta\n *\n * @param {Object} currentLocusPart part of locus DTO to analyze\n * @param {Object} parent parent object\n * @param {string|number} currentKey key of the parent object that currentLocusPart is\n * @returns {void}\n */\nexport const deleteNestedObjectsWithHtMeta = (\n currentLocusPart: any,\n parent?: any,\n currentKey?: string | number\n) => {\n if (typeof currentLocusPart !== 'object' || currentLocusPart === null) {\n return;\n }\n\n if (parent && currentKey !== undefined && currentLocusPart.htMeta) {\n if (Array.isArray(parent)) {\n parent.splice(Number(currentKey), 1);\n } else {\n delete parent[currentKey];\n }\n\n return;\n }\n\n if (Array.isArray(currentLocusPart)) {\n // iterate array in reverse, so that indexes remain valid when deleting elements\n for (let i = currentLocusPart.length - 1; i >= 0; i -= 1) {\n deleteNestedObjectsWithHtMeta(currentLocusPart[i], currentLocusPart, i);\n }\n } else {\n for (const key of Object.keys(currentLocusPart)) {\n if (Object.prototype.hasOwnProperty.call(currentLocusPart, key)) {\n deleteNestedObjectsWithHtMeta(currentLocusPart[key], currentLocusPart, key);\n }\n }\n }\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_types","require","isSelf","object","htMeta","elementId","type","toLowerCase","ObjectType","self","isMetadata","metadata","deleteNestedObjectsWithHtMeta","exports","currentLocusPart","parent","currentKey","_typeof2","default","undefined","_isArray","splice","Number","i","length","_i","_Object$keys","_keys","key","Object","prototype","hasOwnProperty","call","sortByInitPriority","items","priority","prioritized","map","name","find","item","filter","Boolean","rest","includes","concat","_toConsumableArray2","sleep","ms","_promise","resolve","setTimeout"],"sources":["utils.ts"],"sourcesContent":["/* eslint-disable import/prefer-default-export */\n\nimport {ObjectType, HashTreeObject} from './types';\n\n/**\n * Checks if the given hash tree object is of type \"self\"\n * @param {HashTreeObject} object object to check\n * @returns {boolean} True if the object is of type \"self\", false otherwise\n */\nexport function isSelf(object: HashTreeObject) {\n return object.htMeta.elementId.type.toLowerCase() === ObjectType.self;\n}\n\n/**\n * Checks if the given hash tree object is of type \"Metadata\"\n * @param {HashTreeObject} object object to check\n * @returns {boolean} True if the object is of type \"Metadata\", false otherwise\n */\nexport function isMetadata(object: HashTreeObject) {\n return object.htMeta.elementId.type.toLowerCase() === ObjectType.metadata;\n}\n\n/**\n * Analyzes given part of Locus DTO recursively and delete any nested objects that have their own htMeta\n *\n * @param {Object} currentLocusPart part of locus DTO to analyze\n * @param {Object} parent parent object\n * @param {string|number} currentKey key of the parent object that currentLocusPart is\n * @returns {void}\n */\nexport const deleteNestedObjectsWithHtMeta = (\n currentLocusPart: any,\n parent?: any,\n currentKey?: string | number\n) => {\n if (typeof currentLocusPart !== 'object' || currentLocusPart === null) {\n return;\n }\n\n if (parent && currentKey !== undefined && currentLocusPart.htMeta) {\n if (Array.isArray(parent)) {\n parent.splice(Number(currentKey), 1);\n } else {\n delete parent[currentKey];\n }\n\n return;\n }\n\n if (Array.isArray(currentLocusPart)) {\n // iterate array in reverse, so that indexes remain valid when deleting elements\n for (let i = currentLocusPart.length - 1; i >= 0; i -= 1) {\n deleteNestedObjectsWithHtMeta(currentLocusPart[i], currentLocusPart, i);\n }\n } else {\n for (const key of Object.keys(currentLocusPart)) {\n if (Object.prototype.hasOwnProperty.call(currentLocusPart, key)) {\n deleteNestedObjectsWithHtMeta(currentLocusPart[key], currentLocusPart, key);\n }\n }\n }\n};\n\n/**\n * Reorders items so that those matching the given priority list come first (in priority order),\n * followed by everything else in their original order.\n *\n * @param {Array<T>} items - The items to reorder\n * @param {string[]} priority - Ordered list of names that should come first\n * @returns {Array<T>} A new array with prioritized items first\n */\nexport function sortByInitPriority<T extends {name: string}>(items: T[], priority: string[]): T[] {\n const prioritized = priority\n .map((name) => items.find((item) => item.name === name))\n .filter(Boolean) as T[];\n const rest = items.filter((item) => !priority.includes(item.name));\n\n return [...prioritized, ...rest];\n}\n\n/**\n * Sleeps for the specified amount of milliseconds\n *\n * @param {number} ms amount of milliseconds to sleep\n * @returns {Promise<void>} A promise that resolves after the specified delay\n */\nexport function sleep(ms: number): Promise<void> {\n if (ms <= 0) {\n return Promise.resolve();\n }\n\n return new Promise((resolve) => {\n // start a timer that will resolve the promise after the specified delay\n setTimeout(() => {\n resolve();\n }, ms);\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AAFA;;AAIA;AACA;AACA;AACA;AACA;AACO,SAASC,MAAMA,CAACC,MAAsB,EAAE;EAC7C,OAAOA,MAAM,CAACC,MAAM,CAACC,SAAS,CAACC,IAAI,CAACC,WAAW,CAAC,CAAC,KAAKC,iBAAU,CAACC,IAAI;AACvE;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASC,UAAUA,CAACP,MAAsB,EAAE;EACjD,OAAOA,MAAM,CAACC,MAAM,CAACC,SAAS,CAACC,IAAI,CAACC,WAAW,CAAC,CAAC,KAAKC,iBAAU,CAACG,QAAQ;AAC3E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMC,8BAA6B,GAAAC,OAAA,CAAAD,6BAAA,GAAG,SAAhCA,6BAA6BA,CACxCE,gBAAqB,EACrBC,MAAY,EACZC,UAA4B,EACzB;EACH,IAAI,IAAAC,QAAA,CAAAC,OAAA,EAAOJ,gBAAgB,MAAK,QAAQ,IAAIA,gBAAgB,KAAK,IAAI,EAAE;IACrE;EACF;EAEA,IAAIC,MAAM,IAAIC,UAAU,KAAKG,SAAS,IAAIL,gBAAgB,CAACV,MAAM,EAAE;IACjE,IAAI,IAAAgB,QAAA,CAAAF,OAAA,EAAcH,MAAM,CAAC,EAAE;MACzBA,MAAM,CAACM,MAAM,CAACC,MAAM,CAACN,UAAU,CAAC,EAAE,CAAC,CAAC;IACtC,CAAC,MAAM;MACL,OAAOD,MAAM,CAACC,UAAU,CAAC;IAC3B;IAEA;EACF;EAEA,IAAI,IAAAI,QAAA,CAAAF,OAAA,EA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AACA;AACA;AACA;AACA;AACA;AACO,SAASI,KAAKA,CAACC,EAAU,EAAiB;EAC/C,IAAIA,EAAE,IAAI,CAAC,EAAE;IACX,OAAOC,QAAA,CAAA/B,OAAA,CAAQgC,OAAO,CAAC,CAAC;EAC1B;EAEA,OAAO,IAAAD,QAAA,CAAA/B,OAAA,CAAY,UAACgC,OAAO,EAAK;IAC9B;IACAC,UAAU,CAAC,YAAM;MACfD,OAAO,CAAC,CAAC;IACX,CAAC,EAAEF,EAAE,CAAC;EACR,CAAC,CAAC;AACJ","ignoreList":[]}
|
package/dist/index.js
CHANGED
|
@@ -167,6 +167,12 @@ _Object$defineProperty(exports, "SdpResponseTimeoutError", {
|
|
|
167
167
|
return _webexErrors.SdpResponseTimeoutError;
|
|
168
168
|
}
|
|
169
169
|
});
|
|
170
|
+
_Object$defineProperty(exports, "SitePreferenceSelectOption", {
|
|
171
|
+
enumerable: true,
|
|
172
|
+
get: function get() {
|
|
173
|
+
return _meetings2.SitePreferenceSelectOption;
|
|
174
|
+
}
|
|
175
|
+
});
|
|
170
176
|
_Object$defineProperty(exports, "StreamEventNames", {
|
|
171
177
|
enumerable: true,
|
|
172
178
|
get: function get() {
|
|
@@ -246,6 +252,7 @@ var _sdkAnnotationTypes = _interopRequireWildcard(require("./annotation/annotati
|
|
|
246
252
|
exports.sdkAnnotationTypes = _sdkAnnotationTypes;
|
|
247
253
|
var _MeetingInfoV = _interopRequireWildcard(require("./meeting-info/meeting-info-v2"));
|
|
248
254
|
exports.MeetingInfoV2 = _MeetingInfoV;
|
|
255
|
+
var _meetings2 = require("./meetings/meetings.types");
|
|
249
256
|
var _remoteMedia = require("./multistream/remoteMedia");
|
|
250
257
|
var _triggerProxy = _interopRequireDefault(require("./common/events/trigger-proxy"));
|
|
251
258
|
var _utils = require("./aiEnableRequest/utils");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_webexCore","require","_meetings","_interopRequireDefault","_config","_interceptors","_captchaError","_intentToJoin","_passwordError","_permission","_joinWebinarError","_reclaimHostRoleErrors","_meeting","_utilv","_joinMeeting","_webexErrors","_mediaHelpers","_CONSTANTS","_interopRequireWildcard","exports","CONSTANTS","_REACTIONS","REACTIONS","_sdkAnnotationTypes","sdkAnnotationTypes","_MeetingInfoV","MeetingInfoV2","_remoteMedia","_triggerProxy","_utils","e","t","_WeakMap","r","n","__esModule","o","i","f","__proto__","default","_typeof","has","get","set","_t","hasOwnProperty","call","_Object$defineProperty","_Object$getOwnPropertyDescriptor","registerPlugin","Meetings","config","interceptors","LocusRetryStatusInterceptor","create","LocusRouteTokenInterceptor","DataChannelAuthTokenInterceptor","_default"],"sources":["index.ts"],"sourcesContent":["/* eslint-env browser */\nimport {registerPlugin} from '@webex/webex-core';\n\nimport Meetings from './meetings';\nimport config from './config';\nimport {\n LocusRetryStatusInterceptor,\n LocusRouteTokenInterceptor,\n DataChannelAuthTokenInterceptor,\n} from './interceptors';\nimport CaptchaError from './common/errors/captcha-error';\nimport IntentToJoinError from './common/errors/intent-to-join';\nimport PasswordError from './common/errors/password-error';\nimport PermissionError from './common/errors/permission';\nimport JoinWebinarError from './common/errors/join-webinar-error';\nimport {\n ReclaimHostEmptyWrongKeyError,\n ReclaimHostIsHostAlreadyError,\n ReclaimHostNotAllowedError,\n ReclaimHostNotSupportedError,\n} from './common/errors/reclaim-host-role-errors';\nimport Meeting from './meeting';\nimport MeetingInfoUtil from './meeting-info/utilv2';\nimport JoinMeetingError from './common/errors/join-meeting';\nimport {SdpResponseTimeoutError} from './common/errors/webex-errors';\n\nregisterPlugin('meetings', Meetings, {\n config,\n interceptors: {\n LocusRetryStatusInterceptor: LocusRetryStatusInterceptor.create,\n LocusRouteTokenInterceptor: LocusRouteTokenInterceptor.create,\n DataChannelAuthTokenInterceptor: DataChannelAuthTokenInterceptor.create,\n },\n});\n\nexport {\n LocalStream,\n LocalDisplayStream,\n LocalSystemAudioStream,\n LocalStreamEventNames,\n StreamEventNames,\n RemoteStreamEventNames,\n type ServerMuteReason,\n LocalMicrophoneStreamEventNames,\n LocalCameraStreamEventNames,\n LocalMicrophoneStream,\n LocalCameraStream,\n createMicrophoneStream,\n createCameraStream,\n createCameraAndMicrophoneStreams,\n createDisplayStream,\n createDisplayStreamWithAudio,\n createDisplayMedia,\n FacingMode,\n DisplaySurface,\n PresetCameraConstraints,\n type VideoContentHint,\n type StreamState,\n} from '@webex/media-helpers';\n\nexport default Meetings;\n\nexport * as CONSTANTS from './constants';\nexport * as REACTIONS from './reactions/reactions';\nexport * as sdkAnnotationTypes from './annotation/annotation.types';\nexport * as MeetingInfoV2 from './meeting-info/meeting-info-v2';\nexport {type Reaction} from './reactions/reactions.type';\n\nexport {\n CaptchaError,\n IntentToJoinError,\n JoinMeetingError,\n PasswordError,\n PermissionError,\n ReclaimHostIsHostAlreadyError,\n ReclaimHostNotAllowedError,\n ReclaimHostNotSupportedError,\n ReclaimHostEmptyWrongKeyError,\n Meeting,\n MeetingInfoUtil,\n JoinWebinarError,\n SdpResponseTimeoutError,\n};\n\nexport {RemoteMedia} from './multistream/remoteMedia';\n\nexport {default as TriggerProxy} from './common/events/trigger-proxy';\n\nexport {getAIEnablementApprover} from './aiEnableRequest/utils';\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_webexCore","require","_meetings","_interopRequireDefault","_config","_interceptors","_captchaError","_intentToJoin","_passwordError","_permission","_joinWebinarError","_reclaimHostRoleErrors","_meeting","_utilv","_joinMeeting","_webexErrors","_mediaHelpers","_CONSTANTS","_interopRequireWildcard","exports","CONSTANTS","_REACTIONS","REACTIONS","_sdkAnnotationTypes","sdkAnnotationTypes","_MeetingInfoV","MeetingInfoV2","_meetings2","_remoteMedia","_triggerProxy","_utils","e","t","_WeakMap","r","n","__esModule","o","i","f","__proto__","default","_typeof","has","get","set","_t","hasOwnProperty","call","_Object$defineProperty","_Object$getOwnPropertyDescriptor","registerPlugin","Meetings","config","interceptors","LocusRetryStatusInterceptor","create","LocusRouteTokenInterceptor","DataChannelAuthTokenInterceptor","_default"],"sources":["index.ts"],"sourcesContent":["/* eslint-env browser */\nimport {registerPlugin} from '@webex/webex-core';\n\nimport Meetings from './meetings';\nimport config from './config';\nimport {\n LocusRetryStatusInterceptor,\n LocusRouteTokenInterceptor,\n DataChannelAuthTokenInterceptor,\n} from './interceptors';\nimport CaptchaError from './common/errors/captcha-error';\nimport IntentToJoinError from './common/errors/intent-to-join';\nimport PasswordError from './common/errors/password-error';\nimport PermissionError from './common/errors/permission';\nimport JoinWebinarError from './common/errors/join-webinar-error';\nimport {\n ReclaimHostEmptyWrongKeyError,\n ReclaimHostIsHostAlreadyError,\n ReclaimHostNotAllowedError,\n ReclaimHostNotSupportedError,\n} from './common/errors/reclaim-host-role-errors';\nimport Meeting from './meeting';\nimport MeetingInfoUtil from './meeting-info/utilv2';\nimport JoinMeetingError from './common/errors/join-meeting';\nimport {SdpResponseTimeoutError} from './common/errors/webex-errors';\n\nregisterPlugin('meetings', Meetings, {\n config,\n interceptors: {\n LocusRetryStatusInterceptor: LocusRetryStatusInterceptor.create,\n LocusRouteTokenInterceptor: LocusRouteTokenInterceptor.create,\n DataChannelAuthTokenInterceptor: DataChannelAuthTokenInterceptor.create,\n },\n});\n\nexport {\n LocalStream,\n LocalDisplayStream,\n LocalSystemAudioStream,\n LocalStreamEventNames,\n StreamEventNames,\n RemoteStreamEventNames,\n type ServerMuteReason,\n LocalMicrophoneStreamEventNames,\n LocalCameraStreamEventNames,\n LocalMicrophoneStream,\n LocalCameraStream,\n createMicrophoneStream,\n createCameraStream,\n createCameraAndMicrophoneStreams,\n createDisplayStream,\n createDisplayStreamWithAudio,\n createDisplayMedia,\n FacingMode,\n DisplaySurface,\n PresetCameraConstraints,\n type VideoContentHint,\n type StreamState,\n} from '@webex/media-helpers';\n\nexport default Meetings;\n\nexport * as CONSTANTS from './constants';\nexport * as REACTIONS from './reactions/reactions';\nexport * as sdkAnnotationTypes from './annotation/annotation.types';\nexport * as MeetingInfoV2 from './meeting-info/meeting-info-v2';\nexport {type Reaction} from './reactions/reactions.type';\nexport {SitePreferenceSelectOption} from './meetings/meetings.types';\nexport type {\n FetchSitePreferencesMeViaSiteOptions,\n SitePreferencesResponse,\n} from './meetings/meetings.types';\nexport type {Interpreter, InterpreterUsingResource} from './interpretation/interpretation.types';\n\nexport {\n CaptchaError,\n IntentToJoinError,\n JoinMeetingError,\n PasswordError,\n PermissionError,\n ReclaimHostIsHostAlreadyError,\n ReclaimHostNotAllowedError,\n ReclaimHostNotSupportedError,\n ReclaimHostEmptyWrongKeyError,\n Meeting,\n MeetingInfoUtil,\n JoinWebinarError,\n SdpResponseTimeoutError,\n};\n\nexport {RemoteMedia} from './multistream/remoteMedia';\n\nexport {default as TriggerProxy} from './common/events/trigger-proxy';\n\nexport {getAIEnablementApprover} from './aiEnableRequest/utils';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AAKA,IAAAK,aAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,aAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,cAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,WAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,iBAAA,GAAAP,sBAAA,CAAAF,OAAA;AACA,IAAAU,sBAAA,GAAAV,OAAA;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AAAM,CAAA,CAAAQ,GAAA,CAAAd,CAAA,EAAAQ,CAAA,cAAAO,EAAA,IAAAf,CAAA,gBAAAe,EAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAe,EAAA,OAAAR,CAAA,IAAAD,CAAA,GAAAY,sBAAA,KAAAC,gCAAA,CAAAnB,CAAA,EAAAe,EAAA,OAAAR,CAAA,CAAAM,GAAA,IAAAN,CAAA,CAAAO,GAAA,IAAAR,CAAA,CAAAE,CAAA,EAAAO,EAAA,EAAAR,CAAA,IAAAC,CAAA,CAAAO,EAAA,IAAAf,CAAA,CAAAe,EAAA,WAAAP,CAAA,KAAAR,CAAA,EAAAC,CAAA;AA9FhE;;AA0BA,IAAAmB,yBAAc,EAAC,UAAU,EAAEC,iBAAQ,EAAE;EACnCC,MAAM,EAANA,eAAM;EACNC,YAAY,EAAE;IACZC,2BAA2B,EAAEA,yCAA2B,CAACC,MAAM;IAC/DC,0BAA0B,EAAEA,wCAA0B,CAACD,MAAM;IAC7DE,+BAA+B,EAAEA,6CAA+B,CAACF;EACnE;AACF,CAAC,CAAC;AAAC,IAAAG,QAAA,GAAAxC,OAAA,CAAAsB,OAAA,GA2BYW,iBAAQ","ignoreList":[]}
|
|
@@ -19,18 +19,17 @@ var _map = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/map"))
|
|
|
19
19
|
var _now = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/date/now"));
|
|
20
20
|
var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
|
|
21
21
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
|
|
22
|
+
var _values = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/values"));
|
|
22
23
|
var _httpCore = require("@webex/http-core");
|
|
24
|
+
var _internalPluginLlm = _interopRequireDefault(require("@webex/internal-plugin-llm"));
|
|
23
25
|
var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
|
|
24
26
|
var _constant = require("./constant");
|
|
25
27
|
var _utils = require("./utils");
|
|
28
|
+
var _constants = require("../constants");
|
|
26
29
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
27
30
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /*!
|
|
28
31
|
* Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.
|
|
29
32
|
*/
|
|
30
|
-
/*!
|
|
31
|
-
* Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
33
|
var retryCountMap = new _map.default();
|
|
35
34
|
/**
|
|
36
35
|
* @class
|
|
@@ -102,7 +101,7 @@ var DataChannelAuthTokenInterceptor = exports.default = /*#__PURE__*/function (_
|
|
|
102
101
|
}
|
|
103
102
|
_context.prev = 3;
|
|
104
103
|
_context.next = 4;
|
|
105
|
-
return this._refreshDataChannelToken();
|
|
104
|
+
return this._refreshDataChannelToken(options.uri || options.url);
|
|
106
105
|
case 4:
|
|
107
106
|
newToken = _context.sent;
|
|
108
107
|
options.headers[_constant.DATA_CHANNEL_AUTH_HEADER] = newToken;
|
|
@@ -203,7 +202,7 @@ var DataChannelAuthTokenInterceptor = exports.default = /*#__PURE__*/function (_
|
|
|
203
202
|
key = _this2.getRetryKey(options);
|
|
204
203
|
_context3.prev = 1;
|
|
205
204
|
_context3.next = 2;
|
|
206
|
-
return _this2._refreshDataChannelToken();
|
|
205
|
+
return _this2._refreshDataChannelToken(options.uri || options.url);
|
|
207
206
|
case 2:
|
|
208
207
|
newToken = _context3.sent;
|
|
209
208
|
options.headers[_constant.DATA_CHANNEL_AUTH_HEADER] = newToken;
|
|
@@ -258,27 +257,88 @@ var DataChannelAuthTokenInterceptor = exports.default = /*#__PURE__*/function (_
|
|
|
258
257
|
}
|
|
259
258
|
return isDataChannelTokenEnabled;
|
|
260
259
|
}(),
|
|
260
|
+
// Route refresh by request URL in two steps:
|
|
261
|
+
// 1) Match active LLM sessions (supports non-default/multiple sessions)
|
|
262
|
+
// 2) If no session matches, resolve locusUrl and refresh via owning meeting
|
|
263
|
+
// If neither route matches, fall back to the default-session refresh.
|
|
261
264
|
refreshDataChannelToken: function () {
|
|
262
|
-
var _refreshDataChannelToken = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
263
|
-
var
|
|
265
|
+
var _refreshDataChannelToken = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5(requestUrl) {
|
|
266
|
+
var _result, _meeting2, _this3$internal$llm$g3, _this3$internal$llm3;
|
|
267
|
+
var sessionId, meeting, _this3$internal$llm$g, _this3$internal$llm, _this3$internal$llm$g2, _this3$internal$llm2, locusUrl, _this3$meetings, _this3$meetings$getMe, _this3$meetings2, _this3$meetings2$getA, allMeetings, _meeting, _meeting$locusInfo, info, result, _result$body, datachannelToken, dataChannelTokenType, tokenStoreKey, ownerMeetingId;
|
|
264
268
|
return _regenerator.default.wrap(function (_context5) {
|
|
265
269
|
while (1) switch (_context5.prev = _context5.next) {
|
|
266
270
|
case 0:
|
|
271
|
+
if (typeof requestUrl === 'string') {
|
|
272
|
+
// @ts-ignore
|
|
273
|
+
sessionId = (_this3$internal$llm$g = (_this3$internal$llm = _this3.internal.llm).getSessionIdByDatachannelUrl) === null || _this3$internal$llm$g === void 0 ? void 0 : _this3$internal$llm$g.call(_this3$internal$llm, requestUrl);
|
|
274
|
+
if (!sessionId) {
|
|
275
|
+
// @ts-ignore
|
|
276
|
+
locusUrl = (_this3$internal$llm$g2 = (_this3$internal$llm2 = _this3.internal.llm).getLocusUrlByDatachannelUrl) === null || _this3$internal$llm$g2 === void 0 ? void 0 : _this3$internal$llm$g2.call(_this3$internal$llm2, requestUrl);
|
|
277
|
+
if (locusUrl) {
|
|
278
|
+
// @ts-ignore
|
|
279
|
+
meeting = (_this3$meetings = _this3.meetings) === null || _this3$meetings === void 0 ? void 0 : (_this3$meetings$getMe = _this3$meetings.getMeetingByType) === null || _this3$meetings$getMe === void 0 ? void 0 : _this3$meetings$getMe.call(_this3$meetings, _constants.LOCUS_URL, locusUrl);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
if (!meeting) {
|
|
283
|
+
// Fallback: registerAndConnect() pre-populates datachannelUrl in
|
|
284
|
+
// connections before calling register(), so getSessionIdByDatachannelUrl
|
|
285
|
+
// above should normally resolve. This scan covers any residual gap
|
|
286
|
+
// where connections are not yet populated (e.g. if setRefreshHandler
|
|
287
|
+
// is called on a session that has no connection entry at all).
|
|
288
|
+
// @ts-ignore
|
|
289
|
+
allMeetings = ((_this3$meetings2 = _this3.meetings) === null || _this3$meetings2 === void 0 ? void 0 : (_this3$meetings2$getA = _this3$meetings2.getAllMeetings) === null || _this3$meetings2$getA === void 0 ? void 0 : _this3$meetings2$getA.call(_this3$meetings2)) || {};
|
|
290
|
+
meeting = (0, _values.default)(allMeetings).find(function (activeMeeting) {
|
|
291
|
+
var _activeMeeting$locusI;
|
|
292
|
+
var info = (activeMeeting === null || activeMeeting === void 0 ? void 0 : (_activeMeeting$locusI = activeMeeting.locusInfo) === null || _activeMeeting$locusI === void 0 ? void 0 : _activeMeeting$locusI.info) || {};
|
|
293
|
+
return info.practiceSessionDatachannelUrl && _internalPluginLlm.default.matchesDatachannelRequestUrl(requestUrl, info.practiceSessionDatachannelUrl) || info.datachannelUrl && _internalPluginLlm.default.matchesDatachannelRequestUrl(requestUrl, info.datachannelUrl);
|
|
294
|
+
});
|
|
295
|
+
if (!sessionId) {
|
|
296
|
+
// @ts-ignore
|
|
297
|
+
info = ((_meeting = meeting) === null || _meeting === void 0 ? void 0 : (_meeting$locusInfo = _meeting.locusInfo) === null || _meeting$locusInfo === void 0 ? void 0 : _meeting$locusInfo.info) || {};
|
|
298
|
+
if (info.practiceSessionDatachannelUrl && _internalPluginLlm.default.matchesDatachannelRequestUrl(requestUrl, info.practiceSessionDatachannelUrl)) {
|
|
299
|
+
sessionId = _constants.LLM_PRACTICE_SESSION;
|
|
300
|
+
} else if (info.datachannelUrl && _internalPluginLlm.default.matchesDatachannelRequestUrl(requestUrl, info.datachannelUrl)) {
|
|
301
|
+
sessionId = _constants.LLM_DEFAULT_SESSION;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
if (!meeting) {
|
|
307
|
+
_context5.next = 2;
|
|
308
|
+
break;
|
|
309
|
+
}
|
|
267
310
|
_context5.next = 1;
|
|
268
|
-
return
|
|
311
|
+
return meeting.refreshDataChannelToken();
|
|
269
312
|
case 1:
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
_this3.internal.llm.setDatachannelToken(datachannelToken, dataChannelTokenType);
|
|
274
|
-
return _context5.abrupt("return", datachannelToken);
|
|
313
|
+
result = _context5.sent;
|
|
314
|
+
_context5.next = 4;
|
|
315
|
+
break;
|
|
275
316
|
case 2:
|
|
317
|
+
_context5.next = 3;
|
|
318
|
+
return _this3.internal.llm.refreshDataChannelToken(sessionId);
|
|
319
|
+
case 3:
|
|
320
|
+
result = _context5.sent;
|
|
321
|
+
case 4:
|
|
322
|
+
if ((_result = result) !== null && _result !== void 0 && _result.body) {
|
|
323
|
+
_context5.next = 5;
|
|
324
|
+
break;
|
|
325
|
+
}
|
|
326
|
+
throw new Error('DataChannel token refresh returned no payload');
|
|
327
|
+
case 5:
|
|
328
|
+
_result$body = result.body, datachannelToken = _result$body.datachannelToken, dataChannelTokenType = _result$body.dataChannelTokenType;
|
|
329
|
+
tokenStoreKey = dataChannelTokenType || sessionId;
|
|
330
|
+
ownerMeetingId =
|
|
331
|
+
// @ts-ignore
|
|
332
|
+
((_meeting2 = meeting) === null || _meeting2 === void 0 ? void 0 : _meeting2.id) || ((_this3$internal$llm$g3 = (_this3$internal$llm3 = _this3.internal.llm).getOwnerMeetingId) === null || _this3$internal$llm$g3 === void 0 ? void 0 : _this3$internal$llm$g3.call(_this3$internal$llm3, tokenStoreKey)); // @ts-ignore
|
|
333
|
+
_this3.internal.llm.setDatachannelToken(datachannelToken, tokenStoreKey, ownerMeetingId);
|
|
334
|
+
return _context5.abrupt("return", datachannelToken);
|
|
335
|
+
case 6:
|
|
276
336
|
case "end":
|
|
277
337
|
return _context5.stop();
|
|
278
338
|
}
|
|
279
339
|
}, _callee5);
|
|
280
340
|
}));
|
|
281
|
-
function refreshDataChannelToken() {
|
|
341
|
+
function refreshDataChannelToken(_x4) {
|
|
282
342
|
return _refreshDataChannelToken.apply(this, arguments);
|
|
283
343
|
}
|
|
284
344
|
return refreshDataChannelToken;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_httpCore","require","_loggerProxy","_interopRequireDefault","_constant","_utils","_callSuper","t","o","e","_getPrototypeOf2","default","_possibleConstructorReturn2","_isNativeReflectConstruct","_Reflect$construct","constructor","apply","Boolean","prototype","valueOf","call","retryCountMap","_map","DataChannelAuthTokenInterceptor","exports","_Interceptor","options","_this","_classCallCheck2","_defineProperty2","_refreshDataChannelToken","refreshDataChannelToken","_isDataChannelTokenEnabled","isDataChannelTokenEnabled","_inherits2","_createClass2","key","value","getRetryKey","RETRY_KEY","concat","_now","Math","random","getHeader","headers","name","_keys","find","k","toLowerCase","undefined","_onRequest","_asyncToGenerator2","_regenerator","mark","_callee","token","enabled","newToken","_t","wrap","_context","prev","next","DATA_CHANNEL_AUTH_HEADER","sent","abrupt","isJwtTokenExpired","LoggerProxy","logger","warn","message","stop","onRequest","_x","arguments","_onResponseError","_callee2","reason","retryCount","_context2","_promise","reject","statusCode","get","MAX_RETRY","error","delete","set","refreshTokenAndRetryWithDelay","onResponseError","_x2","_x3","_this2","resolve","setTimeout","_callee3","res","msg","err","_t2","_context3","webex","request","String","Error","original","RETRY_INTERVAL","create","_this3","_callee4","_context4","internal","llm","_callee5","_yield$_this3$interna","body","_ref2","datachannelToken","dataChannelTokenType","_context5","setDatachannelToken","Interceptor"],"sources":["dataChannelAuthToken.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {Interceptor} from '@webex/http-core';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {DATA_CHANNEL_AUTH_HEADER, MAX_RETRY, RETRY_INTERVAL, RETRY_KEY} from './constant';\nimport {isJwtTokenExpired} from './utils';\n\n/*!\n * Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.\n */\n\nconst retryCountMap = new Map();\ninterface HttpLikeError extends Error {\n statusCode?: number;\n original?: any;\n}\n/**\n * @class\n */\nexport default class DataChannelAuthTokenInterceptor extends Interceptor {\n private _refreshDataChannelToken: () => Promise<string>;\n private _isDataChannelTokenEnabled: () => Promise<boolean>;\n constructor(options) {\n super(options);\n\n this._refreshDataChannelToken = options.refreshDataChannelToken;\n this._isDataChannelTokenEnabled = options.isDataChannelTokenEnabled;\n }\n\n /**\n * @returns {DataChannelAuthTokenInterceptor}\n */\n static create() {\n // @ts-ignore\n return new DataChannelAuthTokenInterceptor({\n webex: this,\n\n isDataChannelTokenEnabled: async () => {\n // @ts-ignore\n return this.internal.llm.isDataChannelTokenEnabled();\n },\n\n refreshDataChannelToken: async () => {\n // @ts-ignore\n const {body} = await this.internal.llm.refreshDataChannelToken();\n const {datachannelToken, dataChannelTokenType} = body ?? {};\n\n // @ts-ignore\n this.internal.llm.setDatachannelToken(datachannelToken, dataChannelTokenType);\n\n return datachannelToken;\n },\n });\n }\n\n private getRetryKey(options) {\n if (!options[RETRY_KEY]) {\n options[RETRY_KEY] = `${Date.now()}-${Math.random()}`;\n }\n\n return options[RETRY_KEY];\n }\n\n // Helper function to get header value case insensitively\n private getHeader(headers: Record<string, string>, name: string) {\n const key = Object.keys(headers).find((k) => k.toLowerCase() === name.toLowerCase());\n\n return key ? headers[key] : undefined;\n }\n\n /**\n * Intercepts outgoing requests and refreshes the Data-Channel-Auth-Token\n * if the current JWT token is expired before the request is sent.\n *\n * @param {Object} options - The original request options.\n * @returns {Promise<Object>} Updated request options with refreshed token if needed.\n */\n async onRequest(options) {\n const token = this.getHeader(options.headers, DATA_CHANNEL_AUTH_HEADER);\n const enabled = await this._isDataChannelTokenEnabled();\n\n if (!token || !enabled) {\n return options;\n }\n\n if (isJwtTokenExpired(token)) {\n try {\n const newToken = await this._refreshDataChannelToken();\n options.headers[DATA_CHANNEL_AUTH_HEADER] = newToken;\n } catch (e) {\n LoggerProxy.logger.warn(`DataChannelAuthTokenInterceptor: refresh failed: ${e.message}`);\n }\n }\n\n return options;\n }\n\n /**\n * Intercept responses and, on 401/403 with `Data-Channel-Auth-Token` header,\n * attempt to refresh the data channel token and retry the original request once.\n *\n * @param {Object} options\n * @param {Object} reason\n * @returns {Promise<HttpResponse>}\n */\n async onResponseError(options, reason) {\n const token = this.getHeader(options.headers, DATA_CHANNEL_AUTH_HEADER);\n const enabled = await this._isDataChannelTokenEnabled();\n\n if (!token || !enabled) {\n return Promise.reject(reason);\n }\n\n if (reason.statusCode !== 401 && reason.statusCode !== 403) {\n return Promise.reject(reason);\n }\n\n const key = this.getRetryKey(options);\n const retryCount = retryCountMap.get(key) || 0;\n\n if (retryCount >= MAX_RETRY) {\n LoggerProxy.logger.error(`data channel token refresh exceeded max retry (${MAX_RETRY})`);\n retryCountMap.delete(key);\n\n return Promise.reject(reason);\n }\n\n retryCountMap.set(key, retryCount + 1);\n\n return this.refreshTokenAndRetryWithDelay(options);\n }\n\n /**\n * Retry the failed data channel request after a delay.\n * Refreshes the Data-Channel-Auth-Token and re-sends the original request.\n *\n * @param {Object} options - Original request options.\n * @returns {Promise<HttpResponse>} - Resolves on successful retry.\n */\n refreshTokenAndRetryWithDelay(options) {\n return new Promise((resolve, reject) => {\n setTimeout(async () => {\n const key = this.getRetryKey(options);\n try {\n const newToken = await this._refreshDataChannelToken();\n\n options.headers[DATA_CHANNEL_AUTH_HEADER] = newToken;\n\n // @ts-ignore\n const res = await this.webex.request(options);\n retryCountMap.delete(key);\n\n resolve(res);\n } catch (e) {\n retryCountMap.delete(key);\n\n const msg = e?.message || String(e);\n\n const err: HttpLikeError = new Error(`DataChannel token refresh failed: ${msg}`);\n err.statusCode = e?.statusCode;\n err.original = e;\n\n reject(err);\n }\n }, RETRY_INTERVAL);\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAIA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAA0C,SAAAK,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,CAAAC,OAAA,EAAAH,CAAA,OAAAI,2BAAA,CAAAD,OAAA,EAAAJ,CAAA,EAAAM,yBAAA,KAAAC,kBAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,CAAAC,OAAA,EAAAJ,CAAA,EAAAQ,WAAA,IAAAP,CAAA,CAAAQ,KAAA,CAAAT,CAAA,EAAAE,CAAA;AAAA,SAAAI,0BAAA,cAAAN,CAAA,IAAAU,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAN,kBAAA,CAAAG,OAAA,iCAAAV,CAAA,aAAAM,yBAAA,YAAAA,0BAAA,aAAAN,CAAA,UAP1C;AACA;AACA;AAOA;AACA;AACA;;AAEA,IAAMc,aAAa,GAAG,IAAAC,IAAA,CAAAX,OAAA,CAAQ,CAAC;AAK/B;AACA;AACA;AAFA,IAGqBY,+BAA+B,GAAAC,OAAA,CAAAb,OAAA,0BAAAc,YAAA;EAGlD,SAAAF,gCAAYG,OAAO,EAAE;IAAA,IAAAC,KAAA;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AzDmD,IAAI,GAAAD,qBAAA,CAAJC,IAAI;kBAAAC,KAAA,GACsCD,IAAI,aAAJA,IAAI,cAAJA,IAAI,GAAI,CAAC,CAAC,EAApDE,gBAAgB,GAAAD,KAAA,CAAhBC,gBAAgB,EAAEC,oBAAoB,GAAAF,KAAA,CAApBE,oBAAoB,EAE7C;kBACAV,MAAI,CAACG,QAAQ,CAACC,GAAG,CAACQ,mBAAmB,CAACH,gBAAgB,EAAEC,oBAAoB,CAAC;kBAAC,OAAAC,SAAA,CAAAtD,MAAA,WAEvEoD,gBAAgB;gBAAA;gBAAA;kBAAA,OAAAE,SAAA,CAAAhD,IAAA;cAAA;YAAA,GAAA0C,QAAA;UAAA,CACxB;UAAA,SATDpF,uBAAuBA,CAAA;YAAA,OAAAD,wBAAA,CAAAd,KAAA,OAAA4D,SAAA;UAAA;UAAA,OAAvB7C,uBAAuB;QAAA;MAUzB,CAAC,CAAC;IACJ;EAAC;AAAA,EAlC0D4F,qBAAW","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_httpCore","require","_internalPluginLlm","_interopRequireDefault","_loggerProxy","_constant","_utils","_constants","_callSuper","t","o","e","_getPrototypeOf2","default","_possibleConstructorReturn2","_isNativeReflectConstruct","_Reflect$construct","constructor","apply","Boolean","prototype","valueOf","call","retryCountMap","_map","DataChannelAuthTokenInterceptor","exports","_Interceptor","options","_this","_classCallCheck2","_defineProperty2","_refreshDataChannelToken","refreshDataChannelToken","_isDataChannelTokenEnabled","isDataChannelTokenEnabled","_inherits2","_createClass2","key","value","getRetryKey","RETRY_KEY","concat","_now","Math","random","getHeader","headers","name","_keys","find","k","toLowerCase","undefined","_onRequest","_asyncToGenerator2","_regenerator","mark","_callee","token","enabled","newToken","_t","wrap","_context","prev","next","DATA_CHANNEL_AUTH_HEADER","sent","abrupt","isJwtTokenExpired","uri","url","LoggerProxy","logger","warn","message","stop","onRequest","_x","arguments","_onResponseError","_callee2","reason","retryCount","_context2","_promise","reject","statusCode","get","MAX_RETRY","error","delete","set","refreshTokenAndRetryWithDelay","onResponseError","_x2","_x3","_this2","resolve","setTimeout","_callee3","res","msg","err","_t2","_context3","webex","request","String","Error","original","RETRY_INTERVAL","create","_this3","_callee4","_context4","internal","llm","_callee5","requestUrl","_result","_meeting2","_this3$internal$llm$g3","_this3$internal$llm3","sessionId","meeting","_this3$internal$llm$g","_this3$internal$llm","_this3$internal$llm$g2","_this3$internal$llm2","locusUrl","_this3$meetings","_this3$meetings$getMe","_this3$meetings2","_this3$meetings2$getA","allMeetings","_meeting","_meeting$locusInfo","info","result","_result$body","datachannelToken","dataChannelTokenType","tokenStoreKey","ownerMeetingId","_context5","getSessionIdByDatachannelUrl","getLocusUrlByDatachannelUrl","meetings","getMeetingByType","LOCUS_URL","getAllMeetings","_values","activeMeeting","_activeMeeting$locusI","locusInfo","practiceSessionDatachannelUrl","LLMChannel","matchesDatachannelRequestUrl","datachannelUrl","LLM_PRACTICE_SESSION","LLM_DEFAULT_SESSION","body","id","getOwnerMeetingId","setDatachannelToken","_x4","Interceptor"],"sources":["dataChannelAuthToken.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {Interceptor} from '@webex/http-core';\nimport LLMChannel from '@webex/internal-plugin-llm';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {DATA_CHANNEL_AUTH_HEADER, MAX_RETRY, RETRY_INTERVAL, RETRY_KEY} from './constant';\nimport {isJwtTokenExpired} from './utils';\nimport {LLM_DEFAULT_SESSION, LLM_PRACTICE_SESSION, LOCUS_URL} from '../constants';\n\nconst retryCountMap = new Map();\ninterface HttpLikeError extends Error {\n statusCode?: number;\n original?: any;\n}\n/**\n * @class\n */\nexport default class DataChannelAuthTokenInterceptor extends Interceptor {\n private _refreshDataChannelToken: (requestUrl?: string) => Promise<string>;\n private _isDataChannelTokenEnabled: () => Promise<boolean>;\n constructor(options) {\n super(options);\n\n this._refreshDataChannelToken = options.refreshDataChannelToken;\n this._isDataChannelTokenEnabled = options.isDataChannelTokenEnabled;\n }\n\n /**\n * @returns {DataChannelAuthTokenInterceptor}\n */\n static create() {\n // @ts-ignore\n return new DataChannelAuthTokenInterceptor({\n webex: this,\n\n isDataChannelTokenEnabled: async () => {\n // @ts-ignore\n return this.internal.llm.isDataChannelTokenEnabled();\n },\n\n // Route refresh by request URL in two steps:\n // 1) Match active LLM sessions (supports non-default/multiple sessions)\n // 2) If no session matches, resolve locusUrl and refresh via owning meeting\n // If neither route matches, fall back to the default-session refresh.\n refreshDataChannelToken: async (requestUrl?: string) => {\n let sessionId;\n let meeting;\n\n if (typeof requestUrl === 'string') {\n // @ts-ignore\n sessionId = this.internal.llm.getSessionIdByDatachannelUrl?.(requestUrl);\n\n if (!sessionId) {\n // @ts-ignore\n const locusUrl = this.internal.llm.getLocusUrlByDatachannelUrl?.(requestUrl);\n\n if (locusUrl) {\n // @ts-ignore\n meeting = this.meetings?.getMeetingByType?.(LOCUS_URL, locusUrl);\n }\n }\n\n if (!meeting) {\n // Fallback: registerAndConnect() pre-populates datachannelUrl in\n // connections before calling register(), so getSessionIdByDatachannelUrl\n // above should normally resolve. This scan covers any residual gap\n // where connections are not yet populated (e.g. if setRefreshHandler\n // is called on a session that has no connection entry at all).\n // @ts-ignore\n const allMeetings = this.meetings?.getAllMeetings?.() || {};\n\n meeting = Object.values(allMeetings).find((activeMeeting: any) => {\n const info = activeMeeting?.locusInfo?.info || {};\n\n return (\n (info.practiceSessionDatachannelUrl &&\n LLMChannel.matchesDatachannelRequestUrl(\n requestUrl,\n info.practiceSessionDatachannelUrl\n )) ||\n (info.datachannelUrl &&\n LLMChannel.matchesDatachannelRequestUrl(requestUrl, info.datachannelUrl))\n );\n });\n\n if (!sessionId) {\n // @ts-ignore\n const info = meeting?.locusInfo?.info || {};\n\n if (\n info.practiceSessionDatachannelUrl &&\n LLMChannel.matchesDatachannelRequestUrl(\n requestUrl,\n info.practiceSessionDatachannelUrl\n )\n ) {\n sessionId = LLM_PRACTICE_SESSION;\n } else if (\n info.datachannelUrl &&\n LLMChannel.matchesDatachannelRequestUrl(requestUrl, info.datachannelUrl)\n ) {\n sessionId = LLM_DEFAULT_SESSION;\n }\n }\n }\n }\n\n let result;\n if (meeting) {\n result = await meeting.refreshDataChannelToken();\n } else {\n // @ts-ignore\n result = await this.internal.llm.refreshDataChannelToken(sessionId);\n }\n\n if (!result?.body) {\n throw new Error('DataChannel token refresh returned no payload');\n }\n const {datachannelToken, dataChannelTokenType} = result.body;\n const tokenStoreKey = dataChannelTokenType || sessionId;\n const ownerMeetingId =\n // @ts-ignore\n meeting?.id || this.internal.llm.getOwnerMeetingId?.(tokenStoreKey);\n // @ts-ignore\n this.internal.llm.setDatachannelToken(datachannelToken, tokenStoreKey, ownerMeetingId);\n\n return datachannelToken;\n },\n });\n }\n\n private getRetryKey(options) {\n if (!options[RETRY_KEY]) {\n options[RETRY_KEY] = `${Date.now()}-${Math.random()}`;\n }\n\n return options[RETRY_KEY];\n }\n\n // Helper function to get header value case insensitively\n private getHeader(headers: Record<string, string>, name: string) {\n const key = Object.keys(headers).find((k) => k.toLowerCase() === name.toLowerCase());\n\n return key ? headers[key] : undefined;\n }\n\n /**\n * Intercepts outgoing requests and refreshes the Data-Channel-Auth-Token\n * if the current JWT token is expired before the request is sent.\n *\n * @param {Object} options - The original request options.\n * @returns {Promise<Object>} Updated request options with refreshed token if needed.\n */\n async onRequest(options) {\n const token = this.getHeader(options.headers, DATA_CHANNEL_AUTH_HEADER);\n const enabled = await this._isDataChannelTokenEnabled();\n\n if (!token || !enabled) {\n return options;\n }\n\n if (isJwtTokenExpired(token)) {\n try {\n const newToken = await this._refreshDataChannelToken(options.uri || options.url);\n options.headers[DATA_CHANNEL_AUTH_HEADER] = newToken;\n } catch (e) {\n LoggerProxy.logger.warn(`DataChannelAuthTokenInterceptor: refresh failed: ${e.message}`);\n }\n }\n\n return options;\n }\n\n /**\n * Intercept responses and, on 401/403 with `Data-Channel-Auth-Token` header,\n * attempt to refresh the data channel token and retry the original request once.\n *\n * @param {Object} options\n * @param {Object} reason\n * @returns {Promise<HttpResponse>}\n */\n async onResponseError(options, reason) {\n const token = this.getHeader(options.headers, DATA_CHANNEL_AUTH_HEADER);\n const enabled = await this._isDataChannelTokenEnabled();\n\n if (!token || !enabled) {\n return Promise.reject(reason);\n }\n\n if (reason.statusCode !== 401 && reason.statusCode !== 403) {\n return Promise.reject(reason);\n }\n\n const key = this.getRetryKey(options);\n const retryCount = retryCountMap.get(key) || 0;\n\n if (retryCount >= MAX_RETRY) {\n LoggerProxy.logger.error(`data channel token refresh exceeded max retry (${MAX_RETRY})`);\n retryCountMap.delete(key);\n\n return Promise.reject(reason);\n }\n\n retryCountMap.set(key, retryCount + 1);\n\n return this.refreshTokenAndRetryWithDelay(options);\n }\n\n /**\n * Retry the failed data channel request after a delay.\n * Refreshes the Data-Channel-Auth-Token and re-sends the original request.\n *\n * @param {Object} options - Original request options.\n * @returns {Promise<HttpResponse>} - Resolves on successful retry.\n */\n refreshTokenAndRetryWithDelay(options) {\n return new Promise((resolve, reject) => {\n setTimeout(async () => {\n const key = this.getRetryKey(options);\n try {\n const newToken = await this._refreshDataChannelToken(options.uri || options.url);\n\n options.headers[DATA_CHANNEL_AUTH_HEADER] = newToken;\n\n // @ts-ignore\n const res = await this.webex.request(options);\n retryCountMap.delete(key);\n\n resolve(res);\n } catch (e) {\n retryCountMap.delete(key);\n\n const msg = e?.message || String(e);\n\n const err: HttpLikeError = new Error(`DataChannel token refresh failed: ${msg}`);\n err.statusCode = e?.statusCode;\n err.original = e;\n\n reject(err);\n }\n }, RETRY_INTERVAL);\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAIA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,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AACuB,IAAI,EAArDrB,gBAAgB,GAAAD,YAAA,CAAhBC,gBAAgB,EAAEC,oBAAoB,GAAAF,YAAA,CAApBE,oBAAoB;kBACvCC,aAAa,GAAGD,oBAAoB,IAAIlB,SAAS;kBACjDoB,cAAc;kBAClB;kBACA,EAAAvB,SAAA,GAAAI,OAAO,cAAAJ,SAAA,uBAAPA,SAAA,CAAS0C,EAAE,OAAAzC,sBAAA,GAAI,CAAAC,oBAAA,GAAAV,MAAI,CAACG,QAAQ,CAACC,GAAG,EAAC+C,iBAAiB,cAAA1C,sBAAA,uBAAnCA,sBAAA,CAAArG,IAAA,CAAAsG,oBAAA,EAAsCoB,aAAa,CAAC,GACrE;kBACA9B,MAAI,CAACG,QAAQ,CAACC,GAAG,CAACgD,mBAAmB,CAACxB,gBAAgB,EAAEE,aAAa,EAAEC,cAAc,CAAC;kBAAC,OAAAC,SAAA,CAAA7E,MAAA,WAEhFyE,gBAAgB;gBAAA;gBAAA;kBAAA,OAAAI,SAAA,CAAArE,IAAA;cAAA;YAAA,GAAA0C,QAAA;UAAA,CACxB;UAAA,SAnFDtF,uBAAuBA,CAAAsI,GAAA;YAAA,OAAAvI,wBAAA,CAAAd,KAAA,OAAA8D,SAAA;UAAA;UAAA,OAAvB/C,uBAAuB;QAAA;MAoFzB,CAAC,CAAC;IACJ;EAAC;AAAA,EAhH0DuI,qBAAW","ignoreList":[]}
|
|
@@ -31,14 +31,12 @@ var LocusRetryStatusInterceptor = exports.default = /*#__PURE__*/function (_Inte
|
|
|
31
31
|
(0, _inherits2.default)(LocusRetryStatusInterceptor, _Interceptor);
|
|
32
32
|
return (0, _createClass2.default)(LocusRetryStatusInterceptor, [{
|
|
33
33
|
key: "onResponseError",
|
|
34
|
-
value:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
*/
|
|
41
|
-
function onResponseError(options, reason) {
|
|
34
|
+
value: function onResponseError(options, reason) {
|
|
35
|
+
// Don't retry /hashtree or /sync calls for 429 or any 5xx — during a sync storm retries
|
|
36
|
+
// make things worse. The normal sync timers will handle recovery for these endpoints.
|
|
37
|
+
if ((reason.statusCode === 429 || reason.statusCode >= 500) && LocusRetryStatusInterceptor.isLocusHashtreeOrSync(options.uri)) {
|
|
38
|
+
return _promise.default.reject(reason);
|
|
39
|
+
}
|
|
42
40
|
if ((reason.statusCode === 503 || reason.statusCode === 429) && options.uri.includes('locus')) {
|
|
43
41
|
var hasRetriedLocusRequest = rateLimitExpiryTime.get(this);
|
|
44
42
|
var retryAfterTime = options.headers['retry-after'] || 2000;
|
|
@@ -87,6 +85,23 @@ var LocusRetryStatusInterceptor = exports.default = /*#__PURE__*/function (_Inte
|
|
|
87
85
|
webex: this
|
|
88
86
|
});
|
|
89
87
|
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Check whether a URI is a Locus /hashtree or /sync endpoint.
|
|
91
|
+
* @param {string} uri
|
|
92
|
+
* @returns {boolean}
|
|
93
|
+
*/
|
|
94
|
+
}, {
|
|
95
|
+
key: "isLocusHashtreeOrSync",
|
|
96
|
+
value: function isLocusHashtreeOrSync(uri) {
|
|
97
|
+
try {
|
|
98
|
+
var _URL = new URL(uri),
|
|
99
|
+
pathname = _URL.pathname;
|
|
100
|
+
return pathname.includes('/locus/') && (pathname.endsWith('/hashtree') || pathname.endsWith('/sync'));
|
|
101
|
+
} catch (_unused) {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
90
105
|
}]);
|
|
91
106
|
}(_httpCore.Interceptor);
|
|
92
107
|
//# sourceMappingURL=locusRetry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_httpCore","require","_callSuper","t","o","e","_getPrototypeOf2","default","_possibleConstructorReturn2","_isNativeReflectConstruct","_Reflect$construct","constructor","apply","Boolean","prototype","valueOf","call","rateLimitExpiryTime","_weakMap","LocusRetryStatusInterceptor","exports","_Interceptor","_classCallCheck2","arguments","_inherits2","_createClass2","key","value","onResponseError","options","reason","statusCode","uri","includes","hasRetriedLocusRequest","get","retryAfterTime","headers","set","
|
|
1
|
+
{"version":3,"names":["_httpCore","require","_callSuper","t","o","e","_getPrototypeOf2","default","_possibleConstructorReturn2","_isNativeReflectConstruct","_Reflect$construct","constructor","apply","Boolean","prototype","valueOf","call","rateLimitExpiryTime","_weakMap","LocusRetryStatusInterceptor","exports","_Interceptor","_classCallCheck2","arguments","_inherits2","_createClass2","key","value","onResponseError","options","reason","statusCode","isLocusHashtreeOrSync","uri","_promise","reject","includes","hasRetriedLocusRequest","get","retryAfterTime","headers","set","handleRetryRequestLocusServiceError","_this","resolve","timeout","setTimeout","clearTimeout","webex","request","method","body","then","catch","create","_URL","URL","pathname","endsWith","_unused","Interceptor"],"sources":["locusRetry.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {Interceptor} from '@webex/http-core';\n\nconst rateLimitExpiryTime = new WeakMap();\n/**\n * @class\n */\nexport default class LocusRetryStatusInterceptor extends Interceptor {\n /**\n * @returns {LocusRetryStatusInterceptor}\n */\n static create() {\n // @ts-ignore\n return new LocusRetryStatusInterceptor({webex: this});\n }\n\n /**\n * Check whether a URI is a Locus /hashtree or /sync endpoint.\n * @param {string} uri\n * @returns {boolean}\n */\n private static isLocusHashtreeOrSync(uri: string): boolean {\n try {\n const {pathname} = new URL(uri);\n\n return (\n pathname.includes('/locus/') &&\n (pathname.endsWith('/hashtree') || pathname.endsWith('/sync'))\n );\n } catch {\n return false;\n }\n }\n\n onResponseError(options, reason) {\n // Don't retry /hashtree or /sync calls for 429 or any 5xx — during a sync storm retries\n // make things worse. The normal sync timers will handle recovery for these endpoints.\n if (\n (reason.statusCode === 429 || reason.statusCode >= 500) &&\n LocusRetryStatusInterceptor.isLocusHashtreeOrSync(options.uri)\n ) {\n return Promise.reject(reason);\n }\n\n if ((reason.statusCode === 503 || reason.statusCode === 429) && options.uri.includes('locus')) {\n const hasRetriedLocusRequest = rateLimitExpiryTime.get(this);\n const retryAfterTime = options.headers['retry-after'] || 2000;\n\n if (hasRetriedLocusRequest) {\n rateLimitExpiryTime.set(this, false);\n\n return Promise.reject(options);\n }\n rateLimitExpiryTime.set(this, true);\n\n return this.handleRetryRequestLocusServiceError(options, retryAfterTime);\n }\n\n return Promise.reject(reason);\n }\n\n /**\n * Handle retries for locus service unavailable errors\n * @param {Object} options associated with the request\n * @param {number} retryAfterTime retry after time in milliseconds\n * @returns {Promise}\n */\n handleRetryRequestLocusServiceError(options, retryAfterTime) {\n return new Promise((resolve, reject) => {\n const timeout = setTimeout(() => {\n clearTimeout(timeout);\n\n // @ts-ignore\n this.webex\n .request({\n method: options.method,\n uri: options.uri,\n body: options.body,\n })\n .then(resolve)\n .catch(reject);\n }, retryAfterTime);\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAIA,IAAAA,SAAA,GAAAC,OAAA;AAA6C,SAAAC,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,CAAAC,OAAA,EAAAH,CAAA,OAAAI,2BAAA,CAAAD,OAAA,EAAAJ,CAAA,EAAAM,yBAAA,KAAAC,kBAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,CAAAC,OAAA,EAAAJ,CAAA,EAAAQ,WAAA,IAAAP,CAAA,CAAAQ,KAAA,CAAAT,CAAA,EAAAE,CAAA;AAAA,SAAAI,0BAAA,cAAAN,CAAA,IAAAU,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAN,kBAAA,CAAAG,OAAA,iCAAAV,CAAA,aAAAM,yBAAA,YAAAA,0BAAA,aAAAN,CAAA,UAJ7C;AACA;AACA;AAIA,IAAMc,mBAAmB,GAAG,IAAAC,QAAA,CAAAX,OAAA,CAAY,CAAC;AACzC;AACA;AACA;AAFA,IAGqBY,2BAA2B,GAAAC,OAAA,CAAAb,OAAA,0BAAA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10,7 @@ var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/pr
|
|
|
10
10
|
var _webexCore = require("@webex/webex-core");
|
|
11
11
|
var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
|
|
12
12
|
var _constants = require("../constants");
|
|
13
|
+
var _util = _interopRequireDefault(require("../meeting/util"));
|
|
13
14
|
var _collection = _interopRequireDefault(require("./collection"));
|
|
14
15
|
/*!
|
|
15
16
|
* Copyright (c) 2015-2023 Cisco Systems, Inc. See LICENSE file.
|
|
@@ -212,6 +213,7 @@ var SimultaneousInterpretation = _webexCore.WebexPlugin.extend({
|
|
|
212
213
|
* @returns {Promise}
|
|
213
214
|
*/
|
|
214
215
|
updateInterpreters: function updateInterpreters(interpreters) {
|
|
216
|
+
var meeting = this.webex.meetings.meetingCollection.getByKey('locusUrl', this.locusUrl);
|
|
215
217
|
return this.request({
|
|
216
218
|
method: _constants.HTTP_VERBS.PATCH,
|
|
217
219
|
uri: "".concat(this.locusUrl, "/controls"),
|
|
@@ -220,6 +222,9 @@ var SimultaneousInterpretation = _webexCore.WebexPlugin.extend({
|
|
|
220
222
|
interpreters: interpreters
|
|
221
223
|
}
|
|
222
224
|
}
|
|
225
|
+
}).then(function (response) {
|
|
226
|
+
_util.default.updateLocusFromApiResponse(meeting, response);
|
|
227
|
+
return response;
|
|
223
228
|
}).catch(function (error) {
|
|
224
229
|
_loggerProxy.default.logger.error('Meeting:interpretation#updateInterpreters failed', error);
|
|
225
230
|
throw error;
|
|
@@ -236,6 +241,7 @@ var SimultaneousInterpretation = _webexCore.WebexPlugin.extend({
|
|
|
236
241
|
if (!this.selfParticipantId) {
|
|
237
242
|
return _promise.default.reject(new Error('Missing self participant id'));
|
|
238
243
|
}
|
|
244
|
+
var meeting = this.webex.meetings.meetingCollection.getByKey('locusUrl', this.locusUrl);
|
|
239
245
|
return this.request({
|
|
240
246
|
method: _constants.HTTP_VERBS.PATCH,
|
|
241
247
|
uri: "".concat(this.locusUrl, "/participant/").concat(this.selfParticipantId, "/controls"),
|
|
@@ -247,6 +253,9 @@ var SimultaneousInterpretation = _webexCore.WebexPlugin.extend({
|
|
|
247
253
|
order: this.order
|
|
248
254
|
}
|
|
249
255
|
}
|
|
256
|
+
}).then(function (response) {
|
|
257
|
+
_util.default.updateLocusFromApiResponse(meeting, response);
|
|
258
|
+
return response;
|
|
250
259
|
}).catch(function (error) {
|
|
251
260
|
_loggerProxy.default.logger.error('Meeting:interpretation#changeDirection failed', error);
|
|
252
261
|
throw error;
|
|
@@ -372,7 +381,7 @@ var SimultaneousInterpretation = _webexCore.WebexPlugin.extend({
|
|
|
372
381
|
throw error;
|
|
373
382
|
});
|
|
374
383
|
},
|
|
375
|
-
version: "3.12.0-next.
|
|
384
|
+
version: "3.12.0-next.71"
|
|
376
385
|
});
|
|
377
386
|
var _default = exports.default = SimultaneousInterpretation;
|
|
378
387
|
//# sourceMappingURL=index.js.map
|