@azure/notification-hubs 1.1.2-alpha.20240321.1 → 1.2.0
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/dist/index.cjs +12 -8
- package/dist/index.cjs.map +1 -1
- package/dist-esm/src/models/notification.js +10 -6
- package/dist-esm/src/models/notification.js.map +1 -1
- package/dist-esm/src/models/notificationHeaderBuilder.js.map +1 -1
- package/dist-esm/src/serializers/registrationSerializer.js +1 -1
- package/dist-esm/src/serializers/registrationSerializer.js.map +1 -1
- package/dist-esm/src/utils/constants.js +1 -1
- package/dist-esm/src/utils/constants.js.map +1 -1
- package/package.json +4 -4
- package/types/latest/notification-hubs.d.ts +27 -13
- package/types/src/models/notification.d.ts +24 -11
- package/types/src/models/notification.d.ts.map +1 -1
- package/types/src/models/notificationHeaderBuilder.d.ts +2 -2
- package/types/src/models/notificationHeaderBuilder.d.ts.map +1 -1
package/dist/index.cjs
CHANGED
|
@@ -12,7 +12,7 @@ var tslib = require('tslib');
|
|
|
12
12
|
|
|
13
13
|
// Copyright (c) Microsoft Corporation.
|
|
14
14
|
// Licensed under the MIT license.
|
|
15
|
-
const SDK_VERSION = "1.
|
|
15
|
+
const SDK_VERSION = "1.2.0";
|
|
16
16
|
const JSON_CONTENT_TYPE = "application/json;charset=utf-8";
|
|
17
17
|
const XML_CONTENT_TYPE = "application/xml";
|
|
18
18
|
const STREAM_CONTENT_TYPE = "application/octet-stream";
|
|
@@ -1068,7 +1068,7 @@ const registrationDescriptionSerializer = {
|
|
|
1068
1068
|
* Serializes an existing Browser registration description to an object for serialization.
|
|
1069
1069
|
*/
|
|
1070
1070
|
serializeBrowserRegistrationDescription(description) {
|
|
1071
|
-
return Object.assign(Object.assign({}, serializeRegistrationDescription(description)), { Endpoint: description.endpoint,
|
|
1071
|
+
return Object.assign(Object.assign({}, serializeRegistrationDescription(description)), { Endpoint: description.endpoint, P256DH: description.p256dh, Auth: description.auth });
|
|
1072
1072
|
},
|
|
1073
1073
|
/**
|
|
1074
1074
|
* @internal
|
|
@@ -2223,7 +2223,8 @@ function createAdmNotification(notification) {
|
|
|
2223
2223
|
* @returns A newly created Baidu.
|
|
2224
2224
|
*/
|
|
2225
2225
|
function createBaiduNotification(notification) {
|
|
2226
|
-
|
|
2226
|
+
const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);
|
|
2227
|
+
return Object.assign(Object.assign({}, notification), { body, platform: "baidu", contentType: JSON_CONTENT_TYPE });
|
|
2227
2228
|
}
|
|
2228
2229
|
/**
|
|
2229
2230
|
* Creates a notification to send to a browser.
|
|
@@ -2231,7 +2232,8 @@ function createBaiduNotification(notification) {
|
|
|
2231
2232
|
* @returns A newly created Web Push browser.
|
|
2232
2233
|
*/
|
|
2233
2234
|
function createBrowserNotification(notification) {
|
|
2234
|
-
|
|
2235
|
+
const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);
|
|
2236
|
+
return Object.assign(Object.assign({}, notification), { body, platform: "browser", contentType: JSON_CONTENT_TYPE });
|
|
2235
2237
|
}
|
|
2236
2238
|
/**
|
|
2237
2239
|
* Creates a notification to send to Firebase.
|
|
@@ -2257,15 +2259,17 @@ function createFcmV1Notification(notification) {
|
|
|
2257
2259
|
* @returns A newly created Xiaomi notification.
|
|
2258
2260
|
*/
|
|
2259
2261
|
function createXiaomiNotification(notification) {
|
|
2260
|
-
|
|
2262
|
+
const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);
|
|
2263
|
+
return Object.assign(Object.assign({}, notification), { body, platform: "xiaomi", contentType: JSON_CONTENT_TYPE });
|
|
2261
2264
|
}
|
|
2262
2265
|
/**
|
|
2263
|
-
* Creates a notification
|
|
2264
|
-
* @param notification - A partial message used to
|
|
2266
|
+
* Creates a template notification.
|
|
2267
|
+
* @param notification - A partial message used to be used for a template notification.
|
|
2265
2268
|
* @returns A newly created Firebase.
|
|
2266
2269
|
*/
|
|
2267
2270
|
function createTemplateNotification(notification) {
|
|
2268
|
-
|
|
2271
|
+
const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);
|
|
2272
|
+
return Object.assign(Object.assign({}, notification), { body, platform: "template", contentType: JSON_CONTENT_TYPE });
|
|
2269
2273
|
}
|
|
2270
2274
|
/**
|
|
2271
2275
|
* Creates a notification to send to WNS.
|