@azure/notification-hubs 1.0.0-beta.4 → 1.0.0-beta.6
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 +28 -44
- package/dist/index.cjs +421 -307
- package/dist/index.cjs.map +1 -1
- package/dist-esm/src/client/beginSubmitNotificationHubJob.js +131 -0
- package/dist-esm/src/client/beginSubmitNotificationHubJob.js.map +1 -0
- package/dist-esm/src/client/cancelScheduledNotification.js +1 -1
- package/dist-esm/src/client/cancelScheduledNotification.js.map +1 -1
- package/dist-esm/src/client/createOrUpdateInstallation.js +1 -1
- package/dist-esm/src/client/createOrUpdateInstallation.js.map +1 -1
- package/dist-esm/src/client/createOrUpdateRegistration.js +1 -1
- package/dist-esm/src/client/createOrUpdateRegistration.js.map +1 -1
- package/dist-esm/src/client/createRegistration.js +1 -1
- package/dist-esm/src/client/createRegistration.js.map +1 -1
- package/dist-esm/src/client/createRegistrationId.js +1 -1
- package/dist-esm/src/client/createRegistrationId.js.map +1 -1
- package/dist-esm/src/client/deleteInstallation.js +1 -1
- package/dist-esm/src/client/deleteInstallation.js.map +1 -1
- package/dist-esm/src/client/deleteRegistration.js +1 -1
- package/dist-esm/src/client/deleteRegistration.js.map +1 -1
- package/dist-esm/src/client/getFeedbackContainerUrl.js +1 -1
- package/dist-esm/src/client/getFeedbackContainerUrl.js.map +1 -1
- package/dist-esm/src/client/getInstallation.js +1 -1
- package/dist-esm/src/client/getInstallation.js.map +1 -1
- package/dist-esm/src/client/getNotificationHubJob.js +1 -1
- package/dist-esm/src/client/getNotificationHubJob.js.map +1 -1
- package/dist-esm/src/client/getNotificationOutcomeDetails.js +1 -1
- package/dist-esm/src/client/getNotificationOutcomeDetails.js.map +1 -1
- package/dist-esm/src/client/getRegistration.js +1 -1
- package/dist-esm/src/client/getRegistration.js.map +1 -1
- package/dist-esm/src/client/index.js +2 -2
- package/dist-esm/src/client/index.js.map +1 -1
- package/dist-esm/src/client/listNotificationHubJobs.js +1 -1
- package/dist-esm/src/client/listNotificationHubJobs.js.map +1 -1
- package/dist-esm/src/client/listRegistrations.js +1 -1
- package/dist-esm/src/client/listRegistrations.js.map +1 -1
- package/dist-esm/src/client/listRegistrationsByTag.js +1 -1
- package/dist-esm/src/client/listRegistrationsByTag.js.map +1 -1
- package/dist-esm/src/client/scheduleNotification.js +20 -6
- package/dist-esm/src/client/scheduleNotification.js.map +1 -1
- package/dist-esm/src/client/sendNotification.js +53 -6
- package/dist-esm/src/client/sendNotification.js.map +1 -1
- package/dist-esm/src/client/submitNotificationHubJob.js +1 -1
- package/dist-esm/src/client/submitNotificationHubJob.js.map +1 -1
- package/dist-esm/src/client/updateInstallation.js +1 -1
- package/dist-esm/src/client/updateInstallation.js.map +1 -1
- package/dist-esm/src/client/updateRegistration.js +1 -1
- package/dist-esm/src/client/updateRegistration.js.map +1 -1
- package/dist-esm/src/models/notificationHubJob.js.map +1 -1
- package/dist-esm/src/models/options.js.map +1 -1
- package/dist-esm/src/notificationHubsClient.js +27 -45
- package/dist-esm/src/notificationHubsClient.js.map +1 -1
- package/dist-esm/src/serializers/notificationDetailsSerializer.js +2 -1
- package/dist-esm/src/serializers/notificationDetailsSerializer.js.map +1 -1
- package/dist-esm/src/serializers/notificationHubJobSerializer.js +5 -2
- package/dist-esm/src/serializers/notificationHubJobSerializer.js.map +1 -1
- package/dist-esm/src/serializers/registrationSerializer.js +2 -1
- package/dist-esm/src/serializers/registrationSerializer.js.map +1 -1
- package/dist-esm/src/utils/constants.js +1 -1
- package/dist-esm/src/utils/constants.js.map +1 -1
- package/dist-esm/src/utils/notificationUtils.js +25 -0
- package/dist-esm/src/utils/notificationUtils.js.map +1 -0
- package/dist-esm/src/utils/optionUtils.js +20 -0
- package/dist-esm/src/utils/optionUtils.js.map +1 -0
- package/package.json +6 -5
- package/types/3.1/notification-hubs.d.ts +60 -36
- package/types/latest/notification-hubs.d.ts +64 -36
- package/types/latest/tsdoc-metadata.json +1 -1
- package/types/src/client/beginSubmitNotificationHubJob.d.ts +12 -0
- package/types/src/client/beginSubmitNotificationHubJob.d.ts.map +1 -0
- package/types/src/client/index.d.ts +1 -1
- package/types/src/client/index.d.ts.map +1 -1
- package/types/src/client/scheduleNotification.d.ts +3 -5
- package/types/src/client/scheduleNotification.d.ts.map +1 -1
- package/types/src/client/sendNotification.d.ts +3 -5
- package/types/src/client/sendNotification.d.ts.map +1 -1
- package/types/src/models/notificationHubJob.d.ts +5 -0
- package/types/src/models/notificationHubJob.d.ts.map +1 -1
- package/types/src/models/options.d.ts +36 -2
- package/types/src/models/options.d.ts.map +1 -1
- package/types/src/notificationHubsClient.d.ts +22 -37
- package/types/src/notificationHubsClient.d.ts.map +1 -1
- package/types/src/serializers/notificationHubJobSerializer.d.ts.map +1 -1
- package/types/src/serializers/registrationSerializer.d.ts.map +1 -1
- package/types/src/utils/notificationUtils.d.ts +10 -0
- package/types/src/utils/notificationUtils.d.ts.map +1 -0
- package/types/src/utils/optionUtils.d.ts +14 -0
- package/types/src/utils/optionUtils.d.ts.map +1 -0
- package/dist-esm/src/client/internal/_scheduleNotificationPayload.js +0 -38
- package/dist-esm/src/client/internal/_scheduleNotificationPayload.js.map +0 -1
- package/dist-esm/src/client/internal/_sendNotificationPayload.js +0 -51
- package/dist-esm/src/client/internal/_sendNotificationPayload.js.map +0 -1
- package/dist-esm/src/client/scheduleBroadcastNotification.js +0 -17
- package/dist-esm/src/client/scheduleBroadcastNotification.js.map +0 -1
- package/dist-esm/src/client/sendBroadcastNotification.js +0 -15
- package/dist-esm/src/client/sendBroadcastNotification.js.map +0 -1
- package/dist-esm/src/client/sendDirectNotification.js +0 -15
- package/dist-esm/src/client/sendDirectNotification.js.map +0 -1
- package/types/src/client/internal/_scheduleNotificationPayload.d.ts +0 -9
- package/types/src/client/internal/_scheduleNotificationPayload.d.ts.map +0 -1
- package/types/src/client/internal/_sendNotificationPayload.d.ts +0 -10
- package/types/src/client/internal/_sendNotificationPayload.d.ts.map +0 -1
- package/types/src/client/scheduleBroadcastNotification.d.ts +0 -16
- package/types/src/client/scheduleBroadcastNotification.d.ts.map +0 -1
- package/types/src/client/sendBroadcastNotification.d.ts +0 -14
- package/types/src/client/sendBroadcastNotification.d.ts.map +0 -1
- package/types/src/client/sendDirectNotification.d.ts +0 -15
- package/types/src/client/sendDirectNotification.d.ts.map +0 -1
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT license.
|
|
3
|
-
import { createRequest, parseNotificationSendResponse, sendRequest } from "./_client.js";
|
|
4
|
-
import { tracingClient } from "../../utils/tracing.js";
|
|
5
|
-
/**
|
|
6
|
-
* @internal
|
|
7
|
-
*/
|
|
8
|
-
export function sendNotificationPayload(context, notification, method, pushHandle, tags, options = {}) {
|
|
9
|
-
return tracingClient.withSpan(`NotificationHubsClientContext-${method}`, options, async (updatedOptions) => {
|
|
10
|
-
const endpoint = context.requestUrl();
|
|
11
|
-
endpoint.pathname += "/messages/";
|
|
12
|
-
if (options.enableTestSend) {
|
|
13
|
-
endpoint.searchParams.append("test", "true");
|
|
14
|
-
}
|
|
15
|
-
const headers = await context.createHeaders(method);
|
|
16
|
-
if (notification.headers) {
|
|
17
|
-
for (const headerName of Object.keys(notification.headers)) {
|
|
18
|
-
headers.set(headerName, notification.headers[headerName]);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
if (pushHandle) {
|
|
22
|
-
endpoint.searchParams.append("direct", "true");
|
|
23
|
-
if (notification.platform === "browser") {
|
|
24
|
-
const browserHandle = pushHandle;
|
|
25
|
-
headers.set("ServiceBusNotification-DeviceHandle", browserHandle.endpoint);
|
|
26
|
-
headers.set("Auth", browserHandle.auth);
|
|
27
|
-
headers.set("P256DH", browserHandle.p256dh);
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
headers.set("ServiceBusNotification-DeviceHandle", pushHandle);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
headers.set("Content-Type", notification.contentType);
|
|
34
|
-
headers.set("ServiceBusNotification-Format", notification.platform);
|
|
35
|
-
if (tags) {
|
|
36
|
-
let tagExpression = null;
|
|
37
|
-
if (Array.isArray(tags)) {
|
|
38
|
-
tagExpression = tags.join("||");
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
tagExpression = tags;
|
|
42
|
-
}
|
|
43
|
-
headers.set("ServiceBusNotification-Tags", tagExpression);
|
|
44
|
-
}
|
|
45
|
-
const request = createRequest(endpoint, "POST", headers, updatedOptions);
|
|
46
|
-
request.body = notification.body;
|
|
47
|
-
const response = await sendRequest(context, request, 201);
|
|
48
|
-
return parseNotificationSendResponse(response);
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
//# sourceMappingURL=_sendNotificationPayload.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_sendNotificationPayload.js","sourceRoot":"","sources":["../../../../src/client/internal/_sendNotificationPayload.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,aAAa,EAAE,6BAA6B,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAKzF,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD;;GAEG;AACH,MAAM,UAAU,uBAAuB,CACrC,OAAsC,EACtC,YAA0B,EAC1B,MAAc,EACd,UAAuB,EACvB,IAAwB,EACxB,UAAgC,EAAE;IAElC,OAAO,aAAa,CAAC,QAAQ,CAC3B,iCAAiC,MAAM,EAAE,EACzC,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;QACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACtC,QAAQ,CAAC,QAAQ,IAAI,YAAY,CAAC;QAElC,IAAI,OAAO,CAAC,cAAc,EAAE;YAC1B,QAAQ,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;SAC9C;QAED,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QACpD,IAAI,YAAY,CAAC,OAAO,EAAE;YACxB,KAAK,MAAM,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE;gBAC1D,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;aAC3D;SACF;QAED,IAAI,UAAU,EAAE;YACd,QAAQ,CAAC,YAAY,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YAE/C,IAAI,YAAY,CAAC,QAAQ,KAAK,SAAS,EAAE;gBACvC,MAAM,aAAa,GAAG,UAAgC,CAAC;gBACvD,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;gBAC3E,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;gBACxC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;aAC7C;iBAAM;gBACL,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,UAAoB,CAAC,CAAC;aAC1E;SACF;QAED,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;QACtD,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;QAEpE,IAAI,IAAI,EAAE;YACR,IAAI,aAAa,GAAG,IAAI,CAAC;YACzB,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;gBACvB,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACjC;iBAAM;gBACL,aAAa,GAAG,IAAI,CAAC;aACtB;YACD,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,aAAa,CAAC,CAAC;SAC3D;QAED,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;QACzE,OAAO,CAAC,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC;QAEjC,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QAE1D,OAAO,6BAA6B,CAAC,QAAQ,CAAC,CAAC;IACjD,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { BrowserPushChannel, PushHandle } from \"../../models/installation.js\";\nimport { createRequest, parseNotificationSendResponse, sendRequest } from \"./_client.js\";\nimport { Notification } from \"../../models/notification.js\";\nimport { NotificationHubsClientContext } from \"../index.js\";\nimport { NotificationHubsMessageResponse } from \"../../models/notificationDetails.js\";\nimport { SendOperationOptions } from \"../../models/options.js\";\nimport { tracingClient } from \"../../utils/tracing.js\";\n\n/**\n * @internal\n */\nexport function sendNotificationPayload(\n context: NotificationHubsClientContext,\n notification: Notification,\n method: string,\n pushHandle?: PushHandle,\n tags?: string | string[],\n options: SendOperationOptions = {}\n): Promise<NotificationHubsMessageResponse> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext-${method}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/messages/\";\n\n if (options.enableTestSend) {\n endpoint.searchParams.append(\"test\", \"true\");\n }\n\n const headers = await context.createHeaders(method);\n if (notification.headers) {\n for (const headerName of Object.keys(notification.headers)) {\n headers.set(headerName, notification.headers[headerName]);\n }\n }\n\n if (pushHandle) {\n endpoint.searchParams.append(\"direct\", \"true\");\n\n if (notification.platform === \"browser\") {\n const browserHandle = pushHandle as BrowserPushChannel;\n headers.set(\"ServiceBusNotification-DeviceHandle\", browserHandle.endpoint);\n headers.set(\"Auth\", browserHandle.auth);\n headers.set(\"P256DH\", browserHandle.p256dh);\n } else {\n headers.set(\"ServiceBusNotification-DeviceHandle\", pushHandle as string);\n }\n }\n\n headers.set(\"Content-Type\", notification.contentType);\n headers.set(\"ServiceBusNotification-Format\", notification.platform);\n\n if (tags) {\n let tagExpression = null;\n if (Array.isArray(tags)) {\n tagExpression = tags.join(\"||\");\n } else {\n tagExpression = tags;\n }\n headers.set(\"ServiceBusNotification-Tags\", tagExpression);\n }\n\n const request = createRequest(endpoint, \"POST\", headers, updatedOptions);\n request.body = notification.body;\n\n const response = await sendRequest(context, request, 201);\n\n return parseNotificationSendResponse(response);\n }\n );\n}\n"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT license.
|
|
3
|
-
import { scheduleNotificationPayload } from "./internal/_scheduleNotificationPayload.js";
|
|
4
|
-
/**
|
|
5
|
-
* Schedules a push notification to all devices registered on the Notification Hub.
|
|
6
|
-
* NOTE: This is only available in Standard SKU Azure Notification Hubs.
|
|
7
|
-
* @param context - The Notification Hubs client.
|
|
8
|
-
* @param scheduledTime - The Date to send the push notification.
|
|
9
|
-
* @param notification - The notification to send to the matching devices.
|
|
10
|
-
* @param options - Configuration options for the direct send operation which can contain custom headers
|
|
11
|
-
* which may include APNs specific such as apns-topic or for WNS, X-WNS-TYPE.
|
|
12
|
-
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
13
|
-
*/
|
|
14
|
-
export function scheduleBroadcastNotification(context, scheduledTime, notification, options = {}) {
|
|
15
|
-
return scheduleNotificationPayload(context, scheduledTime, undefined, notification, options);
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=scheduleBroadcastNotification.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scheduleBroadcastNotification.js","sourceRoot":"","sources":["../../../src/client/scheduleBroadcastNotification.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAMlC,OAAO,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAC;AAEzF;;;;;;;;;GASG;AACH,MAAM,UAAU,6BAA6B,CAC3C,OAAsC,EACtC,aAAmB,EACnB,YAA0B,EAC1B,UAA4B,EAAE;IAE9B,OAAO,2BAA2B,CAAC,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;AAC/F,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { Notification } from \"../models/notification.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { NotificationHubsMessageResponse } from \"../models/notificationDetails.js\";\nimport { OperationOptions } from \"@azure/core-client\";\nimport { scheduleNotificationPayload } from \"./internal/_scheduleNotificationPayload.js\";\n\n/**\n * Schedules a push notification to all devices registered on the Notification Hub.\n * NOTE: This is only available in Standard SKU Azure Notification Hubs.\n * @param context - The Notification Hubs client.\n * @param scheduledTime - The Date to send the push notification.\n * @param notification - The notification to send to the matching devices.\n * @param options - Configuration options for the direct send operation which can contain custom headers\n * which may include APNs specific such as apns-topic or for WNS, X-WNS-TYPE.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function scheduleBroadcastNotification(\n context: NotificationHubsClientContext,\n scheduledTime: Date,\n notification: Notification,\n options: OperationOptions = {}\n): Promise<NotificationHubsMessageResponse> {\n return scheduleNotificationPayload(context, scheduledTime, undefined, notification, options);\n}\n"]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT license.
|
|
3
|
-
import { sendNotificationPayload } from "./internal/_sendNotificationPayload.js";
|
|
4
|
-
/**
|
|
5
|
-
* Sends push notifications to all devices on the Notification Hub.
|
|
6
|
-
* @param context - The Notification Hubs client.
|
|
7
|
-
* @param notification - The notification to send to all devices.
|
|
8
|
-
* @param options - Configuration options for the direct send operation which can contain custom headers
|
|
9
|
-
* which may include APNs specific such as apns-topic or for WNS, X-WNS-TYPE.
|
|
10
|
-
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
11
|
-
*/
|
|
12
|
-
export function sendBroadcastNotification(context, notification, options = {}) {
|
|
13
|
-
return sendNotificationPayload(context, notification, "sendNotification", undefined, undefined, options);
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=sendBroadcastNotification.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sendBroadcastNotification.js","sourceRoot":"","sources":["../../../src/client/sendBroadcastNotification.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAMlC,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAEjF;;;;;;;GAOG;AACH,MAAM,UAAU,yBAAyB,CACvC,OAAsC,EACtC,YAA0B,EAC1B,UAAgC,EAAE;IAElC,OAAO,uBAAuB,CAC5B,OAAO,EACP,YAAY,EACZ,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,OAAO,CACR,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { Notification } from \"../models/notification.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { NotificationHubsMessageResponse } from \"../models/notificationDetails.js\";\nimport { SendOperationOptions } from \"../models/options.js\";\nimport { sendNotificationPayload } from \"./internal/_sendNotificationPayload.js\";\n\n/**\n * Sends push notifications to all devices on the Notification Hub.\n * @param context - The Notification Hubs client.\n * @param notification - The notification to send to all devices.\n * @param options - Configuration options for the direct send operation which can contain custom headers\n * which may include APNs specific such as apns-topic or for WNS, X-WNS-TYPE.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function sendBroadcastNotification(\n context: NotificationHubsClientContext,\n notification: Notification,\n options: SendOperationOptions = {}\n): Promise<NotificationHubsMessageResponse> {\n return sendNotificationPayload(\n context,\n notification,\n \"sendNotification\",\n undefined,\n undefined,\n options\n );\n}\n"]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT license.
|
|
3
|
-
import { sendNotificationPayload } from "./internal/_sendNotificationPayload.js";
|
|
4
|
-
/**
|
|
5
|
-
* Sends a direct push notification to a device with the given push handle.
|
|
6
|
-
* @param context - The Notification Hubs client.
|
|
7
|
-
* @param pushHandle - The push handle which is the unique identifier for the device.
|
|
8
|
-
* @param notification - The notification to send to the device.
|
|
9
|
-
* @param options - The options for sending a direct notification.
|
|
10
|
-
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
11
|
-
*/
|
|
12
|
-
export function sendDirectNotification(context, pushHandle, notification, options = {}) {
|
|
13
|
-
return sendNotificationPayload(context, notification, "sendDirectNotification", pushHandle, undefined, options);
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=sendDirectNotification.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sendDirectNotification.js","sourceRoot":"","sources":["../../../src/client/sendDirectNotification.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAEjF;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB,CACpC,OAAsC,EACtC,UAAsB,EACtB,YAA0B,EAC1B,UAA4B,EAAE;IAE9B,OAAO,uBAAuB,CAC5B,OAAO,EACP,YAAY,EACZ,wBAAwB,EACxB,UAAU,EACV,SAAS,EACT,OAAO,CACR,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { Notification } from \"../models/notification.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { NotificationHubsMessageResponse } from \"../models/notificationDetails.js\";\nimport { OperationOptions } from \"@azure/core-client\";\nimport { PushHandle } from \"../models/installation.js\";\nimport { sendNotificationPayload } from \"./internal/_sendNotificationPayload.js\";\n\n/**\n * Sends a direct push notification to a device with the given push handle.\n * @param context - The Notification Hubs client.\n * @param pushHandle - The push handle which is the unique identifier for the device.\n * @param notification - The notification to send to the device.\n * @param options - The options for sending a direct notification.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function sendDirectNotification(\n context: NotificationHubsClientContext,\n pushHandle: PushHandle,\n notification: Notification,\n options: OperationOptions = {}\n): Promise<NotificationHubsMessageResponse> {\n return sendNotificationPayload(\n context,\n notification,\n \"sendDirectNotification\",\n pushHandle,\n undefined,\n options\n );\n}\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Notification } from "../../models/notification.js";
|
|
2
|
-
import { NotificationHubsClientContext } from "../index.js";
|
|
3
|
-
import { NotificationHubsMessageResponse } from "../../models/notificationDetails.js";
|
|
4
|
-
import { OperationOptions } from "@azure/core-client";
|
|
5
|
-
/**
|
|
6
|
-
* @internal
|
|
7
|
-
*/
|
|
8
|
-
export declare function scheduleNotificationPayload(context: NotificationHubsClientContext, scheduledTime: Date, tags: string[] | string | undefined, notification: Notification, options?: OperationOptions): Promise<NotificationHubsMessageResponse>;
|
|
9
|
-
//# sourceMappingURL=_scheduleNotificationPayload.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_scheduleNotificationPayload.d.ts","sourceRoot":"","sources":["../../../../src/client/internal/_scheduleNotificationPayload.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,+BAA+B,EAAE,MAAM,qCAAqC,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAKtD;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,6BAA6B,EACtC,aAAa,EAAE,IAAI,EACnB,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,EACnC,YAAY,EAAE,YAAY,EAC1B,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,+BAA+B,CAAC,CAqC1C"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { PushHandle } from "../../models/installation.js";
|
|
2
|
-
import { Notification } from "../../models/notification.js";
|
|
3
|
-
import { NotificationHubsClientContext } from "../index.js";
|
|
4
|
-
import { NotificationHubsMessageResponse } from "../../models/notificationDetails.js";
|
|
5
|
-
import { SendOperationOptions } from "../../models/options.js";
|
|
6
|
-
/**
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export declare function sendNotificationPayload(context: NotificationHubsClientContext, notification: Notification, method: string, pushHandle?: PushHandle, tags?: string | string[], options?: SendOperationOptions): Promise<NotificationHubsMessageResponse>;
|
|
10
|
-
//# sourceMappingURL=_sendNotificationPayload.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_sendNotificationPayload.d.ts","sourceRoot":"","sources":["../../../../src/client/internal/_sendNotificationPayload.ts"],"names":[],"mappings":"AAGA,OAAO,EAAsB,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE9E,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,+BAA+B,EAAE,MAAM,qCAAqC,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAG/D;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,6BAA6B,EACtC,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,MAAM,EACd,UAAU,CAAC,EAAE,UAAU,EACvB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,EACxB,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,+BAA+B,CAAC,CAqD1C"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Notification } from "../models/notification.js";
|
|
2
|
-
import { NotificationHubsClientContext } from "./index.js";
|
|
3
|
-
import { NotificationHubsMessageResponse } from "../models/notificationDetails.js";
|
|
4
|
-
import { OperationOptions } from "@azure/core-client";
|
|
5
|
-
/**
|
|
6
|
-
* Schedules a push notification to all devices registered on the Notification Hub.
|
|
7
|
-
* NOTE: This is only available in Standard SKU Azure Notification Hubs.
|
|
8
|
-
* @param context - The Notification Hubs client.
|
|
9
|
-
* @param scheduledTime - The Date to send the push notification.
|
|
10
|
-
* @param notification - The notification to send to the matching devices.
|
|
11
|
-
* @param options - Configuration options for the direct send operation which can contain custom headers
|
|
12
|
-
* which may include APNs specific such as apns-topic or for WNS, X-WNS-TYPE.
|
|
13
|
-
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
14
|
-
*/
|
|
15
|
-
export declare function scheduleBroadcastNotification(context: NotificationHubsClientContext, scheduledTime: Date, notification: Notification, options?: OperationOptions): Promise<NotificationHubsMessageResponse>;
|
|
16
|
-
//# sourceMappingURL=scheduleBroadcastNotification.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scheduleBroadcastNotification.d.ts","sourceRoot":"","sources":["../../../src/client/scheduleBroadcastNotification.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,+BAA+B,EAAE,MAAM,kCAAkC,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD;;;;;;;;;GASG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,6BAA6B,EACtC,aAAa,EAAE,IAAI,EACnB,YAAY,EAAE,YAAY,EAC1B,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,+BAA+B,CAAC,CAE1C"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Notification } from "../models/notification.js";
|
|
2
|
-
import { NotificationHubsClientContext } from "./index.js";
|
|
3
|
-
import { NotificationHubsMessageResponse } from "../models/notificationDetails.js";
|
|
4
|
-
import { SendOperationOptions } from "../models/options.js";
|
|
5
|
-
/**
|
|
6
|
-
* Sends push notifications to all devices on the Notification Hub.
|
|
7
|
-
* @param context - The Notification Hubs client.
|
|
8
|
-
* @param notification - The notification to send to all devices.
|
|
9
|
-
* @param options - Configuration options for the direct send operation which can contain custom headers
|
|
10
|
-
* which may include APNs specific such as apns-topic or for WNS, X-WNS-TYPE.
|
|
11
|
-
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
12
|
-
*/
|
|
13
|
-
export declare function sendBroadcastNotification(context: NotificationHubsClientContext, notification: Notification, options?: SendOperationOptions): Promise<NotificationHubsMessageResponse>;
|
|
14
|
-
//# sourceMappingURL=sendBroadcastNotification.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sendBroadcastNotification.d.ts","sourceRoot":"","sources":["../../../src/client/sendBroadcastNotification.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,+BAA+B,EAAE,MAAM,kCAAkC,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAG5D;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,6BAA6B,EACtC,YAAY,EAAE,YAAY,EAC1B,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,+BAA+B,CAAC,CAS1C"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Notification } from "../models/notification.js";
|
|
2
|
-
import { NotificationHubsClientContext } from "./index.js";
|
|
3
|
-
import { NotificationHubsMessageResponse } from "../models/notificationDetails.js";
|
|
4
|
-
import { OperationOptions } from "@azure/core-client";
|
|
5
|
-
import { PushHandle } from "../models/installation.js";
|
|
6
|
-
/**
|
|
7
|
-
* Sends a direct push notification to a device with the given push handle.
|
|
8
|
-
* @param context - The Notification Hubs client.
|
|
9
|
-
* @param pushHandle - The push handle which is the unique identifier for the device.
|
|
10
|
-
* @param notification - The notification to send to the device.
|
|
11
|
-
* @param options - The options for sending a direct notification.
|
|
12
|
-
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
13
|
-
*/
|
|
14
|
-
export declare function sendDirectNotification(context: NotificationHubsClientContext, pushHandle: PushHandle, notification: Notification, options?: OperationOptions): Promise<NotificationHubsMessageResponse>;
|
|
15
|
-
//# sourceMappingURL=sendDirectNotification.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sendDirectNotification.d.ts","sourceRoot":"","sources":["../../../src/client/sendDirectNotification.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,+BAA+B,EAAE,MAAM,kCAAkC,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAGvD;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,6BAA6B,EACtC,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,EAC1B,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,+BAA+B,CAAC,CAS1C"}
|