@azure/notification-hubs 1.1.0 → 1.1.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"notification.js","sourceRoot":"","sources":["../../../src/models/notification.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AASnD,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,YAAY,MAAM,CAAC;AAC9D,CAAC;AAoDD;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAqC;IAC3E,MAAM,IAAI,GAAG,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IAEjG,uCACK,YAAY,KACf,IAAI,EACJ,QAAQ,EAAE,OAAO,EACjB,WAAW,EAAE,SAAS,CAAC,iBAAiB,IACxC;AACJ,CAAC;AA2BD;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,YAAmC;IACvE,MAAM,IAAI,GAAG,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IAEjG,uCACK,YAAY,KACf,IAAI,EACJ,QAAQ,EAAE,KAAK,EACf,WAAW,EAAE,SAAS,CAAC,iBAAiB,IACxC;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAgC;IACtE,uCACK,YAAY,KACf,QAAQ,EAAE,OAAO,EACjB,WAAW,EAAE,SAAS,CAAC,iBAAiB,IACxC;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAA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CAAC;IAC9D,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport * as Constants from \"../utils/constants.js\";\nimport {\n AdmNativeMessage,\n AppleNativeMessage,\n FirebaseLegacyNativeMessage,\n FirebaseV1NativeMessage,\n} from \"./notificationBodyBuilder.js\";\nimport { AppleHeaders, WindowsHeaders } from \"./notificationHeaderBuilder.js\";\n\nfunction isString(value: unknown): value is string {\n return typeof value === \"string\" || value instanceof String;\n}\n\n/**\n * Represents a notification that can be sent to a device.\n */\nexport interface NotificationCommon {\n /**\n * The body for the push notification.\n */\n body: string;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: Record<string, string | undefined>;\n}\n\n/**\n * Represents a JSON notification hub.\n */\nexport interface JsonNotification extends NotificationCommon {\n /**\n * The content type for the push notification.\n */\n contentType: \"application/json;charset=utf-8\";\n}\n\n/**\n * Represents an Apple APNs push notification.\n */\nexport interface AppleNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"apple\";\n}\n\n/**\n * Represents an Apple notification that can be sent to a device.\n */\nexport interface AppleNotificationParams {\n /**\n * The body for the push notification.\n */\n body: string | AppleNativeMessage;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: AppleHeaders;\n}\n\n/**\n * Creates a notification to send to an Apple device.\n * @param notification - A partial message used to create a message for Apple.\n * @returns A newly created Apple.\n */\nexport function createAppleNotification(notification: AppleNotificationParams): AppleNotification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"apple\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents an Amazon Device Messaging (ADM) push notification.\n */\nexport interface AdmNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"adm\";\n}\n\n/**\n * Represents an ADM notification that can be sent to a device.\n */\nexport interface AdmNotificationParams {\n /**\n * The body for the push notification.\n */\n body: string | AdmNativeMessage;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: Record<string, string | undefined>;\n}\n\n/**\n * Creates a notification to send to an Amazon Device Messaging device.\n * @param notification - A partial message used to create a message for Amazon Device Messaging.\n * @returns A newly created Amazon Device Messaging.\n */\nexport function createAdmNotification(notification: AdmNotificationParams): AdmNotification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"adm\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents a Baidu push notification.\n */\nexport interface BaiduNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"baidu\";\n}\n\n/**\n * Creates a notification to send to a Baidu registered device.\n * @param notification - A partial message used to create a message for Baidu.\n * @returns A newly created Baidu.\n */\nexport function createBaiduNotification(notification: NotificationCommon): BaiduNotification {\n return {\n ...notification,\n platform: \"baidu\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents a Browser push notification.\n */\nexport interface BrowserNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"browser\";\n}\n\n/**\n * Creates a notification to send to a browser.\n * @param notification - A partial message used to create a message for a browser.\n * @returns A newly created Web Push browser.\n */\nexport function createBrowserNotification(notification: NotificationCommon): BrowserNotification {\n return {\n ...notification,\n platform: \"browser\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents a Firebase legacy HTTP push notification.\n */\nexport interface FcmLegacyNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"gcm\";\n}\n\n/**\n * Represents an Firebase Legacy notification that can be sent to a device.\n */\nexport interface FcmLegacyNotificationParams {\n /**\n * The body for the push notification.\n */\n body: string | FirebaseLegacyNativeMessage;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: Record<string, string | undefined>;\n}\n\n/**\n * Creates a notification to send to Firebase.\n * @param notification - A partial message used to create a message for Firebase.\n * @returns A newly created Firebase notification.\n */\nexport function createFcmLegacyNotification(\n notification: FcmLegacyNotificationParams,\n): FcmLegacyNotification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"gcm\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents an Firebase V1 API notification that can be sent to a device.\n */\nexport interface FcmV1Notification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"fcmv1\";\n}\n\n/**\n * Represents an Firebase Legacy notification that can be sent to a device.\n */\nexport interface FcmV1NotificationParams {\n /**\n * The body for the push notification.\n */\n body: string | FirebaseV1NativeMessage;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: Record<string, string | undefined>;\n}\n\n/**\n * Creates a notification to send to Firebase.\n * @param notification - A partial message used to create a message for Firebase.\n * @returns A newly created Firebase notification.\n */\nexport function createFcmV1Notification(notification: FcmV1NotificationParams): FcmV1Notification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"fcmv1\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents a Xiaomi push notification.\n */\nexport interface XiaomiNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"xiaomi\";\n}\n\n/**\n * Creates a notification to send to Xiaomi.\n * @param notification - A partial message used to create a message for Xiaomi.\n * @returns A newly created Xiaomi notification.\n */\nexport function createXiaomiNotification(notification: NotificationCommon): XiaomiNotification {\n return {\n ...notification,\n platform: \"xiaomi\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents a template based push notification.\n */\nexport interface TemplateNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"template\";\n}\n\n/**\n * Creates a notification to send to Firebase.\n * @param notification - A partial message used to create a message for Firebase.\n * @returns A newly created Firebase.\n */\nexport function createTemplateNotification(notification: NotificationCommon): TemplateNotification {\n return {\n ...notification,\n platform: \"template\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents the possible WNS content-types.\n */\nexport type WindowsContentType = \"application/xml\" | \"application/octet-stream\";\n\n/**\n * Represents a Windows Notification Services (WNS) push notification.\n */\nexport interface WindowsNotification extends NotificationCommon {\n /**\n * The platform for the push notification.\n */\n platform: \"windows\";\n\n /**\n * The content type for the push notification.\n */\n contentType: WindowsContentType;\n}\n\n/**\n * Represents a WNS notification that can be sent to a device.\n */\nexport interface WnsNotificationParams {\n /**\n * The body for the push notification.\n */\n body: string;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: WindowsHeaders;\n}\n\n/**\n * Creates a notification to send to WNS.\n * @param notification - The WNS notification to send.\n * @returns A newly created WNS message.\n */\nexport function createWindowsNotification(\n notification: WnsNotificationParams,\n): WindowsNotification {\n if (notification?.headers && notification.headers[\"X-WNS-Type\"]) {\n const wnsType = notification.headers[\"X-WNS-Type\"];\n switch (wnsType) {\n case Constants.WNS_TOAST:\n return createWindowsToastNotification(notification);\n case Constants.WNS_TITLE:\n return createWindowsTileNotification(notification);\n case Constants.WNS_BADGE:\n return createWindowsBadgeNotification(notification);\n case Constants.WNS_RAW:\n return createWindowsRawNotification(notification);\n default:\n throw new Error(`Invalid WNS type: ${wnsType}`);\n }\n } else {\n throw new Error(`Missing WNS type in headers`);\n }\n}\n\n/**\n * Creates a badge message to send to WNS.\n * @param notification - A partial message used to create a badge message for WNS.\n * @returns A newly created WNS badge.\n */\nexport function createWindowsBadgeNotification(\n notification: WnsNotificationParams,\n): WindowsNotification {\n const result: WindowsNotification = {\n ...notification,\n platform: \"windows\",\n contentType: Constants.XML_CONTENT_TYPE,\n };\n\n if (!result.headers) {\n result.headers = {};\n }\n\n if (!result.headers[Constants.WNS_TYPE_NAME]) {\n result.headers[Constants.WNS_TYPE_NAME] = Constants.WNS_BADGE;\n }\n\n return result;\n}\n\n/**\n * Creates a tile message to send to WNS.\n * @param notification - A partial message used to create a tile message for WNS.\n * @returns A newly created WNS tile.\n */\nexport function createWindowsTileNotification(\n notification: WnsNotificationParams,\n): WindowsNotification {\n const result: WindowsNotification = {\n ...notification,\n platform: \"windows\",\n contentType: Constants.XML_CONTENT_TYPE,\n };\n\n if (!result.headers) {\n result.headers = {};\n }\n\n if (!result.headers[Constants.WNS_TYPE_NAME]) {\n result.headers[Constants.WNS_TYPE_NAME] = Constants.WNS_TITLE;\n }\n\n return result;\n}\n\n/**\n * Creates a toast message to send to WNS.\n * @param notification - A partial message used to create a toast message for WNS.\n * @returns A newly created WNS toast.\n */\nexport function createWindowsToastNotification(\n notification: WnsNotificationParams,\n): WindowsNotification {\n const result: WindowsNotification = {\n ...notification,\n platform: \"windows\",\n contentType: Constants.XML_CONTENT_TYPE,\n };\n\n if (!result.headers) {\n result.headers = {};\n }\n\n if (!result.headers[Constants.WNS_TYPE_NAME]) {\n result.headers[Constants.WNS_TYPE_NAME] = Constants.WNS_TOAST;\n }\n\n return result;\n}\n\n/**\n * Creates a notification to send to WNS in wns/raw format..\n * @param notification - A partial message used to create a message for WNS in XML format.\n * @returns A newly created WNS message using XML.\n */\nexport function createWindowsRawNotification(\n notification: WnsNotificationParams,\n): WindowsNotification {\n const result: WindowsNotification = {\n ...notification,\n platform: \"windows\",\n contentType: Constants.STREAM_CONTENT_TYPE,\n };\n\n if (!result.headers) {\n result.headers = {};\n }\n\n if (!result.headers[Constants.WNS_TYPE_NAME]) {\n result.headers[Constants.WNS_TYPE_NAME] = Constants.WNS_RAW;\n }\n\n return result;\n}\n\n/**\n * Represents the possible push notification messages types.\n */\nexport type Notification =\n | AppleNotification\n | AdmNotification\n | BaiduNotification\n | BrowserNotification\n | FcmLegacyNotification\n | XiaomiNotification\n | WindowsNotification\n | TemplateNotification;\n"]}
1
+ {"version":3,"file":"notification.js","sourceRoot":"","sources":["../../../src/models/notification.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AASnD,SAAS,QAAQ,CAAC,K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AChE,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,8BAA8B,CAC5C,YAAmC;IAEnC,MAAM,MAAM,mCACP,YAAY,KACf,QAAQ,EAAE,SAAS,EACnB,WAAW,EAAE,SAAS,CAAC,gBAAgB,GACxC,CAAC;IAEF,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,CAAC,OAAO,GAAG,EAAE,CAAC;IACtB,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE,CAAC;QAC7C,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,aAAa,CAAC,GAAG,SAAS,CAAC,SAAS,CAAC;IAChE,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,4BAA4B,CAC1C,YAAmC;IAEnC,MAAM,MAAM,mCACP,YAAY,KACf,QAAQ,EAAE,SAAS,EACnB,WAAW,EAAE,SAAS,CAAC,mBAAmB,GAC3C,CAAC;IAEF,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,CAAC,OAAO,GAAG,EAAE,CAAC;IACtB,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE,CAAC;QAC7C,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,aAAa,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;IAC9D,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport * as Constants from \"../utils/constants.js\";\nimport {\n AdmNativeMessage,\n AppleNativeMessage,\n FirebaseLegacyNativeMessage,\n FirebaseV1NativeMessage,\n} from \"./notificationBodyBuilder.js\";\nimport { AppleHeaders, WindowsHeaders } from \"./notificationHeaderBuilder.js\";\n\nfunction isString(value: unknown): value is string {\n return typeof value === \"string\" || value instanceof String;\n}\n\n/**\n * Represents a notification that can be sent to a device.\n */\nexport interface NotificationCommon {\n /**\n * The body for the push notification.\n */\n body: string;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: Record<string, string | undefined>;\n}\n\n/**\n * Represents a JSON notification hub.\n */\nexport interface JsonNotification extends NotificationCommon {\n /**\n * The content type for the push notification.\n */\n contentType: \"application/json;charset=utf-8\";\n}\n\n/**\n * Represents an Apple APNs push notification.\n */\nexport interface AppleNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"apple\";\n}\n\n/**\n * Represents an Apple notification that can be sent to a device.\n */\nexport interface AppleNotificationParams {\n /**\n * The body for the push notification.\n */\n body: string | AppleNativeMessage;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: AppleHeaders;\n}\n\n/**\n * Creates a notification to send to an Apple device.\n * @param notification - A partial message used to create a message for Apple.\n * @returns A newly created Apple.\n */\nexport function createAppleNotification(notification: AppleNotificationParams): AppleNotification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"apple\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents an Amazon Device Messaging (ADM) push notification.\n */\nexport interface AdmNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"adm\";\n}\n\n/**\n * Represents an ADM notification that can be sent to a device.\n */\nexport interface AdmNotificationParams {\n /**\n * The body for the push notification.\n */\n body: string | AdmNativeMessage;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: Record<string, string | undefined>;\n}\n\n/**\n * Creates a notification to send to an Amazon Device Messaging device.\n * @param notification - A partial message used to create a message for Amazon Device Messaging.\n * @returns A newly created Amazon Device Messaging.\n */\nexport function createAdmNotification(notification: AdmNotificationParams): AdmNotification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"adm\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents a Baidu push notification.\n */\nexport interface BaiduNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"baidu\";\n}\n\n/**\n * Creates a notification to send to a Baidu registered device.\n * @param notification - A partial message used to create a message for Baidu.\n * @returns A newly created Baidu.\n */\nexport function createBaiduNotification(notification: NotificationCommon): BaiduNotification {\n return {\n ...notification,\n platform: \"baidu\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents a Browser push notification.\n */\nexport interface BrowserNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"browser\";\n}\n\n/**\n * Creates a notification to send to a browser.\n * @param notification - A partial message used to create a message for a browser.\n * @returns A newly created Web Push browser.\n */\nexport function createBrowserNotification(notification: NotificationCommon): BrowserNotification {\n return {\n ...notification,\n platform: \"browser\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents a Firebase legacy HTTP push notification.\n */\nexport interface FcmLegacyNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"gcm\";\n}\n\n/**\n * Represents an Firebase Legacy notification that can be sent to a device.\n */\nexport interface FcmLegacyNotificationParams {\n /**\n * The body for the push notification.\n */\n body: string | FirebaseLegacyNativeMessage;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: Record<string, string | undefined>;\n}\n\n/**\n * Creates a notification to send to Firebase.\n * @param notification - A partial message used to create a message for Firebase.\n * @returns A newly created Firebase notification.\n */\nexport function createFcmLegacyNotification(\n notification: FcmLegacyNotificationParams,\n): FcmLegacyNotification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"gcm\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents an Firebase V1 API notification that can be sent to a device.\n */\nexport interface FcmV1Notification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"fcmv1\";\n}\n\n/**\n * Represents an Firebase Legacy notification that can be sent to a device.\n */\nexport interface FcmV1NotificationParams {\n /**\n * The body for the push notification.\n */\n body: string | FirebaseV1NativeMessage;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: Record<string, string | undefined>;\n}\n\n/**\n * Creates a notification to send to Firebase.\n * @param notification - A partial message used to create a message for Firebase.\n * @returns A newly created Firebase notification.\n */\nexport function createFcmV1Notification(notification: FcmV1NotificationParams): FcmV1Notification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"fcmv1\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents a Xiaomi push notification.\n */\nexport interface XiaomiNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"xiaomi\";\n}\n\n/**\n * Creates a notification to send to Xiaomi.\n * @param notification - A partial message used to create a message for Xiaomi.\n * @returns A newly created Xiaomi notification.\n */\nexport function createXiaomiNotification(notification: NotificationCommon): XiaomiNotification {\n return {\n ...notification,\n platform: \"xiaomi\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents a template based push notification.\n */\nexport interface TemplateNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"template\";\n}\n\n/**\n * Creates a notification to send to Firebase.\n * @param notification - A partial message used to create a message for Firebase.\n * @returns A newly created Firebase.\n */\nexport function createTemplateNotification(notification: NotificationCommon): TemplateNotification {\n return {\n ...notification,\n platform: \"template\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents the possible WNS content-types.\n */\nexport type WindowsContentType = \"application/xml\" | \"application/octet-stream\";\n\n/**\n * Represents a Windows Notification Services (WNS) push notification.\n */\nexport interface WindowsNotification extends NotificationCommon {\n /**\n * The platform for the push notification.\n */\n platform: \"windows\";\n\n /**\n * The content type for the push notification.\n */\n contentType: WindowsContentType;\n}\n\n/**\n * Represents a WNS notification that can be sent to a device.\n */\nexport interface WnsNotificationParams {\n /**\n * The body for the push notification.\n */\n body: string;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: WindowsHeaders;\n}\n\n/**\n * Creates a notification to send to WNS.\n * @param notification - The WNS notification to send.\n * @returns A newly created WNS message.\n */\nexport function createWindowsNotification(\n notification: WnsNotificationParams,\n): WindowsNotification {\n if (notification?.headers && notification.headers[\"X-WNS-Type\"]) {\n const wnsType = notification.headers[\"X-WNS-Type\"];\n switch (wnsType) {\n case Constants.WNS_TOAST:\n return createWindowsToastNotification(notification);\n case Constants.WNS_TITLE:\n return createWindowsTileNotification(notification);\n case Constants.WNS_BADGE:\n return createWindowsBadgeNotification(notification);\n case Constants.WNS_RAW:\n return createWindowsRawNotification(notification);\n default:\n throw new Error(`Invalid WNS type: ${wnsType}`);\n }\n } else {\n throw new Error(`Missing WNS type in headers`);\n }\n}\n\n/**\n * Creates a badge message to send to WNS.\n * @param notification - A partial message used to create a badge message for WNS.\n * @returns A newly created WNS badge.\n */\nexport function createWindowsBadgeNotification(\n notification: WnsNotificationParams,\n): WindowsNotification {\n const result: WindowsNotification = {\n ...notification,\n platform: \"windows\",\n contentType: Constants.XML_CONTENT_TYPE,\n };\n\n if (!result.headers) {\n result.headers = {};\n }\n\n if (!result.headers[Constants.WNS_TYPE_NAME]) {\n result.headers[Constants.WNS_TYPE_NAME] = Constants.WNS_BADGE;\n }\n\n return result;\n}\n\n/**\n * Creates a tile message to send to WNS.\n * @param notification - A partial message used to create a tile message for WNS.\n * @returns A newly created WNS tile.\n */\nexport function createWindowsTileNotification(\n notification: WnsNotificationParams,\n): WindowsNotification {\n const result: WindowsNotification = {\n ...notification,\n platform: \"windows\",\n contentType: Constants.XML_CONTENT_TYPE,\n };\n\n if (!result.headers) {\n result.headers = {};\n }\n\n if (!result.headers[Constants.WNS_TYPE_NAME]) {\n result.headers[Constants.WNS_TYPE_NAME] = Constants.WNS_TITLE;\n }\n\n return result;\n}\n\n/**\n * Creates a toast message to send to WNS.\n * @param notification - A partial message used to create a toast message for WNS.\n * @returns A newly created WNS toast.\n */\nexport function createWindowsToastNotification(\n notification: WnsNotificationParams,\n): WindowsNotification {\n const result: WindowsNotification = {\n ...notification,\n platform: \"windows\",\n contentType: Constants.XML_CONTENT_TYPE,\n };\n\n if (!result.headers) {\n result.headers = {};\n }\n\n if (!result.headers[Constants.WNS_TYPE_NAME]) {\n result.headers[Constants.WNS_TYPE_NAME] = Constants.WNS_TOAST;\n }\n\n return result;\n}\n\n/**\n * Creates a notification to send to WNS in wns/raw format..\n * @param notification - A partial message used to create a message for WNS in XML format.\n * @returns A newly created WNS message using XML.\n */\nexport function createWindowsRawNotification(\n notification: WnsNotificationParams,\n): WindowsNotification {\n const result: WindowsNotification = {\n ...notification,\n platform: \"windows\",\n contentType: Constants.STREAM_CONTENT_TYPE,\n };\n\n if (!result.headers) {\n result.headers = {};\n }\n\n if (!result.headers[Constants.WNS_TYPE_NAME]) {\n result.headers[Constants.WNS_TYPE_NAME] = Constants.WNS_RAW;\n }\n\n return result;\n}\n\n/**\n * Represents the possible push notification messages types.\n */\nexport type Notification =\n | AppleNotification\n | AdmNotification\n | BaiduNotification\n | BrowserNotification\n | FcmLegacyNotification\n | FcmV1Notification\n | XiaomiNotification\n | WindowsNotification\n | TemplateNotification;\n"]}
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT license.
3
- export const SDK_VERSION = "1.1.0";
3
+ export const SDK_VERSION = "1.1.1";
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.1.0\";\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.1.1\";\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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure/notification-hubs",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Azure Notification Hubs SDK for JavaScript",
5
5
  "sdk-type": "client",
