From e905eaf35a8b80abef6265a10921ef824b6849ee Mon Sep 17 00:00:00 2001 From: Matthew Podwysocki Date: Mon, 29 Apr 2024 18:27:07 -0400 Subject: [PATCH] [notification-hubs] Fix FCMV1 bugs (#29507) ### Packages impacted by this PR - @azure/notification-hubs ### Issues associated with this PR - #29465 ### Describe the problem that is addressed by this PR Fixes the right signatures for the FCM versus FCM Legacy. ### What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen? ### Are there test cases added in this PR? _(If not, why?)_ ### Provide a list of related PRs _(if any)_ ### Command used to generate this PR:**_(Applicable only to SDK release request PRs)_ ### Checklists - [ ] Added impacted package name to the issue description - [ ] Does this PR needs any fixes in the SDK Generator?** _(If so, create an Issue in the [Autorest/typescript](https://github.com/Azure/autorest.typescript) repository and link it here)_ - [ ] Added a changelog (if necessary) --- .../notification-hubs/CHANGELOG.md | 17 ++++++----------- .../review/notification-hubs-models.api.md | 4 ++-- .../review/notification-hubs.api.md | 4 ++-- .../src/models/notificationBodyBuilder.ts | 6 ++++-- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/sdk/notificationhubs/notification-hubs/CHANGELOG.md b/sdk/notificationhubs/notification-hubs/CHANGELOG.md index 1a4d20419d2..8cf6fa5280e 100644 --- a/sdk/notificationhubs/notification-hubs/CHANGELOG.md +++ b/sdk/notificationhubs/notification-hubs/CHANGELOG.md @@ -1,22 +1,17 @@ # Release History -## 1.2.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 1.2.1 (2024-04-25) +## 1.2.2 (2024-04-29) ### Bugs Fixed - Fixed FirebaseV1 Notification to use the correct `data` and create the wrapper `message`. - [#29404](https://github.com/Azure/azure-sdk-for-js/issues/29404) - [#29371](https://github.com/Azure/azure-sdk-for-js/issues/29371) + +## 1.2.1 (2024-04-25) + +### Bugs Fixed + - Fixed Firebase query for `listRegistrationsByChannel` to use the correct `channel` query parameter. - [#29372](https://github.com/Azure/azure-sdk-for-js/issues/29372) diff --git a/sdk/notificationhubs/notification-hubs/review/notification-hubs-models.api.md b/sdk/notificationhubs/notification-hubs/review/notification-hubs-models.api.md index ab8be4c5563..1a18f63bb27 100644 --- a/sdk/notificationhubs/notification-hubs/review/notification-hubs-models.api.md +++ b/sdk/notificationhubs/notification-hubs/review/notification-hubs-models.api.md @@ -381,10 +381,10 @@ export function createFcmV1RegistrationDescription(description: FcmV1Registratio export function createFcmV1TemplateRegistrationDescription(description: FcmV1TemplateRegistrationDescriptionCommon): FcmV1TemplateRegistrationDescription; // @public -export function createFirebaseLegacyNotificationBody(nativeMessage: FirebaseV1NativeMessageEnvelope): string; +export function createFirebaseLegacyNotificationBody(nativeMessage: FirebaseLegacyNativeMessage): string; // @public -export function createFirebaseV1NotificationBody(nativeMessage: FirebaseV1NativeMessage): string; +export function createFirebaseV1NotificationBody(nativeMessage: FirebaseV1NativeMessageEnvelope): string; // @public export function createTagExpression(tags: string[]): string; diff --git a/sdk/notificationhubs/notification-hubs/review/notification-hubs.api.md b/sdk/notificationhubs/notification-hubs/review/notification-hubs.api.md index 40da117de45..83d4af386bc 100644 --- a/sdk/notificationhubs/notification-hubs/review/notification-hubs.api.md +++ b/sdk/notificationhubs/notification-hubs/review/notification-hubs.api.md @@ -382,10 +382,10 @@ export function createFcmV1RegistrationDescription(description: FcmV1Registratio export function createFcmV1TemplateRegistrationDescription(description: FcmV1TemplateRegistrationDescriptionCommon): FcmV1TemplateRegistrationDescription; // @public -export function createFirebaseLegacyNotificationBody(nativeMessage: FirebaseV1NativeMessageEnvelope): string; +export function createFirebaseLegacyNotificationBody(nativeMessage: FirebaseLegacyNativeMessage): string; // @public -export function createFirebaseV1NotificationBody(nativeMessage: FirebaseV1NativeMessage): string; +export function createFirebaseV1NotificationBody(nativeMessage: FirebaseV1NativeMessageEnvelope): string; // @public export function createTagExpression(tags: string[]): string; diff --git a/sdk/notificationhubs/notification-hubs/src/models/notificationBodyBuilder.ts b/sdk/notificationhubs/notification-hubs/src/models/notificationBodyBuilder.ts index 99ae419bfdf..ea822d28173 100644 --- a/sdk/notificationhubs/notification-hubs/src/models/notificationBodyBuilder.ts +++ b/sdk/notificationhubs/notification-hubs/src/models/notificationBodyBuilder.ts @@ -427,7 +427,7 @@ export interface FirebaseLegacyWebNativePayload { * @returns The JSON body to send to Notification Hubs. */ export function createFirebaseLegacyNotificationBody( - nativeMessage: FirebaseV1NativeMessageEnvelope, + nativeMessage: FirebaseLegacyNativeMessage, ): string { return JSON.stringify(nativeMessage); } @@ -874,7 +874,9 @@ export interface FirebaseV1FcmOptions { * @param nativeMessage - The native message payload to send to Notification Hubs. * @returns The JSON body to send to Notification Hubs. */ -export function createFirebaseV1NotificationBody(nativeMessage: FirebaseV1NativeMessage): string { +export function createFirebaseV1NotificationBody( + nativeMessage: FirebaseV1NativeMessageEnvelope, +): string { return JSON.stringify(nativeMessage); }