Skip to content

Commit fd13979

Browse files
committed
[testing] publish some samples
1 parent 0f5bbfb commit fd13979

File tree

11 files changed

+34
-57
lines changed

11 files changed

+34
-57
lines changed

sdk/schemaregistry/schema-registry/samples/v1-beta/javascript/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Take a look at our [API Documentation][apiref] for more information about the AP
4949

5050
[getschemabyversion]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/schemaregistry/schema-registry/samples/v1-beta/javascript/getSchemaByVersion.js
5151
[schemaregistrysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/schemaregistry/schema-registry/samples/v1-beta/javascript/schemaRegistrySample.js
52-
[apiref]: https://learn.microsoft.com/javascript/api/@azure/schema-registry
52+
[apiref]: https://learn.microsoft.com/javascript/api/@azure/schema-registry?view=azure-node-preview
5353
[freesub]: https://azure.microsoft.com/free/
5454
[createinstance_azureschemaregistryresource]: https://aka.ms/schemaregistry
5555
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/schemaregistry/schema-registry/README.md

sdk/schemaregistry/schema-registry/samples/v1-beta/javascript/getSchemaByVersion.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77

88
const { DefaultAzureCredential } = require("@azure/identity");
99
const { SchemaRegistryClient, KnownSchemaFormats } = require("@azure/schema-registry");
10-
11-
// Load the .env file if it exists
12-
require("dotenv").config();
10+
require("dotenv/config");
1311

1412
// Set these environment variables or edit the following values
1513
const fullyQualifiedNamespace =
@@ -50,7 +48,7 @@ async function main() {
5048
// Register a schema and get back its ID and version.
5149
const { id, version } = await client.registerSchema(schemaDescription);
5250
console.log(
53-
`Registered schema with the following properties:\n- ID=${id}\n- Version: ${version}`
51+
`Registered schema with the following properties:\n- ID=${id}\n- Version: ${version}`,
5452
);
5553

5654
// Get definition of existing schema by its version

sdk/schemaregistry/schema-registry/samples/v1-beta/javascript/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
"dependencies": {
2626
"@azure/schema-registry": "next",
2727
"dotenv": "latest",
28-
"@azure/identity": "^4.2.1"
28+
"@azure/identity": "^4.11.1"
29+
},
30+
"devDependencies": {
31+
"cross-env": "latest"
2932
}
3033
}

sdk/schemaregistry/schema-registry/samples/v1-beta/javascript/sample.env

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,3 @@ SCHEMAREGISTRY_AVRO_FULLY_QUALIFIED_NAMESPACE=<Fully qualified namespace for an
22
SCHEMAREGISTRY_JSON_FULLY_QUALIFIED_NAMESPACE=<Fully qualified namespace for a JSON schema group>
33
SCHEMAREGISTRY_CUSTOM_FULLY_QUALIFIED_NAMESPACE=<Fully qualified namespace for a custom schema group>
44
SCHEMA_REGISTRY_GROUP=<Group name for schemas in registry>
5-
6-
# Used to authenticate using Azure AD as a service principal for role-based authentication
7-
# in the tokenAuth sample.
8-
#
9-
# See the documentation for `EnvironmentCredential` at the following link:
10-
# https://learn.microsoft.com/javascript/api/@azure/identity/environmentcredential
11-
AZURE_TENANT_ID=<AD tenant id or name>
12-
AZURE_CLIENT_ID=<ID of the user/service principal to authenticate as>
13-
AZURE_CLIENT_SECRET=<client secret used to authenticate to Azure AD>

sdk/schemaregistry/schema-registry/samples/v1-beta/javascript/schemaRegistrySample.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77

88
const { DefaultAzureCredential } = require("@azure/identity");
99
const { SchemaRegistryClient, KnownSchemaFormats } = require("@azure/schema-registry");
10-
11-
// Load the .env file if it exists
12-
require("dotenv").config();
10+
require("dotenv/config");
1311

1412
// Set these environment variables or edit the following values
1513
const fullyQualifiedNamespace =
@@ -50,7 +48,7 @@ async function main() {
5048
// Register a schema and get back its ID.
5149
const { id, version } = await client.registerSchema(schemaDescription);
5250
console.log(
53-
`Registered schema with the following properties:\n- ID=${id}\n- Version: ${version}`
51+
`Registered schema with the following properties:\n- ID=${id}\n- Version: ${version}`,
5452
);
5553

5654
// Get definition of existing schema by its ID

sdk/schemaregistry/schema-registry/samples/v1-beta/typescript/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Take a look at our [API Documentation][apiref] for more information about the AP
6161

6262
[getschemabyversion]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/schemaregistry/schema-registry/samples/v1-beta/typescript/src/getSchemaByVersion.ts
6363
[schemaregistrysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/schemaregistry/schema-registry/samples/v1-beta/typescript/src/schemaRegistrySample.ts
64-
[apiref]: https://learn.microsoft.com/javascript/api/@azure/schema-registry
64+
[apiref]: https://learn.microsoft.com/javascript/api/@azure/schema-registry?view=azure-node-preview
6565
[freesub]: https://azure.microsoft.com/free/
6666
[createinstance_azureschemaregistryresource]: https://aka.ms/schemaregistry
6767
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/schemaregistry/schema-registry/README.md

sdk/schemaregistry/schema-registry/samples/v1-beta/typescript/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@
2929
"dependencies": {
3030
"@azure/schema-registry": "next",
3131
"dotenv": "latest",
32-
"@azure/identity": "^4.2.1"
32+
"@azure/identity": "^4.11.1"
3333
},
3434
"devDependencies": {
3535
"@types/node": "^20.0.0",
36-
"typescript": "~5.8.2",
37-
"rimraf": "latest"
36+
"cross-env": "latest",
37+
"rimraf": "latest",
38+
"typescript": "~5.9.3"
3839
}
3940
}

sdk/schemaregistry/schema-registry/samples/v1-beta/typescript/sample.env

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,3 @@ SCHEMAREGISTRY_AVRO_FULLY_QUALIFIED_NAMESPACE=<Fully qualified namespace for an
22
SCHEMAREGISTRY_JSON_FULLY_QUALIFIED_NAMESPACE=<Fully qualified namespace for a JSON schema group>
33
SCHEMAREGISTRY_CUSTOM_FULLY_QUALIFIED_NAMESPACE=<Fully qualified namespace for a custom schema group>
44
SCHEMA_REGISTRY_GROUP=<Group name for schemas in registry>
5-
6-
# Used to authenticate using Azure AD as a service principal for role-based authentication
7-
# in the tokenAuth sample.
8-
#
9-
# See the documentation for `EnvironmentCredential` at the following link:
10-
# https://learn.microsoft.com/javascript/api/@azure/identity/environmentcredential
11-
AZURE_TENANT_ID=<AD tenant id or name>
12-
AZURE_CLIENT_ID=<ID of the user/service principal to authenticate as>
13-
AZURE_CLIENT_SECRET=<client secret used to authenticate to Azure AD>

sdk/schemaregistry/schema-registry/samples/v1-beta/typescript/src/getSchemaByVersion.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,10 @@
66
*/
77

88
import { DefaultAzureCredential } from "@azure/identity";
9-
import {
10-
SchemaRegistryClient,
11-
SchemaDescription,
12-
KnownSchemaFormats,
13-
} from "@azure/schema-registry";
14-
15-
// Load the .env file if it exists
9+
import type { SchemaDescription } from "@azure/schema-registry";
10+
import { SchemaRegistryClient, KnownSchemaFormats } from "@azure/schema-registry";
1611
import "dotenv/config";
12+
1713
// Set these environment variables or edit the following values
1814
const fullyQualifiedNamespace =
1915
process.env["SCHEMAREGISTRY_AVRO_FULLY_QUALIFIED_NAMESPACE"] || "<fullyQualifiedNamespace>";
@@ -53,7 +49,7 @@ export async function main(): Promise<void> {
5349
// Register a schema and get back its ID and version.
5450
const { id, version } = await client.registerSchema(schemaDescription);
5551
console.log(
56-
`Registered schema with the following properties:\n- ID=${id}\n- Version: ${version}`
52+
`Registered schema with the following properties:\n- ID=${id}\n- Version: ${version}`,
5753
);
5854

5955
// Get definition of existing schema by its version

sdk/schemaregistry/schema-registry/samples/v1-beta/typescript/src/schemaRegistrySample.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,10 @@
66
*/
77

88
import { DefaultAzureCredential } from "@azure/identity";
9-
import {
10-
SchemaRegistryClient,
11-
SchemaDescription,
12-
KnownSchemaFormats,
13-
} from "@azure/schema-registry";
14-
15-
// Load the .env file if it exists
9+
import type { SchemaDescription } from "@azure/schema-registry";
10+
import { SchemaRegistryClient, KnownSchemaFormats } from "@azure/schema-registry";
1611
import "dotenv/config";
12+
1713
// Set these environment variables or edit the following values
1814
const fullyQualifiedNamespace =
1915
process.env["SCHEMAREGISTRY_AVRO_FULLY_QUALIFIED_NAMESPACE"] || "<fullyQualifiedNamespace>";
@@ -53,7 +49,7 @@ export async function main(): Promise<void> {
5349
// Register a schema and get back its ID.
5450
const { id, version } = await client.registerSchema(schemaDescription);
5551
console.log(
56-
`Registered schema with the following properties:\n- ID=${id}\n- Version: ${version}`
52+
`Registered schema with the following properties:\n- ID=${id}\n- Version: ${version}`,
5753
);
5854

5955
// Get definition of existing schema by its ID

0 commit comments

Comments
 (0)