@azure-rest/purview-datamap 1.0.0-alpha.20250220.1 → 1.0.0-alpha.20250224.2

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 CHANGED
@@ -44,6 +44,18 @@ can be used to authenticate the client.
44
44
  Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:
45
45
  AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET
46
46
 
47
+ Use the returned token credential to authenticate the client:
48
+
49
+ ```ts snippet:ReadmeSampleCreateClient_Node
50
+ import PurviewDataMap from "@azure-rest/purview-datamap";
51
+ import { DefaultAzureCredential } from "@azure/identity";
52
+
53
+ const client = PurviewDataMap(
54
+ "https://<my-account-name>.purview.azure.com",
55
+ new DefaultAzureCredential(),
56
+ );
57
+ ```
58
+
47
59
  ## Examples
48
60
 
49
61
  The following sections provide several code snippets covering some of the most common Purview DataMap scenarios, including:
@@ -52,26 +64,48 @@ The following sections provide several code snippets covering some of the most c
52
64
 
53
65
  ### Get All Type Definitions
54
66
 
55
- ```typescript
56
- import PurviewDataMap from "@azure-rest/purview-datamap";
67
+ ```ts snippet:ReadmeSampleGetAllTypeDefinitions
68
+ import PurviewDataMap, { isUnexpected } from "@azure-rest/purview-datamap";
57
69
  import { DefaultAzureCredential } from "@azure/identity";
58
- import { isUnexpected } from "@azure-rest/purview-datamap";
59
- import "dotenv/config";
60
70
 
61
- const endpoint = process.env["ENDPOINT"] || "";
71
+ const client = PurviewDataMap(
72
+ "https://<my-account-name>.purview.azure.com",
73
+ new DefaultAzureCredential(),
74
+ );
62
75
 
63
- async function main() {
64
- console.log("== List entity typedefs sample ==");
65
- const client = PurviewDataMap(endpoint, new DefaultAzureCredential());
76
+ const result = await client.path("/atlas/v2/types/typedefs").get();
66
77
 
67
- const result = await client.path("/atlas/v2/types/typedefs").get();
78
+ if (isUnexpected(result)) {
79
+ throw result.body;
80
+ }
81
+
82
+ for (const entityDef of result.body?.businessMetadataDefs) {
83
+ console.log(`Entity Definition Name: ${entityDef.name}`);
84
+ }
68
85
 
69
- if (isUnexpected(result)) {
70
- throw result;
71
- }
86
+ for (const entityDef of result.body?.classificationDefs) {
87
+ console.log(`Entity Definition Name: ${entityDef.name}`);
72
88
  }
73
89
 
74
- main().catch(console.error);
90
+ for (const entityDef of result.body?.entityDefs) {
91
+ console.log(`Entity Definition Name: ${entityDef.name}`);
92
+ }
93
+
94
+ for (const entityDef of result.body?.enumDefs) {
95
+ console.log(`Entity Definition Name: ${entityDef.name}`);
96
+ }
97
+
98
+ for (const entityDef of result.body?.relationshipDefs) {
99
+ console.log(`Entity Definition Name: ${entityDef.name}`);
100
+ }
101
+
102
+ for (const entityDef of result.body?.structDefs) {
103
+ console.log(`Entity Definition Name: ${entityDef.name}`);
104
+ }
105
+
106
+ for (const entityDef of result.body?.termTemplateDefs) {
107
+ console.log(`Entity Definition Name: ${entityDef.name}`);
108
+ }
75
109
  ```
76
110
 
77
111
  ## Troubleshooting
@@ -80,8 +114,8 @@ main().catch(console.error);
80
114
 
81
115
  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`:
82
116
 
83
- ```ts
84
- const { setLogLevel } = require("@azure/logger");
117
+ ```ts snippet:SetLogLevel
118
+ import { setLogLevel } from "@azure/logger";
85
119
 
86
120
  setLogLevel("info");
87
121
  ```
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.50.0"
8
+ "packageVersion": "7.50.1"
9
9
  }
10
10
  ]
11
11
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@azure-rest/purview-datamap",
3
3
  "sdk-type": "client",
4
4
  "author": "Microsoft Corporation",
5
- "version": "1.0.0-alpha.20250220.1",
5
+ "version": "1.0.0-alpha.20250224.2",
6
6
  "description": "Purview DataMap Service\"",
7
7
  "keywords": [
8
8
  "node",
@@ -53,14 +53,14 @@
53
53
  "unit-test": "npm run unit-test:node && npm run unit-test:browser",
54
54
  "unit-test:browser": "npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser",
55
55
  "unit-test:node": "dev-tool run test:vitest",
56
- "update-snippets": "echo skipped"
56
+ "update-snippets": "dev-tool run update-snippets"
57
57
  },
58
58
  "sideEffects": false,
59
59
  "autoPublish": false,
60
60
  "dependencies": {
61
61
  "@azure-rest/core-client": "^2.3.1",
62
62
  "@azure/core-auth": "^1.9.0",
63
- "@azure/core-rest-pipeline": "^1.18.0",
63
+ "@azure/core-rest-pipeline": "^1.19.0",
64
64
  "@azure/logger": "^1.1.4",
65
65
  "tslib": "^2.8.1"
66
66
  },
@@ -70,16 +70,16 @@
70
70
  "@azure-tools/test-utils-vitest": ">=1.0.0-alpha <1.0.0-alphb",
71
71
  "@azure/dev-tool": ">=1.0.0-alpha <1.0.0-alphb",
72
72
  "@azure/eslint-plugin-azure-sdk": ">=3.0.0-alpha <3.0.0-alphb",
73
- "@azure/identity": "^4.0.1",
73
+ "@azure/identity": "^4.7.0",
74
74
  "@types/node": "^18.0.0",
75
- "@vitest/browser": "^3.0.3",
76
- "@vitest/coverage-istanbul": "^3.0.3",
75
+ "@vitest/browser": "^3.0.6",
76
+ "@vitest/coverage-istanbul": "^3.0.6",
77
77
  "autorest": "latest",
78
78
  "dotenv": "^16.0.0",
79
79
  "eslint": "^9.9.0",
80
- "playwright": "^1.49.0",
80
+ "playwright": "^1.50.1",
81
81
  "typescript": "~5.7.2",
82
- "vitest": "^3.0.3"
82
+ "vitest": "^3.0.6"
83
83
  },
84
84
  "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/purview/purview-datamap-rest/README.md",
85
85
  "//metadata": {
@@ -93,6 +93,7 @@
93
93
  "browser": "./dist/browser/index.js",
94
94
  "type": "module",
95
95
  "tshy": {
96
+ "project": "./tsconfig.src.json",
96
97
  "exports": {
97
98
  "./package.json": "./package.json",
98
99
  ".": "./src/index.ts"
@@ -105,8 +106,7 @@
105
106
  "browser",
106
107
  "react-native"
107
108
  ],
108
- "selfLink": false,
109
- "project": "./tsconfig.src.json"
109
+ "selfLink": false
110
110
  },
111
111
  "exports": {
112
112
  "./package.json": "./package.json",
@@ -128,5 +128,6 @@
128
128
  "default": "./dist/commonjs/index.js"
129
129
  }
130
130
  }
131
- }
131
+ },
132
+ "react-native": "./dist/react-native/index.js"
132
133
  }