@azure/communication-react 1.10.1-alpha-202311240012 → 1.10.1-alpha-202311260014

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.
Files changed (33) hide show
  1. package/dist/dist-cjs/communication-react/index.js +88 -27
  2. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  3. package/dist/dist-esm/acs-ui-common/src/index.d.ts +1 -0
  4. package/dist/dist-esm/acs-ui-common/src/index.js.map +1 -1
  5. package/dist/dist-esm/acs-ui-common/src/telemetry.d.ts +7 -1
  6. package/dist/dist-esm/acs-ui-common/src/telemetry.js +24 -2
  7. package/dist/dist-esm/acs-ui-common/src/telemetry.js.map +1 -1
  8. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  9. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  10. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.d.ts +7 -0
  11. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js +12 -4
  12. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js.map +1 -1
  13. package/dist/dist-esm/calling-stateful-client/src/index.d.ts +1 -0
  14. package/dist/dist-esm/calling-stateful-client/src/index.js +1 -0
  15. package/dist/dist-esm/calling-stateful-client/src/index.js.map +1 -1
  16. package/dist/dist-esm/chat-stateful-client/src/StatefulChatClient.d.ts +7 -0
  17. package/dist/dist-esm/chat-stateful-client/src/StatefulChatClient.js +10 -2
  18. package/dist/dist-esm/chat-stateful-client/src/StatefulChatClient.js.map +1 -1
  19. package/dist/dist-esm/chat-stateful-client/src/index.d.ts +1 -1
  20. package/dist/dist-esm/chat-stateful-client/src/index.js +1 -1
  21. package/dist/dist-esm/chat-stateful-client/src/index.js.map +1 -1
  22. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +15 -0
  23. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +26 -6
  24. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  25. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.d.ts +1 -1
  26. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js +1 -1
  27. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js.map +1 -1
  28. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +6 -11
  29. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  30. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.d.ts +7 -0
  31. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +13 -5
  32. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
  33. package/package.json +1 -1