6
6
  "main": "dist/index.cjs",
@@ -48,7 +48,7 @@
48
48
  "extract-api": "tsc -p . && api-extractor run --local",
49
49
  "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
50
50
  "integration-test:browser": "echo skipped",
51
- "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 600000 \"test/internal/**/*.spec.ts\" \"test/public/**/*.spec.ts\"",
51
+ "integration-test:node": "dev-tool run test:node-js-input -- --timeout 600000 \"dist-esm/test/internal/**/*.spec.js\" \"dist-esm/test/public/**/*.spec.js\"",
52
52
  "integration-test": "npm run integration-test:node && npm run integration-test:browser",
53
53
  "lint:fix": "eslint README.md package.json api-extractor.json src test --ext .ts,.javascript,.js --fix --fix-type [problem,suggestion]",
54
54
  "lint": "eslint README.md package.json api-extractor.json src test --ext .ts,.javascript,.js",
@@ -57,7 +57,7 @@
57
57
  "test:node": "npm run clean && tsc -p . && npm run integration-test:node",
58
58
  "test": "npm run clean && tsc -p . && npm run unit-test:node && npm run bundle && npm run unit-test:browser && npm run integration-test",
59
59
  "unit-test:browser": "karma start karma.conf.cjs --single-run",
60
- "unit-test:node": "mocha --exclude \"test/**/browser/*.spec.ts\" \"test/internal/unit/{,!(browser)/**/}*.spec.ts\" \"test/public/unit/{,!(browser)/**/}*.spec.ts\"",
60
+ "unit-test:node": "dev-tool run test:node-tsx-ts --no-test-proxy -- --exclude \"test/**/browser/*.spec.ts\" \"test/internal/unit/{,!(browser)/**/}*.spec.ts\" \"test/public/unit/{,!(browser)/**/}*.spec.ts\"",
61
61
  "unit-test": "npm run unit-test:node && npm run unit-test:browser"
