From 815b816abdf724f6d03b10062be18a9a64d2d609 Mon Sep 17 00:00:00 2001 From: Jeff Fisher Date: Tue, 31 Dec 2024 15:22:37 +0000 Subject: [PATCH] Add missing samples --- eng/tools/rush-runner/test/helpers.spec.js | 2 +- .../samples/v1/javascript/namespaceActivities.js | 13 +------------ .../samples/v1/javascript/package.json | 2 +- .../samples/v1/typescript/package.json | 4 ++-- .../v1/typescript/src/namespaceActivities.ts | 14 +++----------- 5 files changed, 8 insertions(+), 27 deletions(-) diff --git a/eng/tools/rush-runner/test/helpers.spec.js b/eng/tools/rush-runner/test/helpers.spec.js index 911222050953..d0f1556bd31d 100644 --- a/eng/tools/rush-runner/test/helpers.spec.js +++ b/eng/tools/rush-runner/test/helpers.spec.js @@ -2,7 +2,7 @@ import { assert, describe, it } from "vitest"; import { getDirectionMappedPackages, reducedDependencyTestMatrix } from "../helpers.js"; describe("getDirectionMappedPackages", () => { - it("should use --to reduced core scope for changed core package", () => { + it.only("should use --to reduced core scope for changed core package", () => { const changed = ["@azure/core-client"]; const mapped = getDirectionMappedPackages(changed, ["unit-test"]); diff --git a/sdk/eventgrid/eventgrid-namespaces/samples/v1/javascript/namespaceActivities.js b/sdk/eventgrid/eventgrid-namespaces/samples/v1/javascript/namespaceActivities.js index 511dc14ae51c..07cda3c782f8 100644 --- a/sdk/eventgrid/eventgrid-namespaces/samples/v1/javascript/namespaceActivities.js +++ b/sdk/eventgrid/eventgrid-namespaces/samples/v1/javascript/namespaceActivities.js @@ -1,17 +1,6 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -/** - * @summary Publish and Receive events to Event Grid. - */ - const { EventGridSenderClient, EventGridReceiverClient } = require("@azure/eventgrid-namespaces"); const { AzureKeyCredential } = require("@azure/core-auth"); - -const dotenv = require("dotenv"); - -// Load the .env file if it exists -dotenv.config(); +require("dotenv/config"); const endpoint = process.env["EVENT_GRID_NAMESPACES_ENDPOINT"] ?? "https://endpoint"; const key = process.env["EVENT_GRID_NAMESPACES_KEY"] ?? "api_key"; diff --git a/sdk/eventgrid/eventgrid-namespaces/samples/v1/javascript/package.json b/sdk/eventgrid/eventgrid-namespaces/samples/v1/javascript/package.json index 289113b03116..edb782f164ad 100644 --- a/sdk/eventgrid/eventgrid-namespaces/samples/v1/javascript/package.json +++ b/sdk/eventgrid/eventgrid-namespaces/samples/v1/javascript/package.json @@ -28,6 +28,6 @@ "dependencies": { "@azure/eventgrid-namespaces": "latest", "dotenv": "latest", - "@azure/core-auth": "^1.7.0" + "@azure/core-auth": "^1.9.0" } } diff --git a/sdk/eventgrid/eventgrid-namespaces/samples/v1/typescript/package.json b/sdk/eventgrid/eventgrid-namespaces/samples/v1/typescript/package.json index 0e9bc138144f..0a7111286ec0 100644 --- a/sdk/eventgrid/eventgrid-namespaces/samples/v1/typescript/package.json +++ b/sdk/eventgrid/eventgrid-namespaces/samples/v1/typescript/package.json @@ -32,11 +32,11 @@ "dependencies": { "@azure/eventgrid-namespaces": "latest", "dotenv": "latest", - "@azure/core-auth": "^1.7.0" + "@azure/core-auth": "^1.9.0" }, "devDependencies": { "@types/node": "^18.0.0", - "typescript": "~5.7.2", + "typescript": "~5.6.2", "rimraf": "latest" } } diff --git a/sdk/eventgrid/eventgrid-namespaces/samples/v1/typescript/src/namespaceActivities.ts b/sdk/eventgrid/eventgrid-namespaces/samples/v1/typescript/src/namespaceActivities.ts index 718c6c717266..ae0aec2ba68c 100644 --- a/sdk/eventgrid/eventgrid-namespaces/samples/v1/typescript/src/namespaceActivities.ts +++ b/sdk/eventgrid/eventgrid-namespaces/samples/v1/typescript/src/namespaceActivities.ts @@ -5,18 +5,10 @@ * @summary Publish and Receive events to Event Grid. */ -import { - EventGridSenderClient, - EventGridReceiverClient, - CloudEvent, - ReceiveResult, -} from "@azure/eventgrid-namespaces"; +import type { CloudEvent, ReceiveResult } from "@azure/eventgrid-namespaces"; +import { EventGridSenderClient, EventGridReceiverClient } from "@azure/eventgrid-namespaces"; import { AzureKeyCredential } from "@azure/core-auth"; - -import * as dotenv from "dotenv"; - -// Load the .env file if it exists -dotenv.config(); +import "dotenv/config"; const endpoint = process.env["EVENT_GRID_NAMESPACES_ENDPOINT"] ?? "https://endpoint"; const key = process.env["EVENT_GRID_NAMESPACES_KEY"] ?? "api_key";