@azure/notification-hubs 1.0.2 → 1.0.3-alpha.20230703.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.
Files changed (51) hide show
  1. package/dist/{index.cjs → index.js} +185 -108
  2. package/dist/index.js.map +1 -0
  3. package/dist-esm/src/api/clientContext.js +48 -0
  4. package/dist-esm/src/api/clientContext.js.map +1 -0
  5. package/dist-esm/src/api/index.js +1 -45
  6. package/dist-esm/src/api/index.js.map +1 -1
  7. package/dist-esm/src/api/scheduleNotification.js.map +1 -1
  8. package/dist-esm/src/api/sendNotification.js.map +1 -1
  9. package/dist-esm/src/auth/hmacSha256.browser.js +0 -1
  10. package/dist-esm/src/auth/hmacSha256.browser.js.map +1 -1
  11. package/dist-esm/src/index.js +2 -10
  12. package/dist-esm/src/index.js.map +1 -1
  13. package/dist-esm/src/models/index.js +1 -0
  14. package/dist-esm/src/models/index.js.map +1 -1
  15. package/dist-esm/src/models/notification.js +46 -7
  16. package/dist-esm/src/models/notification.js.map +1 -1
  17. package/dist-esm/src/models/notificationBodyBuilder.js.map +1 -1
  18. package/dist-esm/src/models/notificationHeaderBuilder.js +4 -0
  19. package/dist-esm/src/models/notificationHeaderBuilder.js.map +1 -0
  20. package/dist-esm/src/notificationHubsClient.js +1 -1
  21. package/dist-esm/src/notificationHubsClient.js.map +1 -1
  22. package/dist-esm/src/utils/constants.js +1 -1
  23. package/dist-esm/src/utils/constants.js.map +1 -1
  24. package/dist-esm/src/utils/utils.js.map +1 -1
  25. package/package.json +15 -18
  26. package/types/3.1/notification-hubs.d.ts +171 -38
  27. package/types/latest/notification-hubs.d.ts +183 -40
  28. package/types/latest/tsdoc-metadata.json +1 -1
  29. package/types/src/api/clientContext.d.ts +41 -0
  30. package/types/src/api/clientContext.d.ts.map +1 -0
  31. package/types/src/api/index.d.ts +1 -39
  32. package/types/src/api/index.d.ts.map +1 -1
  33. package/types/src/api/internal/_client.d.ts +1 -0
  34. package/types/src/api/internal/_client.d.ts.map +1 -1
  35. package/types/src/api/scheduleNotification.d.ts.map +1 -1
  36. package/types/src/api/sendNotification.d.ts.map +1 -1
  37. package/types/src/auth/hmacSha256.browser.d.ts +18 -1
  38. package/types/src/auth/hmacSha256.browser.d.ts.map +1 -1
  39. package/types/src/index.d.ts +2 -10
  40. package/types/src/index.d.ts.map +1 -1
  41. package/types/src/models/index.d.ts +1 -0
  42. package/types/src/models/index.d.ts.map +1 -1
  43. package/types/src/models/notification.d.ts +69 -9
  44. package/types/src/models/notification.d.ts.map +1 -1
  45. package/types/src/models/notificationBodyBuilder.d.ts +29 -0
  46. package/types/src/models/notificationBodyBuilder.d.ts.map +1 -1
  47. package/types/src/models/notificationHeaderBuilder.d.ts +47 -0
  48. package/types/src/models/notificationHeaderBuilder.d.ts.map +1 -0
  49. package/types/src/utils/utils.d.ts +2 -0
  50. package/types/src/utils/utils.d.ts.map +1 -1
  51. package/dist/index.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"notificationHubsClient.js","sourceRoot":"","sources":["../../src/notificationHubsClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAkBlC,OAAO,EAAiC,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAKpF,OAAO,EAAE,6BAA6B,IAAI,mCAAmC,EAAE,MAAM,wCAAwC,CAAC;AAC9H,OAAO,EAAE,2BAA2B,IAAI,iCAAiC,EAAE,MAAM,sCAAsC,CAAC;AACxH,OAAO,EAAE,0BAA0B,IAAI,gCAAgC,EAAE,MAAM,qCAAqC,CAAC;AACrH,OAAO,EAAE,0BAA0B,IAAI,gCAAgC,EAAE,MAAM,qCAAqC,CAAC;AACrH,OAAO,EAAE,oBAAoB,IAAI,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AACnG,OAAO,EAAE,kBAAkB,IAAI,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC7F,OAAO,EAAE,kBAAkB,IAAI,wBAAwB,EAAE,MAA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,EAAE,OAAO,CAAC,CAAC;IAClF,CAAC;IAED;;;;;OAKG;IACH,uBAAuB,CAAC,UAA4B,EAAE;QACpD,OAAO,6BAA6B,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;IAED;;;;;;OAMG;IACH,6BAA6B,CAC3B,cAAsB,EACtB,UAA4B,EAAE;QAE9B,OAAO,mCAAmC,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;IACpF,CAAC;IAED;;;;;OAKG;IACH,qBAAqB,CACnB,KAAa,EACb,UAA4B,EAAE;QAE9B,OAAO,2BAA2B,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACnE,CAAC;IAED;;;;;OAKG;IACH,6BAA6B,CAC3B,kBAAsC,EACtC,UAAkC,EAAE;QAEpC,OAAO,mCAAmC,CAAC,IAAI,CAAC,OAAO,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAAC;IACxF,CAAC;IAED;;;;;OAKG;IACH,wBAAwB,CACtB,GAAuB,EACvB,UAA4B,EAAE;QAE9B,OAAO,8BAA8B,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;IAED;;;;OAIG;IACH,uBAAuB,CAAC,UAA4B,EAAE;QACpD,OAAO,6BAA6B,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;CACF","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/index.js\";\nimport { RegistrationDescription, RegistrationChannel } from \"./models/registration.js\";\nimport { Notification } from \"./models/notification.js\";\nimport { OperationOptions } from \"@azure/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":"AAAA,uCAAuC;AACvC,kCAAkC;AAkBlC,OAAO,EAAiC,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAK5F,OAAO,EAAE,6BAA6B,IAAI,mCAAmC,EAAE,MAAM,wCAAwC,CAAC;AAC9H,OAAO,EAAE,2BAA2B,IAAI,iCAAiC,EAAE,MAAM,sCAAsC,CAAC;AACxH,OAAO,EAAE,0BAA0B,IAAI,gCAAgC,EAAE,MAAM,qCAAqC,CAAC;AACrH,OAAO,EAAE,0BAA0B,IAAI,gCAAgC,EAAE,MAAM,qCAAqC,CAAC;AACrH,OAAO,EAAE,oBAAoB,IAAI,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AACnG,OAAO,EAAE,kBAAkB,IAAI,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC7F,OAAO,EAAE,kBAAkB,IAAI,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC7F,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,uBAAuB,IAAI,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAC5G,OAAO,EAAE,eAAe,IAAI,qBA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;;;;OAMG;IACH,6BAA6B,CAC3B,cAAsB,EACtB,UAA4B,EAAE;QAE9B,OAAO,mCAAmC,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;IACpF,CAAC;IAED;;;;;OAKG;IACH,qBAAqB,CACnB,KAAa,EACb,UAA4B,EAAE;QAE9B,OAAO,2BAA2B,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACnE,CAAC;IAED;;;;;OAKG;IACH,6BAA6B,CAC3B,kBAAsC,EACtC,UAAkC,EAAE;QAEpC,OAAO,mCAAmC,CAAC,IAAI,CAAC,OAAO,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAAC;IACxF,CAAC;IAED;;;;;OAKG;IACH,wBAAwB,CACtB,GAAuB,EACvB,UAA4B,EAAE;QAE9B,OAAO,8BAA8B,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;IAED;;;;OAIG;IACH,uBAAuB,CAAC,UAA4B,EAAE;QACpD,OAAO,6BAA6B,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;CACF","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/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,6 +1,6 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT license.
3
- export const SDK_VERSION = "1.0.2";
3
+ export const SDK_VERSION = "1.0.3";
4
4
  export const JSON_CONTENT_TYPE = "application/json;charset=utf-8";
5
5
  export const XML_CONTENT_TYPE = "application/xml";
6
6
  export const STREAM_CONTENT_TYPE = "application/octet-stream";
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAW,OAAO,CAAC;AAE3C,MAAM,CAAC,MAAM,iBAAiB,GAAG,gCAAgC,CAAC;AAClE,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAClD,MAAM,CAAC,MAAM,mBAAmB,GAAG,0BAA0B,CAAC;AAE9D,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,CAAC;AAC1C,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC;AACjC,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC;AACrC,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAC;AACpC,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport const SDK_VERSION: string = \"1.0.2\";\n\nexport const JSON_CONTENT_TYPE = \"application/json;charset=utf-8\";\nexport const XML_CONTENT_TYPE = \"application/xml\";\nexport const STREAM_CONTENT_TYPE = \"application/octet-stream\";\n\nexport const WNS_TYPE_NAME = \"X-WNS-Type\";\nexport const WNS_RAW = \"wns/raw\";\nexport const WNS_BADGE = \"wns/badge\";\nexport const WNS_TITLE = \"wns/tile\";\nexport const WNS_TOAST = \"wns/toast\";\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAW,OAAO,CAAC;AAE3C,MAAM,CAAC,MAAM,iBAAiB,GAAG,gCAAgC,CAAC;AAClE,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAClD,MAAM,CAAC,MAAM,mBAAmB,GAAG,0BAA0B,CAAC;AAE9D,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,CAAC;AAC1C,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC;AACjC,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC;AACrC,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAC;AACpC,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport const SDK_VERSION: string = \"1.0.3\";\n\nexport const JSON_CONTENT_TYPE = \"application/json;charset=utf-8\";\nexport const XML_CONTENT_TYPE = \"application/xml\";\nexport const STREAM_CONTENT_TYPE = \"application/octet-stream\";\n\nexport const WNS_TYPE_NAME = \"X-WNS-Type\";\nexport const WNS_RAW = \"wns/raw\";\nexport const WNS_BADGE = \"wns/badge\";\nexport const WNS_TITLE = \"wns/tile\";\nexport const WNS_TOAST = \"wns/toast\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/utils/utils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;GAIG;AACH,MAAM,UAA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AC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;AACpD,CAAC;AAED;;;GAGG;AACH,6EAA6E;AAC7E,MAAM,UAAU,kBAAkB,CAAC,KAAW;IAC5C,MAAM,MAAM,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAC3C,IAAI,MAAM,KAAK,SAAS,EAAE;QACxB,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Helper TypeGuard that checks if something is defined or not.\n * @param thing - Anything\n * @internal\n */\nexport function isDefined<T>(thing: T | undefined | null): thing is T {\n return typeof thing !== \"undefined\" && thing !== null;\n}\n\n/**\n * Helper TypeGuard that checks if something is a string or not.\n * @param thing - Anything\n * @internal\n */\nexport function isString(thing: unknown): thing is string {\n return typeof thing === \"string\" || thing instanceof String;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `string` value from given string,\n * or throws error if undefined.\n */\nexport function getString(value: unknown, nameOfProperty: string): string {\n const result = getStringOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a string value and not undefined.`\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `string` value from given input,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getStringOrUndefined(value: any): string | undefined {\n if (!isDefined(value)) {\n return undefined;\n }\n return value.toString();\n}\n\n/**\n * @internal\n * Helper utility to retrieve `integer` value from given string,\n * or throws error if undefined.\n */\nexport function getInteger(value: unknown, nameOfProperty: string): number {\n const result = getIntegerOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a number value and not undefined.`\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `integer` value from given string,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getIntegerOrUndefined(value: any): number | undefined {\n if (!isDefined(value)) {\n return undefined;\n }\n const result = parseInt(value.toString());\n return isNaN(result) ? undefined : result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `float` value from given string,\n * or throws error if undefined.\n */\nexport function getFloat(value: unknown, nameOfProperty: string): number {\n const result = getFloatOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a number value and not undefined.`\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `float` value from given string,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getFloatOrUndefined(value: any): number | undefined {\n if (!isDefined(value)) {\n return undefined;\n }\n const result = parseFloat(value.toString());\n return Number.isNaN(result) ? undefined : result;\n}\n\n/**\n * @internal\n * Helper utility to convert ISO-8601 time into Date type.\n */\nexport function getDate(value: string, nameOfProperty: string): Date {\n const result = getDateOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a Date value and not undefined.`\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to convert ISO-8601 time into Date type,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getDateOrUndefined(value: any): Date | undefined {\n const stringValue = getStringOrUndefined(value);\n if (stringValue === undefined) {\n return undefined;\n }\n const result = new Date(stringValue.toString());\n return Number.isNaN(+result) ? undefined : result;\n}\n\n/**\n * @internal\n * Helper utility to parse tags from a comma separated string.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getTagsOrUndefined(value?: any): string[] | undefined {\n const result = getStringOrUndefined(value);\n if (result === undefined) {\n return undefined;\n }\n return result.split(\",\");\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/utils/utils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC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AAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;AACpD,CAAC;AAED;;;GAGG;AACH,6EAA6E;AAC7E,MAAM,UAAU,kBAAkB,CAAC,KAAW;IAC5C,MAAM,MAAM,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAC3C,IAAI,MAAM,KAAK,SAAS,EAAE;QACxB,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Helper TypeGuard that checks if something is defined or not.\n * @param thing - Anything\n * @internal\n */\nexport function isDefined<T>(thing: T | undefined | null): thing is T {\n return typeof thing !== \"undefined\" && thing !== null;\n}\n\n/**\n * Helper TypeGuard that checks if something is a string or not.\n * @param thing - Anything\n * @internal\n */\nexport function isString(thing: unknown): thing is string {\n return typeof thing === \"string\" || thing instanceof String;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `string` value from given string,\n * or throws error if undefined.\n */\nexport function getString(value: unknown, nameOfProperty: string): string {\n const result = getStringOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a string value and not undefined.`\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `string` value from given input,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getStringOrUndefined(value: any): string | undefined {\n if (!isDefined(value)) {\n return undefined;\n }\n return value.toString();\n}\n\n/**\n * @internal\n * Helper utility to retrieve `integer` value from given string,\n * or throws error if undefined.\n */\nexport function getInteger(value: unknown, nameOfProperty: string): number {\n const result = getIntegerOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a number value and not undefined.`\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `integer` value from given string,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getIntegerOrUndefined(value: any): number | undefined {\n if (!isDefined(value)) {\n return undefined;\n }\n const result = parseInt(value.toString());\n return isNaN(result) ? undefined : result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `float` value from given string,\n * or throws error if undefined.\n */\nexport function getFloat(value: unknown, nameOfProperty: string): number {\n const result = getFloatOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a number value and not undefined.`\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `float` value from given string,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getFloatOrUndefined(value: any): number | undefined {\n if (!isDefined(value)) {\n return undefined;\n }\n const result = parseFloat(value.toString());\n return Number.isNaN(result) ? undefined : result;\n}\n\n/**\n * @internal\n * Helper utility to convert ISO-8601 time into Date type.\n */\nexport function getDate(value: string, nameOfProperty: string): Date {\n const result = getDateOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a Date value and not undefined.`\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to convert ISO-8601 time into Date type,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getDateOrUndefined(value: any): Date | undefined {\n const stringValue = getStringOrUndefined(value);\n if (stringValue === undefined) {\n return undefined;\n }\n const result = new Date(stringValue.toString());\n return Number.isNaN(+result) ? undefined : result;\n}\n\n/**\n * @internal\n * Helper utility to parse tags from a comma separated string.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getTagsOrUndefined(value?: any): string[] | undefined {\n const result = getStringOrUndefined(value);\n if (result === undefined) {\n return undefined;\n }\n return result.split(\",\");\n}\n\nexport type NullableRecord = Record<string, string | undefined>;\nexport type NonNullableRecord = Record<string, NonNullable<NullableRecord[string]>>;\n"]}
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@azure/notification-hubs",
3
- "version": "1.0.2",
3
+ "version": "1.0.3-alpha.20230703.2",
4
4
  "description": "Azure Notification Hubs SDK for JavaScript",
