@azure-tools/communication-toll-free-verification 1.0.0-alpha.20250122.7 → 1.0.0-alpha.20250127.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.
Files changed (2) hide show
  1. package/README.md +25 -12
  2. package/package.json +18 -19
package/README.md CHANGED
@@ -35,8 +35,8 @@ Once you have a key, you can authenticate the `TollFreeVerificationClient` with
35
35
 
36
36
  ### Using a connection string
37
37
 
38
- ```javascript
39
- const { TollFreeVerificationClient } = require("@azure-tools/communication-toll-free-verification");
38
+ ```ts snippet:ReadmeSampleCreateClient_ConnectionString
39
+ import { TollFreeVerificationClient } from "@azure-tools/communication-toll-free-verification";
40
40
 
41
41
  const connectionString = "endpoint=<endpoint>;accessKey=<accessKey>";
42
42
  const client = new TollFreeVerificationClient(connectionString);
@@ -46,9 +46,9 @@ const client = new TollFreeVerificationClient(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
- ```javascript
50
- const { AzureKeyCredential } = require("@azure/core-auth");
51
- const { TollFreeVerificationClient } = require("@azure-tools/communication-toll-free-verification");
49
+ ```ts snippet:ReadmeSampleCreateClient_KeyCredential
50
+ import { AzureKeyCredential } from "@azure/core-auth";
51
+ import { TollFreeVerificationClient } from "@azure-tools/communication-toll-free-verification";
52
52
 
53
53
  const credential = new AzureKeyCredential("<key-from-resource>");
54
54
  const client = new TollFreeVerificationClient("<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
- ```javascript
68
- const { DefaultAzureCredential } = require("@azure/identity");
69
- const { TollFreeVerificationClient } = require("@azure-tools/communication-toll-free-verification");
67
+ ```ts snippet:ReadmeSampleCreateClient_TokenCredential
68
+ import { DefaultAzureCredential } from "@azure/identity";
69
+ import { TollFreeVerificationClient } from "@azure-tools/communication-toll-free-verification";
70
70
 
71
71
  const credential = new DefaultAzureCredential();
72
72
  const client = new TollFreeVerificationClient("<endpoint-from-resource>", credential);
@@ -82,11 +82,12 @@ The following sections provide code snippets that cover some of the common tasks
82
82
 
83
83
  Use the `getCampaignBrief` method to obtain the current applied configuration for your resource.
84
84
 
85
- ```javascript
86
- const { TollFreeVerificationClient } = require("@azure-tools/communication-toll-free-verification");
85
+ ```ts snippet:SampleReadmeGetCampaignBrief
86
+ import { DefaultAzureCredential } from "@azure/identity";
87
+ import { TollFreeVerificationClient } from "@azure-tools/communication-toll-free-verification";
87
88
 
88
- const connectionString = "endpoint=<endpoint>;accessKey=<accessKey>";
89
- const client = new TollFreeVerificationClient(connectionString);
89
+ const credential = new DefaultAzureCredential();
90
+ const client = new TollFreeVerificationClient("<endpoint-from-resource>", credential);
90
91
 
91
92
  // get a campaign brief
92
93
  const campaignBrief = await client.getCampaignBrief("63215741-b596-4eb4-a9c0-b2905ce22cb0", "US");
@@ -96,6 +97,18 @@ console.log(campaignBrief);
96
97
 
97
98
  ## Troubleshooting
98
99
 
100
+ ### Logging
101
+
102
+ 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`:
103
+
104
+ ```ts snippet:SetLogLevel
105
+ import { setLogLevel } from "@azure/logger";
106
+
107
+ setLogLevel("info");
108
+ ```
109
+
110
+ 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).
111
+
99
112
  ## Next steps
100
113
 
101
114
  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-toll-free-verification",
3
- "version": "1.0.0-alpha.20250122.7",
3
+ "version": "1.0.0-alpha.20250127.1",
4
4
  "description": "SDK for Azure Communication Services which facilitates Toll Free Verification.",
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": "echo skipped"
35
+ "update-snippets": "dev-tool run update-snippets"
36
36
  },
37
37
  "files": [
38
38
  "dist/",
@@ -57,33 +57,32 @@
57
57
  "sideEffects": false,
58
58
  "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
59
59
  "dependencies": {
60
- "@azure/abort-controller": "^2.0.0",
61
- "@azure/communication-common": "^2.2.0",
62
- "@azure/core-auth": "^1.3.0",
63
- "@azure/core-client": "^1.3.2",
64
- "@azure/core-lro": "^2.2.0",
65
- "@azure/core-paging": "^1.1.1",
66
- "@azure/core-rest-pipeline": "^1.3.2",
67
- "@azure/core-tracing": "^1.0.0",
68
- "@azure/core-util": "^1.6.1",
69
- "@azure/logger": "^1.0.0",
70
- "tslib": "^2.2.0"
60
+ "@azure/abort-controller": "^2.1.2",
61
+ "@azure/communication-common": "^2.3.1",
62
+ "@azure/core-auth": "^1.9.0",
63
+ "@azure/core-client": "^1.9.2",
64
+ "@azure/core-lro": "^2.7.2",
65
+ "@azure/core-paging": "^1.6.2",
66
+ "@azure/core-rest-pipeline": "^1.18.2",
67
+ "@azure/core-tracing": "^1.2.0",
68
+ "@azure/core-util": "^1.11.0",
69
+ "@azure/logger": "^1.1.4",
70
+ "tslib": "^2.8.1"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@azure-tools/test-recorder": ">=4.1.0-alpha <4.1.0-alphb",
74
74
  "@azure-tools/test-utils-vitest": ">=1.0.0-alpha <1.0.0-alphb",
75
75
  "@azure/dev-tool": ">=1.0.0-alpha <1.0.0-alphb",
76
76
  "@azure/eslint-plugin-azure-sdk": ">=3.0.0-alpha <3.0.0-alphb",
77
- "@azure/identity": "^4.0.1",
77
+ "@azure/identity": "^4.5.0",
78
78
  "@types/node": "^18.0.0",
79
- "@vitest/browser": "^2.1.4",
80
- "@vitest/coverage-istanbul": "^2.1.4",
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
- "inherits": "^2.0.3",
84
- "playwright": "^1.48.2",
83
+ "playwright": "^1.49.1",
85
84
  "typescript": "~5.7.2",
86
- "vitest": "^2.1.4"
85
+ "vitest": "^3.0.3"
87
86
  },
88
87
  "//metadata": {
89
88
  "constantPaths": [