diff --git a/sdk/notificationhubs/notification-hubs/samples-dev/exportRegistrationsJob.ts b/sdk/notificationhubs/notification-hubs/samples-dev/exportRegistrationsJob.ts index 2ab45f6d08d4..4790d84a03a6 100644 --- a/sdk/notificationhubs/notification-hubs/samples-dev/exportRegistrationsJob.ts +++ b/sdk/notificationhubs/notification-hubs/samples-dev/exportRegistrationsJob.ts @@ -19,7 +19,7 @@ import { getNotificationHubJob, submitNotificationHubJob, } from "@azure/notification-hubs/api"; -import { NotificationHubJob } from "@azure/notification-hubs/models"; +import type { NotificationHubJob } from "@azure/notification-hubs/models"; import { delay } from "@azure/core-util"; // Define connection string and hub name diff --git a/sdk/notificationhubs/notification-hubs/samples-dev/importRegistrationsJob.ts b/sdk/notificationhubs/notification-hubs/samples-dev/importRegistrationsJob.ts index e34b0879d4d2..dc32ab3d6c2d 100644 --- a/sdk/notificationhubs/notification-hubs/samples-dev/importRegistrationsJob.ts +++ b/sdk/notificationhubs/notification-hubs/samples-dev/importRegistrationsJob.ts @@ -19,7 +19,7 @@ import { getNotificationHubJob, submitNotificationHubJob, } from "@azure/notification-hubs/api"; -import { NotificationHubJob } from "@azure/notification-hubs/models"; +import type { NotificationHubJob } from "@azure/notification-hubs/models"; import { delay } from "@azure/core-util"; // Define connection string and hub name diff --git a/sdk/notificationhubs/notification-hubs/samples-dev/listRegistrationsByChannel.ts b/sdk/notificationhubs/notification-hubs/samples-dev/listRegistrationsByChannel.ts index 65d31ee09c94..9e5cebf57405 100644 --- a/sdk/notificationhubs/notification-hubs/samples-dev/listRegistrationsByChannel.ts +++ b/sdk/notificationhubs/notification-hubs/samples-dev/listRegistrationsByChannel.ts @@ -15,7 +15,7 @@ import "dotenv/config"; import { createClientContext, listRegistrationsByChannel } from "@azure/notification-hubs/api"; -import { AppleRegistrationChannel } from "@azure/notification-hubs/models"; +import type { AppleRegistrationChannel } from "@azure/notification-hubs/models"; // Define connection string and hub name const connectionString = process.env.NOTIFICATIONHUBS_CONNECTION_STRING || ""; diff --git a/sdk/notificationhubs/notification-hubs/samples-dev/sendBroadcastNotification.ts b/sdk/notificationhubs/notification-hubs/samples-dev/sendBroadcastNotification.ts index 8ecab72a6ae3..41012b68d7a3 100644 --- a/sdk/notificationhubs/notification-hubs/samples-dev/sendBroadcastNotification.ts +++ b/sdk/notificationhubs/notification-hubs/samples-dev/sendBroadcastNotification.ts @@ -16,15 +16,15 @@ import "dotenv/config"; import { - NotificationHubsClientContext, + type NotificationHubsClientContext, createClientContext, getNotificationOutcomeDetails, sendBroadcastNotification, } from "@azure/notification-hubs/api"; import { createAppleNotification, - NotificationDetails, - NotificationOutcomeState, + type NotificationDetails, + type NotificationOutcomeState, } from "@azure/notification-hubs/models"; import { delay } from "@azure/core-util"; diff --git a/sdk/notificationhubs/notification-hubs/samples-dev/sendDirectNotification.fcmLegacy.ts b/sdk/notificationhubs/notification-hubs/samples-dev/sendDirectNotification.fcmLegacy.ts index 10ee0f411a91..23c9bc54e28d 100644 --- a/sdk/notificationhubs/notification-hubs/samples-dev/sendDirectNotification.fcmLegacy.ts +++ b/sdk/notificationhubs/notification-hubs/samples-dev/sendDirectNotification.fcmLegacy.ts @@ -16,12 +16,12 @@ import "dotenv/config"; import { - NotificationDetails, - NotificationOutcomeState, + type NotificationDetails, + type NotificationOutcomeState, createFcmLegacyNotification, } from "@azure/notification-hubs/models"; import { - NotificationHubsClientContext, + type NotificationHubsClientContext, createClientContext, getNotificationOutcomeDetails, sendNotification, diff --git a/sdk/notificationhubs/notification-hubs/samples-dev/sendDirectNotification.fcmV1.ts b/sdk/notificationhubs/notification-hubs/samples-dev/sendDirectNotification.fcmV1.ts index 9125a4d5cba4..bd4d8653a3b8 100644 --- a/sdk/notificationhubs/notification-hubs/samples-dev/sendDirectNotification.fcmV1.ts +++ b/sdk/notificationhubs/notification-hubs/samples-dev/sendDirectNotification.fcmV1.ts @@ -16,12 +16,12 @@ import "dotenv/config"; import { - NotificationDetails, - NotificationOutcomeState, + type NotificationDetails, + type NotificationOutcomeState, createFcmV1Notification, } from "@azure/notification-hubs/models"; import { - NotificationHubsClientContext, + type NotificationHubsClientContext, createClientContext, getNotificationOutcomeDetails, sendNotification, diff --git a/sdk/notificationhubs/notification-hubs/samples-dev/sendDirectNotification.ts b/sdk/notificationhubs/notification-hubs/samples-dev/sendDirectNotification.ts index a5d0b797609a..b3b3981db676 100644 --- a/sdk/notificationhubs/notification-hubs/samples-dev/sendDirectNotification.ts +++ b/sdk/notificationhubs/notification-hubs/samples-dev/sendDirectNotification.ts @@ -16,12 +16,12 @@ import "dotenv/config"; import { - NotificationDetails, - NotificationOutcomeState, + type NotificationDetails, + type NotificationOutcomeState, createAppleNotification, } from "@azure/notification-hubs/models"; import { - NotificationHubsClientContext, + type NotificationHubsClientContext, createClientContext, getNotificationOutcomeDetails, sendNotification, diff --git a/sdk/notificationhubs/notification-hubs/samples-dev/sendDirectNotificationBatch.ts b/sdk/notificationhubs/notification-hubs/samples-dev/sendDirectNotificationBatch.ts index 020944de6100..f3b709be5dd1 100644 --- a/sdk/notificationhubs/notification-hubs/samples-dev/sendDirectNotificationBatch.ts +++ b/sdk/notificationhubs/notification-hubs/samples-dev/sendDirectNotificationBatch.ts @@ -16,12 +16,12 @@ import "dotenv/config"; import { - NotificationDetails, - NotificationOutcomeState, + type NotificationDetails, + type NotificationOutcomeState, createAppleNotification, } from "@azure/notification-hubs/models"; import { - NotificationHubsClientContext, + type NotificationHubsClientContext, createClientContext, getNotificationOutcomeDetails, sendNotification, diff --git a/sdk/notificationhubs/notification-hubs/samples-dev/sendTagExpression.ts b/sdk/notificationhubs/notification-hubs/samples-dev/sendTagExpression.ts index 5a3d81e65223..026c1173fc08 100644 --- a/sdk/notificationhubs/notification-hubs/samples-dev/sendTagExpression.ts +++ b/sdk/notificationhubs/notification-hubs/samples-dev/sendTagExpression.ts @@ -16,12 +16,12 @@ import "dotenv/config"; import { - NotificationDetails, - NotificationOutcomeState, + type NotificationDetails, + type NotificationOutcomeState, createAppleNotification, } from "@azure/notification-hubs/models"; import { - NotificationHubsClientContext, + type NotificationHubsClientContext, createClientContext, getNotificationOutcomeDetails, sendNotification, diff --git a/sdk/notificationhubs/notification-hubs/samples-dev/sendTagsList.ts b/sdk/notificationhubs/notification-hubs/samples-dev/sendTagsList.ts index 5ede721d0a61..f108f0edfd00 100644 --- a/sdk/notificationhubs/notification-hubs/samples-dev/sendTagsList.ts +++ b/sdk/notificationhubs/notification-hubs/samples-dev/sendTagsList.ts @@ -16,13 +16,13 @@ import "dotenv/config"; import { - NotificationDetails, - NotificationOutcomeState, + type NotificationDetails, + type NotificationOutcomeState, createAppleNotification, createTagExpression, } from "@azure/notification-hubs/models"; import { - NotificationHubsClientContext, + type NotificationHubsClientContext, createClientContext, getNotificationOutcomeDetails, sendNotification, diff --git a/sdk/notificationhubs/notification-hubs/samples-dev/updateInstallation.ts b/sdk/notificationhubs/notification-hubs/samples-dev/updateInstallation.ts index db5c2a6763c5..72d64b97be5b 100644 --- a/sdk/notificationhubs/notification-hubs/samples-dev/updateInstallation.ts +++ b/sdk/notificationhubs/notification-hubs/samples-dev/updateInstallation.ts @@ -16,7 +16,7 @@ import "dotenv/config"; import { createClientContext, updateInstallation } from "@azure/notification-hubs/api"; -import { JsonPatch } from "@azure/notification-hubs/models"; +import type { JsonPatch } from "@azure/notification-hubs/models"; // Define connection string and hub name const connectionString = process.env.NOTIFICATIONHUBS_CONNECTION_STRING || ""; diff --git a/sdk/notificationhubs/notification-hubs/samples/v2/javascript/README.md b/sdk/notificationhubs/notification-hubs/samples/v2/javascript/README.md index 2dfb8c28fcf9..181d33ab708b 100644 --- a/sdk/notificationhubs/notification-hubs/samples/v2/javascript/README.md +++ b/sdk/notificationhubs/notification-hubs/samples/v2/javascript/README.md @@ -59,10 +59,10 @@ npm install node createInstallation.fcmLegacy.js ``` -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): +Alternatively, run a single sample with the required environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): ```bash -cross-env NOTIFICATIONHUBS_CONNECTION_STRING="" NOTIFICATION_HUB_NAME="" FCM_REGISTRATION_ID="" node createInstallation.fcmLegacy.js +npx cross-env NOTIFICATIONHUBS_CONNECTION_STRING="" NOTIFICATION_HUB_NAME="" FCM_REGISTRATION_ID="" node createInstallation.fcmLegacy.js ``` ## Next Steps diff --git a/sdk/notificationhubs/notification-hubs/samples/v2/javascript/createInstallation.fcmV1.js b/sdk/notificationhubs/notification-hubs/samples/v2/javascript/createInstallation.fcmV1.js index 1d457ac651f2..86db888aaf84 100644 --- a/sdk/notificationhubs/notification-hubs/samples/v2/javascript/createInstallation.fcmV1.js +++ b/sdk/notificationhubs/notification-hubs/samples/v2/javascript/createInstallation.fcmV1.js @@ -1,5 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. + /** * This sample demonstrates how the createOrUpdateInstallation() method can be used to create or overwrite an * installation in place. diff --git a/sdk/notificationhubs/notification-hubs/samples/v2/javascript/exportRegistrationsJob.polling.js b/sdk/notificationhubs/notification-hubs/samples/v2/javascript/exportRegistrationsJob.polling.js index 4635e2666a46..15df6ca8a4a1 100644 --- a/sdk/notificationhubs/notification-hubs/samples/v2/javascript/exportRegistrationsJob.polling.js +++ b/sdk/notificationhubs/notification-hubs/samples/v2/javascript/exportRegistrationsJob.polling.js @@ -17,7 +17,6 @@ const { beginSubmitNotificationHubJob, createClientContext, } = require("@azure/notification-hubs/api"); - // Define connection string and hub name const connectionString = process.env.NOTIFICATIONHUBS_CONNECTION_STRING || ""; const hubName = process.env.NOTIFICATION_HUB_NAME || ""; diff --git a/sdk/notificationhubs/notification-hubs/samples/v2/javascript/importRegistrationsJob.js b/sdk/notificationhubs/notification-hubs/samples/v2/javascript/importRegistrationsJob.js index f4fb8456a878..71aaffe0ac1d 100644 --- a/sdk/notificationhubs/notification-hubs/samples/v2/javascript/importRegistrationsJob.js +++ b/sdk/notificationhubs/notification-hubs/samples/v2/javascript/importRegistrationsJob.js @@ -1,5 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. + /** * This sample demonstrates how the createNotificationJob() method can be used to import registrations * descriptions from an existing set of exports. diff --git a/sdk/notificationhubs/notification-hubs/samples/v2/javascript/importRegistrationsJob.poller.js b/sdk/notificationhubs/notification-hubs/samples/v2/javascript/importRegistrationsJob.poller.js index 472d3ddc82ee..8d5fb4858686 100644 --- a/sdk/notificationhubs/notification-hubs/samples/v2/javascript/importRegistrationsJob.poller.js +++ b/sdk/notificationhubs/notification-hubs/samples/v2/javascript/importRegistrationsJob.poller.js @@ -17,7 +17,6 @@ const { beginSubmitNotificationHubJob, createClientContext, } = require("@azure/notification-hubs/api"); - // Define connection string and hub name const connectionString = process.env.NOTIFICATIONHUBS_CONNECTION_STRING || ""; const hubName = process.env.NOTIFICATION_HUB_NAME || ""; diff --git a/sdk/notificationhubs/notification-hubs/samples/v2/javascript/listRegistrationsByChannel.js b/sdk/notificationhubs/notification-hubs/samples/v2/javascript/listRegistrationsByChannel.js index 0263184c5eca..e6950d5e6949 100644 --- a/sdk/notificationhubs/notification-hubs/samples/v2/javascript/listRegistrationsByChannel.js +++ b/sdk/notificationhubs/notification-hubs/samples/v2/javascript/listRegistrationsByChannel.js @@ -14,7 +14,6 @@ require("dotenv/config"); const { createClientContext, listRegistrationsByChannel } = require("@azure/notification-hubs/api"); - // Define connection string and hub name const connectionString = process.env.NOTIFICATIONHUBS_CONNECTION_STRING || ""; const hubName = process.env.NOTIFICATION_HUB_NAME || ""; diff --git a/sdk/notificationhubs/notification-hubs/samples/v2/javascript/package.json b/sdk/notificationhubs/notification-hubs/samples/v2/javascript/package.json index 983da233a269..0a89637fb3e5 100644 --- a/sdk/notificationhubs/notification-hubs/samples/v2/javascript/package.json +++ b/sdk/notificationhubs/notification-hubs/samples/v2/javascript/package.json @@ -27,5 +27,8 @@ "dotenv": "latest", "@azure/core-util": "^1.11.0", "@azure/core-rest-pipeline": "^1.19.0" + }, + "devDependencies": { + "cross-env": "latest" } } diff --git a/sdk/notificationhubs/notification-hubs/samples/v2/javascript/updateInstallation.js b/sdk/notificationhubs/notification-hubs/samples/v2/javascript/updateInstallation.js index 2801e1562c54..be13686b5b6f 100644 --- a/sdk/notificationhubs/notification-hubs/samples/v2/javascript/updateInstallation.js +++ b/sdk/notificationhubs/notification-hubs/samples/v2/javascript/updateInstallation.js @@ -15,7 +15,6 @@ require("dotenv/config"); const { createClientContext, updateInstallation } = require("@azure/notification-hubs/api"); - // Define connection string and hub name const connectionString = process.env.NOTIFICATIONHUBS_CONNECTION_STRING || ""; const hubName = process.env.NOTIFICATION_HUB_NAME || ""; diff --git a/sdk/notificationhubs/notification-hubs/samples/v2/javascript/updateRegistration.js b/sdk/notificationhubs/notification-hubs/samples/v2/javascript/updateRegistration.js index 4145a8422417..2a2c0c32870f 100644 --- a/sdk/notificationhubs/notification-hubs/samples/v2/javascript/updateRegistration.js +++ b/sdk/notificationhubs/notification-hubs/samples/v2/javascript/updateRegistration.js @@ -36,7 +36,7 @@ async function main() { registration.tags = []; } - await registration.tags.push("likes_sports"); + registration.tags.push("likes_sports"); const registrationResponse = await updateRegistration(context, registration); diff --git a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/README.md b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/README.md index 1966e36b2d16..4d321ffb8364 100644 --- a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/README.md +++ b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/README.md @@ -71,10 +71,10 @@ npm run build node dist/createInstallation.fcmLegacy.js ``` -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): +Alternatively, run a single sample with the required environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): ```bash -cross-env NOTIFICATIONHUBS_CONNECTION_STRING="" NOTIFICATION_HUB_NAME="" FCM_REGISTRATION_ID="" node dist/createInstallation.fcmLegacy.js +npx cross-env NOTIFICATIONHUBS_CONNECTION_STRING="" NOTIFICATION_HUB_NAME="" FCM_REGISTRATION_ID="" node dist/createInstallation.fcmLegacy.js ``` ## Next Steps diff --git a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/package.json b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/package.json index a76c46ae5197..c8231ade3cf6 100644 --- a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/package.json +++ b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/package.json @@ -34,7 +34,8 @@ }, "devDependencies": { "@types/node": "^20.0.0", - "typescript": "~5.8.2", - "rimraf": "latest" + "cross-env": "latest", + "rimraf": "latest", + "typescript": "~6.0.2" } } diff --git a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/createInstallation.fcmV1.ts b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/createInstallation.fcmV1.ts index 1e436729f890..62a4d232d42b 100644 --- a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/createInstallation.fcmV1.ts +++ b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/createInstallation.fcmV1.ts @@ -1,5 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. + /** * This sample demonstrates how the createOrUpdateInstallation() method can be used to create or overwrite an * installation in place. diff --git a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/exportRegistrationsJob.polling.ts b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/exportRegistrationsJob.polling.ts index a4430fb33367..1ac2e38a9c38 100644 --- a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/exportRegistrationsJob.polling.ts +++ b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/exportRegistrationsJob.polling.ts @@ -14,7 +14,7 @@ import "dotenv/config"; import { beginSubmitNotificationHubJob, createClientContext } from "@azure/notification-hubs/api"; -import { NotificationHubJob } from "@azure/notification-hubs/models"; +import type { NotificationHubJob, NotificationHubJobPoller } from "@azure/notification-hubs/models"; // Define connection string and hub name const connectionString = process.env.NOTIFICATIONHUBS_CONNECTION_STRING || ""; @@ -31,7 +31,10 @@ async function main(): Promise { type: "ExportRegistrations", }; - const poller = await beginSubmitNotificationHubJob(context, exportJob); + const poller = (await beginSubmitNotificationHubJob( + context, + exportJob, + )) as unknown as NotificationHubJobPoller; exportJob = await poller.pollUntilDone(); console.log(`Notification Hub Job status: ${exportJob.status}`); diff --git a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/exportRegistrationsJob.ts b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/exportRegistrationsJob.ts index df8ddf55c028..470dca7c767d 100644 --- a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/exportRegistrationsJob.ts +++ b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/exportRegistrationsJob.ts @@ -18,7 +18,7 @@ import { getNotificationHubJob, submitNotificationHubJob, } from "@azure/notification-hubs/api"; -import { NotificationHubJob } from "@azure/notification-hubs/models"; +import type { NotificationHubJob } from "@azure/notification-hubs/models"; import { delay } from "@azure/core-util"; // Define connection string and hub name diff --git a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/importRegistrationsJob.poller.ts b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/importRegistrationsJob.poller.ts index eb619c71d22c..a5f5e13cdd3d 100644 --- a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/importRegistrationsJob.poller.ts +++ b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/importRegistrationsJob.poller.ts @@ -14,7 +14,7 @@ import "dotenv/config"; import { beginSubmitNotificationHubJob, createClientContext } from "@azure/notification-hubs/api"; -import { NotificationHubJob } from "@azure/notification-hubs/models"; +import type { NotificationHubJob, NotificationHubJobPoller } from "@azure/notification-hubs/models"; // Define connection string and hub name const connectionString = process.env.NOTIFICATIONHUBS_CONNECTION_STRING || ""; @@ -33,7 +33,10 @@ async function main(): Promise { type: "ImportCreateRegistrations", }; - const poller = await beginSubmitNotificationHubJob(context, importJob); + const poller = (await beginSubmitNotificationHubJob( + context, + importJob, + )) as unknown as NotificationHubJobPoller; importJob = await poller.pollUntilDone(); console.log(`Notification Hub Job status: ${importJob.status}`); diff --git a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/importRegistrationsJob.ts b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/importRegistrationsJob.ts index 7ae085a21383..89436a25ec57 100644 --- a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/importRegistrationsJob.ts +++ b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/importRegistrationsJob.ts @@ -1,5 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. + /** * This sample demonstrates how the createNotificationJob() method can be used to import registrations * descriptions from an existing set of exports. @@ -17,7 +18,7 @@ import { getNotificationHubJob, submitNotificationHubJob, } from "@azure/notification-hubs/api"; -import { NotificationHubJob } from "@azure/notification-hubs/models"; +import type { NotificationHubJob } from "@azure/notification-hubs/models"; import { delay } from "@azure/core-util"; // Define connection string and hub name diff --git a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/listRegistrationsByChannel.ts b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/listRegistrationsByChannel.ts index 8cb6ef4194f4..a5c90f69aaf0 100644 --- a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/listRegistrationsByChannel.ts +++ b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/listRegistrationsByChannel.ts @@ -14,7 +14,7 @@ import "dotenv/config"; import { createClientContext, listRegistrationsByChannel } from "@azure/notification-hubs/api"; -import { AppleRegistrationChannel } from "@azure/notification-hubs/models"; +import type { AppleRegistrationChannel } from "@azure/notification-hubs/models"; // Define connection string and hub name const connectionString = process.env.NOTIFICATIONHUBS_CONNECTION_STRING || ""; diff --git a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/sendBroadcastNotification.ts b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/sendBroadcastNotification.ts index c0a069523aa7..0d546b7a2835 100644 --- a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/sendBroadcastNotification.ts +++ b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/sendBroadcastNotification.ts @@ -15,15 +15,15 @@ import "dotenv/config"; import { - NotificationHubsClientContext, + type NotificationHubsClientContext, createClientContext, getNotificationOutcomeDetails, sendBroadcastNotification, } from "@azure/notification-hubs/api"; import { createAppleNotification, - NotificationDetails, - NotificationOutcomeState, + type NotificationDetails, + type NotificationOutcomeState, } from "@azure/notification-hubs/models"; import { delay } from "@azure/core-util"; diff --git a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/sendDirectNotification.fcmLegacy.ts b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/sendDirectNotification.fcmLegacy.ts index 9274f9994bd4..3f1d8e8cb8a0 100644 --- a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/sendDirectNotification.fcmLegacy.ts +++ b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/sendDirectNotification.fcmLegacy.ts @@ -15,12 +15,12 @@ import "dotenv/config"; import { - NotificationDetails, - NotificationOutcomeState, + type NotificationDetails, + type NotificationOutcomeState, createFcmLegacyNotification, } from "@azure/notification-hubs/models"; import { - NotificationHubsClientContext, + type NotificationHubsClientContext, createClientContext, getNotificationOutcomeDetails, sendNotification, diff --git a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/sendDirectNotification.fcmV1.ts b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/sendDirectNotification.fcmV1.ts index e1399a9e47a0..799eb6a09dc0 100644 --- a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/sendDirectNotification.fcmV1.ts +++ b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/sendDirectNotification.fcmV1.ts @@ -15,12 +15,12 @@ import "dotenv/config"; import { - NotificationDetails, - NotificationOutcomeState, + type NotificationDetails, + type NotificationOutcomeState, createFcmV1Notification, } from "@azure/notification-hubs/models"; import { - NotificationHubsClientContext, + type NotificationHubsClientContext, createClientContext, getNotificationOutcomeDetails, sendNotification, diff --git a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/sendDirectNotification.ts b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/sendDirectNotification.ts index 7b44e54e1bd8..59833423af48 100644 --- a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/sendDirectNotification.ts +++ b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/sendDirectNotification.ts @@ -15,12 +15,12 @@ import "dotenv/config"; import { - NotificationDetails, - NotificationOutcomeState, + type NotificationDetails, + type NotificationOutcomeState, createAppleNotification, } from "@azure/notification-hubs/models"; import { - NotificationHubsClientContext, + type NotificationHubsClientContext, createClientContext, getNotificationOutcomeDetails, sendNotification, diff --git a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/sendDirectNotificationBatch.ts b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/sendDirectNotificationBatch.ts index 13564a1456c7..1afc3ff2e3d0 100644 --- a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/sendDirectNotificationBatch.ts +++ b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/sendDirectNotificationBatch.ts @@ -15,12 +15,12 @@ import "dotenv/config"; import { - NotificationDetails, - NotificationOutcomeState, + type NotificationDetails, + type NotificationOutcomeState, createAppleNotification, } from "@azure/notification-hubs/models"; import { - NotificationHubsClientContext, + type NotificationHubsClientContext, createClientContext, getNotificationOutcomeDetails, sendNotification, diff --git a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/sendTagExpression.ts b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/sendTagExpression.ts index 62109407bab8..bdf041461e2c 100644 --- a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/sendTagExpression.ts +++ b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/sendTagExpression.ts @@ -15,12 +15,12 @@ import "dotenv/config"; import { - NotificationDetails, - NotificationOutcomeState, + type NotificationDetails, + type NotificationOutcomeState, createAppleNotification, } from "@azure/notification-hubs/models"; import { - NotificationHubsClientContext, + type NotificationHubsClientContext, createClientContext, getNotificationOutcomeDetails, sendNotification, diff --git a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/sendTagsList.ts b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/sendTagsList.ts index 5b08cd755fcd..3b2b434cb174 100644 --- a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/sendTagsList.ts +++ b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/sendTagsList.ts @@ -15,13 +15,13 @@ import "dotenv/config"; import { - NotificationDetails, - NotificationOutcomeState, + type NotificationDetails, + type NotificationOutcomeState, createAppleNotification, createTagExpression, } from "@azure/notification-hubs/models"; import { - NotificationHubsClientContext, + type NotificationHubsClientContext, createClientContext, getNotificationOutcomeDetails, sendNotification, diff --git a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/updateInstallation.ts b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/updateInstallation.ts index bd61f9369882..d8979db78cb0 100644 --- a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/updateInstallation.ts +++ b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/updateInstallation.ts @@ -15,7 +15,7 @@ import "dotenv/config"; import { createClientContext, updateInstallation } from "@azure/notification-hubs/api"; -import { JsonPatch } from "@azure/notification-hubs/models"; +import type { JsonPatch } from "@azure/notification-hubs/models"; // Define connection string and hub name const connectionString = process.env.NOTIFICATIONHUBS_CONNECTION_STRING || ""; diff --git a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/updateRegistration.ts b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/updateRegistration.ts index 04ae4989fe18..313cda66af53 100644 --- a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/updateRegistration.ts +++ b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/src/updateRegistration.ts @@ -36,7 +36,7 @@ async function main(): Promise { registration.tags = []; } - await registration.tags.push("likes_sports"); + registration.tags.push("likes_sports"); const registrationResponse = await updateRegistration(context, registration); diff --git a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/tsconfig.json b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/tsconfig.json index 400db87cf648..4f7c3f6e72dc 100644 --- a/sdk/notificationhubs/notification-hubs/samples/v2/typescript/tsconfig.json +++ b/sdk/notificationhubs/notification-hubs/samples/v2/typescript/tsconfig.json @@ -1,18 +1,22 @@ { "compilerOptions": { "target": "ES2023", - "module": "commonjs", - "lib": [], + "module": "nodenext", + "lib": [ + "ESNext" + ], "importHelpers": true, - "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, - "moduleResolution": "node10", - "esModuleInterop": true, + "types": [ + "node" + ], "outDir": "./dist", - "resolveJsonModule": true + "rootDir": "./src", + "resolveJsonModule": true, + "moduleResolution": "nodenext" }, "include": [ "./src"