5
5
  "sdk-type": "client",
6
- "main": "dist/index.js",
6
+ "main": "dist/index.cjs",
7
7
  "module": "dist-esm/src/index.js",
8
8
  "browser": {
9
9
  "./dist-esm/src/auth/hmacSha256.js": "./dist-esm/src/auth/hmacSha256.browser.js"
@@ -46,12 +46,11 @@
46
46
  "scripts": {
47
47
  "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
48
48
  "build:samples": "echo Obsolete",
49
- "build:test:browser": "tsc -p . && rollup -c rollup.test.config.js 2>&1",
49
+ "build:test:browser": "tsc -p . && rollup --bundleConfigAsCjs -c rollup.test.config.cjs 2>&1",
50
50
  "build:test:node": "tsc -p . && dev-tool run bundle",
51
- "build:test": "tsc -p . && rollup -c rollup.test.config.js 2>&1",
51
+ "build:test": "tsc -p . && rollup --bundleConfigAsCjs -c rollup.test.config.cjs 2>&1",
52
52
  "build:types": "downlevel-dts types/latest/ types/3.1/",
53
- "build:output": "node scripts/renameOutput.mjs",
54
- "build": "npm run build:test && api-extractor run --local && npm run build:types && npm run build:output",
53
+ "build": "npm run build:test && api-extractor run --local && npm run build:types",
55
54
  "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
56
55
  "clean": "rimraf dist dist-* temp types *.tgz *.log",
57
56
  "execute:samples": "dev-tool samples run samples-dev",
@@ -97,23 +96,22 @@
97
96
  "sideEffects": false,
98
97
  "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
99
98
  "devDependencies": {
100
- "@azure/dev-tool": "^1.0.0",
101
- "@azure/eslint-plugin-azure-sdk": "^3.0.0",
99
+ "@azure/dev-tool": ">=1.0.0-alpha <1.0.0-alphb",
100
+ "@azure/eslint-plugin-azure-sdk": ">=3.0.0-alpha <3.0.0-alphb",
102
101
  "@azure-tools/test-recorder": "^3.0.0",
103
- "@azure/test-utils": "^1.0.0",
102
+ "@azure/test-utils": ">=1.0.0-alpha <1.0.0-alphb",
104
103
  "@microsoft/api-extractor": "^7.31.1",
105
- "@rollup/plugin-commonjs": "^24.0.0",
106
- "@rollup/plugin-inject": "^5.0.0",
104
+ "@rollup/plugin-commonjs": "^25.0.2",
105
+ "@rollup/plugin-inject": "^5.0.3",
107
106
  "@rollup/plugin-json": "^6.0.0",
108
107
  "@rollup/plugin-multi-entry": "^6.0.0",
109
- "@rollup/plugin-node-resolve": "^13.1.3",
110
- "@rollup/plugin-replace": "^5.0.0",
111
- "@rollup/plugin-typescript": "^11.0.0",
108
+ "@rollup/plugin-node-resolve": "^15.1.0",
109
+ "@rollup/plugin-replace": "^5.0.2",
110
+ "@rollup/plugin-typescript": "^11.1.1",
112
111
  "@types/chai": "^4.3.1",
113
112
  "@types/mocha": "^7.0.2",
114
113
  "@types/node": "^14.0.0",
115
114
  "chai": "^4.3.6",
116
- "cross-env": "^7.0.3",
117
115
  "dotenv": "^16.0.0",
118
116
  "downlevel-dts": "^0.10.0",
119
117
  "eslint": "^8.16.0",
@@ -135,10 +133,9 @@
135
133
  "prettier": "^2.5.1",
136
134
  "puppeteer": "^19.2.2",
137
135
  "rimraf": "^3.0.2",
138
- "rollup": "^2.0.0",
136
+ "rollup": "^3.25.3",
139
137
  "rollup-plugin-shim": "^1.0.0",
140
- "rollup-plugin-sourcemaps": "^0.6.3",
141
- "ts-node": "^10.0.0",
138
+ "ts-node": "^10.9.1",
142
139
  "typescript": "~5.0.0",
143
140
  "util": "^0.12.4"
144
141
  },
@@ -140,6 +140,19 @@ export declare interface AdmNotification extends JsonNotification {
140
140
  */
141
141
  platform: "adm";
142
142
  }
143
+ /**
144
+ * Represents an ADM notification that can be sent to a device.
145
+ */
146
+ export declare interface AdmNotificationParams {
147
+ /**
148
+ * The body for the push notification.
149
+ */
150
+ body: string | AdmNativeMessage;
151
+ /**
152
+ * The headers to include for the push notification.
153
+ */
154
+ headers?: Record<string, string | undefined>;
155
+ }
143
156
  /**
144
157
  * Describes an ADM Registration channel query.
145
158
  */
@@ -182,6 +195,10 @@ export declare interface AdmTemplateRegistrationDescription extends AdmTemplateR
182
195
  */
183
196
  export declare interface AdmTemplateRegistrationDescriptionCommon extends AdmRegistrationDescriptionCommon, TemplateRegistrationDescription {
184
197
  }
198
+ /**
199
+ * Describes the types of APNs pushes.
200
+ */
201
+ export declare type ApnsPushTypes = "alert" | "background" | "voip" | "complication" | "fileprovider" | "mdm" | "location" | "liveactivity" | "pushtotalk";
185
202
  /**
186
203
  * Represents what is in the APNs alert body.
187
204
  */
@@ -244,36 +261,9 @@ export declare interface AppleAlert {
244
261
  "loc-args"?: string[];
245
262
  }
246
263
  /**
247
- * Represents an APNs critical sound
248
- */
249
- export declare interface AppleCriticalSound {
250
- /**
251
- * The critical alert flag. Set to 1 to enable the critical alert.
252
- */
253
- critical: number;
254
- /**
255
- * The name of a sound file in your app’s main bundle or in the Library/Sounds folder
256
- * of your app’s container directory. Specify the string “default” to play the system sound.
257
- */
258
- name: string;
259
- /**
260
- * The volume for the critical alert’s sound. Set this to a value between 0 (silent) and 1 (full volume).
261
- */
262
- volume: number;
263
- }
264
- /**
265
- * Represents an Apple APNs based installation.
266
- */
267
- export declare interface AppleInstallation extends DeviceTokenInstallation {
268
- /**
269
- * The platform for the installation.
270
- */
271
- platform: "apns";
272
- }
273
- /**
274
- * Represents a native APNs message.
264
+ * Represents a native APNs APS message.
275
265
  */
276
- export declare interface AppleNativeMessage extends Record<string, any> {
266
+ export declare interface AppleApsNativeMessage extends Record<string, any> {
277
267
  /**
278
268
  * The information for displaying an alert.
279
269
  */
@@ -324,6 +314,91 @@ export declare interface AppleNativeMessage extends Record<string, any> {
324
314
  * The criteria the system evaluates to determine if it displays the notification in the current Focus.
325
315
  */
326
316
  "filter-criteria"?: string;
317
+ /**
318
+ * The UNIX timestamp that represents the date at which a Live Activity becomes stale, or out of date.
319
+ */
320
+ "stale-date"?: number;
321
+ /**
322
+ * The updated or final content for a Live Activity.
323
+ */
324
+ "content-state"?: Record<string, any>;
325
+ /**
326
+ * The UNIX timestamp that marks the time when you send the remote notification that updates or ends a Live Activity.
327
+ */
328
+ timestamp?: number;
329
+ /**
330
+ * The string that describes whether you update or end an ongoing Live Activity with the remote push notification. To update the Live Activity, use update. To end the Live Activity, use end.
331
+ */
332
+ events?: string;
333
+ /**
334
+ * The UNIX timestamp that represents the date at which the system ends a Live Activity and removes it from the Dynamic Island and the Lock Screen.
335
+ */
336
+ "dismissal-date"?: number;
337
+ }
338
+ /**
339
+ * Represents an APNs critical sound
340
+ */
341
+ export declare interface AppleCriticalSound {
342
+ /**
343
+ * The critical alert flag. Set to 1 to enable the critical alert.
344
+ */
345
+ critical: number;
346
+ /**
347
+ * The name of a sound file in your app’s main bundle or in the Library/Sounds folder
348
+ * of your app’s container directory. Specify the string “default” to play the system sound.
349
+ */
350
+ name: string;
351
+ /**
352
+ * The volume for the critical alert’s sound. Set this to a value between 0 (silent) and 1 (full volume).
353
+ */
354
+ volume: number;
355
+ }
356
+ /**
357
+ * The list of APNs specific headers.
358
+ */
359
+ export declare interface AppleHeaders extends Record<string, string | undefined> {
360
+ /**
361
+ * The value of this header must accurately reflect the contents of your notification’s payload.
362
+ */
363
+ "apns-push-type"?: ApnsPushTypes;
364
+ /**
365
+ * A canonical UUID that’s the unique ID for the notification.
366
+ */
367
+ "apns-id"?: string;
368
+ /**
369
+ * The date at which the notification is no longer valid. This value is a UNIX epoch expressed in seconds (UTC).
370
+ */
371
+ "apns-expiration"?: string;
372
+ /**
373
+ * The priority of the notification. If you omit this header, APNs sets the notification priority to 10.
374
+ */
375
+ "apns-priority"?: "5" | "10";
376
+ /**
377
+ * The topic for the notification. In general, the topic is your app’s bundle ID/app ID.
378
+ */
379
+ "apns-topic"?: string;
380
+ /**
381
+ * An identifier you use to merge multiple notifications into a single notification for the user.
382
+ */
383
+ "apns-collapse-id"?: string;
384
+ }
385
+ /**
386
+ * Represents an Apple APNs based installation.
387
+ */
388
+ export declare interface AppleInstallation extends DeviceTokenInstallation {
389
+ /**
390
+ * The platform for the installation.
391
+ */
392
+ platform: "apns";
393
+ }
394
+ /**
395
+ * Represents a native APNs message.
396
+ */
397
+ export declare interface AppleNativeMessage extends Record<string, any> {
398
+ /**
399
+ * The Apple specific push notification information.
400
+ */
401
+ aps?: AppleApsNativeMessage;
327
402
  }
328
403
  /**
329
404
  * Represents an Apple APNs push notification.
@@ -334,6 +409,19 @@ export declare interface AppleNotification extends JsonNotification {
334
409
  */
335
410
  platform: "apple";
336
411
  }
412
+ /**
413
+ * Represents an Apple notification that can be sent to a device.
414
+ */
415
+ export declare interface AppleNotificationParams {
416
+ /**
417
+ * The body for the push notification.
418
+ */
419
+ body: string | AppleNativeMessage;
420
+ /**
421
+ * The headers to include for the push notification.
422
+ */
423
+ headers?: AppleHeaders;
424
+ }
337
425
  /**
338
426
  * Describes an Apple Registration channel query.
339
427
  */
@@ -647,7 +735,7 @@ export declare function createAdmInstallation(installation: DeviceTokenInstallat
647
735
  * @param notification - A partial message used to create a message for Amazon Device Messaging.
648
736
  * @returns A newly created Amazon Device Messaging.
649
737
  */
650
- export declare function createAdmNotification(notification: NotificationCommon): AdmNotification;
738
+ export declare function createAdmNotification(notification: AdmNotificationParams): AdmNotification;
651
739
  /**
652
740
  * Creates a AdmNotification from a native ADM payload.
653
741
  * @param nativeMessage - The native message payload to send to Notification Hubs.
@@ -677,7 +765,7 @@ export declare function createAppleInstallation(installation: DeviceTokenInstall
677
765
  * @param notification - A partial message used to create a message for Apple.
678
766
  * @returns A newly created Apple.
679
767
  */
680
- export declare function createAppleNotification(notification: NotificationCommon): AppleNotification;
768
+ export declare function createAppleNotification(notification: AppleNotificationParams): AppleNotification;
681
769
  /**
682
770
  * Creates an APNs native message to send to Notification Hubs.
683
771
  * @param nativeMessage - The Apple native message properties to set.
@@ -762,7 +850,7 @@ export declare function createFcmLegacyInstallation(installation: DeviceTokenIns
762
850
  * @param notification - A partial message used to create a message for Firebase.
763
851
  * @returns A newly created Firebase notification.
764
852
  */
765
- export declare function createFcmLegacyNotification(notification: NotificationCommon): FcmLegacyNotification;
853
+ export declare function createFcmLegacyNotification(notification: FcmLegacyNotificationParams): FcmLegacyNotification;
766
854
  /**
767
855
  * Creates a Firebase Legacy registration description.
768
856
  * @param description - A partial GCM registration description.
@@ -798,7 +886,7 @@ export declare function createTemplateNotification(notification: NotificationCom
798
886
  * @param notification - A partial message used to create a badge message for WNS.
799
887
  * @returns A newly created WNS badge.
800
888
  */
801
- export declare function createWindowsBadgeNotification(notification: NotificationCommon): WindowsNotification;
889
+ export declare function createWindowsBadgeNotification(notification: WnsNotificationParams): WindowsNotification;
802
890
  /**
803
891
  * Builds a WindowsNotification from a Windows Badge.
804
892
  * @param nativeMessage - The Windows Badge Message to build.
@@ -811,12 +899,18 @@ export declare function createWindowsBadgeNotificationBody(nativeMessage: Window
811
899
  * @returns The newly created WNS installation.
812
900
  */
813
901
  export declare function createWindowsInstallation(installation: DeviceTokenInstallation): WindowsInstallation;
902
+ /**
903
+ * Creates a notification to send to WNS.
904
+ * @param notification - The WNS notification to send.
905
+ * @returns A newly created WNS message.
906
+ */
907
+ export declare function createWindowsNotification(notification: WnsNotificationParams): WindowsNotification;
814
908
  /**
815
909
  * Creates a notification to send to WNS in wns/raw format..
816
910
  * @param notification - A partial message used to create a message for WNS in XML format.
817
911
  * @returns A newly created WNS message using XML.
818
912
  */
819
- export declare function createWindowsRawNotification(notification: NotificationCommon): WindowsNotification;
913
+ export declare function createWindowsRawNotification(notification: WnsNotificationParams): WindowsNotification;
820
914
  /**
821
915
  * Creates a Windows registration description.
822
916
  * @param description - A partial Windows registration description.
@@ -834,13 +928,13 @@ export declare function createWindowsTemplateRegistrationDescription(description
834
928
  * @param notification - A partial message used to create a tile message for WNS.
835
929
  * @returns A newly created WNS tile.
836
930
  */
837
- export declare function createWindowsTileNotification(notification: NotificationCommon): WindowsNotification;
931
+ export declare function createWindowsTileNotification(notification: WnsNotificationParams): WindowsNotification;
838
932
  /**
839
933
  * Creates a toast message to send to WNS.
840
934
  * @param notification - A partial message used to create a toast message for WNS.
841
935
  * @returns A newly created WNS toast.
842
936
  */
843
- export declare function createWindowsToastNotification(notification: NotificationCommon): WindowsNotification;
937
+ export declare function createWindowsToastNotification(notification: WnsNotificationParams): WindowsNotification;
844
938
  /**
845
939
  * Creates a Xiaomi based installation.
846
940
  * @param installation - A partial installation used to create the Xiaomi installation.
@@ -910,6 +1004,19 @@ export declare interface FcmLegacyNotification extends JsonNotification {
910
1004
  */
911
1005
  platform: "gcm";
912
1006
  }
1007
+ /**
1008
+ * Represents an Firebase Legacy notification that can be sent to a device.
1009
+ */
1010
+ export declare interface FcmLegacyNotificationParams {
1011
+ /**
1012
+ * The body for the push notification.
1013
+ */
1014
+ body: string | FirebaseLegacyNativeMessage;
1015
+ /**
1016
+ * The headers to include for the push notification.
1017
+ */
1018
+ headers?: Record<string, string | undefined>;
1019
+ }
913
1020
  /**
914
1021
  * Represents an Android native payload for the Firebase Legacy HTTP interface.
915
1022
  */
@@ -1268,7 +1375,7 @@ export declare interface MpnsTemplateRegistrationDescriptionCommon extends MpnsR
1268
1375
  */
1269
1376
  export declare type Notification = AppleNotification | AdmNotification | BaiduNotification | BrowserNotification | FcmLegacyNotification | XiaomiNotification | WindowsNotification | TemplateNotification;
1270
1377
  /**
1271
- * Represents a notification hub.
1378
+ * Represents a notification that can be sent to a device.
1272
1379
  */
1273
1380
  export declare interface NotificationCommon {
1274
1381
  /**
@@ -1278,7 +1385,7 @@ export declare interface NotificationCommon {
1278
1385
  /**
1279
1386
  * The headers to include for the push notification.
1280
1387
  */
1281
- headers?: Record<string, string>;
1388
+ headers?: Record<string, string | undefined>;
1282
1389
  }
1283
1390
  /**
1284
1391
  * Represents Notification details.
@@ -1860,6 +1967,15 @@ export declare interface WindowsBadgeNativeMessage {
1860
1967
  * Represents the possible WNS content-types.
1861
1968
  */
1862
1969
  export declare type WindowsContentType = "application/xml" | "application/octet-stream";
1970
+ /**
1971
+ * List of WNS specific headers.
1972
+ */
1973
+ export declare interface WindowsHeaders extends Record<string, string | undefined> {
1974
+ /**
1975
+ * The header specifies whether this is a tile, toast, badge, or raw notification.
1976
+ */
1977
+ "X-WNS-Type"?: WnsTypes;
1978
+ }
1863
1979
  /**
1864
1980
  * Represents a Windows Notification Services (WNS) based installation.
1865
1981
  */
@@ -1931,6 +2047,23 @@ export declare interface WindowsTemplateRegistrationDescriptionCommon extends Wi
1931
2047
  */
1932
2048
  wnsHeaders?: Record<string, string>;
1933
2049
  }
2050
+ /**
2051
+ * Represents a WNS notification that can be sent to a device.
2052
+ */
2053
+ export declare interface WnsNotificationParams {
2054
+ /**
2055
+ * The body for the push notification.
2056
+ */
2057
+ body: string;
2058
+ /**
2059
+ * The headers to include for the push notification.
2060
+ */
2061
+ headers?: WindowsHeaders;
2062
+ }
2063
+ /**
2064
+ * The list of WNS specific types.
2065
+ */
2066
+ export declare type WnsTypes = "wns/toast" | "wns/badge" | "wns/tile" | "wns/raw";
1934
2067
  /**
1935
2068
  * Represents a Xiaomi based installation.
1936
2069
  */