@@ -177,7 +177,7 @@ const _isValidIdentifier = (identifier) => {
177
177
  // Copyright (c) Microsoft Corporation.
178
178
  // Licensed under the MIT License.
179
179
  // GENERATED FILE. DO NOT EDIT MANUALLY.
180
- var telemetryVersion = '1.10.1-alpha-202311240012';
180
+ var telemetryVersion = '1.10.1-alpha-202311260014';
181
181
 
182
182
  // Copyright (c) Microsoft Corporation.
183
183
  /**
@@ -192,6 +192,25 @@ const sanitize = (version) => {
192
192
  }
193
193
  return version;
194
194
  };
195
+ /**
196
+ * Takes a telemetry implementation hint and returns the numerical value.
197
+ *
198
+ * @private
199
+ */
200
+ const getTelemetryImplementationHint = (telemetryImplementationHint) => {
201
+ switch (telemetryImplementationHint) {
202
+ case 'Call':
203
+ return 1;
204
+ case 'Chat':
205
+ return 2;
206
+ case 'CallWithChat':
207
+ return 3;
208
+ case 'StatefulComponents':
209
+ return 4;
210
+ default:
211
+ return 0;
212
+ }
213
+ };
195
214
  /**
196
215
  * Application ID to be included in telemetry data from the UI library.
197
216
  * Template: acXYYY/<version>
@@ -207,9 +226,12 @@ const sanitize = (version) => {
207
226
  *
208
227
  * @internal
209
228
  */
210
- const _getApplicationId = () => {
229
+ const _getApplicationId = (telemetryImplementationHint) => {
230
+ const highLevelArtifact = 0;
231
+ const specificImplementation = getTelemetryImplementationHint(telemetryImplementationHint);
232
+ const implementationDetails = 0;
211
233
  const version = telemetryVersion;
212
- return sanitize(`acr/${version}`);
234
+ return sanitize(`acr${highLevelArtifact}${specificImplementation}${implementationDetails}/${version}`);
213
235
  };
214
236
 
215
237
  // Copyright (c) Microsoft Corporation.
@@ -4783,8 +4805,16 @@ class ProxyCallClient {
4783
4805
  * @public
4784
4806
  */
4785
4807
  const createStatefulCallClient = (args, options) => {
4786
- callingStatefulLogger.info(`Creating calling stateful client using library version: ${_getApplicationId()}`);
4787
- return createStatefulCallClientWithDeps(new communicationCalling.CallClient(withTelemetryTag(options === null || options === void 0 ? void 0 : options.callClientOptions)), new CallContext$2(communicationCommon.getIdentifierKind(args.userId), options === null || options === void 0 ? void 0 : options.maxStateChangeListeners,
4808
+ return _createStatefulCallClientInner(args, options);
4809
+ };
4810
+ /**
4811
+ * This inner function is used to allow injection of TelemetryImplementationHint without changing the public API.
4812
+ *
4813
+ * @internal
4814
+ */
4815
+ const _createStatefulCallClientInner = (args, options, telemetryImplementationHint = 'StatefulComponents') => {
4816
+ callingStatefulLogger.info(`Creating calling stateful client using library version: ${_getApplicationId(telemetryImplementationHint)}`);
4817
+ return createStatefulCallClientWithDeps(new communicationCalling.CallClient(withTelemetryTag(telemetryImplementationHint, options === null || options === void 0 ? void 0 : options.callClientOptions)), new CallContext$2(communicationCommon.getIdentifierKind(args.userId), options === null || options === void 0 ? void 0 : options.maxStateChangeListeners,
4788
4818
  /* @conditional-compile-remove(PSTN-calls) */ args.alternateCallerId), new InternalCallContext());
4789
4819
  };
4790
4820
  /**
@@ -4827,10 +4857,10 @@ const createStatefulCallClientWithDeps = (callClient, context, internalContext)
4827
4857
  });
4828
4858
  return new Proxy(callClient, new ProxyCallClient(context, internalContext));
4829
4859
  };
4830
- const withTelemetryTag = (options) => {
4860
+ const withTelemetryTag = (telemetryImplementationHint, options) => {
4831
4861
  var _a, _b;
4832
4862
  const tags = (_b = (_a = options === null || options === void 0 ? void 0 : options.diagnostics) === null || _a === void 0 ? void 0 : _a.tags) !== null && _b !== void 0 ? _b : [];
4833
- tags.push(_getApplicationId());
4863
+ tags.push(_getApplicationId(telemetryImplementationHint));
4834
4864
  return Object.assign(Object.assign({}, options), { diagnostics: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.diagnostics), { tags }) });
4835
4865
  };
4836
4866
 
@@ -21111,8 +21141,16 @@ const proxyChatClient = {
21111
21141
  * @public
21112
21142
  */
21113
21143
  const createStatefulChatClient = (args, options) => {
21114
- chatStatefulLogger.info(`Creating chat stateful client using library version: ${_getApplicationId()}`);
21115
- const tweakedOptions = Object.assign(Object.assign({}, options), { chatClientOptions: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.chatClientOptions), { userAgentOptions: { userAgentPrefix: _getApplicationId() } }) });
21144
+ return _createStatefulChatClientInner(args, options);
21145
+ };
21146
+ /**
21147
+ * This inner function is used to allow injection of TelemetryImplementationHint without changing the public API.
21148
+ *
21149
+ * @internal
21150
+ */
21151
+ const _createStatefulChatClientInner = (args, options, telemetryImplementationHint = 'StatefulComponents') => {
21152
+ chatStatefulLogger.info(`Creating chat stateful client using library version: ${_getApplicationId(telemetryImplementationHint)}`);
21153
+ const tweakedOptions = Object.assign(Object.assign({}, options), { chatClientOptions: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.chatClientOptions), { userAgentOptions: { userAgentPrefix: _getApplicationId(telemetryImplementationHint) } }) });
21116
21154
  return _createStatefulChatClientWithDeps(new communicationChat.ChatClient(args.endpoint, args.credential, tweakedOptions.chatClientOptions), args, tweakedOptions);
21117
21155
  };
21118
21156
  /**
@@ -21968,15 +22006,23 @@ const convertEventType = (type) => {
21968
22006
  * @public
21969
22007
  */
21970
22008
  const createAzureCommunicationChatAdapter = ({ endpoint: endpointUrl, userId, displayName, credential, threadId }) => __awaiter$k(void 0, void 0, void 0, function* () {
22009
+ return _createAzureCommunicationChatAdapterInner(endpointUrl, userId, displayName, credential, threadId);
22010
+ });
22011
+ /**
22012
+ * This inner function is used to allow injection of TelemetryImplementationHint without changing the public API.
22013
+ *
22014
+ * @internal
22015
+ */
22016
+ const _createAzureCommunicationChatAdapterInner = (endpoint, userId, displayName, credential, threadId, telemetryImplementationHint = 'Chat') => __awaiter$k(void 0, void 0, void 0, function* () {
21971
22017
  if (!_isValidIdentifier(userId)) {
21972
22018
  throw new Error('Provided userId is invalid. Please provide valid identifier object.');
21973
22019
  }
21974
- const chatClient = createStatefulChatClient({
22020
+ const chatClient = _createStatefulChatClientInner({
21975
22021
  userId,
21976
22022
  displayName,
21977
- endpoint: endpointUrl,
21978
- credential: credential
21979
- });
22023
+ endpoint,
22024
+ credential
22025
+ }, undefined, telemetryImplementationHint);
21980
22026
  const chatThreadClient = yield chatClient.getChatThreadClient(threadId);
21981
22027
  yield chatClient.startRealtimeNotifications();
21982
22028
  /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
@@ -31317,13 +31363,33 @@ class AzureCommunicationCallAdapter {
31317
31363
  const createAzureCommunicationCallAdapter = ({ userId, displayName, credential, locator,
31318
31364
  /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,
31319
31365
  /* @conditional-compile-remove(video-background-effects) */ options }) => __awaiter$5(void 0, void 0, void 0, function* () {
31366
+ return _createAzureCommunicationCallAdapterInner({
31367
+ userId,
31368
+ displayName,
31369
+ credential,
31370
+ locator,
31371
+ /* @conditional-compile-remove(PSTN-calls) */
31372
+ alternateCallerId,
31373
+ /* @conditional-compile-remove(video-background-effects) */
31374
+ options
31375
+ });
31376
+ });
31377
+ /**
31378
+ * This inner function is used to allow injection of TelemetryImplementationHint without changing the public API.
31379
+ *
31380
+ * @internal
31381
+ */
31382
+ const _createAzureCommunicationCallAdapterInner = ({ userId, displayName, credential, locator,
31383
+ /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,
31384
+ /* @conditional-compile-remove(video-background-effects) */ options, telemetryImplementationHint = 'Call' }) => __awaiter$5(void 0, void 0, void 0, function* () {
31320
31385
  if (!_isValidIdentifier(userId)) {
31321
31386
  throw new Error('Invalid identifier. Please provide valid identifier object.');
31322
31387
  }
31323
- const callClient = createStatefulCallClient({
31388
+ const callClient = _createStatefulCallClientInner({
31324
31389
  userId,
31325
- /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId
31326
- });
31390
+ /* @conditional-compile-remove(PSTN-calls) */
31391
+ alternateCallerId
31392
+ }, undefined, telemetryImplementationHint);
31327
31393
  const callAgent = yield callClient.createCallAgent(credential, {
31328
31394
  displayName
31329
31395
  });
@@ -31336,9 +31402,9 @@ const createAzureCommunicationCallAdapter = ({ userId, displayName, credential,
31336
31402
  * @beta
31337
31403
  */
31338
31404
  const createTeamsCallAdapter = ({ userId, credential, locator, options }) => __awaiter$5(void 0, void 0, void 0, function* () {
31339
- const callClient = createStatefulCallClient({
31405
+ const callClient = _createStatefulCallClientInner({
31340
31406
  userId
31341
- });
31407
+ }, undefined, 'Call');
31342
31408
  const callAgent = yield callClient.createTeamsCallAgent(credential, {
31343
31409
  undefined
31344
31410
  });
@@ -33027,24 +33093,19 @@ const createAzureCommunicationCallWithChatAdapter = ({ userId, displayName, cred
33027
33093
  /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,
33028
33094
  /* @conditional-compile-remove(video-background-effects) */ callAdapterOptions }) => __awaiter$2(void 0, void 0, void 0, function* () {
33029
33095
  const callAdapterLocator = isTeamsMeetingLinkLocator(locator) ? locator : locator.callLocator;
33030
- const createCallAdapterPromise = createAzureCommunicationCallAdapter({
33096
+ const createCallAdapterPromise = _createAzureCommunicationCallAdapterInner({
33031
33097
  userId,
33032
33098
  displayName,
33033
33099
  credential,
33034
33100
  locator: callAdapterLocator,
33035
33101
  /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,
33036
- /* @conditional-compile-remove(video-background-effects) */ options: callAdapterOptions
33102
+ /* @conditional-compile-remove(video-background-effects) */ options: callAdapterOptions,
33103
+ telemetryImplementationHint: 'CallWithChat'
33037
33104
  });
33038
33105
  const threadId = isTeamsMeetingLinkLocator(locator)
33039
33106
  ? getChatThreadFromTeamsLink(locator.meetingLink)
33040
33107
  : locator.chatThreadId;
33041
- const createChatAdapterPromise = createAzureCommunicationChatAdapter({
33042
- endpoint,
33043
- userId,
33044
- displayName,
33045
- credential,
33046
- threadId
33047
- });
33108
+ const createChatAdapterPromise = _createAzureCommunicationChatAdapterInner(endpoint, userId, displayName, credential, threadId, 'CallWithChat');
33048
33109
  const [callAdapter, chatAdapter] = yield Promise.all([createCallAdapterPromise, createChatAdapterPromise]);
33049
33110
  return new AzureCommunicationCallWithChatAdapter(callAdapter, chatAdapter);
33050
33111
  });