Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions sdk/notificationhubs/notification-hubs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,16 @@
"vitest": "catalog:testing"
},
"dependencies": {
"@azure-rest/core-client": "^2.3.3",
"@azure/abort-controller": "^2.1.2",
"@azure/core-auth": "^1.9.0",
"@azure/core-lro": "^3.1.0",
"@azure/core-paging": "^1.6.2",
"@azure/core-rest-pipeline": "^1.19.0",
"@azure/core-tracing": "^1.1.2",
"@azure/core-util": "^1.11.0",
"@azure/core-xml": "^1.4.4",
"@azure/logger": "^1.1.2",
"@azure-rest/core-client": "workspace:^",
"@azure/abort-controller": "workspace:^",
"@azure/core-auth": "workspace:^",
"@azure/core-lro": "workspace:^",
"@azure/core-paging": "workspace:^",
"@azure/core-rest-pipeline": "workspace:^",
"@azure/core-tracing": "workspace:^",
"@azure/core-util": "workspace:^",
"@azure/core-xml": "workspace:^",
"@azure/logger": "workspace:^",
"tslib": "^2.8.1"
Comment on lines +88 to 98
},
"exports": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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="<notificationhubs connection string>" NOTIFICATION_HUB_NAME="<notification hub name>" FCM_REGISTRATION_ID="<fcm registration id>" node createInstallation.fcmLegacy.js
npx cross-env NOTIFICATIONHUBS_CONNECTION_STRING="<notificationhubs connection string>" NOTIFICATION_HUB_NAME="<notification hub name>" FCM_REGISTRATION_ID="<fcm registration id>" node createInstallation.fcmLegacy.js
```

## Next Steps
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 || "<connection string>";
const hubName = process.env.NOTIFICATION_HUB_NAME || "<hub name>";
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 || "<connection string>";
const hubName = process.env.NOTIFICATION_HUB_NAME || "<hub name>";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
"dependencies": {
"@azure/notification-hubs": "latest",
"dotenv": "latest",
"@azure/core-util": "^1.11.0",
"@azure/core-rest-pipeline": "^1.19.0"
"@azure/core-util": "latest",
"@azure/core-rest-pipeline": "latest"
},
"devDependencies": {
"cross-env": "latest"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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="<notificationhubs connection string>" NOTIFICATION_HUB_NAME="<notification hub name>" FCM_REGISTRATION_ID="<fcm registration id>" node dist/createInstallation.fcmLegacy.js
npx cross-env NOTIFICATIONHUBS_CONNECTION_STRING="<notificationhubs connection string>" NOTIFICATION_HUB_NAME="<notification hub name>" FCM_REGISTRATION_ID="<fcm registration id>" node dist/createInstallation.fcmLegacy.js
```

## Next Steps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@
"dependencies": {
"@azure/notification-hubs": "latest",
"dotenv": "latest",
"@azure/core-util": "^1.11.0",
"@azure/core-rest-pipeline": "^1.19.0"
"@azure/core-util": "latest",
"@azure/core-rest-pipeline": "latest"
},
"devDependencies": {
"@types/node": "^20.0.0",
"typescript": "~5.8.2",
"rimraf": "latest"
"cross-env": "latest",
"rimraf": "latest",
"typescript": "~6.0.2"
}
}
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 || "<connection string>";
Expand All @@ -31,7 +31,10 @@ async function main(): Promise<void> {
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}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 || "<connection string>";
Expand All @@ -33,7 +33,10 @@ async function main(): Promise<void> {
type: "ImportCreateRegistrations",
};

const poller = await beginSubmitNotificationHubJob(context, importJob);
const poller = (await beginSubmitNotificationHubJob(
context,
importJob,
)) as unknown as NotificationHubJobPoller;
importJob = await poller.pollUntilDone();
Comment on lines +36 to 40

console.log(`Notification Hub Job status: ${importJob.status}`);
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async function main(): Promise<void> {
registration.tags = [];
}

await registration.tags.push("likes_sports");
registration.tags.push("likes_sports");

const registrationResponse = await updateRegistration(context, registration);

Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Loading