Get real-time notification configuration from Chat Gateway 2 (#31492)

### Packages impacted by this PR
@azure/communication-signaling

### Describe the problem that is addressed by this PR
This PR is used for retrieving Trouter Config from Chat GW rather than
hardcode it in signaling client.
There are 2 main changes.
1.Remove the "environment" from SignalingClientOptions as it should be
retrieved from Chat GW;
2.Declare a TrouterConfigClientOptions and pass it to Signaling Client
constructor since this is needed for signaling client to make http call
to Chat Gateway.


### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_

### Checklists
- [Yes] Added impacted package name to the issue description
- [No] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [TODO] Added a changelog (if necessary)
This commit is contained in:
angellan-msft 2024-10-22 11:54:47 -07:00 коммит произвёл GitHub
Родитель d8ca8e2be3
Коммит e605b318e5
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
6 изменённых файлов: 435 добавлений и 429 удалений

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -785,7 +785,7 @@ const REQUIRE_DIRECTORY_ERROR = 'loading a directory of commands is not supporte
let __dirname$1;
try {
__dirname$1 = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('execute.cjs', document.baseURI).href)));
__dirname$1 = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('execute.cjs', document.baseURI).href)));
} catch (e) {
__dirname$1 = process.cwd();
}
@ -885,7 +885,7 @@ const buildGetConfig = (gray, red) => {
// Licensed under the MIT License.
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const sourceDir = node_path.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('execute.cjs', document.baseURI).href))));
const sourceDir = node_path.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('execute.cjs', document.baseURI).href))));
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -65,7 +65,7 @@
"dependencies": {
"@azure/abort-controller": "^2.0.0",
"@azure/communication-common": "^2.3.1",
"@azure/communication-signaling": "1.0.0-beta.28",
"@azure/communication-signaling": "1.0.0-beta.29",
"@azure/core-auth": "^1.3.0",
"@azure/core-client": "^1.9.2",
"@azure/core-paging": "^1.1.1",

Просмотреть файл

@ -12,8 +12,9 @@ export const getSignalingClient = (
options?: SignalingClientOptions,
): SignalingClient | undefined => {
return new CommunicationSignalingClient(credential, logger, {
environment: options?.environment ?? undefined,
resourceEndpoint: options?.resourceEndpoint ?? undefined,
gatewayApiVersion: options?.gatewayApiVersion ?? undefined,
additionalPolicies: options?.additionalPolicies ?? undefined,
userAgentOptions: options?.userAgentOptions ?? undefined,
});
};

Просмотреть файл

@ -4,9 +4,9 @@
import { CommunicationSignalingClient, SignalingClient } from "@azure/communication-signaling";
import { CommunicationTokenCredential } from "@azure/communication-common";
import { AzureLogger } from "@azure/logger";
import { ChatClientOptions } from "@azure/communication-chat";
export interface SignalingClientOptions {
environment?: string;
export interface SignalingClientOptions extends ChatClientOptions {
resourceEndpoint?: string;
gatewayApiVersion?: string;
}
@ -19,9 +19,10 @@ export const getSignalingClient = (
if (typeof navigator !== "undefined" && navigator.product === "ReactNative") {
// In React Native
return new CommunicationSignalingClient(credential, logger, {
environment: options?.environment ?? undefined,
resourceEndpoint: options?.resourceEndpoint ?? undefined,
gatewayApiVersion: options?.gatewayApiVersion ?? undefined,
additionalPolicies: options?.additionalPolicies ?? undefined,
userAgentOptions: options?.userAgentOptions ?? undefined,
});
}