62
62
  },
63
63
  "files": [
@@ -94,11 +94,10 @@
94
94
  "@types/chai": "^4.3.1",
95
95
  "@types/mocha": "^10.0.0",
96
96
  "@types/node": "^18.0.0",
97
- "c8": "^8.0.0",
97
+ "c8": "^9.1.0",
98
98
  "chai": "^4.3.10",
99
- "dotenv": "^16.4.4",
100
- "eslint": "^8.56.0",
101
- "esm": "^3.2.25",
99
+ "dotenv": "^16.4.5",
100
+ "eslint": "^8.57.0",
102
101
  "karma": "^6.4.2",
103
102
  "karma-chrome-launcher": "^3.1.1",
104
103
  "karma-coverage": "^2.2.0",
@@ -113,20 +112,20 @@
113
112
  "mocha": "^10.0.0",
114
113
  "puppeteer": "^22.2.0",
115
114
  "rimraf": "^5.0.5",
116
- "ts-node": "^10.9.2",
115
+ "tsx": "^4.7.1",
117
116
  "typescript": "~5.3.3"
118
117
  },
119
118
  "dependencies": {
120
- "@azure/core-auth": "^1.6.0",
121
- "@azure/abort-controller": "^2.0.0",
122
- "@azure/core-lro": "^2.6.0",
123
- "@azure/core-paging": "^1.5.0",
124
- "@azure/core-rest-pipeline": "^1.14.0",
125
- "@azure/core-tracing": "^1.0.1",
126
- "@azure/core-util": "^1.7.0",
127
- "@azure/core-xml": "^1.3.4",
128
- "@azure/logger": "^1.0.4",
129
- "@azure-rest/core-client": "^1.2.0",
119
+ "@azure/core-auth": "^1.7.0",
120
+ "@azure/abort-controller": "^2.1.0",
121
+ "@azure/core-lro": "^2.7.0",
122
+ "@azure/core-paging": "^1.6.0",
123
+ "@azure/core-rest-pipeline": "^1.15.0",
124
+ "@azure/core-tracing": "^1.1.0",
125
+ "@azure/core-util": "^1.8.0",
126
+ "@azure/core-xml": "^1.4.0",
127
+ "@azure/logger": "^1.1.0",
128
+ "@azure-rest/core-client": "^1.3.0",
130
129
  "tslib": "^2.6.2"
131
130
  }
