@azure/notification-hubs 2.0.0-alpha.20240911.1 → 2.0.0-alpha.20240913.2
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 +6 -6
- package/dist/api/notification-hubs.d.ts +37 -13
- package/dist/browser/api/index.d.ts +2 -0
- package/dist/browser/api/index.d.ts.map +1 -1
- package/dist/browser/api/index.js +2 -0
- package/dist/browser/api/index.js.map +1 -1
- package/dist/browser/api/internal/_scheduleNotification.d.ts +15 -0
- package/dist/browser/api/internal/_scheduleNotification.d.ts.map +1 -0
- package/dist/browser/api/internal/_scheduleNotification.js +31 -0
- package/dist/browser/api/internal/_scheduleNotification.js.map +1 -0
- package/dist/browser/api/internal/_sendNotification.d.ts +13 -0
- package/dist/browser/api/internal/_sendNotification.d.ts.map +1 -0
- package/dist/browser/api/internal/_sendNotification.js +62 -0
- package/dist/browser/api/internal/_sendNotification.js.map +1 -0
- package/dist/browser/api/scheduleBroadcastNotification.d.ts +15 -0
- package/dist/browser/api/scheduleBroadcastNotification.d.ts.map +1 -0
- package/dist/browser/api/scheduleBroadcastNotification.js +16 -0
- package/dist/browser/api/scheduleBroadcastNotification.js.map +1 -0
- package/dist/browser/api/scheduleNotification.d.ts +1 -1
- package/dist/browser/api/scheduleNotification.d.ts.map +1 -1
- package/dist/browser/api/scheduleNotification.js +3 -18
- package/dist/browser/api/scheduleNotification.js.map +1 -1
- package/dist/browser/api/sendBroadcastNotification.d.ts +13 -0
- package/dist/browser/api/sendBroadcastNotification.d.ts.map +1 -0
- package/dist/browser/api/sendBroadcastNotification.js +14 -0
- package/dist/browser/api/sendBroadcastNotification.js.map +1 -0
- package/dist/browser/api/sendNotification.d.ts +1 -1
- package/dist/browser/api/sendNotification.d.ts.map +1 -1
- package/dist/browser/api/sendNotification.js +3 -52
- package/dist/browser/api/sendNotification.js.map +1 -1
- package/dist/browser/models/options.d.ts +13 -10
- package/dist/browser/models/options.d.ts.map +1 -1
- package/dist/browser/models/options.js.map +1 -1
- package/dist/browser/notificationHubsClient.d.ts +19 -3
- package/dist/browser/notificationHubsClient.d.ts.map +1 -1
- package/dist/browser/notificationHubsClient.js +24 -2
- package/dist/browser/notificationHubsClient.js.map +1 -1
- package/dist/browser/utils/optionUtils.d.ts +7 -1
- package/dist/browser/utils/optionUtils.d.ts.map +1 -1
- package/dist/browser/utils/optionUtils.js +8 -0
- package/dist/browser/utils/optionUtils.js.map +1 -1
- package/dist/browser/utils/xmlUtils.js +1 -1
- package/dist/browser/utils/xmlUtils.js.map +1 -1
- package/dist/commonjs/api/index.d.ts +2 -0
- package/dist/commonjs/api/index.d.ts.map +1 -1
- package/dist/commonjs/api/index.js +2 -0
- package/dist/commonjs/api/index.js.map +1 -1
- package/dist/commonjs/api/internal/_scheduleNotification.d.ts +15 -0
- package/dist/commonjs/api/internal/_scheduleNotification.d.ts.map +1 -0
- package/dist/commonjs/api/internal/_scheduleNotification.js +34 -0
- package/dist/commonjs/api/internal/_scheduleNotification.js.map +1 -0
- package/dist/commonjs/api/internal/_sendNotification.d.ts +13 -0
- package/dist/commonjs/api/internal/_sendNotification.d.ts.map +1 -0
- package/dist/commonjs/api/internal/_sendNotification.js +65 -0
- package/dist/commonjs/api/internal/_sendNotification.js.map +1 -0
- package/dist/commonjs/api/scheduleBroadcastNotification.d.ts +15 -0
- package/dist/commonjs/api/scheduleBroadcastNotification.d.ts.map +1 -0
- package/dist/commonjs/api/scheduleBroadcastNotification.js +19 -0
- package/dist/commonjs/api/scheduleBroadcastNotification.js.map +1 -0
- package/dist/commonjs/api/scheduleNotification.d.ts +1 -1
- package/dist/commonjs/api/scheduleNotification.d.ts.map +1 -1
- package/dist/commonjs/api/scheduleNotification.js +3 -18
- package/dist/commonjs/api/scheduleNotification.js.map +1 -1
- package/dist/commonjs/api/sendBroadcastNotification.d.ts +13 -0
- package/dist/commonjs/api/sendBroadcastNotification.d.ts.map +1 -0
- package/dist/commonjs/api/sendBroadcastNotification.js +17 -0
- package/dist/commonjs/api/sendBroadcastNotification.js.map +1 -0
- package/dist/commonjs/api/sendNotification.d.ts +1 -1
- package/dist/commonjs/api/sendNotification.d.ts.map +1 -1
- package/dist/commonjs/api/sendNotification.js +3 -52
- package/dist/commonjs/api/sendNotification.js.map +1 -1
- package/dist/commonjs/models/options.d.ts +13 -10
- package/dist/commonjs/models/options.d.ts.map +1 -1
- package/dist/commonjs/models/options.js.map +1 -1
- package/dist/commonjs/notificationHubsClient.d.ts +19 -3
- package/dist/commonjs/notificationHubsClient.d.ts.map +1 -1
- package/dist/commonjs/notificationHubsClient.js +24 -2
- package/dist/commonjs/notificationHubsClient.js.map +1 -1
- package/dist/commonjs/utils/optionUtils.d.ts +7 -1
- package/dist/commonjs/utils/optionUtils.d.ts.map +1 -1
- package/dist/commonjs/utils/optionUtils.js +9 -0
- package/dist/commonjs/utils/optionUtils.js.map +1 -1
- package/dist/commonjs/utils/xmlUtils.js +1 -1
- package/dist/commonjs/utils/xmlUtils.js.map +1 -1
- package/dist/esm/api/index.d.ts +2 -0
- package/dist/esm/api/index.d.ts.map +1 -1
- package/dist/esm/api/index.js +2 -0
- package/dist/esm/api/index.js.map +1 -1
- package/dist/esm/api/internal/_scheduleNotification.d.ts +15 -0
- package/dist/esm/api/internal/_scheduleNotification.d.ts.map +1 -0
- package/dist/esm/api/internal/_scheduleNotification.js +31 -0
- package/dist/esm/api/internal/_scheduleNotification.js.map +1 -0
- package/dist/esm/api/internal/_sendNotification.d.ts +13 -0
- package/dist/esm/api/internal/_sendNotification.d.ts.map +1 -0
- package/dist/esm/api/internal/_sendNotification.js +62 -0
- package/dist/esm/api/internal/_sendNotification.js.map +1 -0
- package/dist/esm/api/scheduleBroadcastNotification.d.ts +15 -0
- package/dist/esm/api/scheduleBroadcastNotification.d.ts.map +1 -0
- package/dist/esm/api/scheduleBroadcastNotification.js +16 -0
- package/dist/esm/api/scheduleBroadcastNotification.js.map +1 -0
- package/dist/esm/api/scheduleNotification.d.ts +1 -1
- package/dist/esm/api/scheduleNotification.d.ts.map +1 -1
- package/dist/esm/api/scheduleNotification.js +3 -18
- package/dist/esm/api/scheduleNotification.js.map +1 -1
- package/dist/esm/api/sendBroadcastNotification.d.ts +13 -0
- package/dist/esm/api/sendBroadcastNotification.d.ts.map +1 -0
- package/dist/esm/api/sendBroadcastNotification.js +14 -0
- package/dist/esm/api/sendBroadcastNotification.js.map +1 -0
- package/dist/esm/api/sendNotification.d.ts +1 -1
- package/dist/esm/api/sendNotification.d.ts.map +1 -1
- package/dist/esm/api/sendNotification.js +3 -52
- package/dist/esm/api/sendNotification.js.map +1 -1
- package/dist/esm/models/options.d.ts +13 -10
- package/dist/esm/models/options.d.ts.map +1 -1
- package/dist/esm/models/options.js.map +1 -1
- package/dist/esm/notificationHubsClient.d.ts +19 -3
- package/dist/esm/notificationHubsClient.d.ts.map +1 -1
- package/dist/esm/notificationHubsClient.js +24 -2
- package/dist/esm/notificationHubsClient.js.map +1 -1
- package/dist/esm/utils/optionUtils.d.ts +7 -1
- package/dist/esm/utils/optionUtils.d.ts.map +1 -1
- package/dist/esm/utils/optionUtils.js +8 -0
- package/dist/esm/utils/optionUtils.js.map +1 -1
- package/dist/esm/utils/xmlUtils.js +1 -1
- package/dist/esm/utils/xmlUtils.js.map +1 -1
- package/dist/models/notification-hubs.d.ts +15 -11
- package/dist/notification-hubs.d.ts +33 -13
- package/dist/react-native/api/index.d.ts +2 -0
- package/dist/react-native/api/index.d.ts.map +1 -1
- package/dist/react-native/api/index.js +2 -0
- package/dist/react-native/api/index.js.map +1 -1
- package/dist/react-native/api/internal/_scheduleNotification.d.ts +15 -0
- package/dist/react-native/api/internal/_scheduleNotification.d.ts.map +1 -0
- package/dist/react-native/api/internal/_scheduleNotification.js +31 -0
- package/dist/react-native/api/internal/_scheduleNotification.js.map +1 -0
- package/dist/react-native/api/internal/_sendNotification.d.ts +13 -0
- package/dist/react-native/api/internal/_sendNotification.d.ts.map +1 -0
- package/dist/react-native/api/internal/_sendNotification.js +62 -0
- package/dist/react-native/api/internal/_sendNotification.js.map +1 -0
- package/dist/react-native/api/scheduleBroadcastNotification.d.ts +15 -0
- package/dist/react-native/api/scheduleBroadcastNotification.d.ts.map +1 -0
- package/dist/react-native/api/scheduleBroadcastNotification.js +16 -0
- package/dist/react-native/api/scheduleBroadcastNotification.js.map +1 -0
- package/dist/react-native/api/scheduleNotification.d.ts +1 -1
- package/dist/react-native/api/scheduleNotification.d.ts.map +1 -1
- package/dist/react-native/api/scheduleNotification.js +3 -18
- package/dist/react-native/api/scheduleNotification.js.map +1 -1
- package/dist/react-native/api/sendBroadcastNotification.d.ts +13 -0
- package/dist/react-native/api/sendBroadcastNotification.d.ts.map +1 -0
- package/dist/react-native/api/sendBroadcastNotification.js +14 -0
- package/dist/react-native/api/sendBroadcastNotification.js.map +1 -0
- package/dist/react-native/api/sendNotification.d.ts +1 -1
- package/dist/react-native/api/sendNotification.d.ts.map +1 -1
- package/dist/react-native/api/sendNotification.js +3 -52
- package/dist/react-native/api/sendNotification.js.map +1 -1
- package/dist/react-native/models/options.d.ts +13 -10
- package/dist/react-native/models/options.d.ts.map +1 -1
- package/dist/react-native/models/options.js.map +1 -1
- package/dist/react-native/notificationHubsClient.d.ts +19 -3
- package/dist/react-native/notificationHubsClient.d.ts.map +1 -1
- package/dist/react-native/notificationHubsClient.js +24 -2
- package/dist/react-native/notificationHubsClient.js.map +1 -1
- package/dist/react-native/utils/optionUtils.d.ts +7 -1
- package/dist/react-native/utils/optionUtils.d.ts.map +1 -1
- package/dist/react-native/utils/optionUtils.js +8 -0
- package/dist/react-native/utils/optionUtils.js.map +1 -1
- package/dist/react-native/utils/xmlUtils.js +1 -1
- package/dist/react-native/utils/xmlUtils.js.map +1 -1
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notificationHubsClient.js","sourceRoot":"","sources":["../../src/notificationHubsClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAkBlC,6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mC,EAAC,IAAI,CAAC,OAAO,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAAC;IACxF,CAAC;IAED;;;;;OAKG;IACH,wBAAwB,CACtB,GAAuB,EACvB,UAA4B,EAAE;QAE9B,OAAO,IAAA,sDAA8B,EAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;IAED;;;;OAIG;IACH,uBAAuB,CAAC,UAA4B,EAAE;QACpD,OAAO,IAAA,oDAA6B,EAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;CACF;AAtSD,wDAsSC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n DirectSendNotificationOptions,\n EntityOperationOptions,\n NotificationHubsClientOptions,\n PolledOperationOptions,\n RegistrationQueryLimitOptions,\n ScheduleNotificationOptions,\n SendNotificationOptions,\n} from \"./models/options.js\";\nimport { Installation, JsonPatch } from \"./models/installation.js\";\nimport {\n NotificationDetails,\n NotificationHubsMessageResponse,\n NotificationHubsResponse,\n} from \"./models/notificationDetails.js\";\nimport { NotificationHubJob, NotificationHubJobPoller } from \"./models/notificationHubJob.js\";\nimport { NotificationHubsClientContext, createClientContext } from \"./api/clientContext.js\";\nimport { RegistrationDescription, RegistrationChannel } from \"./models/registration.js\";\nimport { Notification } from \"./models/notification.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { beginSubmitNotificationHubJob as beginSubmitNotificationHubJobMethod } from \"./api/beginSubmitNotificationHubJob.js\";\nimport { cancelScheduledNotification as cancelScheduledNotificationMethod } from \"./api/cancelScheduledNotification.js\";\nimport { createOrUpdateInstallation as createOrUpdateInstallationMethod } from \"./api/createOrUpdateInstallation.js\";\nimport { createOrUpdateRegistration as createOrUpdateRegistrationMethod } from \"./api/createOrUpdateRegistration.js\";\nimport { createRegistrationId as createRegistrationIdMethod } from \"./api/createRegistrationId.js\";\nimport { createRegistration as createRegistrationMethod } from \"./api/createRegistration.js\";\nimport { deleteInstallation as deleteInstallationMethod } from \"./api/deleteInstallation.js\";\nimport { deleteRegistration } from \"./api/deleteRegistration.js\";\nimport { getFeedbackContainerUrl as getFeedbackContainerUrlMethod } from \"./api/getFeedbackContainerUrl.js\";\nimport { getInstallation as getInstallationMethod } from \"./api/getInstallation.js\";\nimport { getNotificationHubJob as getNotificationHubJobMethod } from \"./api/getNotificationHubJob.js\";\nimport { getNotificationOutcomeDetails as getNotificationOutcomeDetailsMethod } from \"./api/getNotificationOutcomeDetails.js\";\nimport { getRegistration as getRegistrationMethod } from \"./api/getRegistration.js\";\nimport { listNotificationHubJobs as listNotificationHubJobsMethod } from \"./api/listNotificationHubJobs.js\";\nimport { listRegistrationsByChannel as listRegistrationsByChannelMethod } from \"./api/listRegistrationsByChannel.js\";\nimport { listRegistrationsByTag as listRegistrationsByTagMethod } from \"./api/listRegistrationsByTag.js\";\nimport { listRegistrations as listRegistrationsMethod } from \"./api/listRegistrations.js\";\nimport { scheduleNotification as scheduleNotificationMethod } from \"./api/scheduleNotification.js\";\nimport { sendNotification as sendNotificationMethod } from \"./api/sendNotification.js\";\nimport { submitNotificationHubJob as submitNotificationHubJobMethod } from \"./api/submitNotificationHubJob.js\";\nimport { updateInstallation as updateInstallationMethod } from \"./api/updateInstallation.js\";\nimport { updateRegistration as updateRegistrationMethod } from \"./api/updateRegistration.js\";\n\n/**\n * This represents a client for Azure Notification Hubs to manage installations and send\n * messages to devices.\n */\nexport class NotificationHubsClient {\n private _client: NotificationHubsClientContext;\n\n /**\n * Creates a new instance of the NotificationClient with a connection string, hub name and options.\n * @param connectionString - The Notification Hub Access Policy connection string.\n * @param hubName - The name of the Azure Notification Hub.\n * @param options - Options for configuring the Azure Notification Hubs client.\n */\n constructor(\n connectionString: string,\n hubName: string,\n options: NotificationHubsClientOptions = {},\n ) {\n this._client = createClientContext(connectionString, hubName, options);\n }\n\n /**\n * Creates or overwrites an installation to a Notification Hub.\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 */\n createOrUpdateInstallation(\n installation: Installation,\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return createOrUpdateInstallationMethod(this._client, installation, options);\n }\n\n /**\n * Deletes an installation from a Notification Hub.\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 */\n deleteInstallation(\n installationId: string,\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return deleteInstallationMethod(this._client, installationId, options);\n }\n\n /**\n * Gets an Azure Notification Hub installation by the installation ID.\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 */\n getInstallation(installationId: string, options: OperationOptions = {}): Promise<Installation> {\n return getInstallationMethod(this._client, installationId, options);\n }\n\n /**\n * Updates an installation using the JSON-Patch standard in RFC6902.\n * @param installationId - The ID of the installation to update.\n * @param patches - An array of patches following the JSON-Patch standard.\n * @param options - Configuration options for the patch installation operation.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n updateInstallation(\n installationId: string,\n patches: JsonPatch[],\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return updateInstallationMethod(this._client, installationId, patches, options);\n }\n\n /**\n * Creates a new registration ID.\n * @param options - The options for creating a new registration ID.\n * @returns The newly created registration ID.\n */\n createRegistrationId(options: OperationOptions = {}): Promise<string> {\n return createRegistrationIdMethod(this._client, options);\n }\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 registration - The registration to create.\n * @param options - Options for creating a new registration.\n * @returns The newly created registration description.\n */\n createRegistration(\n registration: RegistrationDescription,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return createRegistrationMethod(this._client, registration, options);\n }\n\n /**\n * Creates or updates a registration.\n * @param registration - The registration to create or update.\n * @param options - The operation options.\n * @returns The created or updated registration description.\n */\n createOrUpdateRegistration(\n registration: RegistrationDescription,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return createOrUpdateRegistrationMethod(this._client, registration, options);\n }\n\n /**\n * Updates an existing registration.\n * @param registration - The registration to update.\n * @param options - The operation options.\n * @returns The updated registration description.\n */\n updateRegistration(\n registration: RegistrationDescription,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return updateRegistrationMethod(this._client, registration, options);\n }\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 */\n deleteRegistration(\n registrationId: string,\n options: EntityOperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return deleteRegistration(this._client, registrationId, options);\n }\n\n /**\n * Gets a registration by the given registration ID.\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 */\n getRegistration(\n registrationId: string,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return getRegistrationMethod(this._client, registrationId, options);\n }\n\n /**\n * Gets all registrations for the notification hub with the given query options.\n * @param options - The options for querying the registrations such as $top.\n * @returns A paged async iterable containing all of the registrations for the notification hub.\n */\n listRegistrations(\n options: RegistrationQueryLimitOptions = {},\n ): PagedAsyncIterableIterator<RegistrationDescription> {\n return listRegistrationsMethod(this._client, options);\n }\n\n /**\n * Gets all registrations for the notification hub with the given device information and options.\n * @param channel - The registration channel information to query per PNS type.\n * @param options - The options for querying the registrations such as $top.\n * @returns A paged async iterable containing all of the registrations for the notification hub.\n */\n listRegistrationsByChannel(\n channel: RegistrationChannel,\n options: RegistrationQueryLimitOptions = {},\n ): PagedAsyncIterableIterator<RegistrationDescription> {\n return listRegistrationsByChannelMethod(this._client, channel, options);\n }\n\n /**\n * Lists all registrations with the matching tag.\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 */\n listRegistrationsByTag(\n tag: string,\n options: RegistrationQueryLimitOptions = {},\n ): PagedAsyncIterableIterator<RegistrationDescription> {\n return listRegistrationsByTagMethod(this._client, tag, options);\n }\n\n /**\n * Sends push notifications to devices that match the given tags or tag expression.\n * @param notification - The notification to send to the matching devices.\n * @param options - Options for the notification including tags, device handles and whether to enable test send.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n sendNotification(\n notification: Notification,\n options: DirectSendNotificationOptions | SendNotificationOptions = { enableTestSend: false },\n ): Promise<NotificationHubsMessageResponse> {\n return sendNotificationMethod(this._client, notification, options);\n }\n\n /**\n * Schedules a push notification to devices that match the given tags or tag expression at the specified time.\n * NOTE: This is only available in Standard SKU Azure Notification Hubs.\n * @param scheduledTime - The Date to send the push notification.\n * @param notification - The notification to send to the matching devices.\n * @param options - Options which include tags used to target the device for push notifications in either an array or tag expression.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n scheduleNotification(\n scheduledTime: Date,\n notification: Notification,\n options: ScheduleNotificationOptions = {},\n ): Promise<NotificationHubsMessageResponse> {\n return scheduleNotificationMethod(this._client, scheduledTime, notification, options);\n }\n\n /**\n * Cancels the scheduled notification with the given notification ID.\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 */\n cancelScheduledNotification(\n notificationId: string,\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return cancelScheduledNotificationMethod(this._client, notificationId, options);\n }\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 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 */\n getFeedbackContainerUrl(options: OperationOptions = {}): Promise<string> {\n return getFeedbackContainerUrlMethod(this._client, options);\n }\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 notificationId - The notification ID returned from the send operation.\n * @param options - The operation options.\n * @returns The results of the send operation.\n */\n getNotificationOutcomeDetails(\n notificationId: string,\n options: OperationOptions = {},\n ): Promise<NotificationDetails> {\n return getNotificationOutcomeDetailsMethod(this._client, notificationId, options);\n }\n\n /**\n * Gets a Notification Hub Job by the ID.\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 */\n getNotificationHubJob(\n jobId: string,\n options: OperationOptions = {},\n ): Promise<NotificationHubJob> {\n return getNotificationHubJobMethod(this._client, jobId, options);\n }\n\n /**\n * Submits a Notification Hub job and creates a poller to poll for results.\n * @param notificationHubJob - The Notification Hub import/export job to start.\n * @param options - The operation options.\n * @returns A poller which can be called to poll until completion of the job.\n */\n beginSubmitNotificationHubJob(\n notificationHubJob: NotificationHubJob,\n options: PolledOperationOptions = {},\n ): Promise<NotificationHubJobPoller> {\n return beginSubmitNotificationHubJobMethod(this._client, notificationHubJob, options);\n }\n\n /**\n * Submits a Notification Hub Job. Note this is available to Standard SKU namespace and above.\n * @param job - The notification hub job to submit.\n * @param options - The operation options.\n * @returns The notification hub job details including job ID and status.\n */\n submitNotificationHubJob(\n job: NotificationHubJob,\n options: OperationOptions = {},\n ): Promise<NotificationHubJob> {\n return submitNotificationHubJobMethod(this._client, job, options);\n }\n\n /**\n * Gets all Notification Hub Jobs for this Notification Hub.\n * @param options - The operation options.\n * @returns An array of all Notification Hub Jobs for this Notification Hub.\n */\n listNotificationHubJobs(options: OperationOptions = {}): Promise<NotificationHubJob[]> {\n return listNotificationHubJobsMethod(this._client, options);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"notificationHubsClient.js","sourceRoot":"","sources":["../../src/notificationHubsClient.ts"],"names":[],"mappings":";AA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BAA6B,CAC3B,cAAsB,EACtB,UAA4B,EAAE;QAE9B,OAAO,IAAA,gEAAmC,EAAC,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;IACpF,CAAC;IAED;;;;;OAKG;IACH,qBAAqB,CACnB,KAAa,EACb,UAA4B,EAAE;QAE9B,OAAO,IAAA,gDAA2B,EAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACnE,CAAC;IAED;;;;;OAKG;IACH,6BAA6B,CAC3B,kBAAsC,EACtC,UAAkC,EAAE;QAEpC,OAAO,IAAA,gEAAmC,EAAC,IAAI,CAAC,OAAO,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAAC;IACxF,CAAC;IAED;;;;;OAKG;IACH,wBAAwB,CACtB,GAAuB,EACvB,UAA4B,EAAE;QAE9B,OAAO,IAAA,sDAA8B,EAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;IAED;;;;OAIG;IACH,uBAAuB,CAAC,UAA4B,EAAE;QACpD,OAAO,IAAA,oDAA6B,EAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;CACF;AAnUD,wDAmUC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n BroadcastSendNotificationOptions,\n DirectSendNotificationOptions,\n EntityOperationOptions,\n NotificationHubsClientOptions,\n PolledOperationOptions,\n RegistrationQueryLimitOptions,\n ScheduleNotificationOptions,\n SendNotificationOptions,\n} from \"./models/options.js\";\nimport { Installation, JsonPatch } from \"./models/installation.js\";\nimport {\n NotificationDetails,\n NotificationHubsMessageResponse,\n NotificationHubsResponse,\n} from \"./models/notificationDetails.js\";\nimport { NotificationHubJob, NotificationHubJobPoller } from \"./models/notificationHubJob.js\";\nimport { NotificationHubsClientContext, createClientContext } from \"./api/clientContext.js\";\nimport { RegistrationDescription, RegistrationChannel } from \"./models/registration.js\";\nimport { Notification } from \"./models/notification.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { beginSubmitNotificationHubJob as beginSubmitNotificationHubJobMethod } from \"./api/beginSubmitNotificationHubJob.js\";\nimport { cancelScheduledNotification as cancelScheduledNotificationMethod } from \"./api/cancelScheduledNotification.js\";\nimport { createOrUpdateInstallation as createOrUpdateInstallationMethod } from \"./api/createOrUpdateInstallation.js\";\nimport { createOrUpdateRegistration as createOrUpdateRegistrationMethod } from \"./api/createOrUpdateRegistration.js\";\nimport { createRegistrationId as createRegistrationIdMethod } from \"./api/createRegistrationId.js\";\nimport { createRegistration as createRegistrationMethod } from \"./api/createRegistration.js\";\nimport { deleteInstallation as deleteInstallationMethod } from \"./api/deleteInstallation.js\";\nimport { deleteRegistration } from \"./api/deleteRegistration.js\";\nimport { getFeedbackContainerUrl as getFeedbackContainerUrlMethod } from \"./api/getFeedbackContainerUrl.js\";\nimport { getInstallation as getInstallationMethod } from \"./api/getInstallation.js\";\nimport { getNotificationHubJob as getNotificationHubJobMethod } from \"./api/getNotificationHubJob.js\";\nimport { getNotificationOutcomeDetails as getNotificationOutcomeDetailsMethod } from \"./api/getNotificationOutcomeDetails.js\";\nimport { getRegistration as getRegistrationMethod } from \"./api/getRegistration.js\";\nimport { listNotificationHubJobs as listNotificationHubJobsMethod } from \"./api/listNotificationHubJobs.js\";\nimport { listRegistrationsByChannel as listRegistrationsByChannelMethod } from \"./api/listRegistrationsByChannel.js\";\nimport { listRegistrationsByTag as listRegistrationsByTagMethod } from \"./api/listRegistrationsByTag.js\";\nimport { listRegistrations as listRegistrationsMethod } from \"./api/listRegistrations.js\";\nimport { scheduleBroadcastNotification as scheduleBroadcastNotificationMethod } from \"./api/scheduleBroadcastNotification.js\";\nimport { scheduleNotification as scheduleNotificationMethod } from \"./api/scheduleNotification.js\";\nimport { sendBroadcastNotification as sendBroadcastNotificationMethod } from \"./api/sendBroadcastNotification.js\";\nimport { sendNotification as sendNotificationMethod } from \"./api/sendNotification.js\";\nimport { submitNotificationHubJob as submitNotificationHubJobMethod } from \"./api/submitNotificationHubJob.js\";\nimport { updateInstallation as updateInstallationMethod } from \"./api/updateInstallation.js\";\nimport { updateRegistration as updateRegistrationMethod } from \"./api/updateRegistration.js\";\n\n/**\n * This represents a client for Azure Notification Hubs to manage installations and send\n * messages to devices.\n */\nexport class NotificationHubsClient {\n private _client: NotificationHubsClientContext;\n\n /**\n * Creates a new instance of the NotificationClient with a connection string, hub name and options.\n * @param connectionString - The Notification Hub Access Policy connection string.\n * @param hubName - The name of the Azure Notification Hub.\n * @param options - Options for configuring the Azure Notification Hubs client.\n */\n constructor(\n connectionString: string,\n hubName: string,\n options: NotificationHubsClientOptions = {},\n ) {\n this._client = createClientContext(connectionString, hubName, options);\n }\n\n /**\n * Creates or overwrites an installation to a Notification Hub.\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 */\n createOrUpdateInstallation(\n installation: Installation,\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return createOrUpdateInstallationMethod(this._client, installation, options);\n }\n\n /**\n * Deletes an installation from a Notification Hub.\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 */\n deleteInstallation(\n installationId: string,\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return deleteInstallationMethod(this._client, installationId, options);\n }\n\n /**\n * Gets an Azure Notification Hub installation by the installation ID.\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 */\n getInstallation(installationId: string, options: OperationOptions = {}): Promise<Installation> {\n return getInstallationMethod(this._client, installationId, options);\n }\n\n /**\n * Updates an installation using the JSON-Patch standard in RFC6902.\n * @param installationId - The ID of the installation to update.\n * @param patches - An array of patches following the JSON-Patch standard.\n * @param options - Configuration options for the patch installation operation.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n updateInstallation(\n installationId: string,\n patches: JsonPatch[],\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return updateInstallationMethod(this._client, installationId, patches, options);\n }\n\n /**\n * Creates a new registration ID.\n * @param options - The options for creating a new registration ID.\n * @returns The newly created registration ID.\n */\n createRegistrationId(options: OperationOptions = {}): Promise<string> {\n return createRegistrationIdMethod(this._client, options);\n }\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 registration - The registration to create.\n * @param options - Options for creating a new registration.\n * @returns The newly created registration description.\n */\n createRegistration(\n registration: RegistrationDescription,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return createRegistrationMethod(this._client, registration, options);\n }\n\n /**\n * Creates or updates a registration.\n * @param registration - The registration to create or update.\n * @param options - The operation options.\n * @returns The created or updated registration description.\n */\n createOrUpdateRegistration(\n registration: RegistrationDescription,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return createOrUpdateRegistrationMethod(this._client, registration, options);\n }\n\n /**\n * Updates an existing registration.\n * @param registration - The registration to update.\n * @param options - The operation options.\n * @returns The updated registration description.\n */\n updateRegistration(\n registration: RegistrationDescription,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return updateRegistrationMethod(this._client, registration, options);\n }\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 */\n deleteRegistration(\n registrationId: string,\n options: EntityOperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return deleteRegistration(this._client, registrationId, options);\n }\n\n /**\n * Gets a registration by the given registration ID.\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 */\n getRegistration(\n registrationId: string,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return getRegistrationMethod(this._client, registrationId, options);\n }\n\n /**\n * Gets all registrations for the notification hub with the given query options.\n * @param options - The options for querying the registrations such as $top.\n * @returns A paged async iterable containing all of the registrations for the notification hub.\n */\n listRegistrations(\n options: RegistrationQueryLimitOptions = {},\n ): PagedAsyncIterableIterator<RegistrationDescription> {\n return listRegistrationsMethod(this._client, options);\n }\n\n /**\n * Gets all registrations for the notification hub with the given device information and options.\n * @param channel - The registration channel information to query per PNS type.\n * @param options - The options for querying the registrations such as $top.\n * @returns A paged async iterable containing all of the registrations for the notification hub.\n */\n listRegistrationsByChannel(\n channel: RegistrationChannel,\n options: RegistrationQueryLimitOptions = {},\n ): PagedAsyncIterableIterator<RegistrationDescription> {\n return listRegistrationsByChannelMethod(this._client, channel, options);\n }\n\n /**\n * Lists all registrations with the matching tag.\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 */\n listRegistrationsByTag(\n tag: string,\n options: RegistrationQueryLimitOptions = {},\n ): PagedAsyncIterableIterator<RegistrationDescription> {\n return listRegistrationsByTagMethod(this._client, tag, options);\n }\n\n /**\n * Sends push notifications to devices all devices.\n * @param notification - The notification to send to all devices.\n * @param options - Options for the notification including whether to enable test send.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n sendBroadcastNotification(\n notification: Notification,\n options: BroadcastSendNotificationOptions = {},\n ): Promise<NotificationHubsMessageResponse> {\n return sendBroadcastNotificationMethod(this._client, notification, options);\n }\n\n /**\n * Sends push notifications to devices that match the given tags or tag expression.\n * @param notification - The notification to send to the matching devices.\n * @param options - Options for the notification including tags, device handles and whether to enable test send.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n sendNotification(\n notification: Notification,\n options: DirectSendNotificationOptions | SendNotificationOptions,\n ): Promise<NotificationHubsMessageResponse> {\n return sendNotificationMethod(this._client, notification, options);\n }\n\n /**\n * Schedules a push notification to all devices at the specified time.\n * NOTE: This is only available in Standard SKU Azure Notification Hubs.\n * @param scheduledTime - The Date to send the push notification.\n * @param notification - The notification to send to the matching devices.\n * @param options - The operation options.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n scheduleBroadcastNotification(\n scheduledTime: Date,\n notification: Notification,\n options: OperationOptions = {},\n ): Promise<NotificationHubsMessageResponse> {\n return scheduleBroadcastNotificationMethod(this._client, scheduledTime, notification, options);\n }\n\n /**\n * Schedules a push notification to devices that match the given tags or tag expression at the specified time.\n * NOTE: This is only available in Standard SKU Azure Notification Hubs.\n * @param scheduledTime - The Date to send the push notification.\n * @param notification - The notification to send to the matching devices.\n * @param options - Options which include tags used to target the device for push notifications in either an array or tag expression.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n scheduleNotification(\n scheduledTime: Date,\n notification: Notification,\n options: ScheduleNotificationOptions,\n ): Promise<NotificationHubsMessageResponse> {\n return scheduleNotificationMethod(this._client, scheduledTime, notification, options);\n }\n\n /**\n * Cancels the scheduled notification with the given notification ID.\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 */\n cancelScheduledNotification(\n notificationId: string,\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return cancelScheduledNotificationMethod(this._client, notificationId, options);\n }\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 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 */\n getFeedbackContainerUrl(options: OperationOptions = {}): Promise<string> {\n return getFeedbackContainerUrlMethod(this._client, options);\n }\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 notificationId - The notification ID returned from the send operation.\n * @param options - The operation options.\n * @returns The results of the send operation.\n */\n getNotificationOutcomeDetails(\n notificationId: string,\n options: OperationOptions = {},\n ): Promise<NotificationDetails> {\n return getNotificationOutcomeDetailsMethod(this._client, notificationId, options);\n }\n\n /**\n * Gets a Notification Hub Job by the ID.\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 */\n getNotificationHubJob(\n jobId: string,\n options: OperationOptions = {},\n ): Promise<NotificationHubJob> {\n return getNotificationHubJobMethod(this._client, jobId, options);\n }\n\n /**\n * Submits a Notification Hub job and creates a poller to poll for results.\n * @param notificationHubJob - The Notification Hub import/export job to start.\n * @param options - The operation options.\n * @returns A poller which can be called to poll until completion of the job.\n */\n beginSubmitNotificationHubJob(\n notificationHubJob: NotificationHubJob,\n options: PolledOperationOptions = {},\n ): Promise<NotificationHubJobPoller> {\n return beginSubmitNotificationHubJobMethod(this._client, notificationHubJob, options);\n }\n\n /**\n * Submits a Notification Hub Job. Note this is available to Standard SKU namespace and above.\n * @param job - The notification hub job to submit.\n * @param options - The operation options.\n * @returns The notification hub job details including job ID and status.\n */\n submitNotificationHubJob(\n job: NotificationHubJob,\n options: OperationOptions = {},\n ): Promise<NotificationHubJob> {\n return submitNotificationHubJobMethod(this._client, job, options);\n }\n\n /**\n * Gets all Notification Hub Jobs for this Notification Hub.\n * @param options - The operation options.\n * @returns An array of all Notification Hub Jobs for this Notification Hub.\n */\n listNotificationHubJobs(options: OperationOptions = {}): Promise<NotificationHubJob[]> {\n return listNotificationHubJobsMethod(this._client, options);\n }\n}\n"]}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import { DirectSendNotificationOptions, SendNotificationOptions } from "../models/options.js";
|
|
1
|
+
import { BroadcastSendNotificationOptions, DirectSendNotificationOptions, SendNotificationOptions } from "../models/options.js";
|
|
2
|
+
/**
|
|
3
|
+
* Determines whether the options are of type BroadcastSendNotificationOptions.
|
|
4
|
+
* @param options - The options to test if BroadcastSendNotificationOptions.
|
|
5
|
+
* @returns true if BroadcastSendNotificationOptions otherwise false.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isBroadcastSendNotificationOptions(options: unknown): options is BroadcastSendNotificationOptions;
|
|
2
8
|
/**
|
|
3
9
|
* Determines whether the options are of type SendNotificationOptions.
|
|
4
10
|
* @param options - The options to test if SendNotificationOptions.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"optionUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/optionUtils.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"optionUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/optionUtils.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,gCAAgC,EAChC,6BAA6B,EAC7B,uBAAuB,EACxB,MAAM,sBAAsB,CAAC;AAG9B;;;;GAIG;AACH,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,OAAO,GACf,OAAO,IAAI,gCAAgC,CAE7C;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,uBAAuB,CAI9F;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,OAAO,GACf,OAAO,IAAI,6BAA6B,CAE1C"}
|
|
@@ -2,9 +2,18 @@
|
|
|
2
2
|
// Copyright (c) Microsoft Corporation.
|
|
3
3
|
// Licensed under the MIT License.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.isBroadcastSendNotificationOptions = isBroadcastSendNotificationOptions;
|
|
5
6
|
exports.isSendNotificationOptions = isSendNotificationOptions;
|
|
6
7
|
exports.isDirectSendNotificationOptions = isDirectSendNotificationOptions;
|
|
7
8
|
const core_util_1 = require("@azure/core-util");
|
|
9
|
+
/**
|
|
10
|
+
* Determines whether the options are of type BroadcastSendNotificationOptions.
|
|
11
|
+
* @param options - The options to test if BroadcastSendNotificationOptions.
|
|
12
|
+
* @returns true if BroadcastSendNotificationOptions otherwise false.
|
|
13
|
+
*/
|
|
14
|
+
function isBroadcastSendNotificationOptions(options) {
|
|
15
|
+
return (0, core_util_1.objectHasProperty)(options, "enableTestSend");
|
|
16
|
+
}
|
|
8
17
|
/**
|
|
9
18
|
* Determines whether the options are of type SendNotificationOptions.
|
|
10
19
|
* @param options - The options to test if SendNotificationOptions.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"optionUtils.js","sourceRoot":"","sources":["../../../src/utils/optionUtils.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;
|
|
1
|
+
{"version":3,"file":"optionUtils.js","sourceRoot":"","sources":["../../../src/utils/optionUtils.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAclC,gFAIC;AAOD,8DAIC;AAOD,0EAIC;AAjCD,gDAAqD;AAErD;;;;GAIG;AACH,SAAgB,kCAAkC,CAChD,OAAgB;IAEhB,OAAO,IAAA,6BAAiB,EAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;AACtD,CAAC;AAED;;;;GAIG;AACH,SAAgB,yBAAyB,CAAC,OAAgB;IACxD,OAAO,CACL,IAAA,6BAAiB,EAAC,OAAO,EAAE,eAAe,CAAC,IAAI,IAAA,6BAAiB,EAAC,OAAO,EAAE,gBAAgB,CAAC,CAC5F,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAgB,+BAA+B,CAC7C,OAAgB;IAEhB,OAAO,IAAA,6BAAiB,EAAC,OAAO,EAAE,cAAc,CAAC,CAAC;AACpD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n BroadcastSendNotificationOptions,\n DirectSendNotificationOptions,\n SendNotificationOptions,\n} from \"../models/options.js\";\nimport { objectHasProperty } from \"@azure/core-util\";\n\n/**\n * Determines whether the options are of type BroadcastSendNotificationOptions.\n * @param options - The options to test if BroadcastSendNotificationOptions.\n * @returns true if BroadcastSendNotificationOptions otherwise false.\n */\nexport function isBroadcastSendNotificationOptions(\n options: unknown,\n): options is BroadcastSendNotificationOptions {\n return objectHasProperty(options, \"enableTestSend\");\n}\n\n/**\n * Determines whether the options are of type SendNotificationOptions.\n * @param options - The options to test if SendNotificationOptions.\n * @returns true if SendNotificationOptions otherwise false.\n */\nexport function isSendNotificationOptions(options: unknown): options is SendNotificationOptions {\n return (\n objectHasProperty(options, \"tagExpression\") || objectHasProperty(options, \"enableTestSend\")\n );\n}\n\n/**\n * Determines whether the options are of type DirectSendNotificationOptions.\n * @param options - The options to test if DirectSendNotificationOptions.\n * @returns true if DirectSendNotificationOptions otherwise false.\n */\nexport function isDirectSendNotificationOptions(\n options: unknown,\n): options is DirectSendNotificationOptions {\n return objectHasProperty(options, \"deviceHandle\");\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xmlUtils.js","sourceRoot":"","sources":["../../../src/utils/xmlUtils.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AA8BlC,4CAcC;AAYD,gEAQC;AASD,8DAuBC;AAQD,sCAmBC;AAzHD,yCAAuC;AACvC,8CAA2C;AAE3C;;;;GAIG;AACU,QAAA,mBAAmB,GAAG,GAAG,CAAC;AAEvC;;;;GAIG;AACU,QAAA,gBAAgB,GAAG,GAAG,CAAC;AAEpC;;;GAGG;AACH,MAAM,6BAA6B,GAAG,EAAE,CAAC,WAAW,CAAC;AAErD;;;GAGG;AACH,6EAA6E;AAC7E,SAAgB,gBAAgB,CAAC,KAAU;IACzC,6EAA6E;IAC7E,uFAAuF;IAEvF,kFAAkF;IAClF,kFAAkF;IAClF,kFAAkF;IAClF,qDAAqD;IACrD,sDAAsD;IACtD,sDAAsD;IACtD,sDAAsD;IACtD,sDAAsD;IACtD,kFAAkF;IAClF,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,WAAW,KAAK,6BAA6B,CAAC;AAC1F,CAAC;AAED;;;;;;;;;GAS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E,CAAC,CAAC;QACjE,IACE,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC;YAC7C,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,EACvD,CAAC;YACD,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IAAC,WAAM,CAAC;QACP,gBAAgB;IAClB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { isDefined } from \"./utils.js\";\nimport { parseXML } from \"@azure/core-xml\";\n\n/**\n * Marker for atom metadata.\n *\n * @internal\n */\nexport const XML_METADATA_MARKER = \"$\";\n\n/**\n * Marker for atom value.\n *\n * @internal\n */\nexport const XML_VALUE_MARKER = \"_\";\n\n/**\n * @internal\n * Helps in differentiating JSON like objects from other kinds of objects.\n */\nconst EMPTY_JSON_OBJECT_CONSTRUCTOR = {}.constructor;\n\n/**\n * @internal\n * Returns `true` if given input is a JSON like object.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function isJSONLikeObject(value: any): boolean {\n // `value.constructor === {}.constructor` differentiates among the \"object\"s,\n // would filter the JSON objects and won't match any array or other kinds of objects\n\n // -------------------------------------------------------------------------------\n // Few examples | typeof obj ===\"object\" | obj.constructor==={}.constructor\n // -------------------------------------------------------------------------------\n // {abc:1} | true | true\n // [\"a\",\"b\"] | true | false\n // [{\"a\":1},{\"b\":2}] | true | false\n // new Date() | true | false\n // 123 | false | false\n // -------------------------------------------------------------------------------\n return typeof value === \"object\" && value.constructor === EMPTY_JSON_OBJECT_CONSTRUCTOR;\n}\n\n/**\n * @internal\n * The key-value pairs having undefined/null as the values would lead to the empty tags in the serialized XML request.\n * Empty tags in the request body is problematic because of the following reasons.\n * - ATOM based management operations throw a \"Bad Request\" error if empty tags are included in the XML request body at top level.\n * - At the inner levels, Service assigns the empty strings as values to the empty tags instead of throwing an error.\n *\n * This method recursively removes the key-value pairs with undefined/null as the values from the request object that is to be serialized.\n *\n */\nexport function sanitizeSerializableObject(resource: { [key: string]: any }): void {\n Object.keys(resource).forEach(function (property) {\n if (!isDefined(resource[property])) {\n delete resource[property];\n } else if (isJSONLikeObject(resource[property])) {\n sanitizeSerializableObject(resource[property]);\n }\n });\n}\n\n/**\n * @internal\n * Serializes input information to construct the Atom XML request\n * @param resourceName - Name of the resource to be serialized like `QueueDescription`\n * @param resource - The entity details\n * @returns An object to be serialized into a string.\n */\nexport function serializeToAtomXmlRequest(\n resourceName: string,\n resource: unknown,\n): Record<string, unknown> {\n const content: any = {};\n\n content[resourceName] = Object.assign({}, resource);\n sanitizeSerializableObject(content[resourceName]);\n\n content[resourceName][XML_METADATA_MARKER] = {\n xmlns: \"http://schemas.microsoft.com/netservices/2010/10/servicebus/connect\",\n \"xmlns:i\": \"http://www.w3.org/2001/XMLSchema-instance\",\n };\n\n content[XML_METADATA_MARKER] = { type: \"application/xml\" };\n const requestDetails: Record<string, unknown> = {\n updated: new Date().toISOString(),\n content: content,\n };\n requestDetails[XML_METADATA_MARKER] = {\n xmlns: \"http://www.w3.org/2005/Atom\",\n };\n return requestDetails;\n}\n\n/**\n * @internal\n * Parses the XML message from a Notification Hubs response\n * @param bodyText - The HTTP response body.\n * @returns The notification details if any from the XML.\n */\nexport async function parseXMLError(bodyText: string): Promise<string | undefined> {\n if (!bodyText) {\n return;\n }\n\n let result: string | undefined;\n try {\n const xmlError = await parseXML(bodyText, { includeRoot: true });\n if (\n Object.hasOwnProperty.call(xmlError, \"Error\") &&\n Object.hasOwnProperty.call(xmlError[\"Error\"], \"Detail\")\n ) {\n return xmlError[\"Error\"][\"Detail\"];\n }\n } catch {\n // nothing to do\n }\n\n return result;\n}\n"]}
|
package/dist/esm/api/index.d.ts
CHANGED
|
@@ -16,7 +16,9 @@ export * from "./listNotificationHubJobs.js";
|
|
|
16
16
|
export * from "./listRegistrations.js";
|
|
17
17
|
export * from "./listRegistrationsByChannel.js";
|
|
18
18
|
export * from "./listRegistrationsByTag.js";
|
|
19
|
+
export * from "./scheduleBroadcastNotification.js";
|
|
19
20
|
export * from "./scheduleNotification.js";
|
|
21
|
+
export * from "./sendBroadcastNotification.js";
|
|
20
22
|
export * from "./sendNotification.js";
|
|
21
23
|
export * from "./submitNotificationHubJob.js";
|
|
22
24
|
export * from "./updateInstallation.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAGA,cAAc,oBAAoB,CAAC;AACnC,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC;AACnD,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAGA,cAAc,oBAAoB,CAAC;AACnC,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC;AACnD,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC"}
|
package/dist/esm/api/index.js
CHANGED
|
@@ -18,7 +18,9 @@ export * from "./listNotificationHubJobs.js";
|
|
|
18
18
|
export * from "./listRegistrations.js";
|
|
19
19
|
export * from "./listRegistrationsByChannel.js";
|
|
20
20
|
export * from "./listRegistrationsByTag.js";
|
|
21
|
+
export * from "./scheduleBroadcastNotification.js";
|
|
21
22
|
export * from "./scheduleNotification.js";
|
|
23
|
+
export * from "./sendBroadcastNotification.js";
|
|
22
24
|
export * from "./sendNotification.js";
|
|
23
25
|
export * from "./submitNotificationHubJob.js";
|
|
24
26
|
export * from "./updateInstallation.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC;AACnD,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport * from \"./clientContext.js\";\nexport * from \"./beginSubmitNotificationHubJob.js\";\nexport * from \"./cancelScheduledNotification.js\";\nexport * from \"./createOrUpdateInstallation.js\";\nexport * from \"./createOrUpdateRegistration.js\";\nexport * from \"./createRegistration.js\";\nexport * from \"./createRegistrationId.js\";\nexport * from \"./deleteInstallation.js\";\nexport * from \"./deleteRegistration.js\";\nexport * from \"./getFeedbackContainerUrl.js\";\nexport * from \"./getInstallation.js\";\nexport * from \"./getNotificationHubJob.js\";\nexport * from \"./getNotificationOutcomeDetails.js\";\nexport * from \"./getRegistration.js\";\nexport * from \"./listNotificationHubJobs.js\";\nexport * from \"./listRegistrations.js\";\nexport * from \"./listRegistrationsByChannel.js\";\nexport * from \"./listRegistrationsByTag.js\";\nexport * from \"./scheduleNotification.js\";\nexport * from \"./sendNotification.js\";\nexport * from \"./submitNotificationHubJob.js\";\nexport * from \"./updateInstallation.js\";\nexport * from \"./updateRegistration.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC;AACnD,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport * from \"./clientContext.js\";\nexport * from \"./beginSubmitNotificationHubJob.js\";\nexport * from \"./cancelScheduledNotification.js\";\nexport * from \"./createOrUpdateInstallation.js\";\nexport * from \"./createOrUpdateRegistration.js\";\nexport * from \"./createRegistration.js\";\nexport * from \"./createRegistrationId.js\";\nexport * from \"./deleteInstallation.js\";\nexport * from \"./deleteRegistration.js\";\nexport * from \"./getFeedbackContainerUrl.js\";\nexport * from \"./getInstallation.js\";\nexport * from \"./getNotificationHubJob.js\";\nexport * from \"./getNotificationOutcomeDetails.js\";\nexport * from \"./getRegistration.js\";\nexport * from \"./listNotificationHubJobs.js\";\nexport * from \"./listRegistrations.js\";\nexport * from \"./listRegistrationsByChannel.js\";\nexport * from \"./listRegistrationsByTag.js\";\nexport * from \"./scheduleBroadcastNotification.js\";\nexport * from \"./scheduleNotification.js\";\nexport * from \"./sendBroadcastNotification.js\";\nexport * from \"./sendNotification.js\";\nexport * from \"./submitNotificationHubJob.js\";\nexport * from \"./updateInstallation.js\";\nexport * from \"./updateRegistration.js\";\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Notification } from "../../models/notification.js";
|
|
2
|
+
import { NotificationHubsClientContext } from "../index.js";
|
|
3
|
+
import { NotificationHubsMessageResponse } from "../../models/notificationDetails.js";
|
|
4
|
+
import { OperationOptions } from "@azure-rest/core-client";
|
|
5
|
+
/**
|
|
6
|
+
* Schedules a push notification to devices that match the given tags or tag expression at the specified time.
|
|
7
|
+
* NOTE: This is only available in Standard SKU Azure Notification Hubs.
|
|
8
|
+
* @param context - The Notification Hubs client.
|
|
9
|
+
* @param scheduledTime - The Date to send the push notification.
|
|
10
|
+
* @param notification - The notification to send to the matching devices.
|
|
11
|
+
* @param options - Options which include tags used to target the device for push notifications in either an array or tag expression.
|
|
12
|
+
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
13
|
+
*/
|
|
14
|
+
export declare function scheduleNotificationInternal(context: NotificationHubsClientContext, scheduledTime: Date, notification: Notification, options: OperationOptions, method: string, tagExpression?: string): Promise<NotificationHubsMessageResponse>;
|
|
15
|
+
//# sourceMappingURL=_scheduleNotification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_scheduleNotification.d.ts","sourceRoot":"","sources":["../../../../src/api/internal/_scheduleNotification.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,+BAA+B,EAAE,MAAM,qCAAqC,CAAC;AAEtF,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,6BAA6B,EACtC,aAAa,EAAE,IAAI,EACnB,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,MAAM,EACd,aAAa,CAAC,EAAE,MAAM,GACrB,OAAO,CAAC,+BAA+B,CAAC,CA2B1C"}
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
* Schedules a push notification to devices that match the given tags or tag expression at the specified time.
|
|
7
|
+
* NOTE: This is only available in Standard SKU Azure Notification Hubs.
|
|
8
|
+
* @param context - The Notification Hubs client.
|
|
9
|
+
* @param scheduledTime - The Date to send the push notification.
|
|
10
|
+
* @param notification - The notification to send to the matching devices.
|
|
11
|
+
* @param options - Options which include tags used to target the device for push notifications in either an array or tag expression.
|
|
12
|
+
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
13
|
+
*/
|
|
14
|
+
export function scheduleNotificationInternal(context, scheduledTime, notification, options, method, tagExpression) {
|
|
15
|
+
return tracingClient.withSpan(`NotificationHubsClientContext.${method}`, options, async (updatedOptions) => {
|
|
16
|
+
const endpoint = context.requestUrl();
|
|
17
|
+
endpoint.pathname += "/schedulednotifications/";
|
|
18
|
+
const headers = await context.createHeaders("scheduleNotification", notification.headers);
|
|
19
|
+
headers.set("ServiceBusNotification-ScheduleTime", scheduledTime.toISOString());
|
|
20
|
+
headers.set("Content-Type", notification.contentType);
|
|
21
|
+
headers.set("ServiceBusNotification-Format", notification.platform);
|
|
22
|
+
if (tagExpression) {
|
|
23
|
+
headers.set("ServiceBusNotification-Tags", tagExpression);
|
|
24
|
+
}
|
|
25
|
+
const request = createRequest(endpoint, "POST", headers, updatedOptions);
|
|
26
|
+
request.body = notification.body;
|
|
27
|
+
const response = await sendRequest(context, request, 201);
|
|
28
|
+
return parseNotificationSendResponse(response);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=_scheduleNotification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_scheduleNotification.js","sourceRoot":"","sources":["../../../../src/api/internal/_scheduleNotification.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,aAAa,EAAE,6BAA6B,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAKzF,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD;;;;;;;;GAQG;AACH,MAAM,UAAU,4BAA4B,CAC1C,OAAsC,EACtC,aAAmB,EACnB,YAA0B,EAC1B,OAAyB,EACzB,MAAc,EACd,aAAsB;IAEtB,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,0BAA0B,CAAC;QAEhD,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,aAAa,CACzC,sBAAsB,EACtB,YAAY,CAAC,OAA4B,CAC1C,CAAC;QACF,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,aAAa,CAAC,WAAW,EAAE,CAAC,CAAC;QAChF,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;QACtD,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;QACpE,IAAI,aAAa,EAAE,CAAC;YAClB,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,aAAa,CAAC,CAAC;QAC5D,CAAC;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 { NonNullableRecord } from \"../../utils/utils.js\";\nimport { Notification } from \"../../models/notification.js\";\nimport { NotificationHubsClientContext } from \"../index.js\";\nimport { NotificationHubsMessageResponse } from \"../../models/notificationDetails.js\";\nimport { tracingClient } from \"../../utils/tracing.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\n\n/**\n * Schedules a push notification to devices that match the given tags or tag expression at the specified time.\n * NOTE: This is only available in Standard SKU Azure Notification Hubs.\n * @param context - The Notification Hubs client.\n * @param scheduledTime - The Date to send the push notification.\n * @param notification - The notification to send to the matching devices.\n * @param options - Options which include tags used to target the device for push notifications in either an array or tag expression.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function scheduleNotificationInternal(\n context: NotificationHubsClientContext,\n scheduledTime: Date,\n notification: Notification,\n options: OperationOptions,\n method: string,\n tagExpression?: string,\n): Promise<NotificationHubsMessageResponse> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${method}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/schedulednotifications/\";\n\n const headers = await context.createHeaders(\n \"scheduleNotification\",\n notification.headers as NonNullableRecord,\n );\n headers.set(\"ServiceBusNotification-ScheduleTime\", scheduledTime.toISOString());\n headers.set(\"Content-Type\", notification.contentType);\n headers.set(\"ServiceBusNotification-Format\", notification.platform);\n if (tagExpression) {\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"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BroadcastSendNotificationOptions, DirectSendNotificationOptions, SendNotificationOptions } from "../../models/options.js";
|
|
2
|
+
import { Notification } from "../../models/notification.js";
|
|
3
|
+
import { NotificationHubsClientContext } from "../index.js";
|
|
4
|
+
import { NotificationHubsMessageResponse } from "../../models/notificationDetails.js";
|
|
5
|
+
/**
|
|
6
|
+
* Sends push notifications to devices that match the given tags or tag expression.
|
|
7
|
+
* @param context - The Notification Hubs client.
|
|
8
|
+
* @param notification - The notification to send to the matching devices.
|
|
9
|
+
* @param options - Options for the notification including tags, device handles and whether to enable test send.
|
|
10
|
+
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
11
|
+
*/
|
|
12
|
+
export declare function sendNotificationInternal(context: NotificationHubsClientContext, notification: Notification, options: DirectSendNotificationOptions | SendNotificationOptions | BroadcastSendNotificationOptions): Promise<NotificationHubsMessageResponse>;
|
|
13
|
+
//# sourceMappingURL=_sendNotification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_sendNotification.d.ts","sourceRoot":"","sources":["../../../../src/api/internal/_sendNotification.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,gCAAgC,EAChC,6BAA6B,EAC7B,uBAAuB,EACxB,MAAM,yBAAyB,CAAC;AASjC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,+BAA+B,EAAE,MAAM,qCAAqC,CAAC;AAKtF;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,6BAA6B,EACtC,YAAY,EAAE,YAAY,EAC1B,OAAO,EACH,6BAA6B,GAC7B,uBAAuB,GACvB,gCAAgC,GACnC,OAAO,CAAC,+BAA+B,CAAC,CA8D1C"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { createRequest, parseNotificationSendResponse, sendRequest } from "./_client.js";
|
|
4
|
+
import { isBroadcastSendNotificationOptions, isDirectSendNotificationOptions, isSendNotificationOptions, } from "../../utils/optionUtils.js";
|
|
5
|
+
import { createMultipartDirectNotification } from "../../utils/notificationUtils.js";
|
|
6
|
+
import { randomUUID } from "@azure/core-util";
|
|
7
|
+
import { tracingClient } from "../../utils/tracing.js";
|
|
8
|
+
/**
|
|
9
|
+
* Sends push notifications to devices that match the given tags or tag expression.
|
|
10
|
+
* @param context - The Notification Hubs client.
|
|
11
|
+
* @param notification - The notification to send to the matching devices.
|
|
12
|
+
* @param options - Options for the notification including tags, device handles and whether to enable test send.
|
|
13
|
+
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
14
|
+
*/
|
|
15
|
+
export function sendNotificationInternal(context, notification, options) {
|
|
16
|
+
return tracingClient.withSpan(`NotificationHubsClientContext.sendNotification`, options, async (updatedOptions) => {
|
|
17
|
+
const endpoint = context.requestUrl();
|
|
18
|
+
endpoint.pathname += "/messages/";
|
|
19
|
+
// Check if batch direct send
|
|
20
|
+
if (isDirectSendNotificationOptions(options) && Array.isArray(options.deviceHandle)) {
|
|
21
|
+
endpoint.pathname += "$batch";
|
|
22
|
+
}
|
|
23
|
+
// Check for test send
|
|
24
|
+
if ((isSendNotificationOptions(options) || isBroadcastSendNotificationOptions(options)) &&
|
|
25
|
+
options.enableTestSend) {
|
|
26
|
+
endpoint.searchParams.append("test", "true");
|
|
27
|
+
}
|
|
28
|
+
const headers = await context.createHeaders("sendNotification", notification.headers);
|
|
29
|
+
headers.set("ServiceBusNotification-Format", notification.platform);
|
|
30
|
+
let body = notification.body;
|
|
31
|
+
let contentType = notification.contentType;
|
|
32
|
+
// Check for direct batch send
|
|
33
|
+
if (isDirectSendNotificationOptions(options) && Array.isArray(options.deviceHandle)) {
|
|
34
|
+
endpoint.searchParams.append("direct", "true");
|
|
35
|
+
const boundary = `nh-boundary-${randomUUID()}`;
|
|
36
|
+
contentType = `multipart/mixed; boundary = "${boundary}"`;
|
|
37
|
+
body = createMultipartDirectNotification(boundary, notification, options.deviceHandle);
|
|
38
|
+
}
|
|
39
|
+
else if (isDirectSendNotificationOptions(options)) {
|
|
40
|
+
endpoint.searchParams.append("direct", "true");
|
|
41
|
+
if (notification.platform === "browser") {
|
|
42
|
+
const browserHandle = options.deviceHandle;
|
|
43
|
+
headers.set("ServiceBusNotification-DeviceHandle", browserHandle.endpoint);
|
|
44
|
+
headers.set("Auth", browserHandle.auth);
|
|
45
|
+
headers.set("P256DH", browserHandle.p256dh);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
headers.set("ServiceBusNotification-DeviceHandle", options.deviceHandle);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else if (isSendNotificationOptions(options)) {
|
|
52
|
+
headers.set("ServiceBusNotification-Tags", options.tagExpression);
|
|
53
|
+
}
|
|
54
|
+
headers.set("Content-Type", contentType);
|
|
55
|
+
headers.set("ServiceBusNotification-Format", notification.platform);
|
|
56
|
+
const request = createRequest(endpoint, "POST", headers, updatedOptions);
|
|
57
|
+
request.body = body;
|
|
58
|
+
const response = await sendRequest(context, request, 201);
|
|
59
|
+
return parseNotificationSendResponse(response);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=_sendNotification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_sendNotification.js","sourceRoot":"","sources":["../../../../src/api/internal/_sendNotification.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAAE,aAAa,EAAE,6BAA6B,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACzF,OAAO,EACL,kCAAkC,EAClC,+BAA+B,EAC/B,yBAAyB,GAC1B,MAAM,4BAA4B,CAAC;AAMpC,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,IAAI,GAAG,IAAI,CAAC;QAEpB,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 {\n BroadcastSendNotificationOptions,\n DirectSendNotificationOptions,\n SendNotificationOptions,\n} from \"../../models/options.js\";\nimport { createRequest, parseNotificationSendResponse, sendRequest } from \"./_client.js\";\nimport {\n isBroadcastSendNotificationOptions,\n isDirectSendNotificationOptions,\n isSendNotificationOptions,\n} from \"../../utils/optionUtils.js\";\nimport { BrowserPushChannel } from \"../../models/installation.js\";\nimport { NonNullableRecord } from \"../../utils/utils.js\";\nimport { Notification } from \"../../models/notification.js\";\nimport { NotificationHubsClientContext } from \"../index.js\";\nimport { NotificationHubsMessageResponse } from \"../../models/notificationDetails.js\";\nimport { createMultipartDirectNotification } from \"../../utils/notificationUtils.js\";\nimport { randomUUID } from \"@azure/core-util\";\nimport { tracingClient } from \"../../utils/tracing.js\";\n\n/**\n * Sends push notifications to devices that match the given tags or tag expression.\n * @param context - The Notification Hubs client.\n * @param notification - The notification to send to the matching devices.\n * @param options - Options for the notification including tags, device handles and whether to enable test send.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function sendNotificationInternal(\n context: NotificationHubsClientContext,\n notification: Notification,\n options:\n | DirectSendNotificationOptions\n | SendNotificationOptions\n | BroadcastSendNotificationOptions,\n): Promise<NotificationHubsMessageResponse> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.sendNotification`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/messages/\";\n\n // Check if batch direct send\n if (isDirectSendNotificationOptions(options) && Array.isArray(options.deviceHandle)) {\n endpoint.pathname += \"$batch\";\n }\n\n // Check for test send\n if (\n (isSendNotificationOptions(options) || isBroadcastSendNotificationOptions(options)) &&\n options.enableTestSend\n ) {\n endpoint.searchParams.append(\"test\", \"true\");\n }\n\n const headers = await context.createHeaders(\n \"sendNotification\",\n notification.headers as NonNullableRecord,\n );\n headers.set(\"ServiceBusNotification-Format\", notification.platform);\n\n let body = notification.body;\n let contentType: string = notification.contentType;\n\n // Check for direct batch send\n if (isDirectSendNotificationOptions(options) && Array.isArray(options.deviceHandle)) {\n endpoint.searchParams.append(\"direct\", \"true\");\n const boundary = `nh-boundary-${randomUUID()}`;\n contentType = `multipart/mixed; boundary = \"${boundary}\"`;\n body = createMultipartDirectNotification(boundary, notification, options.deviceHandle);\n } else if (isDirectSendNotificationOptions(options)) {\n endpoint.searchParams.append(\"direct\", \"true\");\n\n if (notification.platform === \"browser\") {\n const browserHandle = options.deviceHandle 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\", options.deviceHandle as string);\n }\n } else if (isSendNotificationOptions(options)) {\n headers.set(\"ServiceBusNotification-Tags\", options.tagExpression);\n }\n\n headers.set(\"Content-Type\", contentType);\n headers.set(\"ServiceBusNotification-Format\", notification.platform);\n\n const request = createRequest(endpoint, \"POST\", headers, updatedOptions);\n request.body = body;\n\n const response = await sendRequest(context, request, 201);\n\n return parseNotificationSendResponse(response);\n },\n );\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Notification } from "../models/notification.js";
|
|
2
|
+
import { NotificationHubsClientContext } from "./index.js";
|
|
3
|
+
import { NotificationHubsMessageResponse } from "../models/notificationDetails.js";
|
|
4
|
+
import { OperationOptions } from "@azure-rest/core-client";
|
|
5
|
+
/**
|
|
6
|
+
* Schedules a push notification to all registered devices.
|
|
7
|
+
* NOTE: This is only available in Standard SKU Azure Notification Hubs.
|
|
8
|
+
* @param context - The Notification Hubs client.
|
|
9
|
+
* @param scheduledTime - The Date to send the push notification.
|
|
10
|
+
* @param notification - The notification to send to the matching devices.
|
|
11
|
+
* @param options - Operation options.
|
|
12
|
+
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
13
|
+
*/
|
|
14
|
+
export declare function scheduleBroadcastNotification(context: NotificationHubsClientContext, scheduledTime: Date, notification: Notification, options?: OperationOptions): Promise<NotificationHubsMessageResponse>;
|
|
15
|
+
//# sourceMappingURL=scheduleBroadcastNotification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduleBroadcastNotification.d.ts","sourceRoot":"","sources":["../../../src/api/scheduleBroadcastNotification.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,+BAA+B,EAAE,MAAM,kCAAkC,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3D;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,6BAA6B,EACtC,aAAa,EAAE,IAAI,EACnB,YAAY,EAAE,YAAY,EAC1B,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,+BAA+B,CAAC,CAQ1C"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { scheduleNotificationInternal } from "./internal/_scheduleNotification.js";
|
|
4
|
+
/**
|
|
5
|
+
* Schedules a push notification to all registered devices.
|
|
6
|
+
* NOTE: This is only available in Standard SKU Azure Notification Hubs.
|
|
7
|
+
* @param context - The Notification Hubs client.
|
|
8
|
+
* @param scheduledTime - The Date to send the push notification.
|
|
9
|
+
* @param notification - The notification to send to the matching devices.
|
|
10
|
+
* @param options - Operation options.
|
|
11
|
+
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
12
|
+
*/
|
|
13
|
+
export function scheduleBroadcastNotification(context, scheduledTime, notification, options = {}) {
|
|
14
|
+
return scheduleNotificationInternal(context, scheduledTime, notification, options, "scheduleBroadcastNotification");
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=scheduleBroadcastNotification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduleBroadcastNotification.js","sourceRoot":"","sources":["../../../src/api/scheduleBroadcastNotification.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAMlC,OAAO,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AAEnF;;;;;;;;GAQG;AACH,MAAM,UAAU,6BAA6B,CAC3C,OAAsC,EACtC,aAAmB,EACnB,YAA0B,EAC1B,UAA4B,EAAE;IAE9B,OAAO,4BAA4B,CACjC,OAAO,EACP,aAAa,EACb,YAAY,EACZ,OAAO,EACP,+BAA+B,CAChC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Notification } from \"../models/notification.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { NotificationHubsMessageResponse } from \"../models/notificationDetails.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { scheduleNotificationInternal } from \"./internal/_scheduleNotification.js\";\n\n/**\n * Schedules a push notification to all registered devices.\n * NOTE: This is only available in Standard SKU Azure Notification Hubs.\n * @param context - The Notification Hubs client.\n * @param scheduledTime - The Date to send the push notification.\n * @param notification - The notification to send to the matching devices.\n * @param options - Operation options.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function scheduleBroadcastNotification(\n context: NotificationHubsClientContext,\n scheduledTime: Date,\n notification: Notification,\n options: OperationOptions = {},\n): Promise<NotificationHubsMessageResponse> {\n return scheduleNotificationInternal(\n context,\n scheduledTime,\n notification,\n options,\n \"scheduleBroadcastNotification\",\n );\n}\n"]}
|
|
@@ -11,5 +11,5 @@ import { ScheduleNotificationOptions } from "../models/options.js";
|
|
|
11
11
|
* @param options - Options which include tags used to target the device for push notifications in either an array or tag expression.
|
|
12
12
|
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
13
13
|
*/
|
|
14
|
-
export declare function scheduleNotification(context: NotificationHubsClientContext, scheduledTime: Date, notification: Notification, options
|
|
14
|
+
export declare function scheduleNotification(context: NotificationHubsClientContext, scheduledTime: Date, notification: Notification, options: ScheduleNotificationOptions): Promise<NotificationHubsMessageResponse>;
|
|
15
15
|
//# sourceMappingURL=scheduleNotification.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduleNotification.d.ts","sourceRoot":"","sources":["../../../src/api/scheduleNotification.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scheduleNotification.d.ts","sourceRoot":"","sources":["../../../src/api/scheduleNotification.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,+BAA+B,EAAE,MAAM,kCAAkC,CAAC;AACnF,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AAGnE;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,6BAA6B,EACtC,aAAa,EAAE,IAAI,EACnB,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,+BAA+B,CAAC,CAS1C"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
import {
|
|
4
|
-
import { tracingClient } from "../utils/tracing.js";
|
|
3
|
+
import { scheduleNotificationInternal } from "./internal/_scheduleNotification.js";
|
|
5
4
|
/**
|
|
6
5
|
* Schedules a push notification to devices that match the given tags or tag expression at the specified time.
|
|
7
6
|
* NOTE: This is only available in Standard SKU Azure Notification Hubs.
|
|
@@ -11,21 +10,7 @@ import { tracingClient } from "../utils/tracing.js";
|
|
|
11
10
|
* @param options - Options which include tags used to target the device for push notifications in either an array or tag expression.
|
|
12
11
|
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
13
12
|
*/
|
|
14
|
-
export function scheduleNotification(context, scheduledTime, notification, options
|
|
15
|
-
return
|
|
16
|
-
const endpoint = context.requestUrl();
|
|
17
|
-
endpoint.pathname += "/schedulednotifications/";
|
|
18
|
-
const headers = await context.createHeaders("scheduleNotification", notification.headers);
|
|
19
|
-
headers.set("ServiceBusNotification-ScheduleTime", scheduledTime.toISOString());
|
|
20
|
-
headers.set("Content-Type", notification.contentType);
|
|
21
|
-
headers.set("ServiceBusNotification-Format", notification.platform);
|
|
22
|
-
if (options.tagExpression) {
|
|
23
|
-
headers.set("ServiceBusNotification-Tags", options.tagExpression);
|
|
24
|
-
}
|
|
25
|
-
const request = createRequest(endpoint, "POST", headers, updatedOptions);
|
|
26
|
-
request.body = notification.body;
|
|
27
|
-
const response = await sendRequest(context, request, 201);
|
|
28
|
-
return parseNotificationSendResponse(response);
|
|
29
|
-
});
|
|
13
|
+
export function scheduleNotification(context, scheduledTime, notification, options) {
|
|
14
|
+
return scheduleNotificationInternal(context, scheduledTime, notification, options, "scheduleNotification", options.tagExpression);
|
|
30
15
|
}
|
|
31
16
|
//# sourceMappingURL=scheduleNotification.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduleNotification.js","sourceRoot":"","sources":["../../../src/api/scheduleNotification.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;
|
|
1
|
+
{"version":3,"file":"scheduleNotification.js","sourceRoot":"","sources":["../../../src/api/scheduleNotification.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAMlC,OAAO,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AAEnF;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAClC,OAAsC,EACtC,aAAmB,EACnB,YAA0B,EAC1B,OAAoC;IAEpC,OAAO,4BAA4B,CACjC,OAAO,EACP,aAAa,EACb,YAAY,EACZ,OAAO,EACP,sBAAsB,EACtB,OAAO,CAAC,aAAa,CACtB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Notification } from \"../models/notification.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { NotificationHubsMessageResponse } from \"../models/notificationDetails.js\";\nimport { ScheduleNotificationOptions } from \"../models/options.js\";\nimport { scheduleNotificationInternal } from \"./internal/_scheduleNotification.js\";\n\n/**\n * Schedules a push notification to devices that match the given tags or tag expression at the specified time.\n * NOTE: This is only available in Standard SKU Azure Notification Hubs.\n * @param context - The Notification Hubs client.\n * @param scheduledTime - The Date to send the push notification.\n * @param notification - The notification to send to the matching devices.\n * @param options - Options which include tags used to target the device for push notifications in either an array or tag expression.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function scheduleNotification(\n context: NotificationHubsClientContext,\n scheduledTime: Date,\n notification: Notification,\n options: ScheduleNotificationOptions,\n): Promise<NotificationHubsMessageResponse> {\n return scheduleNotificationInternal(\n context,\n scheduledTime,\n notification,\n options,\n \"scheduleNotification\",\n options.tagExpression,\n );\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BroadcastSendNotificationOptions } from "../models/options.js";
|
|
2
|
+
import { Notification } from "../models/notification.js";
|
|
3
|
+
import { NotificationHubsClientContext } from "./index.js";
|
|
4
|
+
import { NotificationHubsMessageResponse } from "../models/notificationDetails.js";
|
|
5
|
+
/**
|
|
6
|
+
* Sends push notifications to all devices with a broadcast send.
|
|
7
|
+
* @param context - The Notification Hubs client.
|
|
8
|
+
* @param notification - The notification to send to the matching devices.
|
|
9
|
+
* @param options - Options for the notification including whether to enable test send.
|
|
10
|
+
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
11
|
+
*/
|
|
12
|
+
export declare function sendBroadcastNotification(context: NotificationHubsClientContext, notification: Notification, options?: BroadcastSendNotificationOptions): Promise<NotificationHubsMessageResponse>;
|
|
13
|
+
//# sourceMappingURL=sendBroadcastNotification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendBroadcastNotification.d.ts","sourceRoot":"","sources":["../../../src/api/sendBroadcastNotification.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,+BAA+B,EAAE,MAAM,kCAAkC,CAAC;AAGnF;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,6BAA6B,EACtC,YAAY,EAAE,YAAY,EAC1B,OAAO,GAAE,gCAAqC,GAC7C,OAAO,CAAC,+BAA+B,CAAC,CAE1C"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { sendNotificationInternal } from "./internal/_sendNotification.js";
|
|
4
|
+
/**
|
|
5
|
+
* Sends push notifications to all devices with a broadcast send.
|
|
6
|
+
* @param context - The Notification Hubs client.
|
|
7
|
+
* @param notification - The notification to send to the matching devices.
|
|
8
|
+
* @param options - Options for the notification including whether to enable test send.
|
|
9
|
+
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
10
|
+
*/
|
|
11
|
+
export function sendBroadcastNotification(context, notification, options = {}) {
|
|
12
|
+
return sendNotificationInternal(context, notification, options);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=sendBroadcastNotification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendBroadcastNotification.js","sourceRoot":"","sources":["../../../src/api/sendBroadcastNotification.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAMlC,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAE3E;;;;;;GAMG;AACH,MAAM,UAAU,yBAAyB,CACvC,OAAsC,EACtC,YAA0B,EAC1B,UAA4C,EAAE;IAE9C,OAAO,wBAAwB,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;AAClE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { BroadcastSendNotificationOptions } from \"../models/options.js\";\nimport { Notification } from \"../models/notification.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { NotificationHubsMessageResponse } from \"../models/notificationDetails.js\";\nimport { sendNotificationInternal } from \"./internal/_sendNotification.js\";\n\n/**\n * Sends push notifications to all devices with a broadcast send.\n * @param context - The Notification Hubs client.\n * @param notification - The notification to send to the matching devices.\n * @param options - Options for the notification including whether to enable test send.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function sendBroadcastNotification(\n context: NotificationHubsClientContext,\n notification: Notification,\n options: BroadcastSendNotificationOptions = {},\n): Promise<NotificationHubsMessageResponse> {\n return sendNotificationInternal(context, notification, options);\n}\n"]}
|
|
@@ -9,5 +9,5 @@ import { NotificationHubsMessageResponse } from "../models/notificationDetails.j
|
|
|
9
9
|
* @param options - Options for the notification including tags, device handles and whether to enable test send.
|
|
10
10
|
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
11
11
|
*/
|
|
12
|
-
export declare function sendNotification(context: NotificationHubsClientContext, notification: Notification, options
|
|
12
|
+
export declare function sendNotification(context: NotificationHubsClientContext, notification: Notification, options: DirectSendNotificationOptions | SendNotificationOptions): Promise<NotificationHubsMessageResponse>;
|
|
13
13
|
//# sourceMappingURL=sendNotification.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendNotification.d.ts","sourceRoot":"","sources":["../../../src/api/sendNotification.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,6BAA6B,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"sendNotification.d.ts","sourceRoot":"","sources":["../../../src/api/sendNotification.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,6BAA6B,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC9F,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,+BAA+B,EAAE,MAAM,kCAAkC,CAAC;AAGnF;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,6BAA6B,EACtC,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,6BAA6B,GAAG,uBAAuB,GAC/D,OAAO,CAAC,+BAA+B,CAAC,CAE1C"}
|