@azure-tools/communication-alpha-ids 1.0.0-alpha.20250122.7 → 1.0.0-alpha.20250129.1
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/README.md +24 -12
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -35,8 +35,8 @@ Once you have a key, you can authenticate the `AlphaIdsClient` with any of the f
|
|
|
35
35
|
|
|
36
36
|
### Using a connection string
|
|
37
37
|
|
|
38
|
-
```
|
|
39
|
-
|
|
38
|
+
```ts snippet:ReadmeSampleCreateClient_ConnectionString
|
|
39
|
+
import { AlphaIdsClient } from "@azure-tools/communication-alpha-ids";
|
|
40
40
|
|
|
41
41
|
const connectionString = "endpoint=<endpoint>;accessKey=<accessKey>";
|
|
42
42
|
const client = new AlphaIdsClient(connectionString);
|
|
@@ -46,9 +46,9 @@ const client = new AlphaIdsClient(connectionString);
|
|
|
46
46
|
|
|
47
47
|
If you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key and endpoint, you can authenticate with the following code:
|
|
48
48
|
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
```ts snippet:ReadmeSampleCreateClient_AzureKeyCredential
|
|
50
|
+
import { AzureKeyCredential } from "@azure/core-auth";
|
|
51
|
+
import { AlphaIdsClient } from "@azure-tools/communication-alpha-ids";
|
|
52
52
|
|
|
53
53
|
const credential = new AzureKeyCredential("<key-from-resource>");
|
|
54
54
|
const client = new AlphaIdsClient("<endpoint-from-resource>", credential);
|
|
@@ -64,9 +64,9 @@ npm install @azure/identity
|
|
|
64
64
|
|
|
65
65
|
The [`@azure/identity`][azure_identity] package provides a variety of credential types that your application can use to do this. The [README for `@azure/identity`][azure_identity_readme] provides more details and samples to get you started.
|
|
66
66
|
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
```ts snippet:ReadmeSampleCreateClient_ActiveDirectory
|
|
68
|
+
import { DefaultAzureCredential } from "@azure/identity";
|
|
69
|
+
import { AlphaIdsClient } from "@azure-tools/communication-alpha-ids";
|
|
70
70
|
|
|
71
71
|
const credential = new DefaultAzureCredential();
|
|
72
72
|
const client = new AlphaIdsClient("<endpoint-from-resource>", credential);
|
|
@@ -80,22 +80,34 @@ The following sections provide code snippets that cover some of the common tasks
|
|
|
80
80
|
|
|
81
81
|
### Get the current applied configuration
|
|
82
82
|
|
|
83
|
-
Use the `
|
|
83
|
+
Use the `getDynamicAlphaIdConfiguration` method to obtain the current applied configuration for your resource.
|
|
84
84
|
|
|
85
|
-
```
|
|
86
|
-
|
|
85
|
+
```ts snippet:AlphaIdsGetConfiguration
|
|
86
|
+
import { AlphaIdsClient } from "@azure-tools/communication-alpha-ids";
|
|
87
87
|
|
|
88
88
|
const connectionString = "endpoint=<endpoint>;accessKey=<accessKey>";
|
|
89
89
|
const client = new AlphaIdsClient(connectionString);
|
|
90
90
|
|
|
91
91
|
// get the current configuration
|
|
92
|
-
const configuration = await client.
|
|
92
|
+
const configuration = await client.getDynamicAlphaIdConfiguration();
|
|
93
93
|
|
|
94
94
|
console.log(`Usage of Alpha IDs is currently ${configuration.enabled ? "enabled" : "disabled"}`);
|
|
95
95
|
```
|
|
96
96
|
|
|
97
97
|
## Troubleshooting
|
|
98
98
|
|
|
99
|
+
### Logging
|
|
100
|
+
|
|
101
|
+
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
|
|
102
|
+
|
|
103
|
+
```ts snippet:SetLogLevel
|
|
104
|
+
import { setLogLevel } from "@azure/logger";
|
|
105
|
+
|
|
106
|
+
setLogLevel("info");
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).
|
|
110
|
+
|
|
99
111
|
## Next steps
|
|
100
112
|
|
|
101
113
|
Please take a look at the samples directory for detailed examples on how to use this library.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure-tools/communication-alpha-ids",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.20250129.1",
|
|
4
4
|
"description": "SDK for Azure Communication Services which facilitates Alpha IDs administration.",
|
|
5
5
|
"sdk-type": "client",
|
|
6
6
|
"main": "./dist/commonjs/index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
|
|
33
33
|
"unit-test:browser": "npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser",
|
|
34
34
|
"unit-test:node": "dev-tool run test:vitest",
|
|
35
|
-
"update-snippets": "
|
|
35
|
+
"update-snippets": "dev-tool run update-snippets"
|
|
36
36
|
},
|
|
37
37
|
"files": [
|
|
38
38
|
"dist/",
|
|
@@ -76,13 +76,13 @@
|
|
|
76
76
|
"@azure/eslint-plugin-azure-sdk": ">=3.0.0-alpha <3.0.0-alphb",
|
|
77
77
|
"@azure/identity": "^4.0.1",
|
|
78
78
|
"@types/node": "^18.0.0",
|
|
79
|
-
"@vitest/browser": "^
|
|
80
|
-
"@vitest/coverage-istanbul": "^
|
|
79
|
+
"@vitest/browser": "^3.0.3",
|
|
80
|
+
"@vitest/coverage-istanbul": "^3.0.3",
|
|
81
81
|
"dotenv": "^16.0.0",
|
|
82
82
|
"eslint": "^9.9.0",
|
|
83
83
|
"playwright": "^1.48.2",
|
|
84
84
|
"typescript": "~5.7.2",
|
|
85
|
-
"vitest": "^
|
|
85
|
+
"vitest": "^3.0.3"
|
|
86
86
|
},
|
|
87
87
|
"//metadata": {
|
|
88
88
|
"constantPaths": [
|