132
131
  }
@@ -1965,7 +1965,7 @@ export declare interface MpnsTemplateRegistrationDescriptionCommon extends MpnsR
1965
1965
  /**
1966
1966
  * Represents the possible push notification messages types.
1967
1967
  */
1968
- export declare type Notification = AppleNotification | AdmNotification | BaiduNotification | BrowserNotification | FcmLegacyNotification | XiaomiNotification | WindowsNotification | TemplateNotification;
1968
+ export declare type Notification = AppleNotification | AdmNotification | BaiduNotification | BrowserNotification | FcmLegacyNotification | FcmV1Notification | XiaomiNotification | WindowsNotification | TemplateNotification;
1969
1969
 
1970
1970
  /**
1971
1971
  * Represents a notification that can be sent to a device.
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.41.0"
8
+ "packageVersion": "7.42.3"
9
9
  }
10
10
  ]
11
11
  }
@@ -257,5 +257,5 @@ export declare function createWindowsRawNotification(notification: WnsNotificati
257
257
  /**
258
258
  * Represents the possible push notification messages types.
259
259
  */
260
- export type Notification = AppleNotification | AdmNotification | BaiduNotification | BrowserNotification | FcmLegacyNotification | XiaomiNotification | WindowsNotification | TemplateNotification;
260
+ export type Notification = AppleNotification | AdmNotification | BaiduNotification | BrowserNotification | FcmLegacyNotification | FcmV1Notification | XiaomiNotification | WindowsNotification | TemplateNotification;
261
261
  //# sourceMappingURL=notification.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../../src/models/notification.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,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,SAAQ,gBAAgB;IAC5D;;OAEG;IACH,QAAQ,EAAE,UAAU,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,YAAY,EAAE,kBAAkB,GAAG,oBAAoB,CAMjG;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,GAAG,0BAA0B,CAAC;AAEhF;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,kBAAkB;IAC7D;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,WAAW,EAAE,kBAAkB,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,qBAAqB,GAClC,mBAAmB,CAkBrB;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC5C,YAAY,EAAE,qBAAqB,GAClC,mBAAmB,CAgBrB;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,YAAY,EAAE,qBAAqB,GAClC,mBAAmB,CAgBrB;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC5C,YAAY,EAAE,qBAAqB,GAClC,mBAAmB,CAgBrB;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,YAAY,EAAE,qBAAqB,GAClC,mBAAmB,CAgBrB;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GACpB,iBAAiB,GACjB,eAAe,GACf,iBAAiB,GACjB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,GAClB,mBAAmB,GACnB,oBAAoB,CAAC"}
1
+ {"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../../src/models/notification.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,2BAA2B,EAC3B,u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