Skip to content

Commit 0a96583

Browse files
authored
feat(internal-pluging-metrics): provide vendorId (#4499)
1 parent a0991f4 commit 0a96583

File tree

6 files changed

+49
-8
lines changed

6 files changed

+49
-8
lines changed

packages/@webex/internal-plugin-metrics/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"dependencies": {
3838
"@webex/common": "workspace:*",
3939
"@webex/common-timers": "workspace:*",
40-
"@webex/event-dictionary-ts": "^1.0.1819",
40+
"@webex/event-dictionary-ts": "^1.0.1930",
4141
"@webex/test-helper-chai": "workspace:*",
4242
"@webex/test-helper-mock-webex": "workspace:*",
4343
"@webex/webex-core": "workspace:*",

packages/@webex/internal-plugin-metrics/src/call-diagnostic/call-diagnostic-metrics.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ type GetOriginOptions = {
7575
browserLaunchMethod?: BrowserLaunchMethodType;
7676
environment?: EnvironmentType;
7777
newEnvironment?: NewEnvironmentType;
78+
vendorId?: string;
7879
};
7980

8081
type GetIdentifiersOptions = {
@@ -297,6 +298,10 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
297298
origin.clientInfo.browserLaunchMethod = options.browserLaunchMethod;
298299
}
299300

301+
if (options?.vendorId) {
302+
origin.clientInfo.vendorId = options.vendorId;
303+
}
304+
300305
return origin;
301306
}
302307

packages/@webex/internal-plugin-metrics/src/metrics.types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ export type SubmitClientEventOptions = {
138138
triggeredTime?: string;
139139
emailInput?: ClientEmailInput;
140140
userNameInput?: ClientUserNameInput;
141+
vendorId?: string;
141142
};
142143

143144
export type SubmitMQEOptions = {

packages/@webex/internal-plugin-metrics/test/unit/spec/call-diagnostic/call-diagnostic-metrics.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,41 @@ describe('internal-plugin-metrics', () => {
264264
});
265265
});
266266

267+
it('should build origin correctly and vendorId can be passed in options', () => {
268+
sinon.stub(CallDiagnosticUtils, 'anonymizeIPAddress').returns('1.1.1.1');
269+
270+
//@ts-ignore
271+
const res = cd.getOrigin(
272+
{
273+
subClientType: 'WEB_APP',
274+
clientType: 'TEAMS_CLIENT',
275+
clientLaunchMethod: 'url-handler',
276+
vendorId: 'GoogleMeet',
277+
},
278+
fakeMeeting.id
279+
);
280+
281+
assert.deepEqual(res, {
282+
clientInfo: {
283+
browser: getBrowserName(),
284+
browserVersion: getBrowserVersion(),
285+
clientType: 'TEAMS_CLIENT',
286+
clientVersion: 'webex-js-sdk/webex-version',
287+
publicNetworkPrefix: '1.1.1.1',
288+
localNetworkPrefix: '1.1.1.1',
289+
os: getOSNameInternal(),
290+
osVersion: getOSVersion() || 'unknown',
291+
subClientType: 'WEB_APP',
292+
clientLaunchMethod: 'url-handler',
293+
vendorId: 'GoogleMeet',
294+
},
295+
environment: 'meeting_evn',
296+
name: 'endpoint',
297+
networkType: 'unknown',
298+
userAgent,
299+
});
300+
});
301+
267302
it('should build origin correctly with browserLaunchMethod', () => {
268303
sinon.stub(CallDiagnosticUtils, 'anonymizeIPAddress').returns('1.1.1.1');
269304

packages/@webex/plugin-meetings/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
},
6262
"dependencies": {
6363
"@webex/common": "workspace:*",
64-
"@webex/event-dictionary-ts": "^1.0.1819",
64+
"@webex/event-dictionary-ts": "^1.0.1930",
6565
"@webex/internal-media-core": "2.18.5",
6666
"@webex/internal-plugin-conversation": "workspace:*",
6767
"@webex/internal-plugin-device": "workspace:*",

yarn.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7982,16 +7982,16 @@ __metadata:
79827982
languageName: unknown
79837983
linkType: soft
79847984

7985-
"@webex/event-dictionary-ts@npm:^1.0.1819":
7986-
version: 1.0.1819
7987-
resolution: "@webex/event-dictionary-ts@npm:1.0.1819"
7985+
"@webex/event-dictionary-ts@npm:^1.0.1930":
7986+
version: 1.0.1930
7987+
resolution: "@webex/event-dictionary-ts@npm:1.0.1930"
79887988
dependencies:
79897989
amf-client-js: ^5.2.6
79907990
json-schema-to-typescript: ^12.0.0
79917991
minimist: ^1.2.8
79927992
shelljs: ^0.8.5
79937993
webapi-parser: ^0.5.0
7994-
checksum: 89ecf888b1caec2c5965f8e66ea00996b52b3b8ab51ca1cf6c81da789fdb0c7e68d3e9beea3026a4e1307b8bec866343c63413d24574037bccdf4c6204da50fe
7994+
checksum: fd5535f81d4a298cdea3ee77a7c083daf94584cb87b4d436502e6789bfbd83be82a831138712ba3beb4d2ea76d3d4ca745e6b9612f7f5e64c93d838a10ab4784
79957995
languageName: node
79967996
linkType: hard
79977997

@@ -8513,7 +8513,7 @@ __metadata:
85138513
"@webex/common": "workspace:*"
85148514
"@webex/common-timers": "workspace:*"
85158515
"@webex/eslint-config-legacy": "workspace:*"
8516-
"@webex/event-dictionary-ts": ^1.0.1819
8516+
"@webex/event-dictionary-ts": ^1.0.1930
85178517
"@webex/jest-config-legacy": "workspace:*"
85188518
"@webex/legacy-tools": "workspace:*"
85198519
"@webex/test-helper-chai": "workspace:*"
@@ -9149,7 +9149,7 @@ __metadata:
91499149
"@webex/babel-config-legacy": "workspace:*"
91509150
"@webex/common": "workspace:*"
91519151
"@webex/eslint-config-legacy": "workspace:*"
9152-
"@webex/event-dictionary-ts": ^1.0.1819
9152+
"@webex/event-dictionary-ts": ^1.0.1930
91539153
"@webex/internal-media-core": 2.18.5
91549154
"@webex/internal-plugin-conversation": "workspace:*"
91559155
"@webex/internal-plugin-device": "workspace:*"

0 commit comments

Comments
 (0)