@azure/notification-hubs 1.0.0-beta.5 → 1.0.0-beta.7
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 +104 -113
- package/dist/index.cjs +625 -602
- package/dist/index.cjs.map +1 -1
- package/dist-esm/src/api/beginSubmitNotificationHubJob.js +131 -0
- package/dist-esm/src/api/beginSubmitNotificationHubJob.js.map +1 -0
- package/dist-esm/src/{client → api}/cancelScheduledNotification.js +1 -1
- package/dist-esm/src/api/cancelScheduledNotification.js.map +1 -0
- package/dist-esm/src/{client → api}/createOrUpdateInstallation.js +1 -1
- package/dist-esm/src/api/createOrUpdateInstallation.js.map +1 -0
- package/dist-esm/src/{client → api}/createOrUpdateRegistration.js +1 -1
- package/dist-esm/src/api/createOrUpdateRegistration.js.map +1 -0
- package/dist-esm/src/{client → api}/createRegistration.js +1 -1
- package/dist-esm/src/api/createRegistration.js.map +1 -0
- package/dist-esm/src/{client → api}/createRegistrationId.js +1 -1
- package/dist-esm/src/api/createRegistrationId.js.map +1 -0
- package/dist-esm/src/{client → api}/deleteInstallation.js +1 -1
- package/dist-esm/src/api/deleteInstallation.js.map +1 -0
- package/dist-esm/src/{client → api}/deleteRegistration.js +1 -1
- package/dist-esm/src/api/deleteRegistration.js.map +1 -0
- package/dist-esm/src/{client → api}/getFeedbackContainerUrl.js +1 -1
- package/dist-esm/src/api/getFeedbackContainerUrl.js.map +1 -0
- package/dist-esm/src/{client → api}/getInstallation.js +1 -1
- package/dist-esm/src/api/getInstallation.js.map +1 -0
- package/dist-esm/src/{client → api}/getNotificationHubJob.js +1 -1
- package/dist-esm/src/api/getNotificationHubJob.js.map +1 -0
- package/dist-esm/src/{client → api}/getNotificationOutcomeDetails.js +1 -1
- package/dist-esm/src/api/getNotificationOutcomeDetails.js.map +1 -0
- package/dist-esm/src/{client → api}/getRegistration.js +1 -1
- package/dist-esm/src/api/getRegistration.js.map +1 -0
- package/dist-esm/src/{client → api}/index.js +24 -2
- package/dist-esm/src/api/index.js.map +1 -0
- package/dist-esm/src/{client → api}/internal/_client.js +1 -1
- package/dist-esm/src/api/internal/_client.js.map +1 -0
- package/dist-esm/src/{client → api}/internal/_createOrUpdateRegistrationDescription.js +0 -0
- package/dist-esm/src/api/internal/_createOrUpdateRegistrationDescription.js.map +1 -0
- package/dist-esm/src/{client/listRegistrations.js → api/internal/_listRegistrations.js} +6 -38
- package/dist-esm/src/api/internal/_listRegistrations.js.map +1 -0
- package/dist-esm/src/{client → api}/listNotificationHubJobs.js +1 -1
- package/dist-esm/src/api/listNotificationHubJobs.js.map +1 -0
- package/dist-esm/src/api/listRegistrations.js +35 -0
- package/dist-esm/src/api/listRegistrations.js.map +1 -0
- package/dist-esm/src/api/listRegistrationsByChannel.js +58 -0
- package/dist-esm/src/api/listRegistrationsByChannel.js.map +1 -0
- package/dist-esm/src/{client → api}/listRegistrationsByTag.js +1 -1
- package/dist-esm/src/api/listRegistrationsByTag.js.map +1 -0
- package/dist-esm/src/api/scheduleNotification.js +31 -0
- package/dist-esm/src/api/scheduleNotification.js.map +1 -0
- package/dist-esm/src/api/sendNotification.js +63 -0
- package/dist-esm/src/api/sendNotification.js.map +1 -0
- package/dist-esm/src/{client → api}/submitNotificationHubJob.js +1 -1
- package/dist-esm/src/api/submitNotificationHubJob.js.map +1 -0
- package/dist-esm/src/{client → api}/updateInstallation.js +1 -1
- package/dist-esm/src/api/updateInstallation.js.map +1 -0
- package/dist-esm/src/{client → api}/updateRegistration.js +1 -1
- package/dist-esm/src/api/updateRegistration.js.map +1 -0
- package/dist-esm/src/index.js +3 -2
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/models/index.js +12 -0
- package/dist-esm/src/models/index.js.map +1 -0
- package/dist-esm/src/models/installation.js.map +1 -1
- package/dist-esm/src/models/notification.js.map +1 -1
- package/dist-esm/src/models/notificationBodyBuilder.js +48 -0
- package/dist-esm/src/models/notificationBodyBuilder.js.map +1 -0
- package/dist-esm/src/models/notificationDetails.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/models/registration.js +12 -12
- package/dist-esm/src/models/registration.js.map +1 -1
- package/dist-esm/src/models/tagExpressionBuilder.js +11 -0
- package/dist-esm/src/models/tagExpressionBuilder.js.map +1 -0
- package/dist-esm/src/notificationHubsClient.js +49 -68
- 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 +3 -1
- package/dist-esm/src/serializers/notificationHubJobSerializer.js.map +1 -1
- package/dist-esm/src/serializers/notificationOutcomeSerializer.js +2 -2
- package/dist-esm/src/serializers/notificationOutcomeSerializer.js.map +1 -1
- package/dist-esm/src/serializers/registrationSerializer.js +16 -16
- 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 +19 -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 +14 -17
- package/types/3.1/notification-hubs.d.ts +468 -281
- package/types/latest/notification-hubs.d.ts +500 -286
- package/types/latest/tsdoc-metadata.json +1 -1
- package/types/src/api/beginSubmitNotificationHubJob.d.ts +12 -0
- package/types/src/api/beginSubmitNotificationHubJob.d.ts.map +1 -0
- package/types/src/{client → api}/cancelScheduledNotification.d.ts +0 -0
- package/types/src/api/cancelScheduledNotification.d.ts.map +1 -0
- package/types/src/{client → api}/createOrUpdateInstallation.d.ts +0 -0
- package/types/src/api/createOrUpdateInstallation.d.ts.map +1 -0
- package/types/src/{client → api}/createOrUpdateRegistration.d.ts +0 -0
- package/types/src/api/createOrUpdateRegistration.d.ts.map +1 -0
- package/types/src/{client → api}/createRegistration.d.ts +0 -0
- package/types/src/api/createRegistration.d.ts.map +1 -0
- package/types/src/{client → api}/createRegistrationId.d.ts +0 -0
- package/types/src/api/createRegistrationId.d.ts.map +1 -0
- package/types/src/{client → api}/deleteInstallation.d.ts +0 -0
- package/types/src/api/deleteInstallation.d.ts.map +1 -0
- package/types/src/{client → api}/deleteRegistration.d.ts +0 -0
- package/types/src/api/deleteRegistration.d.ts.map +1 -0
- package/types/src/{client → api}/getFeedbackContainerUrl.d.ts +0 -0
- package/types/src/api/getFeedbackContainerUrl.d.ts.map +1 -0
- package/types/src/{client → api}/getInstallation.d.ts +0 -0
- package/types/src/api/getInstallation.d.ts.map +1 -0
- package/types/src/{client → api}/getNotificationHubJob.d.ts +0 -0
- package/types/src/api/getNotificationHubJob.d.ts.map +1 -0
- package/types/src/{client → api}/getNotificationOutcomeDetails.d.ts +0 -0
- package/types/src/api/getNotificationOutcomeDetails.d.ts.map +1 -0
- package/types/src/{client → api}/getRegistration.d.ts +0 -0
- package/types/src/api/getRegistration.d.ts.map +1 -0
- package/types/src/{client → api}/index.d.ts +23 -1
- package/types/src/api/index.d.ts.map +1 -0
- package/types/src/{client → api}/internal/_client.d.ts +0 -0
- package/types/src/api/internal/_client.d.ts.map +1 -0
- package/types/src/{client → api}/internal/_createOrUpdateRegistrationDescription.d.ts +0 -0
- package/types/src/api/internal/_createOrUpdateRegistrationDescription.d.ts.map +1 -0
- package/types/src/api/internal/_listRegistrations.d.ts +6 -0
- package/types/src/api/internal/_listRegistrations.d.ts.map +1 -0
- package/types/src/{client → api}/listNotificationHubJobs.d.ts +0 -0
- package/types/src/api/listNotificationHubJobs.d.ts.map +1 -0
- package/types/src/{client → api}/listRegistrations.d.ts +3 -3
- package/types/src/api/listRegistrations.d.ts.map +1 -0
- package/types/src/api/listRegistrationsByChannel.d.ts +13 -0
- package/types/src/api/listRegistrationsByChannel.d.ts.map +1 -0
- package/types/src/{client → api}/listRegistrationsByTag.d.ts +0 -0
- package/types/src/api/listRegistrationsByTag.d.ts.map +1 -0
- package/types/src/{client → api}/scheduleNotification.d.ts +3 -5
- package/types/src/api/scheduleNotification.d.ts.map +1 -0
- package/types/src/{client → api}/sendNotification.d.ts +3 -5
- package/types/src/api/sendNotification.d.ts.map +1 -0
- package/types/src/{client → api}/submitNotificationHubJob.d.ts +0 -0
- package/types/src/api/submitNotificationHubJob.d.ts.map +1 -0
- package/types/src/{client → api}/updateInstallation.d.ts +0 -0
- package/types/src/api/updateInstallation.d.ts.map +1 -0
- package/types/src/{client → api}/updateRegistration.d.ts +0 -0
- package/types/src/api/updateRegistration.d.ts.map +1 -0
- package/types/src/index.d.ts +3 -2
- package/types/src/index.d.ts.map +1 -1
- package/types/src/models/index.d.ts +10 -0
- package/types/src/models/index.d.ts.map +1 -0
- package/types/src/models/installation.d.ts +12 -11
- package/types/src/models/installation.d.ts.map +1 -1
- package/types/src/models/notification.d.ts +10 -18
- package/types/src/models/notification.d.ts.map +1 -1
- package/types/src/models/{notificationBuilder.d.ts → notificationBodyBuilder.d.ts} +62 -64
- package/types/src/models/notificationBodyBuilder.d.ts.map +1 -0
- package/types/src/models/notificationDetails.d.ts +9 -9
- package/types/src/models/notificationDetails.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/models/registration.d.ts +235 -69
- package/types/src/models/registration.d.ts.map +1 -1
- package/types/src/models/tagExpressionBuilder.d.ts +7 -0
- package/types/src/models/tagExpressionBuilder.d.ts.map +1 -0
- package/types/src/notificationHubsClient.d.ts +25 -41
- package/types/src/notificationHubsClient.d.ts.map +1 -1
- package/types/src/serializers/registrationSerializer.d.ts +14 -14
- package/types/src/serializers/registrationSerializer.d.ts.map +1 -1
- package/types/src/utils/notificationUtils.d.ts +6 -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/cancelScheduledNotification.js.map +0 -1
- package/dist-esm/src/client/createOrUpdateInstallation.js.map +0 -1
- package/dist-esm/src/client/createOrUpdateRegistration.js.map +0 -1
- package/dist-esm/src/client/createRegistration.js.map +0 -1
- package/dist-esm/src/client/createRegistrationId.js.map +0 -1
- package/dist-esm/src/client/deleteInstallation.js.map +0 -1
- package/dist-esm/src/client/deleteRegistration.js.map +0 -1
- package/dist-esm/src/client/getFeedbackContainerUrl.js.map +0 -1
- package/dist-esm/src/client/getInstallation.js.map +0 -1
- package/dist-esm/src/client/getNotificationHubJob.js.map +0 -1
- package/dist-esm/src/client/getNotificationOutcomeDetails.js.map +0 -1
- package/dist-esm/src/client/getRegistration.js.map +0 -1
- package/dist-esm/src/client/index.js.map +0 -1
- package/dist-esm/src/client/internal/_client.js.map +0 -1
- package/dist-esm/src/client/internal/_createOrUpdateRegistrationDescription.js.map +0 -1
- 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/listNotificationHubJobs.js.map +0 -1
- package/dist-esm/src/client/listRegistrations.js.map +0 -1
- package/dist-esm/src/client/listRegistrationsByTag.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/scheduleNotification.js +0 -18
- package/dist-esm/src/client/scheduleNotification.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/dist-esm/src/client/sendNotification.js +0 -16
- package/dist-esm/src/client/sendNotification.js.map +0 -1
- package/dist-esm/src/client/submitNotificationHubJob.js.map +0 -1
- package/dist-esm/src/client/updateInstallation.js.map +0 -1
- package/dist-esm/src/client/updateRegistration.js.map +0 -1
- package/dist-esm/src/models/notificationBuilder.js +0 -169
- package/dist-esm/src/models/notificationBuilder.js.map +0 -1
- package/dist-esm/src/utils/retryPolicy.js +0 -144
- package/dist-esm/src/utils/retryPolicy.js.map +0 -1
- package/types/src/client/cancelScheduledNotification.d.ts.map +0 -1
- package/types/src/client/createOrUpdateInstallation.d.ts.map +0 -1
- package/types/src/client/createOrUpdateRegistration.d.ts.map +0 -1
- package/types/src/client/createRegistration.d.ts.map +0 -1
- package/types/src/client/createRegistrationId.d.ts.map +0 -1
- package/types/src/client/deleteInstallation.d.ts.map +0 -1
- package/types/src/client/deleteRegistration.d.ts.map +0 -1
- package/types/src/client/getFeedbackContainerUrl.d.ts.map +0 -1
- package/types/src/client/getInstallation.d.ts.map +0 -1
- package/types/src/client/getNotificationHubJob.d.ts.map +0 -1
- package/types/src/client/getNotificationOutcomeDetails.d.ts.map +0 -1
- package/types/src/client/getRegistration.d.ts.map +0 -1
- package/types/src/client/index.d.ts.map +0 -1
- package/types/src/client/internal/_client.d.ts.map +0 -1
- package/types/src/client/internal/_createOrUpdateRegistrationDescription.d.ts.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/listNotificationHubJobs.d.ts.map +0 -1
- package/types/src/client/listRegistrations.d.ts.map +0 -1
- package/types/src/client/listRegistrationsByTag.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/scheduleNotification.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
- package/types/src/client/sendNotification.d.ts.map +0 -1
- package/types/src/client/submitNotificationHubJob.d.ts.map +0 -1
- package/types/src/client/updateInstallation.d.ts.map +0 -1
- package/types/src/client/updateRegistration.d.ts.map +0 -1
- package/types/src/models/notificationBuilder.d.ts.map +0 -1
- package/types/src/utils/retryPolicy.d.ts +0 -72
- package/types/src/utils/retryPolicy.d.ts.map +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DirectSendNotificationOptions, EntityOperationOptions, NotificationHubsClientOptions, PolledOperationOptions, RegistrationQueryLimitOptions, ScheduleNotificationOptions, SendNotificationOptions } from "./models/options.js";
|
|
2
|
+
import { Installation, JsonPatch } from "./models/installation.js";
|
|
2
3
|
import { NotificationDetails, NotificationHubsMessageResponse, NotificationHubsResponse } from "./models/notificationDetails.js";
|
|
3
|
-
import {
|
|
4
|
+
import { NotificationHubJob, NotificationHubJobPoller } from "./models/notificationHubJob.js";
|
|
5
|
+
import { RegistrationDescription, RegistrationChannel } from "./models/registration.js";
|
|
4
6
|
import { Notification } from "./models/notification.js";
|
|
5
|
-
import { NotificationHubJob } from "./models/notificationHubJob.js";
|
|
6
7
|
import { OperationOptions } from "@azure/core-client";
|
|
7
8
|
import { PagedAsyncIterableIterator } from "@azure/core-paging";
|
|
8
|
-
import { RegistrationDescription } from "./models/registration.js";
|
|
9
9
|
/**
|
|
10
10
|
* This represents a client for Azure Notification Hubs to manage installations and send
|
|
11
11
|
* messages to devices.
|
|
12
12
|
*/
|
|
13
|
-
export declare class
|
|
13
|
+
export declare class NotificationHubsClient {
|
|
14
14
|
private _client;
|
|
15
15
|
/**
|
|
16
16
|
* Creates a new instance of the NotificationClient with a connection string, hub name and options.
|
|
@@ -93,10 +93,17 @@ export declare class NotificationHubsServiceClient {
|
|
|
93
93
|
getRegistration(registrationId: string, options?: OperationOptions): Promise<RegistrationDescription>;
|
|
94
94
|
/**
|
|
95
95
|
* Gets all registrations for the notification hub with the given query options.
|
|
96
|
-
* @param options - The options for querying the registrations such as $top
|
|
96
|
+
* @param options - The options for querying the registrations such as $top.
|
|
97
97
|
* @returns A paged async iterable containing all of the registrations for the notification hub.
|
|
98
98
|
*/
|
|
99
|
-
listRegistrations(options?:
|
|
99
|
+
listRegistrations(options?: RegistrationQueryLimitOptions): PagedAsyncIterableIterator<RegistrationDescription>;
|
|
100
|
+
/**
|
|
101
|
+
* Gets all registrations for the notification hub with the given device information and options.
|
|
102
|
+
* @param channel - The registration channel information to query per PNS type.
|
|
103
|
+
* @param options - The options for querying the registrations such as $top.
|
|
104
|
+
* @returns A paged async iterable containing all of the registrations for the notification hub.
|
|
105
|
+
*/
|
|
106
|
+
listRegistrationsByChannel(channel: RegistrationChannel, options?: RegistrationQueryLimitOptions): PagedAsyncIterableIterator<RegistrationDescription>;
|
|
100
107
|
/**
|
|
101
108
|
* Lists all registrations with the matching tag.
|
|
102
109
|
* @param tag - The tag to query for matching registrations.
|
|
@@ -104,52 +111,22 @@ export declare class NotificationHubsServiceClient {
|
|
|
104
111
|
* @returns A paged async iterable containing the matching registrations for the notification hub.
|
|
105
112
|
*/
|
|
106
113
|
listRegistrationsByTag(tag: string, options?: RegistrationQueryLimitOptions): PagedAsyncIterableIterator<RegistrationDescription>;
|
|
107
|
-
/**
|
|
108
|
-
* Sends a direct push notification to a device with the given push handle.
|
|
109
|
-
* @param pushHandle - The push handle which is the unique identifier for the device.
|
|
110
|
-
* @param notification - The notification to send to the device.
|
|
111
|
-
* @param options - The options for sending a direct notification.
|
|
112
|
-
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
113
|
-
*/
|
|
114
|
-
sendDirectNotification(pushHandle: PushHandle, notification: Notification, options?: OperationOptions): Promise<NotificationHubsMessageResponse>;
|
|
115
114
|
/**
|
|
116
115
|
* Sends push notifications to devices that match the given tags or tag expression.
|
|
117
|
-
* @param tags - The tags used to target the device for push notifications in either an array or tag expression.
|
|
118
116
|
* @param notification - The notification to send to the matching devices.
|
|
119
|
-
* @param options -
|
|
120
|
-
* which may include APNs specific such as apns-topic or for WNS, X-WNS-TYPE.
|
|
121
|
-
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
122
|
-
*/
|
|
123
|
-
sendNotification(tags: string[] | string, notification: Notification, options?: SendOperationOptions): Promise<NotificationHubsMessageResponse>;
|
|
124
|
-
/**
|
|
125
|
-
* Sends push notifications to all devices on the Notification Hub.
|
|
126
|
-
* @param notification - The notification to send to all devices.
|
|
127
|
-
* @param options - Configuration options for the direct send operation which can contain custom headers
|
|
128
|
-
* which may include APNs specific such as apns-topic or for WNS, X-WNS-TYPE.
|
|
117
|
+
* @param options - Options for the notification including tags, device handles and whether to enable test send.
|
|
129
118
|
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
130
119
|
*/
|
|
131
|
-
|
|
120
|
+
sendNotification(notification: Notification, options?: DirectSendNotificationOptions | SendNotificationOptions): Promise<NotificationHubsMessageResponse>;
|
|
132
121
|
/**
|
|
133
122
|
* Schedules a push notification to devices that match the given tags or tag expression at the specified time.
|
|
134
123
|
* NOTE: This is only available in Standard SKU Azure Notification Hubs.
|
|
135
124
|
* @param scheduledTime - The Date to send the push notification.
|
|
136
|
-
* @param tags - The tags used to target the device for push notifications in either an array or tag expression.
|
|
137
125
|
* @param notification - The notification to send to the matching devices.
|
|
138
|
-
* @param options -
|
|
139
|
-
* which may include APNs specific such as apns-topic or for WNS, X-WNS-TYPE.
|
|
126
|
+
* @param options - Options which include tags used to target the device for push notifications in either an array or tag expression.
|
|
140
127
|
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
141
128
|
*/
|
|
142
|
-
scheduleNotification(scheduledTime: Date,
|
|
143
|
-
/**
|
|
144
|
-
* Schedules a push notification to all devices registered on the Notification Hub.
|
|
145
|
-
* NOTE: This is only available in Standard SKU Azure Notification Hubs.
|
|
146
|
-
* @param scheduledTime - The Date to send the push notification.
|
|
147
|
-
* @param notification - The notification to send to the matching devices.
|
|
148
|
-
* @param options - Configuration options for the direct send operation which can contain custom headers
|
|
149
|
-
* which may include APNs specific such as apns-topic or for WNS, X-WNS-TYPE.
|
|
150
|
-
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
151
|
-
*/
|
|
152
|
-
scheduleBroadcastNotification(scheduledTime: Date, notification: Notification, options?: OperationOptions): Promise<NotificationHubsMessageResponse>;
|
|
129
|
+
scheduleNotification(scheduledTime: Date, notification: Notification, options?: ScheduleNotificationOptions): Promise<NotificationHubsMessageResponse>;
|
|
153
130
|
/**
|
|
154
131
|
* Cancels the scheduled notification with the given notification ID.
|
|
155
132
|
* @param notificationId - The notification ID from the scheduled notification.
|
|
@@ -179,6 +156,13 @@ export declare class NotificationHubsServiceClient {
|
|
|
179
156
|
* @returns The Notification Hub Job with the matching ID.
|
|
180
157
|
*/
|
|
181
158
|
getNotificationHubJob(jobId: string, options?: OperationOptions): Promise<NotificationHubJob>;
|
|
159
|
+
/**
|
|
160
|
+
* Submits a Notification Hub job and creates a poller to poll for results.
|
|
161
|
+
* @param notificationHubJob - The Notification Hub import/export job to start.
|
|
162
|
+
* @param options - The operation options.
|
|
163
|
+
* @returns A poller which can be called to poll until completion of the job.
|
|
164
|
+
*/
|
|
165
|
+
beginSubmitNotificationHubJob(notificationHubJob: NotificationHubJob, options?: PolledOperationOptions): Promise<NotificationHubJobPoller>;
|
|
182
166
|
/**
|
|
183
167
|
* Submits a Notification Hub Job. Note this is available to Standard SKU namespace and above.
|
|
184
168
|
* @param job - The notification hub job to submit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notificationHubsClient.d.ts","sourceRoot":"","sources":["../../src/notificationHubsClient.ts"],"names":[],"mappings":"AAGA,OAAO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A+B,CAAC;IAI3C;;;;;;;OAOG;IACH,oBAAoB,CAClB,aAAa,EAAE,IAAI,EACnB,YAAY,EAAE,YAAY,EAC1B,OAAO,GAAE,2BAAgC,GACxC,OAAO,CAAC,+BAA+B,CAAC;IAI3C;;;;;OAKG;IACH,2BAA2B,CACzB,cAAc,EAAE,MAAM,EACtB,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,wBAAwB,CAAC;IAIpC;;;;;OAKG;IACH,uBAAuB,CAAC,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC;IAIxE;;;;;;OAMG;IACH,6BAA6B,CAC3B,cAAc,EAAE,MAAM,EACtB,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,mBAAmB,CAAC;IAI/B;;;;;OAKG;IACH,qBAAqB,CACnB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,kBAAkB,CAAC;IAI9B;;;;;OAKG;IACH,6BAA6B,CAC3B,kBAAkB,EAAE,kBAAkB,EACtC,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,wBAAwB,CAAC;IAIpC;;;;;OAKG;IACH,wBAAwB,CACtB,GAAG,EAAE,kBAAkB,EACvB,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,kBAAkB,CAAC;IAI9B;;;;OAIG;IACH,uBAAuB,CAAC,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;CAGvF"}
|
|
@@ -99,72 +99,72 @@ export interface RegistrationDescriptionSerializer {
|
|
|
99
99
|
* @internal
|
|
100
100
|
* Serializes an Amazon Device Messaging (ADM) registration description into an XML object for serialization.
|
|
101
101
|
*/
|
|
102
|
-
serializeAdmRegistrationDescription(description: Omit<AdmRegistrationDescription, "
|
|
102
|
+
serializeAdmRegistrationDescription(description: Omit<AdmRegistrationDescription, "kind">): Record<string, any>;
|
|
103
103
|
/**
|
|
104
104
|
* @internal
|
|
105
105
|
* Serializes an Amazon Device Messaging (ADM) template registration description into an XML object for serialization.
|
|
106
106
|
*/
|
|
107
|
-
serializeAdmTemplateRegistrationDescription(description: Omit<AdmTemplateRegistrationDescription, "
|
|
107
|
+
serializeAdmTemplateRegistrationDescription(description: Omit<AdmTemplateRegistrationDescription, "kind">): Record<string, any>;
|
|
108
108
|
/**
|
|
109
109
|
* @internal
|
|
110
110
|
* Serializes an Apple registration description into an XML object for serialization.
|
|
111
111
|
*/
|
|
112
|
-
serializeAppleRegistrationDescription(description: Omit<AppleRegistrationDescription, "
|
|
112
|
+
serializeAppleRegistrationDescription(description: Omit<AppleRegistrationDescription, "kind">): Record<string, any>;
|
|
113
113
|
/**
|
|
114
114
|
* @internal
|
|
115
115
|
* Serializes an Apple template registration description into an XML object for serialization.
|
|
116
116
|
*/
|
|
117
|
-
serializeAppleTemplateRegistrationDescription(description: Omit<AppleRegistrationDescription, "
|
|
117
|
+
serializeAppleTemplateRegistrationDescription(description: Omit<AppleRegistrationDescription, "kind">): Record<string, any>;
|
|
118
118
|
/**
|
|
119
119
|
* @internal
|
|
120
120
|
* Serializes a Baidu registration description into an XML object for serialization.
|
|
121
121
|
*/
|
|
122
|
-
serializeBaiduRegistrationDescription(description: Omit<BaiduRegistrationDescription, "
|
|
122
|
+
serializeBaiduRegistrationDescription(description: Omit<BaiduRegistrationDescription, "kind">): Record<string, any>;
|
|
123
123
|
/**
|
|
124
124
|
* @internal
|
|
125
125
|
* Serializes a Baidu template registration description into an XML object for serialization.
|
|
126
126
|
*/
|
|
127
|
-
serializeBaiduTemplateRegistrationDescription(description: Omit<BaiduTemplateRegistrationDescription, "
|
|
127
|
+
serializeBaiduTemplateRegistrationDescription(description: Omit<BaiduTemplateRegistrationDescription, "kind">): Record<string, any>;
|
|
128
128
|
/**
|
|
129
129
|
* @internal
|
|
130
130
|
* Serializes a Web Push registration description into an XML object for serialization.
|
|
131
131
|
*/
|
|
132
|
-
serializeBrowserRegistrationDescription(description: Omit<BrowserRegistrationDescription, "
|
|
132
|
+
serializeBrowserRegistrationDescription(description: Omit<BrowserRegistrationDescription, "kind">): Record<string, any>;
|
|
133
133
|
/**
|
|
134
134
|
* @internal
|
|
135
135
|
* Serializes a Web Push template registration description into an XML object for serialization.
|
|
136
136
|
*/
|
|
137
|
-
serializeBrowserTemplateRegistrationDescription(description: Omit<BrowserTemplateRegistrationDescription, "
|
|
137
|
+
serializeBrowserTemplateRegistrationDescription(description: Omit<BrowserTemplateRegistrationDescription, "kind">): Record<string, any>;
|
|
138
138
|
/**
|
|
139
139
|
* @internal
|
|
140
140
|
* Serializes a Google Cloud Messaging (GCM) registration description into an XML object for serialization.
|
|
141
141
|
*/
|
|
142
|
-
serializeGcmRegistrationDescription(description: Omit<GcmRegistrationDescription, "
|
|
142
|
+
serializeGcmRegistrationDescription(description: Omit<GcmRegistrationDescription, "kind">): Record<string, any>;
|
|
143
143
|
/**
|
|
144
144
|
* @internal
|
|
145
145
|
* Serializes a Google Cloud Messaging (GCM) template registration description into an XML object for serialization.
|
|
146
146
|
*/
|
|
147
|
-
serializeGcmTemplateRegistrationDescription(description: Omit<GcmTemplateRegistrationDescription, "
|
|
147
|
+
serializeGcmTemplateRegistrationDescription(description: Omit<GcmTemplateRegistrationDescription, "kind">): Record<string, any>;
|
|
148
148
|
/**
|
|
149
149
|
* @internal
|
|
150
150
|
* Serializes a Windows Phone registration description into an XML object for serialization.
|
|
151
151
|
*/
|
|
152
|
-
serializeMpnsRegistrationDescription(description: Omit<MpnsRegistrationDescription, "
|
|
152
|
+
serializeMpnsRegistrationDescription(description: Omit<MpnsRegistrationDescription, "kind">): Record<string, any>;
|
|
153
153
|
/**
|
|
154
154
|
* @internal
|
|
155
155
|
* Serializes a Windows Phone template registration description into an XML object for serialization.
|
|
156
156
|
*/
|
|
157
|
-
serializeMpnsTemplateRegistrationDescription(description: Omit<MpnsTemplateRegistrationDescription, "
|
|
157
|
+
serializeMpnsTemplateRegistrationDescription(description: Omit<MpnsTemplateRegistrationDescription, "kind">): Record<string, any>;
|
|
158
158
|
/**
|
|
159
159
|
* @internal
|
|
160
160
|
* Serializes a Windows Notification Services (WNS) registration description into an XML object for serialization.
|
|
161
161
|
*/
|
|
162
|
-
serializeWindowsRegistrationDescription(description: Omit<WindowsRegistrationDescription, "
|
|
162
|
+
serializeWindowsRegistrationDescription(description: Omit<WindowsRegistrationDescription, "kind">): Record<string, any>;
|
|
163
163
|
/**
|
|
164
164
|
* @internal
|
|
165
165
|
* Serializes a Windows Notification Services (WNS) template registration description into an XML object for serialization.
|
|
166
166
|
*/
|
|
167
|
-
serializeWindowsTemplateRegistrationDescription(description: Omit<WindowsTemplateRegistrationDescription, "
|
|
167
|
+
serializeWindowsTemplateRegistrationDescription(description: Omit<WindowsTemplateRegistrationDescription, "kind">): Record<string, any>;
|
|
168
168
|
}
|
|
169
169
|
/**
|
|
170
170
|
* Represents a RegistrationDescription serializer.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registrationSerializer.d.ts","sourceRoot":"","sources":["../../../src/serializers/registrationSerializer.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,0BAA0B,EAC1B,kCAAkC,
|
|
1
|
+
{"version":3,"file":"registrationSerializer.d.ts","sourceRoot":"","sources":["../../../src/serializers/registrationSerializer.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,0BAA0B,EAC1B,kCAAkC,EAClC,4BAA4B,EAC5B,oCAAoC,EACpC,4BAA4B,EAC5B,oCAAoC,EACpC,8BAA8B,EAC9B,sCAAsC,EACtC,0BAA0B,EAC1B,kCAAkC,EAClC,2BAA2B,EAC3B,mCAAmC,EACnC,uBAAuB,EAGvB,8BAA8B,EAC9B,sCAAsC,EACvC,MAAM,2BAA2B,CAAC;AAYnC;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C;;;OAGG;IACH,sBAAsB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAC/E;;;OAGG;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;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,iCAAiC,EAAE,iCA4P/C,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Notification } from "../models/notification.js";
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare function createMultipartDirectNotification(boundaryName: string, notification: Notification, deviceHandles: string[]): string;
|
|
6
|
+
//# sourceMappingURL=notificationUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notificationUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/notificationUtils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD;;GAEG;AACH,wBAAgB,iCAAiC,CAC/C,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,MAAM,EAAE,GACtB,MAAM,CAcR"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DirectSendNotificationOptions, SendNotificationOptions } from "../models/options.js";
|
|
2
|
+
/**
|
|
3
|
+
* Determines whether the options are of type SendNotificationOptions.
|
|
4
|
+
* @param options - The options to test if SendNotificationOptions.
|
|
5
|
+
* @returns true if SendNotificationOptions otherwise false.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isSendNotificationOptions(options: unknown): options is SendNotificationOptions;
|
|
8
|
+
/**
|
|
9
|
+
* Determines whether the options are of type DirectSendNotificationOptions.
|
|
10
|
+
* @param options - The options to test if DirectSendNotificationOptions.
|
|
11
|
+
* @returns true if DirectSendNotificationOptions otherwise false.
|
|
12
|
+
*/
|
|
13
|
+
export declare function isDirectSendNotificationOptions(options: unknown): options is DirectSendNotificationOptions;
|
|
14
|
+
//# sourceMappingURL=optionUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"optionUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/optionUtils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,6BAA6B,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAG9F;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,uBAAuB,CAE9F;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,OAAO,GACf,OAAO,IAAI,6BAA6B,CAE1C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cancelScheduledNotification.js","sourceRoot":"","sources":["../../../src/client/cancelScheduledNotification.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,aAAa,EAAE,6BAA6B,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIlG,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,cAAc,GAAG,6BAA6B,CAAC;AAErD;;;;;;;GAOG;AACH,MAAM,UAAU,2BAA2B,CACzC,OAAsC,EACtC,cAAsB,EACtB,UAA4B,EAAE;IAE9B,OAAO,aAAa,CAAC,QAAQ,CAC3B,iCAAiC,cAAc,EAAE,EACjD,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;QACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACtC,QAAQ,CAAC,QAAQ,IAAI,2BAA2B,cAAc,EAAE,CAAC;QAEjE,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;QAC5D,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;QAE3E,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 { createRequest, parseNotificationSendResponse, sendRequest } from \"./internal/_client.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { NotificationHubsResponse } from \"../models/notificationDetails.js\";\nimport { OperationOptions } from \"@azure/core-client\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"cancelScheduledNotification\";\n\n/**\n * Cancels the scheduled notification with the given notification ID.\n * NOTE: This is only available in Standard SKU Azure Notification Hubs.\n * @param context - The Notification Hubs client.\n * @param notificationId - The notification ID from the scheduled notification.\n * @param options - The operation options.\n * @returns A notification hub response with correlation ID and tracking ID.\n */\nexport function cancelScheduledNotification(\n context: NotificationHubsClientContext,\n notificationId: string,\n options: OperationOptions = {}\n): Promise<NotificationHubsResponse> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext-${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/schedulednotifications/${notificationId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n const request = createRequest(endpoint, \"DELETE\", headers, updatedOptions);\n\n const response = await sendRequest(context, request, 200);\n\n return parseNotificationSendResponse(response);\n }\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createOrUpdateInstallation.js","sourceRoot":"","sources":["../../../src/client/createOrUpdateInstallation.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,aAAa,EAAE,yBAAyB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAK9F,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,cAAc,GAAG,4BAA4B,CAAC;AAEpD;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CACxC,OAAsC,EACtC,YAA0B,EAC1B,UAA4B,EAAE;IAE9B,OAAO,aAAa,CAAC,QAAQ,CAC3B,iCAAiC,cAAc,EAAE,EACjD,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;QACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACtC,QAAQ,CAAC,QAAQ,IAAI,kBAAkB,YAAY,CAAC,cAAc,EAAE,CAAC;QAErE,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;QAC5D,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;QAEhD,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;QACxE,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QAE5C,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QAE1D,OAAO,yBAAyB,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, parseNotificationResponse, sendRequest } from \"./internal/_client.js\";\nimport { Installation } from \"../models/installation.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { NotificationHubsResponse } from \"../models/notificationDetails.js\";\nimport { OperationOptions } from \"@azure/core-client\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"createOrUpdateInstallation\";\n\n/**\n * Creates or overwrites an installation to a Notification Hub.\n * @param context - The Notification Hubs client.\n * @param installation - The installation to create or overwrite.\n * @param options - Configuration options for the create or update installation operation.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function createOrUpdateInstallation(\n context: NotificationHubsClientContext,\n installation: Installation,\n options: OperationOptions = {}\n): Promise<NotificationHubsResponse> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext-${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/installations/${installation.installationId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/json\");\n\n const request = createRequest(endpoint, \"PUT\", headers, updatedOptions);\n request.body = JSON.stringify(installation);\n\n const response = await sendRequest(context, request, 200);\n\n return parseNotificationResponse(response);\n }\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createOrUpdateRegistration.js","sourceRoot":"","sources":["../../../src/client/createOrUpdateRegistration.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAKlC,OAAO,EAAE,qCAAqC,EAAE,MAAM,sDAAsD,CAAC;AAC7G,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,cAAc,GAAG,4BAA4B,CAAC;AAEpD;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CACxC,OAAsC,EACtC,YAAqC,EACrC,UAA4B,EAAE;IAE9B,OAAO,aAAa,CAAC,QAAQ,CAC3B,iCAAiC,cAAc,EAAE,EACjD,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;QACvB,OAAO,qCAAqC,CAC1C,OAAO,EACP,YAAY,EACZ,gBAAgB,EAChB,cAAc,CACf,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure/core-client\";\nimport { RegistrationDescription } from \"../models/registration.js\";\nimport { createOrUpdateRegistrationDescription } from \"./internal/_createOrUpdateRegistrationDescription.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"createOrUpdateRegistration\";\n\n/**\n * Creates or updates a registration.\n * @param context - The Notification Hubs client.\n * @param registration - The registration to create or update.\n * @param options - The operation options.\n * @returns The created or updated registration description.\n */\nexport function createOrUpdateRegistration(\n context: NotificationHubsClientContext,\n registration: RegistrationDescription,\n options: OperationOptions = {}\n): Promise<RegistrationDescription> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext-${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n return createOrUpdateRegistrationDescription(\n context,\n registration,\n \"createOrUpdate\",\n updatedOptions\n );\n }\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createRegistration.js","sourceRoot":"","sources":["../../../src/client/createRegistration.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAKlC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,qCAAqC,EAAE,MAAM,sDAAsD,CAAC;AAC7G,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,cAAc,GAAG,oBAAoB,CAAC;AAE5C;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAAsC,EACtC,YAAqC,EACrC,UAA4B,EAAE;IAE9B,OAAO,aAAa,CAAC,QAAQ,CAC3B,iCAAiC,cAAc,EAAE,EACjD,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;QACvB,IAAI,YAAY,CAAC,cAAc,EAAE;YAC/B,MAAM,IAAI,SAAS,CAAC,0DAA0D,EAAE;gBAC9E,UAAU,EAAE,GAAG;aAChB,CAAC,CAAC;SACJ;QAED,OAAO,qCAAqC,CAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC;IAChG,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure/core-client\";\nimport { RegistrationDescription } from \"../models/registration.js\";\nimport { RestError } from \"@azure/core-rest-pipeline\";\nimport { createOrUpdateRegistrationDescription } from \"./internal/_createOrUpdateRegistrationDescription.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"createRegistration\";\n\n/**\n * Creates a new registration. This method generates a registration ID,\n * which you can subsequently use to retrieve, update, and delete this registration.\n * @param context - The Notification Hubs client.\n * @param registration - The registration to create.\n * @param options - Options for creating a new registration.\n * @returns The newly created registration description.\n */\nexport function createRegistration(\n context: NotificationHubsClientContext,\n registration: RegistrationDescription,\n options: OperationOptions = {}\n): Promise<RegistrationDescription> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext-${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n if (registration.registrationId) {\n throw new RestError(\"registrationId must not be set during a create operation\", {\n statusCode: 400,\n });\n }\n\n return createOrUpdateRegistrationDescription(context, registration, \"create\", updatedOptions);\n }\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createRegistrationId.js","sourceRoot":"","sources":["../../../src/client/createRegistrationId.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGnE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,cAAc,GAAG,sBAAsB,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAClC,OAAsC,EACtC,UAA4B,EAAE;IAE9B,OAAO,aAAa,CAAC,QAAQ,CAC3B,iCAAiC,cAAc,EAAE,EACjD,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;QACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACtC,QAAQ,CAAC,QAAQ,IAAI,kBAAkB,CAAC;QAExC,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;QAC5D,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,0CAA0C,CAAC,CAAC;QAExE,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;QACzE,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QAE1D,2GAA2G;QAC3G,MAAM,cAAc,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACxD,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,cAAe,CAAC,CAAC;QAC7C,MAAM,cAAc,GAAG,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAE1D,OAAO,cAAc,CAAC;IACxB,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure/core-client\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"createRegistrationId\";\n\n/**\n * Creates a new registration ID.\n * @param context - The Notification Hubs client.\n * @param options - The options for creating a new registration ID.\n * @returns The newly created registration ID.\n */\nexport function createRegistrationId(\n context: NotificationHubsClientContext,\n options: OperationOptions = {}\n): Promise<string> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext-${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/registrationIDs\";\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/xml;type=entry;charset=utf-8\");\n\n const request = createRequest(endpoint, \"POST\", headers, updatedOptions);\n const response = await sendRequest(context, request, 201);\n\n // In the form: https://{namespace}.servicebus.windows.net/{NotificationHub}/registrations/<registrationId>\n const locationHeader = response.headers.get(\"Location\");\n const locationUrl = new URL(locationHeader!);\n const registrationId = locationUrl.pathname.split(\"/\")[3];\n\n return registrationId;\n }\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deleteInstallation.js","sourceRoot":"","sources":["../../../src/client/deleteInstallation.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,aAAa,EAAE,yBAAyB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAI9F,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,cAAc,GAAG,oBAAoB,CAAC;AAE5C;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAAsC,EACtC,cAAsB,EACtB,UAA4B,EAAE;IAE9B,OAAO,aAAa,CAAC,QAAQ,CAC3B,iCAAiC,cAAc,EAAE,EACjD,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;QACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACtC,QAAQ,CAAC,QAAQ,IAAI,kBAAkB,cAAc,EAAE,CAAC;QAExD,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;QAC5D,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;QAC3E,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QAE1D,OAAO,yBAAyB,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, parseNotificationResponse, sendRequest } from \"./internal/_client.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { NotificationHubsResponse } from \"../models/notificationDetails.js\";\nimport { OperationOptions } from \"@azure/core-client\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"deleteInstallation\";\n\n/**\n * Deletes an installation from a Notification Hub.\n * @param context - The Notification Hubs client.\n * @param installationId - The installation ID of the installation to delete.\n * @param options - Configuration options for the installation delete operation.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function deleteInstallation(\n context: NotificationHubsClientContext,\n installationId: string,\n options: OperationOptions = {}\n): Promise<NotificationHubsResponse> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext-${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/installations/${installationId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n const request = createRequest(endpoint, \"DELETE\", headers, updatedOptions);\n const response = await sendRequest(context, request, 204);\n\n return parseNotificationResponse(response);\n }\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deleteRegistration.js","sourceRoot":"","sources":["../../../src/client/deleteRegistration.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,aAAa,EAAE,yBAAyB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAI9F,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,cAAc,GAAG,oBAAoB,CAAC;AAE5C;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAAsC,EACtC,cAAsB,EACtB,UAAkC,EAAE;IAEpC,OAAO,aAAa,CAAC,QAAQ,CAC3B,iCAAiC,cAAc,EAAE,EACjD,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;QACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACtC,QAAQ,CAAC,QAAQ,IAAI,kBAAkB,cAAc,EAAE,CAAC;QAExD,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;QAC5D,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,+CAA+C,CAAC,CAAC;QAC7E,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAE7E,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;QACxE,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QAE1D,OAAO,yBAAyB,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, parseNotificationResponse, sendRequest } from \"./internal/_client.js\";\nimport { EntityOperationOptions } from \"../models/options.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { NotificationHubsResponse } from \"../models/notificationDetails.js\";\nimport { isDefined } from \"../utils/utils.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"deleteRegistration\";\n\n/**\n * Deletes a registration with the given registration ID.\n * @param context - The Notification Hubs client.\n * @param registrationId - The registration ID of the registration to delete.\n * @param options - The options for delete operations including the ETag\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function deleteRegistration(\n context: NotificationHubsClientContext,\n registrationId: string,\n options: EntityOperationOptions = {}\n): Promise<NotificationHubsResponse> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext-${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/registrations/${registrationId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/atom+xml;type=entry;charset=utf-8\");\n headers.set(\"If-Match\", isDefined(options.etag) ? `\"${options.etag}\"` : \"*\");\n\n const request = createRequest(endpoint, \"GET\", headers, updatedOptions);\n const response = await sendRequest(context, request, 200);\n\n return parseNotificationResponse(response);\n }\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getFeedbackContainerUrl.js","sourceRoot":"","sources":["../../../src/client/getFeedbackContainerUrl.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGnE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,cAAc,GAAG,yBAAyB,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CACrC,OAAsC,EACtC,UAA4B,EAAE;IAE9B,OAAO,aAAa,CAAC,QAAQ,CAC3B,iCAAiC,cAAc,EAAE,EACjD,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;QACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACtC,QAAQ,CAAC,QAAQ,IAAI,oBAAoB,CAAC;QAE1C,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;QAC5D,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,0CAA0C,CAAC,CAAC;QAExE,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;QACxE,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QAE1D,OAAO,QAAQ,CAAC,UAAW,CAAC;IAC9B,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure/core-client\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"getFeedbackContainerUrl\";\n\n/**\n * Retrieves an Azure Storage container URL. The container has feedback data for the notification hub.\n * The caller can then use the Azure Storage Services SDK to retrieve the contents of the container.\n * @param context - The Notification Hubs client.\n * @param options - The options for getting the push notification feedback container URL.\n * @returns The URL of the Azure Storage Container containing the feedback data.\n */\nexport function getFeedbackContainerUrl(\n context: NotificationHubsClientContext,\n options: OperationOptions = {}\n): Promise<string> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext-${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/feedbackcontainer\";\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/xml;type=entry;charset=utf-8\");\n\n const request = createRequest(endpoint, \"GET\", headers, updatedOptions);\n const response = await sendRequest(context, request, 200);\n\n return response.bodyAsText!;\n }\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getInstallation.js","sourceRoot":"","sources":["../../../src/client/getInstallation.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAInE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,cAAc,GAAG,iBAAiB,CAAC;AAEzC;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAC7B,OAAsC,EACtC,cAAsB,EACtB,UAA4B,EAAE;IAE9B,OAAO,aAAa,CAAC,QAAQ,CAC3B,iCAAiC,cAAc,EAAE,EACjD,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;QACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACtC,QAAQ,CAAC,QAAQ,IAAI,kBAAkB,cAAc,EAAE,CAAC;QAExD,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;QAC5D,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;QAEhD,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;QACxE,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QAE1D,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAW,CAAiB,CAAC;IAC1D,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport { Installation } from \"../models/installation.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure/core-client\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"getInstallation\";\n\n/**\n * Gets an Azure Notification Hub installation by the installation ID.\n * @param context - The Notification Hubs client.\n * @param installationId - The ID of the installation to get.\n * @param options - Configuration options for the get installation operation.\n * @returns The installation that matches the installation ID.\n */\nexport function getInstallation(\n context: NotificationHubsClientContext,\n installationId: string,\n options: OperationOptions = {}\n): Promise<Installation> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext-${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/installations/${installationId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/json\");\n\n const request = createRequest(endpoint, \"GET\", headers, updatedOptions);\n const response = await sendRequest(context, request, 200);\n\n return JSON.parse(response.bodyAsText!) as Installation;\n }\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getNotificationHubJob.js","sourceRoot":"","sources":["../../../src/client/getNotificationHubJob.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAInE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gDAAgD,CAAC;AAC9F,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,cAAc,GAAG,uBAAuB,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CACnC,OAAsC,EACtC,KAAa,EACb,UAA4B,EAAE;IAE9B,OAAO,aAAa,CAAC,QAAQ,CAC3B,iCAAiC,cAAc,EAAE,EACjD,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;QACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACtC,QAAQ,CAAC,QAAQ,IAAI,SAAS,KAAK,EAAE,CAAC;QAEtC,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;QAC5D,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,+CAA+C,CAAC,CAAC;QAE7E,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;QACxE,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QAE1D,OAAO,4BAA4B,CAAC,QAAQ,CAAC,UAAW,CAAC,CAAC;IAC5D,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport { NotificationHubJob } from \"../models/notificationHubJob.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure/core-client\";\nimport { parseNotificationHubJobEntry } from \"../serializers/notificationHubJobSerializer.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"getNotificationHubJob\";\n\n/**\n * Gets a Notification Hub Job by the ID.\n * @param context - The Notification Hubs client.\n * @param jobId - The Notification Hub Job ID.\n * @param options - The operation options.\n * @returns The Notification Hub Job with the matching ID.\n */\nexport function getNotificationHubJob(\n context: NotificationHubsClientContext,\n jobId: string,\n options: OperationOptions = {}\n): Promise<NotificationHubJob> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext-${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/jobs/${jobId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/atom+xml;type=entry;charset=utf-8\");\n\n const request = createRequest(endpoint, \"GET\", headers, updatedOptions);\n const response = await sendRequest(context, request, 200);\n\n return parseNotificationHubJobEntry(response.bodyAsText!);\n }\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getNotificationOutcomeDetails.js","sourceRoot":"","sources":["../../../src/client/getNotificationOutcomeDetails.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAInE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iDAAiD,CAAC;AAC3F,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,cAAc,GAAG,+BAA+B,CAAC;AAEvD;;;;;;;GAOG;AACH,MAAM,UAAU,6BAA6B,CAC3C,OAAsC,EACtC,cAAsB,EACtB,UAA4B,EAAE;IAE9B,OAAO,aAAa,CAAC,QAAQ,CAC3B,iCAAiC,cAAc,EAAE,EACjD,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;QACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACtC,QAAQ,CAAC,QAAQ,IAAI,aAAa,cAAc,EAAE,CAAC;QAEnD,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;QAC5D,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;QACxE,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QAE1D,OAAO,wBAAwB,CAAC,QAAQ,CAAC,UAAW,CAAC,CAAC;IACxD,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport { NotificationDetails } from \"../models/notificationDetails.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure/core-client\";\nimport { parseNotificationDetails } from \"../serializers/notificationDetailsSerializer.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"getNotificationOutcomeDetails\";\n\n/**\n * Retrieves the results of a send operation. This can retrieve intermediate results if the send is being processed\n * or final results if the Send* has completed. This API can only be called for Standard SKU and above.\n * @param context - The Notification Hubs client.\n * @param notificationId - The notification ID returned from the send operation.\n * @param options - The operation options.\n * @returns The results of the send operation.\n */\nexport function getNotificationOutcomeDetails(\n context: NotificationHubsClientContext,\n notificationId: string,\n options: OperationOptions = {}\n): Promise<NotificationDetails> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext-${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/messages/${notificationId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n const request = createRequest(endpoint, \"GET\", headers, updatedOptions);\n const response = await sendRequest(context, request, 200);\n\n return parseNotificationDetails(response.bodyAsText!);\n }\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getRegistration.js","sourceRoot":"","sources":["../../../src/client/getRegistration.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAInE,OAAO,EAAE,6BAA6B,EAAE,MAAM,0CAA0C,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,cAAc,GAAG,iBAAiB,CAAC;AAEzC;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAC7B,OAAsC,EACtC,cAAsB,EACtB,UAA4B,EAAE;IAE9B,OAAO,aAAa,CAAC,QAAQ,CAC3B,iCAAiC,cAAc,EAAE,EACjD,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;QACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACtC,QAAQ,CAAC,QAAQ,IAAI,kBAAkB,cAAc,EAAE,CAAC;QAExD,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;QAC5D,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,0CAA0C,CAAC,CAAC;QAExE,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;QACxE,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QAE1D,OAAO,6BAA6B,CAAC,sBAAsB,CAAC,QAAQ,CAAC,UAAW,CAAC,CAAC;IACpF,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure/core-client\";\nimport { RegistrationDescription } from \"../models/registration.js\";\nimport { registrationDescriptionParser } from \"../serializers/registrationSerializer.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"getRegistration\";\n\n/**\n * Gets a registration by the given registration ID.\n * @param context - The Notification Hubs client.\n * @param registrationId - The ID of the registration to get.\n * @param options - The options for getting a registration by ID.\n * @returns A RegistrationDescription that has the given registration ID.\n */\nexport function getRegistration(\n context: NotificationHubsClientContext,\n registrationId: string,\n options: OperationOptions = {}\n): Promise<RegistrationDescription> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext-${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/registrations/${registrationId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/xml;type=entry;charset=utf-8\");\n\n const request = createRequest(endpoint, \"GET\", headers, updatedOptions);\n const response = await sendRequest(context, request, 200);\n\n return registrationDescriptionParser.parseRegistrationEntry(response.bodyAsText!);\n }\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAIL,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,iCAAiC,EACjC,qCAAqC,GACtC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAIzD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,MAAM,WAAW,GAAG,SAAS,CAAC;AAqC9B;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CACjC,gBAAwB,EACxB,OAAe,EACf,UAAyC,EAAE;IAE3C,OAAO,IAAI,6BAA6B,CAAC,gBAAgB,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAC/E,CAAC;AAED,MA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,EAAE,WAAW,CAAC,CAAC;QAEjD,OAAO,GAAG,CAAC;IACb,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport * as constants from \"../utils/constants.js\";\nimport {\n HttpHeaders,\n PipelineRequest,\n PipelineResponse,\n createHttpHeaders,\n} from \"@azure/core-rest-pipeline\";\nimport {\n createTokenProviderFromConnection,\n parseNotificationHubsConnectionString,\n} from \"../auth/connectionStringUtils.js\";\nimport { parseXML, stringifyXML } from \"@azure/core-xml\";\nimport { InternalClientPipelineOptions } from \"@azure/core-client\";\nimport { NotificationHubsClientOptions } from \"../models/options.js\";\nimport { SasTokenProvider } from \"../auth/sasTokenProvider.js\";\nimport { ServiceClient } from \"@azure/core-client\";\n\nconst API_VERSION = \"2020-06\";\n\n/**\n * Represents the Notification Hubs SDK client context.\n */\nexport interface NotificationHubsClientContext {\n /**\n * The SAS Token Provider for connecting to Notification Hubs.\n */\n readonly sasTokenProvider: SasTokenProvider;\n\n /**\n * The base URL for the Notification Hub namespace.\n */\n readonly baseUrl: string;\n\n /**\n * The Notification Hub name.\n */\n readonly hubName: string;\n\n /**\n * @internal\n */\n sendRequest(request: PipelineRequest): Promise<PipelineResponse>;\n\n /**\n * @internal\n */\n createHeaders(operationName: string): Promise<HttpHeaders>;\n\n /**\n * @internal\n */\n requestUrl(): URL;\n}\n\n/**\n * Creates a NotificationHubClient from the Access Policy connection string and hub name.\n * @param connectionString - The Access Policy connection string for the notification hub.\n * @param hubName - The notification hub name.\n * @returns A NotificationHubsClientContext initialized from the connection string and hub name.\n */\nexport function createClientContext(\n connectionString: string,\n hubName: string,\n options: NotificationHubsClientOptions = {}\n): NotificationHubsClientContext {\n return new NotificationHubsServiceClient(connectionString, hubName, options);\n}\n\nclass NotificationHubsServiceClient extends ServiceClient implements NotificationHubsClientContext {\n sasTokenProvider: SasTokenProvider;\n baseUrl: string;\n hubName: string;\n\n constructor(\n connectionString: string,\n hubName: string,\n options: NotificationHubsClientOptions = {}\n ) {\n super({\n deserializationOptions: {\n parseXML,\n },\n serializationOptions: {\n stringifyXML,\n },\n userAgentOptions: {\n userAgentPrefix: `azsdk-js-messaging-notificationhubs/${constants.SDK_VERSION}`,\n },\n ...options,\n } as InternalClientPipelineOptions);\n\n this.hubName = hubName;\n\n const parsedConnection = parseNotificationHubsConnectionString(connectionString);\n this.baseUrl = parsedConnection.endpoint;\n this.sasTokenProvider = createTokenProviderFromConnection(\n parsedConnection.sharedAccessKey,\n parsedConnection.sharedAccessKeyName\n );\n }\n\n async createHeaders(operationName: string): Promise<HttpHeaders> {\n const authorization = await this.sasTokenProvider.getToken(this.baseUrl);\n const headers = createHttpHeaders();\n headers.set(\"Authorization\", authorization.token);\n headers.set(\"x-ms-version\", API_VERSION);\n headers.set(\n \"x-ms-azsdk-telemetry\",\n `class=NotificationHubsServiceClient;method=${operationName}`\n );\n\n return headers;\n }\n\n requestUrl(): URL {\n // Node doesn't allow change in protocol but browsers do, so doing a string replace\n const url = new URL(this.baseUrl.replace(\"sb://\", \"https://\"));\n url.pathname = this.hubName;\n url.searchParams.set(\"api-version\", API_VERSION);\n\n return url;\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_client.js","sourceRoot":"","sources":["../../../../src/client/internal/_client.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAKL,SAAS,EACT,qBAAqB,GACtB,MAAM,2BAA2B,CAAC;AAOnC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,oDAAoD,CAAC;AAC9F,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,UAAU,aAAa,CAC3B,QAAa,EACb,MAAmB,EACnB,OAAoB,EACpB,OAAyB;IAEzB,OAAO,qBAAqB,+CACvB,OAAO,CAAC,cAAc,GACtB,OAAO,CAAC,cAAc,KACzB,GA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I,SAAS,CAAC,YAAY,EAAE;YAChC,UAAU,EAAE,QAAQ,CAAC,MAAM;YAC3B,QAAQ;SACT,CAAC,CAAC;KACJ;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n HttpHeaders,\n HttpMethods,\n PipelineRequest,\n PipelineResponse,\n RestError,\n createPipelineRequest,\n} from \"@azure/core-rest-pipeline\";\nimport {\n NotificationHubsMessageResponse,\n NotificationHubsResponse,\n} from \"../../models/notificationDetails.js\";\nimport { NotificationHubsClientContext } from \"../index.js\";\nimport { OperationOptions } from \"@azure/core-client\";\nimport { isDefined } from \"../../utils/utils.js\";\nimport { parseNotificationOutcome } from \"../../serializers/notificationOutcomeSerializer.js\";\nimport { parseXMLError } from \"../../utils/xmlUtils.js\";\n\nexport function createRequest(\n endpoint: URL,\n method: HttpMethods,\n headers: HttpHeaders,\n options: OperationOptions\n): PipelineRequest {\n return createPipelineRequest({\n ...options.tracingOptions,\n ...options.requestOptions,\n url: endpoint.toString(),\n abortSignal: options.abortSignal,\n method,\n headers,\n });\n}\n\n/**\n * Parses the HTTP response and creates a NotificationHubsResponse with header information from the operation.\n * @param response - The HTTP response used to populate the result.\n * @returns A NotificationHubsResponse with header information from the operation.\n */\nexport function parseNotificationResponse(response: PipelineResponse): NotificationHubsResponse {\n const correlationId = response.headers.get(\"x-ms-correlation-request-id\");\n const trackingId = response.headers.get(\"TrackingId\");\n const location = response.headers.get(\"Location\");\n\n return {\n correlationId,\n trackingId,\n location,\n };\n}\n\n/**\n * Parses the HTTP response and creates a NotificationHubsMessageResponse with results from the notification.\n * @param response - The HTTP response used to populate the result.\n * @returns A NotificationHubsMessageResponse with results from the notification.\n */\nexport async function parseNotificationSendResponse(\n response: PipelineResponse\n): Promise<NotificationHubsMessageResponse> {\n const result = parseNotificationResponse(response);\n let notificationId: string | undefined;\n if (result.location) {\n const locationUrl = new URL(result.location);\n notificationId = locationUrl.pathname.split(\"/\")[3];\n }\n\n const requestUrl = new URL(response.request.url);\n const isTestSend = requestUrl.searchParams.has(\"test\");\n const isDirectSend = requestUrl.searchParams.has(\"direct\");\n\n // Only broadcast/tag based sends are supported for test send\n const responseBody = response.bodyAsText;\n if (isTestSend && !isDirectSend && isDefined(responseBody)) {\n const outcome = await parseNotificationOutcome(responseBody);\n return {\n ...result,\n ...outcome,\n notificationId,\n };\n } else {\n return createDefaultResponse(result, notificationId);\n }\n}\n\nfunction createDefaultResponse(\n response: NotificationHubsResponse,\n notificationId?: string\n): NotificationHubsMessageResponse {\n return {\n ...response,\n notificationId,\n success: 0,\n failure: 0,\n results: [],\n state: \"Enqueued\",\n };\n}\n\n/**\n * Sends a request through the client context.\n * @param context - The client context to use.\n * @param request - The HTTP request to send.\n * @param successStatusCode - A status code or list of status codes to check for success.\n * @returns The HTTP Response.\n */\nexport async function sendRequest(\n context: NotificationHubsClientContext,\n request: PipelineRequest,\n successStatusCode: number | number[]\n): Promise<PipelineResponse> {\n const statuses: number[] = Array.isArray(successStatusCode)\n ? successStatusCode\n : [successStatusCode];\n\n const response = await context.sendRequest(request);\n\n if (!statuses.some((statusCode) => statusCode === response.status)) {\n const responseBody = response.bodyAsText;\n let details: string | undefined;\n if (isDefined(responseBody)) {\n try {\n details = await parseXMLError(responseBody);\n } catch (err) {\n // eslint-disable no-empty\n }\n }\n\n let errorMessage: string | undefined;\n if (isDefined(details)) {\n errorMessage = `operations failed with: ${details}`;\n } else {\n errorMessage = `operation failed with status ${response.status}`;\n }\n\n throw new RestError(errorMessage, {\n statusCode: response.status,\n response,\n });\n }\n\n return response;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_createOrUpdateRegistrationDescription.js","sourceRoot":"","sources":["../../../../src/client/internal/_createOrUpdateRegistrationDescription.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM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,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IAEjE,OAAO,6BAA6B,CAAC,sBAAsB,CAAC,QAAQ,CAAC,UAAW,CAAC,CAAC;AACpF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./_client.js\";\nimport {\n registrationDescriptionParser,\n registrationDescriptionSerializer,\n} from \"../../serializers/registrationSerializer.js\";\nimport { HttpMethods } from \"@azure/core-rest-pipeline\";\nimport { NotificationHubsClientContext } from \"../index.js\";\nimport { OperationOptions } from \"@azure/core-client\";\nimport { RegistrationDescription } from \"../../models/registration.js\";\nimport { isDefined } from \"../../utils/utils.js\";\n\n/**\n * @internal\n */\nexport async function createOrUpdateRegistrationDescription(\n context: NotificationHubsClientContext,\n registration: RegistrationDescription,\n operationName: \"create\" | \"createOrUpdate\" | \"update\",\n options: OperationOptions\n): Promise<RegistrationDescription> {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/registrations\";\n let httpMethod: HttpMethods = \"POST\";\n\n if (operationName === \"createOrUpdate\" || operationName === \"update\") {\n endpoint.pathname += `/${registration.registrationId}`;\n httpMethod = \"PUT\";\n }\n\n const etag = registration.etag;\n\n // Clear out readonly properties\n registration.registrationId = undefined;\n registration.etag = undefined;\n\n const headers = await context.createHeaders(`${operationName}Registration`);\n headers.set(\"Content-Type\", \"application/atom+xml;type=entry;charset=utf-8\");\n\n if (operationName === \"update\") {\n headers.set(\"If-Match\", isDefined(etag) ? `\"${etag}\"` : \"*\");\n }\n\n const request = createRequest(endpoint, httpMethod, headers, options);\n request.body = registrationDescriptionSerializer.serializeRegistrationDescription(registration);\n const response = await sendRequest(context, request, [200, 201]);\n\n return registrationDescriptionParser.parseRegistrationEntry(response.bodyAsText!);\n}\n"]}
|
|
@@ -1,38 +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
|
-
const OPERATION_NAME = "scheduleNotificationPayload";
|
|
6
|
-
/**
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export function scheduleNotificationPayload(context, scheduledTime, tags, notification, options = {}) {
|
|
10
|
-
return tracingClient.withSpan(`NotificationHubsClientContext-${OPERATION_NAME}`, options, async (updatedOptions) => {
|
|
11
|
-
const endpoint = context.requestUrl();
|
|
12
|
-
endpoint.pathname += "/schedulednotifications/";
|
|
13
|
-
const headers = await context.createHeaders(OPERATION_NAME);
|
|
14
|
-
if (notification.headers) {
|
|
15
|
-
for (const headerName of Object.keys(notification.headers)) {
|
|
16
|
-
headers.set(headerName, notification.headers[headerName]);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
headers.set("ServiceBusNotification-ScheduleTime", scheduledTime.toISOString());
|
|
20
|
-
headers.set("Content-Type", notification.contentType);
|
|
21
|
-
headers.set("ServiceBusNotification-Format", notification.platform);
|
|
22
|
-
if (tags) {
|
|
23
|
-
let tagExpression = null;
|
|
24
|
-
if (Array.isArray(tags)) {
|
|
25
|
-
tagExpression = tags.join("||");
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
tagExpression = tags;
|
|
29
|
-
}
|
|
30
|
-
headers.set("ServiceBusNotification-Tags", tagExpression);
|
|
31
|
-
}
|
|
32
|
-
const request = createRequest(endpoint, "POST", headers, updatedOptions);
|
|
33
|
-
request.body = notification.body;
|
|
34
|
-
const response = await sendRequest(context, request, 201);
|
|
35
|
-
return parseNotificationSendResponse(response);
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=_scheduleNotificationPayload.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_scheduleNotificationPayload.js","sourceRoot":"","sources":["../../../../src/client/internal/_scheduleNotification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AC,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 { createRequest, parseNotificationSendResponse, sendRequest } from \"./_client.js\";\nimport { Notification } from \"../../models/notification.js\";\nimport { NotificationHubsClientContext } from \"../index.js\";\nimport { NotificationHubsMessageResponse } from \"../../models/notificationDetails.js\";\nimport { OperationOptions } from \"@azure/core-client\";\nimport { tracingClient } from \"../../utils/tracing.js\";\n\nconst OPERATION_NAME = \"scheduleNotificationPayload\";\n\n/**\n * @internal\n */\nexport function scheduleNotificationPayload(\n context: NotificationHubsClientContext,\n scheduledTime: Date,\n tags: string[] | string | undefined,\n notification: Notification,\n options: OperationOptions = {}\n): Promise<NotificationHubsMessageResponse> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext-${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/schedulednotifications/\";\n\n const headers = await context.createHeaders(OPERATION_NAME);\n if (notification.headers) {\n for (const headerName of Object.keys(notification.headers)) {\n headers.set(headerName, notification.headers[headerName]);\n }\n }\n\n headers.set(\"ServiceBusNotification-ScheduleTime\", scheduledTime.toISOString());\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,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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,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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"listNotificationHubJobs.js","sourceRoot":"","sources":["../../../src/client/listNotificationHubJobs.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAInE,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,cAAc,GAAG,yBAAyB,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CACrC,OAAsC,EACtC,UAA4B,EAAE;IAE9B,OAAO,aAAa,CAAC,QAAQ,CAC3B,iCAAiC,cAAc,EAAE,EACjD,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;QACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACtC,QAAQ,CAAC,QAAQ,IAAI,OAAO,CAAC;QAE7B,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;QAC5D,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,+CAA+C,CAAC,CAAC;QAE7E,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;QACxE,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QAE1D,OAAO,2BAA2B,CAAC,QAAQ,CAAC,UAAW,CAAC,CAAC;IAC3D,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport { NotificationHubJob } from \"../models/notificationHubJob.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure/core-client\";\nimport { parseNotificationHubJobFeed } from \"../serializers/notificationHubJobSerializer.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"listNotificationHubJobs\";\n\n/**\n * Gets all Notification Hub Jobs for this Notification Hub.\n * @param context - The Notification Hubs client.xs\n * @param options - The operation options.\n * @returns An array of all Notification Hub Jobs for this Notification Hub.\n */\nexport function listNotificationHubJobs(\n context: NotificationHubsClientContext,\n options: OperationOptions = {}\n): Promise<NotificationHubJob[]> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext-${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/jobs\";\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/atom+xml;type=entry;charset=utf-8\");\n\n const request = createRequest(endpoint, \"GET\", headers, updatedOptions);\n const response = await sendRequest(context, request, 200);\n\n return parseNotificationHubJobFeed(response.bodyAsText!);\n }\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"listRegistrations.js","sourceRoot":"","sources":["../../../src/client/listRegistrations.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAMnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,0C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6B,CAAC,qBAAqB,CAC7E,QAAQ,CAAC,UAAW,CACrB,CAAC;IACF,MAAM,SAAS,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IACjE,OAAO;QACL,aAAa;QACb,iBAAiB,EAAE,SAAS;KAC7B,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { RegistrationDescription } from \"../models/registration.js\";\nimport { RegistrationQueryOptions } from \"../models/options.js\";\nimport { RegistrationQueryResponse } from \"../models/response.js\";\nimport { registrationDescriptionParser } from \"../serializers/registrationSerializer.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"listRegistrations\";\n\n/**\n * Gets all registrations for the notification hub with the given query options.\n * @param context - The Notification Hubs client.\n * @param options - The options for querying the registrations such as $top and $filter.\n * @returns A paged async iterable containing all of the registrations for the notification hub.\n */\nexport function listRegistrations(\n context: NotificationHubsClientContext,\n options: RegistrationQueryOptions = {}\n): PagedAsyncIterableIterator<RegistrationDescription> {\n const { span, updatedOptions } = tracingClient.startSpan(\n `NotificationHubsClientContext-${OPERATION_NAME}`,\n options\n );\n try {\n const iter = listRegistrationsAll(context, updatedOptions);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return listRegistrationPagingPage(context, options);\n },\n };\n } catch (e: any) {\n span.setStatus({ status: \"error\", error: e });\n throw e;\n } finally {\n span.end();\n }\n}\n\nasync function* listRegistrationsAll(\n context: NotificationHubsClientContext,\n options: RegistrationQueryOptions\n): AsyncIterableIterator<RegistrationDescription> {\n for await (const page of listRegistrationPagingPage(context, options)) {\n yield* page;\n }\n}\n\nasync function* listRegistrationPagingPage(\n context: NotificationHubsClientContext,\n options: RegistrationQueryOptions\n): AsyncIterableIterator<RegistrationDescription[]> {\n let result = await _listRegistrations(context, options);\n yield result.registrations || [];\n let continuationToken = result.continuationToken;\n while (continuationToken) {\n result = await _listRegistrations(context, options, continuationToken);\n continuationToken = result.continuationToken;\n yield result.registrations || [];\n }\n}\n\nasync function _listRegistrations(\n context: NotificationHubsClientContext,\n options: RegistrationQueryOptions,\n continuationToken?: string\n): Promise<RegistrationQueryResponse> {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/registrations\";\n if (options.top !== undefined) {\n endpoint.searchParams.set(\"$top\", `${options.top}`);\n }\n\n if (options.filter !== undefined) {\n endpoint.searchParams.set(\"$filter\", options.filter);\n }\n\n if (continuationToken !== undefined) {\n endpoint.searchParams.set(\"continuationtoken\", continuationToken);\n }\n\n const headers = await context.createHeaders(OPERATION_NAME);\n const request = createRequest(endpoint, \"GET\", headers, options);\n const response = await sendRequest(context, request, 200);\n\n const registrations = await registrationDescriptionParser.parseRegistrationFeed(\n response.bodyAsText!\n );\n const nextToken = response.headers.get(\"x-ms-continuationtoken\");\n return {\n registrations,\n continuationToken: nextToken,\n };\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"listRegistrationsByTag.js","sourceRoot":"","sources":["../../../src/client/listRegistrationsByTag.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAMnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,0CAA0C,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,cAAc,GAAG,wBAAwB,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CACpC,OAAsC,EACtC,GAAW,EACX,UAAyC,EAAE;IAE3C,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,aAAa,CAAC,SAAS,CACtD,iCAAiC,c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AAE,GAAG,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAA,CAAC;YACjF,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAC;YAC7C,oBAAM,MAAM,CAAC,aAAa,IAAI,EAAE,CAAA,CAAC;SAClC;IACH,CAAC;CAAA;AAED,KAAK,UAAU,uBAAuB,CACpC,OAAsC,EACtC,GAAW,EACX,OAAsC,EACtC,iBAA0B;IAE1B,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IACtC,QAAQ,CAAC,QAAQ,IAAI,SAAS,GAAG,gBAAgB,CAAC;IAClD,IAAI,OAAO,CAAC,GAAG,KAAK,SAAS,EAAE;QAC7B,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;KACrD;IAED,IAAI,iBAAiB,KAAK,SAAS,EAAE;QACnC,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,CAAC;KACnE;IAED,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;IAC5D,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACjE,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;IAE1D,MAAM,aAAa,GAAG,MAAM,6BAA6B,CAAC,qBAAqB,CAC7E,QAAQ,CAAC,UAAW,CACrB,CAAC;IACF,MAAM,SAAS,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IACjE,OAAO;QACL,aAAa;QACb,iBAAiB,EAAE,SAAS;KAC7B,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { RegistrationDescription } from \"../models/registration.js\";\nimport { RegistrationQueryLimitOptions } from \"../models/options.js\";\nimport { RegistrationQueryResponse } from \"../models/response.js\";\nimport { registrationDescriptionParser } from \"../serializers/registrationSerializer.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"listRegistrationsByTag\";\n\n/**\n * Lists all registrations with the matching tag.\n * @param context - The Notification Hubs client.\n * @param tag - The tag to query for matching registrations.\n * @param options - The query options such as $top.\n * @returns A paged async iterable containing the matching registrations for the notification hub.\n */\nexport function listRegistrationsByTag(\n context: NotificationHubsClientContext,\n tag: string,\n options: RegistrationQueryLimitOptions = {}\n): PagedAsyncIterableIterator<RegistrationDescription> {\n const { span, updatedOptions } = tracingClient.startSpan(\n `NotificationHubsClientContext-${OPERATION_NAME}`,\n options\n );\n try {\n const iter = listRegistrationsByTagAll(context, tag, updatedOptions);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return listRegistrationsByTagPagingPage(context, tag, options);\n },\n };\n } catch (e: any) {\n span.setStatus({ status: \"error\", error: e });\n throw e;\n } finally {\n span.end();\n }\n}\n\nasync function* listRegistrationsByTagAll(\n context: NotificationHubsClientContext,\n tag: string,\n options: RegistrationQueryLimitOptions\n): AsyncIterableIterator<RegistrationDescription> {\n for await (const page of listRegistrationsByTagPagingPage(context, tag, options)) {\n yield* page;\n }\n}\n\nasync function* listRegistrationsByTagPagingPage(\n context: NotificationHubsClientContext,\n tag: string,\n options: RegistrationQueryLimitOptions\n): AsyncIterableIterator<RegistrationDescription[]> {\n let result = await _listRegistrationsByTag(context, tag, options);\n yield result.registrations || [];\n let continuationToken = result.continuationToken;\n while (continuationToken) {\n result = await _listRegistrationsByTag(context, tag, options, continuationToken);\n continuationToken = result.continuationToken;\n yield result.registrations || [];\n }\n}\n\nasync function _listRegistrationsByTag(\n context: NotificationHubsClientContext,\n tag: string,\n options: RegistrationQueryLimitOptions,\n continuationToken?: string\n): Promise<RegistrationQueryResponse> {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/tags/${tag}/registrations`;\n if (options.top !== undefined) {\n endpoint.searchParams.set(\"$top\", `${options.top}`);\n }\n\n if (continuationToken !== undefined) {\n endpoint.searchParams.set(\"continuationtoken\", continuationToken);\n }\n\n const headers = await context.createHeaders(OPERATION_NAME);\n const request = createRequest(endpoint, \"GET\", headers, options);\n const response = await sendRequest(context, request, 200);\n\n const registrations = await registrationDescriptionParser.parseRegistrationFeed(\n response.bodyAsText!\n );\n const nextToken = response.headers.get(\"x-ms-continuationtoken\");\n return {\n registrations,\n continuationToken: nextToken,\n };\n}\n"]}
|