@azure/notification-hubs 1.2.3-alpha.20240520.1 → 1.2.3

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 (28) hide show
  1. package/dist/api/notification-hubs.d.ts +4 -0
  2. package/dist/browser/models/notificationDetails.d.ts +4 -0
  3. package/dist/browser/models/notificationDetails.d.ts.map +1 -1
  4. package/dist/browser/models/notificationDetails.js.map +1 -1
  5. package/dist/browser/serializers/notificationDetailsSerializer.d.ts.map +1 -1
  6. package/dist/browser/serializers/notificationDetailsSerializer.js +10 -0
  7. package/dist/browser/serializers/notificationDetailsSerializer.js.map +1 -1
  8. package/dist/commonjs/models/notificationDetails.d.ts +4 -0
  9. package/dist/commonjs/models/notificationDetails.d.ts.map +1 -1
  10. package/dist/commonjs/models/notificationDetails.js.map +1 -1
  11. package/dist/commonjs/serializers/notificationDetailsSerializer.d.ts.map +1 -1
  12. package/dist/commonjs/serializers/notificationDetailsSerializer.js +10 -0
  13. package/dist/commonjs/serializers/notificationDetailsSerializer.js.map +1 -1
  14. package/dist/esm/models/notificationDetails.d.ts +4 -0
  15. package/dist/esm/models/notificationDetails.d.ts.map +1 -1
  16. package/dist/esm/models/notificationDetails.js.map +1 -1
  17. package/dist/esm/serializers/notificationDetailsSerializer.d.ts.map +1 -1
  18. package/dist/esm/serializers/notificationDetailsSerializer.js +10 -0
  19. package/dist/esm/serializers/notificationDetailsSerializer.js.map +1 -1
  20. package/dist/models/notification-hubs.d.ts +4 -0
  21. package/dist/notification-hubs.d.ts +4 -0
  22. package/dist/react-native/models/notificationDetails.d.ts +4 -0
  23. package/dist/react-native/models/notificationDetails.d.ts.map +1 -1
  24. package/dist/react-native/models/notificationDetails.js.map +1 -1
  25. package/dist/react-native/serializers/notificationDetailsSerializer.d.ts.map +1 -1
  26. package/dist/react-native/serializers/notificationDetailsSerializer.js +10 -0
  27. package/dist/react-native/serializers/notificationDetailsSerializer.js.map +1 -1
  28. package/package.json +9 -9
@@ -898,6 +898,10 @@ declare interface NotificationDetails {
898
898
  * FCM outcome counts per state.
899
899
  */
900
900
  fcmOutcomeCounts?: NotificationOutcome[];
901
+ /**
902
+ * FCM V1 outcome counts per state.
903
+ */
904
+ fcmV1OutcomeCounts?: NotificationOutcome[];
901
905
  /**
902
906
  * ADM outcome counts per state.
903
907
  */
@@ -71,6 +71,10 @@ export interface NotificationDetails {
71
71
  * FCM outcome counts per state.
72
72
  */
73
73
  fcmOutcomeCounts?: NotificationOutcome[];
74
+ /**
75
+ * FCM V1 outcome counts per state.
76
+ */
77
+ fcmV1OutcomeCounts?: NotificationOutcome[];
74
78
  /**
75
79
  * ADM outcome counts per state.
76
80
  */
@@ -1 +1 @@
1
- {"version":3,"file":"notificationDetails.d.ts","sourceRoot":"","sources":["../../../src/models/notificationDetails.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAChC,UAAU,GACV,wBAAwB,GACxB,YAAY,GACZ,WAAW,GACX,WAAW,GACX,SAAS,GACT,eAAe,GACf,WAAW,CAAC;AAEhB;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,wBAAwB,CAAC;IAEjC;;OAEG;IACH,WAAW,CAAC,EAAE,IAAI,CAAC;IAEnB;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC;IAEf;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;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,"file":"notificationDetails.d.ts","sourceRoot":"","sources":["../../../src/models/notificationDetails.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAChC,UAAU,GACV,wBAAwB,GACxB,YAAY,GACZ,WAAW,GACX,WAAW,GACX,SAAS,GACT,eAAe,GACf,WAAW,CAAC;AAEhB;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,wBAAwB,CAAC;IAEjC;;OAEG;IACH,WAAW,CAAC,EAAE,IAAI,CAAC;IAEnB;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC;IAEf;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,iBAAiB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAE1C;;OAEG;IACH,gBAAgB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAEzC;;OAEG;IACH,gBAAgB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAEzC;;OAEG;IACH,kBAAkB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAE3C;;OAEG;IACH,gBAAgB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAEzC;;OAEG;IACH,kBAAkB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAE3C;;OAEG;IACH,oBAAoB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAE7C;;OAEG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,EAAE,CAAC;CAC7C;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,+BAAgC,SAAQ,wBAAwB;IAC/E;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAE9B;;OAEG;IACH,KAAK,EAAE,wBAAwB,CAAC;CACjC"}
@@ -1 +1 @@
1
- {"version":3,"file":"notificationDetails.js","sourceRoot":"","sources":["../../../src/models/notificationDetails.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Represents the notification outcome states.\n */\nexport type NotificationOutcomeState =\n | \"Enqueued\"\n | \"DetailedStateAvailable\"\n | \"Processing\"\n | \"Completed\"\n | \"Abandoned\"\n | \"Unknown\"\n | \"NoTargetFound\"\n | \"Cancelled\";\n\n/**\n * The per platform count per state.\n */\nexport interface NotificationOutcome {\n /**\n * The state of the notification.\n */\n state: string;\n\n /**\n * The count of notifications per state.\n */\n count: number;\n}\n\n/**\n * Represents Notification details.\n */\nexport interface NotificationDetails {\n /**\n * The unique notification identifier.\n */\n notificationId?: string;\n\n /**\n * The notification location.\n */\n location?: string;\n\n /**\n * The notification state.\n */\n state?: NotificationOutcomeState;\n\n /**\n * The enqueue time of the notification.\n */\n enqueueTime?: Date;\n\n /**\n * The notification send start time.\n */\n startTime?: Date;\n\n /**\n * The notification send end time.\n */\n endTime?: Date;\n\n /**\n * The notification body.\n */\n notificationBody?: string;\n\n /**\n * The notification tags.\n */\n tags?: string;\n\n /**\n * The notification platforms targeted.\n */\n targetPlatforms?: string;\n\n /**\n * The URL for the platform notification services errors.\n */\n pnsErrorDetailsUrl?: string;\n\n /**\n * APNs outcomes counts per state.\n */\n apnsOutcomeCounts?: NotificationOutcome[];\n\n /**\n * WNS outcomes counts per state.\n */\n wnsOutcomeCounts?: NotificationOutcome[];\n\n /**\n * FCM outcome counts per state.\n */\n fcmOutcomeCounts?: NotificationOutcome[];\n\n /**\n * ADM outcome counts per state.\n */\n admOutcomeCounts?: NotificationOutcome[];\n\n /**\n * Baidu outcome counts per state.\n */\n baiduOutcomeCounts?: NotificationOutcome[];\n\n /**\n * Web Push outcome counts per state.\n */\n browserOutcomeCounts?: NotificationOutcome[];\n\n /**\n * Xiaomi outcome counts per state.\n */\n xiaomiOutcomeCounts?: NotificationOutcome[];\n}\n\n/**\n * Describes a response from the Notification Hubs which includes a tracking ID, correlation ID and location.\n */\nexport interface NotificationHubsResponse {\n /**\n * The Tracking ID of the operation.\n */\n trackingId?: string;\n\n /**\n * The correlation ID of the operation.\n */\n correlationId?: string;\n\n /**\n * The location of the operation.\n */\n location?: string;\n}\n\n/**\n * Represents the result of the registration.\n */\nexport interface RegistrationResult {\n /**\n * The application platform.\n */\n applicationPlatform: string;\n\n /**\n * The PNS handle.\n */\n pnsHandle: string;\n\n /**\n * The registration ID.\n */\n registrationId: string;\n\n /**\n * The outcome of the registration.\n */\n outcome: string;\n}\n\n/**\n * Describes a response from the Notification Hubs service for send operations.\n */\nexport interface NotificationHubsMessageResponse extends NotificationHubsResponse {\n /**\n * The notification ID from the operation. Note this is only available in Standard SKU and above.\n */\n notificationId?: string;\n\n /**\n * The number of devices that successfully received the notification.\n */\n successCount: number;\n\n /**\n * The number of devices that failed to receive a notification.\n */\n failureCount: number;\n\n /**\n * The list of notification outcome results for each device registered with the hub, to which this notification was sent.\n */\n results: RegistrationResult[];\n\n /**\n * The state of this notification outcome.\n */\n state: NotificationOutcomeState;\n}\n"]}
1
+ {"version":3,"file":"notificationDetails.js","sourceRoot":"","sources":["../../../src/models/notificationDetails.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Represents the notification outcome states.\n */\nexport type NotificationOutcomeState =\n | \"Enqueued\"\n | \"DetailedStateAvailable\"\n | \"Processing\"\n | \"Completed\"\n | \"Abandoned\"\n | \"Unknown\"\n | \"NoTargetFound\"\n | \"Cancelled\";\n\n/**\n * The per platform count per state.\n */\nexport interface NotificationOutcome {\n /**\n * The state of the notification.\n */\n state: string;\n\n /**\n * The count of notifications per state.\n */\n count: number;\n}\n\n/**\n * Represents Notification details.\n */\nexport interface NotificationDetails {\n /**\n * The unique notification identifier.\n */\n notificationId?: string;\n\n /**\n * The notification location.\n */\n location?: string;\n\n /**\n * The notification state.\n */\n state?: NotificationOutcomeState;\n\n /**\n * The enqueue time of the notification.\n */\n enqueueTime?: Date;\n\n /**\n * The notification send start time.\n */\n startTime?: Date;\n\n /**\n * The notification send end time.\n */\n endTime?: Date;\n\n /**\n * The notification body.\n */\n notificationBody?: string;\n\n /**\n * The notification tags.\n */\n tags?: string;\n\n /**\n * The notification platforms targeted.\n */\n targetPlatforms?: string;\n\n /**\n * The URL for the platform notification services errors.\n */\n pnsErrorDetailsUrl?: string;\n\n /**\n * APNs outcomes counts per state.\n */\n apnsOutcomeCounts?: NotificationOutcome[];\n\n /**\n * WNS outcomes counts per state.\n */\n wnsOutcomeCounts?: NotificationOutcome[];\n\n /**\n * FCM outcome counts per state.\n */\n fcmOutcomeCounts?: NotificationOutcome[];\n\n /**\n * FCM V1 outcome counts per state.\n */\n fcmV1OutcomeCounts?: NotificationOutcome[];\n\n /**\n * ADM outcome counts per state.\n */\n admOutcomeCounts?: NotificationOutcome[];\n\n /**\n * Baidu outcome counts per state.\n */\n baiduOutcomeCounts?: NotificationOutcome[];\n\n /**\n * Web Push outcome counts per state.\n */\n browserOutcomeCounts?: NotificationOutcome[];\n\n /**\n * Xiaomi outcome counts per state.\n */\n xiaomiOutcomeCounts?: NotificationOutcome[];\n}\n\n/**\n * Describes a response from the Notification Hubs which includes a tracking ID, correlation ID and location.\n */\nexport interface NotificationHubsResponse {\n /**\n * The Tracking ID of the operation.\n */\n trackingId?: string;\n\n /**\n * The correlation ID of the operation.\n */\n correlationId?: string;\n\n /**\n * The location of the operation.\n */\n location?: string;\n}\n\n/**\n * Represents the result of the registration.\n */\nexport interface RegistrationResult {\n /**\n * The application platform.\n */\n applicationPlatform: string;\n\n /**\n * The PNS handle.\n */\n pnsHandle: string;\n\n /**\n * The registration ID.\n */\n registrationId: string;\n\n /**\n * The outcome of the registration.\n */\n outcome: string;\n}\n\n/**\n * Describes a response from the Notification Hubs service for send operations.\n */\nexport interface NotificationHubsMessageResponse extends NotificationHubsResponse {\n /**\n * The notification ID from the operation. Note this is only available in Standard SKU and above.\n */\n notificationId?: string;\n\n /**\n * The number of devices that successfully received the notification.\n */\n successCount: number;\n\n /**\n * The number of devices that failed to receive a notification.\n */\n failureCount: number;\n\n /**\n * The list of notification outcome results for each device registered with the hub, to which this notification was sent.\n */\n results: RegistrationResult[];\n\n /**\n * The state of this notification outcome.\n */\n state: NotificationOutcomeState;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"notificationDetailsSerializer.d.ts","sourceRoot":"","sources":["../../../src/serializers/notificationDetailsSerializer.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,mBAAmB,EAGpB,MAAM,kCAAkC,CAAC;AAI1C;;;GAGG;AACH,wBAAsB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAqD7F"}
1
+ {"version":3,"file":"notificationDetailsSerializer.d.ts","sourceRoot":"","sources":["../../../src/serializers/notificationDetailsSerializer.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,mBAAmB,EAGpB,MAAM,kCAAkC,CAAC;AAI1C;;;GAGG;AACH,wBAAsB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAmE7F"}
@@ -23,10 +23,18 @@ export async function parseNotificationDetails(bodyText) {
23
23
  if (isDefined(notificationDetails["BaiduOutcomeCounts"])) {
24
24
  baiduOutcomeCounts = parseOutcomeCounts(notificationDetails["BaiduOutcomeCounts"]["Outcome"]);
25
25
  }
26
+ let browserOutcomeCounts;
27
+ if (isDefined(notificationDetails["BrowserOutcomeCounts"])) {
28
+ browserOutcomeCounts = parseOutcomeCounts(notificationDetails["BrowserOutcomeCounts"]["Outcome"]);
29
+ }
26
30
  let fcmOutcomeCounts;
27
31
  if (isDefined(notificationDetails["GcmOutcomeCounts"])) {
28
32
  fcmOutcomeCounts = parseOutcomeCounts(notificationDetails["GcmOutcomeCounts"]["Outcome"]);
29
33
  }
34
+ let fcmV1OutcomeCounts;
35
+ if (isDefined(notificationDetails["FcmV1OutcomeCounts"])) {
36
+ fcmV1OutcomeCounts = parseOutcomeCounts(notificationDetails["FcmV1OutcomeCounts"]["Outcome"]);
37
+ }
30
38
  let xiaomiOutcomeCounts;
31
39
  if (isDefined(notificationDetails["XiaomiOutcomeCounts"])) {
32
40
  xiaomiOutcomeCounts = parseOutcomeCounts(notificationDetails["XiaomiOutcomeCounts"]["Outcome"]);
@@ -48,7 +56,9 @@ export async function parseNotificationDetails(bodyText) {
48
56
  apnsOutcomeCounts,
49
57
  admOutcomeCounts,
50
58
  baiduOutcomeCounts,
59
+ browserOutcomeCounts,
51
60
  fcmOutcomeCounts,
61
+ fcmV1OutcomeCounts,
52
62
  xiaomiOutcomeCounts,
53
63
  wnsOutcomeCounts,
54
64
  };
@@ -1 +1 @@
1
- {"version":3,"file":"notificationDetailsSerializer.js","sourceRoot":"","sources":["../../../src/serializers/notificationDetailsSerializer.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACpG,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,QAAgB;IAC7D,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,QAAQ,EAAE;QACnC,WAAW,EAAE,IAAI;KAClB,CAAC,CAAC;IACH,MAAM,mBAAmB,GAAG,GAAG,CAAC,qBAAqB,CAAC,CAAC;IAEvD,IAAI,iBAAoD,CAAC;IACzD,IAAI,SAAS,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC;QACxD,iBAAiB,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC9F,CAAC;IAED,IAAI,gBAAmD,CAAC;IACxD,IAAI,SAAS,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC;QACvD,gBAAgB,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC5F,CAAC;IAED,IAAI,kBAAqD,CAAC;IAC1D,IAAI,SAAS,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC;QACzD,kBAAkB,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,CAAC,SA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mB,CAAC,kBAAkB,CAAC,CAAC;QAC/E,iBAAiB;QACjB,gBAAgB;QAChB,kBAAkB;QAClB,gBAAgB;QAChB,mBAAmB;QACnB,gBAAgB;KACjB,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CACzB,MAAmD;IAEnD,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACxD,MAAM,OAAO,GAA0B,EAAE,CAAC;IAC1C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;IACnF,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n NotificationDetails,\n NotificationOutcome,\n NotificationOutcomeState,\n} from \"../models/notificationDetails.js\";\nimport { getDateOrUndefined, getInteger, getStringOrUndefined, isDefined } from \"../utils/utils.js\";\nimport { parseXML } from \"@azure/core-xml\";\n\n/**\n * @internal\n * Parses a NotificationDetails from incoming XML.\n */\nexport async function parseNotificationDetails(bodyText: string): Promise<NotificationDetails> {\n const xml = await parseXML(bodyText, {\n includeRoot: true,\n });\n const notificationDetails = xml[\"NotificationDetails\"];\n\n let apnsOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"ApnsOutcomeCounts\"])) {\n apnsOutcomeCounts = parseOutcomeCounts(notificationDetails[\"ApnsOutcomeCounts\"][\"Outcome\"]);\n }\n\n let admOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"AdmOutcomeCounts\"])) {\n admOutcomeCounts = parseOutcomeCounts(notificationDetails[\"AdmOutcomeCounts\"][\"Outcome\"]);\n }\n\n let baiduOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"BaiduOutcomeCounts\"])) {\n baiduOutcomeCounts = parseOutcomeCounts(notificationDetails[\"BaiduOutcomeCounts\"][\"Outcome\"]);\n }\n\n let fcmOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"GcmOutcomeCounts\"])) {\n fcmOutcomeCounts = parseOutcomeCounts(notificationDetails[\"GcmOutcomeCounts\"][\"Outcome\"]);\n }\n\n let xiaomiOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"XiaomiOutcomeCounts\"])) {\n xiaomiOutcomeCounts = parseOutcomeCounts(notificationDetails[\"XiaomiOutcomeCounts\"][\"Outcome\"]);\n }\n\n let wnsOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"WnsOutcomeCounts\"])) {\n wnsOutcomeCounts = parseOutcomeCounts(notificationDetails[\"WnsOutcomeCounts\"][\"Outcome\"]);\n }\n\n return {\n notificationId: getStringOrUndefined(notificationDetails[\"NotificationId\"]),\n location: getStringOrUndefined(notificationDetails[\"Location\"]),\n state: getStringOrUndefined(notificationDetails[\"State\"]) as NotificationOutcomeState,\n enqueueTime: getDateOrUndefined(notificationDetails[\"EnqueueTime\"]),\n startTime: getDateOrUndefined(notificationDetails[\"StartTime\"]),\n endTime: getDateOrUndefined(notificationDetails[\"EndTime\"]),\n pnsErrorDetailsUrl: getStringOrUndefined(notificationDetails[\"PnsErrorDetailsUri\"]),\n targetPlatforms: getStringOrUndefined(notificationDetails[\"TargetPlatforms\"]),\n notificationBody: getStringOrUndefined(notificationDetails[\"NotificationBody\"]),\n apnsOutcomeCounts,\n admOutcomeCounts,\n baiduOutcomeCounts,\n fcmOutcomeCounts,\n xiaomiOutcomeCounts,\n wnsOutcomeCounts,\n };\n}\n\nfunction parseOutcomeCounts(\n counts: Record<string, any>[] | Record<string, any>,\n): NotificationOutcome[] {\n const items = Array.isArray(counts) ? counts : [counts];\n const results: NotificationOutcome[] = [];\n for (const item of items) {\n results.push({ state: item[\"Name\"], count: getInteger(item[\"Count\"], \"Count\") });\n }\n\n return results;\n}\n"]}
1
+ {"version":3,"file":"notificationDetailsSerializer.js","sourceRoot":"","sources":["../../../src/serializers/notificationDetailsSerializer.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACpG,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,QAAgB;IAC7D,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,QAAQ,EAAE;QACnC,WAAW,EAAE,IAAI;KAClB,CAAC,CAAC;IACH,MAAM,mBAAmB,GAAG,GAAG,CAAC,qBAAqB,CAAC,CAAC;IAEvD,IAAI,iBAAoD,CAAC;IACzD,IAAI,SAAS,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC;QACxD,iBAAiB,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC9F,CAAC;IAED,IAAI,gBAAmD,CAAC;IACxD,IAAI,SAAS,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC;QACvD,gBAAgB,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC5F,CAAC;IAED,IAAI,kBAAqD,CAAC;IAC1D,IAAI,SAAS,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC;QACzD,kBAAkB,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC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AAC,CAA6B;QACrF,WAAW,EAAE,kBAAkB,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAC;QACnE,SAAS,EAAE,kBAAkB,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;QAC/D,OAAO,EAAE,kBAAkB,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;QAC3D,kBAAkB,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;QACnF,eAAe,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,CAAC;QAC7E,gBAAgB,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC;QAC/E,iBAAiB;QACjB,gBAAgB;QAChB,kBAAkB;QAClB,oBAAoB;QACpB,gBAAgB;QAChB,kBAAkB;QAClB,mBAAmB;QACnB,gBAAgB;KACjB,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CACzB,MAAmD;IAEnD,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACxD,MAAM,OAAO,GAA0B,EAAE,CAAC;IAC1C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;IACnF,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n NotificationDetails,\n NotificationOutcome,\n NotificationOutcomeState,\n} from \"../models/notificationDetails.js\";\nimport { getDateOrUndefined, getInteger, getStringOrUndefined, isDefined } from \"../utils/utils.js\";\nimport { parseXML } from \"@azure/core-xml\";\n\n/**\n * @internal\n * Parses a NotificationDetails from incoming XML.\n */\nexport async function parseNotificationDetails(bodyText: string): Promise<NotificationDetails> {\n const xml = await parseXML(bodyText, {\n includeRoot: true,\n });\n const notificationDetails = xml[\"NotificationDetails\"];\n\n let apnsOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"ApnsOutcomeCounts\"])) {\n apnsOutcomeCounts = parseOutcomeCounts(notificationDetails[\"ApnsOutcomeCounts\"][\"Outcome\"]);\n }\n\n let admOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"AdmOutcomeCounts\"])) {\n admOutcomeCounts = parseOutcomeCounts(notificationDetails[\"AdmOutcomeCounts\"][\"Outcome\"]);\n }\n\n let baiduOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"BaiduOutcomeCounts\"])) {\n baiduOutcomeCounts = parseOutcomeCounts(notificationDetails[\"BaiduOutcomeCounts\"][\"Outcome\"]);\n }\n\n let browserOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"BrowserOutcomeCounts\"])) {\n browserOutcomeCounts = parseOutcomeCounts(\n notificationDetails[\"BrowserOutcomeCounts\"][\"Outcome\"],\n );\n }\n\n let fcmOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"GcmOutcomeCounts\"])) {\n fcmOutcomeCounts = parseOutcomeCounts(notificationDetails[\"GcmOutcomeCounts\"][\"Outcome\"]);\n }\n\n let fcmV1OutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"FcmV1OutcomeCounts\"])) {\n fcmV1OutcomeCounts = parseOutcomeCounts(notificationDetails[\"FcmV1OutcomeCounts\"][\"Outcome\"]);\n }\n\n let xiaomiOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"XiaomiOutcomeCounts\"])) {\n xiaomiOutcomeCounts = parseOutcomeCounts(notificationDetails[\"XiaomiOutcomeCounts\"][\"Outcome\"]);\n }\n\n let wnsOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"WnsOutcomeCounts\"])) {\n wnsOutcomeCounts = parseOutcomeCounts(notificationDetails[\"WnsOutcomeCounts\"][\"Outcome\"]);\n }\n\n return {\n notificationId: getStringOrUndefined(notificationDetails[\"NotificationId\"]),\n location: getStringOrUndefined(notificationDetails[\"Location\"]),\n state: getStringOrUndefined(notificationDetails[\"State\"]) as NotificationOutcomeState,\n enqueueTime: getDateOrUndefined(notificationDetails[\"EnqueueTime\"]),\n startTime: getDateOrUndefined(notificationDetails[\"StartTime\"]),\n endTime: getDateOrUndefined(notificationDetails[\"EndTime\"]),\n pnsErrorDetailsUrl: getStringOrUndefined(notificationDetails[\"PnsErrorDetailsUri\"]),\n targetPlatforms: getStringOrUndefined(notificationDetails[\"TargetPlatforms\"]),\n notificationBody: getStringOrUndefined(notificationDetails[\"NotificationBody\"]),\n apnsOutcomeCounts,\n admOutcomeCounts,\n baiduOutcomeCounts,\n browserOutcomeCounts,\n fcmOutcomeCounts,\n fcmV1OutcomeCounts,\n xiaomiOutcomeCounts,\n wnsOutcomeCounts,\n };\n}\n\nfunction parseOutcomeCounts(\n counts: Record<string, any>[] | Record<string, any>,\n): NotificationOutcome[] {\n const items = Array.isArray(counts) ? counts : [counts];\n const results: NotificationOutcome[] = [];\n for (const item of items) {\n results.push({ state: item[\"Name\"], count: getInteger(item[\"Count\"], \"Count\") });\n }\n\n return results;\n}\n"]}
@@ -71,6 +71,10 @@ export interface NotificationDetails {
71
71
  * FCM outcome counts per state.
72
72
  */
73
73
  fcmOutcomeCounts?: NotificationOutcome[];
74
+ /**
75
+ * FCM V1 outcome counts per state.
76
+ */
77
+ fcmV1OutcomeCounts?: NotificationOutcome[];
74
78
  /**
75
79
  * ADM outcome counts per state.
76
80
  */
@@ -1 +1 @@
1
- {"version":3,"file":"notificationDetails.d.ts","sourceRoot":"","sources":["../../../src/models/notificationDetails.ts"],"names":[],"mappings":"AAGA;;G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ACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,+BAAgC,SAAQ,wBAAwB;IAC/E;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAE9B;;OAEG;IACH,KAAK,EAAE,wBAAwB,CAAC;CACjC"}
1
+ {"version":3,"file":"notificationDetails.d.ts","sourceRoot":"","sources":["../../../src/models/notificationDetails.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAChC,UAAU,GACV,wBAAwB,GACxB,YAAY,GACZ,WAAW,GACX,WAAW,GACX,SAAS,GACT,eAAe,GACf,WAAW,CAAC;AAEhB;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,wBAAwB,CAAC;IAEjC;;OAEG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AED;;GAEG;AACH,MAAM,WAAW,+BAAgC,SAAQ,wBAAwB;IAC/E;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAE9B;;OAEG;IACH,KAAK,EAAE,wBAAwB,CAAC;CACjC"}
@@ -1 +1 @@
1
- {"version":3,"file":"notificationDetails.js","sourceRoot":"","sources":["../../../src/models/notificationDetails.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Represents the notification outcome states.\n */\nexport type NotificationOutcomeState =\n | \"Enqueued\"\n | \"DetailedStateAvailable\"\n | \"Processing\"\n | \"Completed\"\n | \"Abandoned\"\n | \"Unknown\"\n | \"NoTargetFound\"\n | \"Cancelled\";\n\n/**\n * The per platform count per state.\n */\nexport interface NotificationOutcome {\n /**\n * The state of the notification.\n */\n state: string;\n\n /**\n * The count of notifications per state.\n */\n count: number;\n}\n\n/**\n * Represents Notification details.\n */\nexport interface NotificationDetails {\n /**\n * The unique notification identifier.\n */\n notificationId?: string;\n\n /**\n * The notification location.\n */\n location?: string;\n\n /**\n * The notification state.\n */\n state?: NotificationOutcomeState;\n\n /**\n * The enqueue time of the notification.\n */\n enqueueTime?: Date;\n\n /**\n * The notification send start time.\n */\n startTime?: Date;\n\n /**\n * The notification send end time.\n */\n endTime?: Date;\n\n /**\n * The notification body.\n */\n notificationBody?: string;\n\n /**\n * The notification tags.\n */\n tags?: string;\n\n /**\n * The notification platforms targeted.\n */\n targetPlatforms?: string;\n\n /**\n * The URL for the platform notification services errors.\n */\n pnsErrorDetailsUrl?: string;\n\n /**\n * APNs outcomes counts per state.\n */\n apnsOutcomeCounts?: NotificationOutcome[];\n\n /**\n * WNS outcomes counts per state.\n */\n wnsOutcomeCounts?: NotificationOutcome[];\n\n /**\n * FCM outcome counts per state.\n */\n fcmOutcomeCounts?: NotificationOutcome[];\n\n /**\n * ADM outcome counts per state.\n */\n admOutcomeCounts?: NotificationOutcome[];\n\n /**\n * Baidu outcome counts per state.\n */\n baiduOutcomeCounts?: NotificationOutcome[];\n\n /**\n * Web Push outcome counts per state.\n */\n browserOutcomeCounts?: NotificationOutcome[];\n\n /**\n * Xiaomi outcome counts per state.\n */\n xiaomiOutcomeCounts?: NotificationOutcome[];\n}\n\n/**\n * Describes a response from the Notification Hubs which includes a tracking ID, correlation ID and location.\n */\nexport interface NotificationHubsResponse {\n /**\n * The Tracking ID of the operation.\n */\n trackingId?: string;\n\n /**\n * The correlation ID of the operation.\n */\n correlationId?: string;\n\n /**\n * The location of the operation.\n */\n location?: string;\n}\n\n/**\n * Represents the result of the registration.\n */\nexport interface RegistrationResult {\n /**\n * The application platform.\n */\n applicationPlatform: string;\n\n /**\n * The PNS handle.\n */\n pnsHandle: string;\n\n /**\n * The registration ID.\n */\n registrationId: string;\n\n /**\n * The outcome of the registration.\n */\n outcome: string;\n}\n\n/**\n * Describes a response from the Notification Hubs service for send operations.\n */\nexport interface NotificationHubsMessageResponse extends NotificationHubsResponse {\n /**\n * The notification ID from the operation. Note this is only available in Standard SKU and above.\n */\n notificationId?: string;\n\n /**\n * The number of devices that successfully received the notification.\n */\n successCount: number;\n\n /**\n * The number of devices that failed to receive a notification.\n */\n failureCount: number;\n\n /**\n * The list of notification outcome results for each device registered with the hub, to which this notification was sent.\n */\n results: RegistrationResult[];\n\n /**\n * The state of this notification outcome.\n */\n state: NotificationOutcomeState;\n}\n"]}
1
+ {"version":3,"file":"notificationDetails.js","sourceRoot":"","sources":["../../../src/models/notificationDetails.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Represents the notification outcome states.\n */\nexport type NotificationOutcomeState =\n | \"Enqueued\"\n | \"DetailedStateAvailable\"\n | \"Processing\"\n | \"Completed\"\n | \"Abandoned\"\n | \"Unknown\"\n | \"NoTargetFound\"\n | \"Cancelled\";\n\n/**\n * The per platform count per state.\n */\nexport interface NotificationOutcome {\n /**\n * The state of the notification.\n */\n state: string;\n\n /**\n * The count of notifications per state.\n */\n count: number;\n}\n\n/**\n * Represents Notification details.\n */\nexport interface NotificationDetails {\n /**\n * The unique notification identifier.\n */\n notificationId?: string;\n\n /**\n * The notification location.\n */\n location?: string;\n\n /**\n * The notification state.\n */\n state?: NotificationOutcomeState;\n\n /**\n * The enqueue time of the notification.\n */\n enqueueTime?: Date;\n\n /**\n * The notification send start time.\n */\n startTime?: Date;\n\n /**\n * The notification send end time.\n */\n endTime?: Date;\n\n /**\n * The notification body.\n */\n notificationBody?: string;\n\n /**\n * The notification tags.\n */\n tags?: string;\n\n /**\n * The notification platforms targeted.\n */\n targetPlatforms?: string;\n\n /**\n * The URL for the platform notification services errors.\n */\n pnsErrorDetailsUrl?: string;\n\n /**\n * APNs outcomes counts per state.\n */\n apnsOutcomeCounts?: NotificationOutcome[];\n\n /**\n * WNS outcomes counts per state.\n */\n wnsOutcomeCounts?: NotificationOutcome[];\n\n /**\n * FCM outcome counts per state.\n */\n fcmOutcomeCounts?: NotificationOutcome[];\n\n /**\n * FCM V1 outcome counts per state.\n */\n fcmV1OutcomeCounts?: NotificationOutcome[];\n\n /**\n * ADM outcome counts per state.\n */\n admOutcomeCounts?: NotificationOutcome[];\n\n /**\n * Baidu outcome counts per state.\n */\n baiduOutcomeCounts?: NotificationOutcome[];\n\n /**\n * Web Push outcome counts per state.\n */\n browserOutcomeCounts?: NotificationOutcome[];\n\n /**\n * Xiaomi outcome counts per state.\n */\n xiaomiOutcomeCounts?: NotificationOutcome[];\n}\n\n/**\n * Describes a response from the Notification Hubs which includes a tracking ID, correlation ID and location.\n */\nexport interface NotificationHubsResponse {\n /**\n * The Tracking ID of the operation.\n */\n trackingId?: string;\n\n /**\n * The correlation ID of the operation.\n */\n correlationId?: string;\n\n /**\n * The location of the operation.\n */\n location?: string;\n}\n\n/**\n * Represents the result of the registration.\n */\nexport interface RegistrationResult {\n /**\n * The application platform.\n */\n applicationPlatform: string;\n\n /**\n * The PNS handle.\n */\n pnsHandle: string;\n\n /**\n * The registration ID.\n */\n registrationId: string;\n\n /**\n * The outcome of the registration.\n */\n outcome: string;\n}\n\n/**\n * Describes a response from the Notification Hubs service for send operations.\n */\nexport interface NotificationHubsMessageResponse extends NotificationHubsResponse {\n /**\n * The notification ID from the operation. Note this is only available in Standard SKU and above.\n */\n notificationId?: string;\n\n /**\n * The number of devices that successfully received the notification.\n */\n successCount: number;\n\n /**\n * The number of devices that failed to receive a notification.\n */\n failureCount: number;\n\n /**\n * The list of notification outcome results for each device registered with the hub, to which this notification was sent.\n */\n results: RegistrationResult[];\n\n /**\n * The state of this notification outcome.\n */\n state: NotificationOutcomeState;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"notificationDetailsSerializer.d.ts","sourceRoot":"","sources":["../../../src/serializers/notificationDetailsSerializer.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,mBAAmB,EAGpB,MAAM,kCAAkC,CAAC;AAI1C;;;GAGG;AACH,wBAAsB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAqD7F"}
1
+ {"version":3,"file":"notificationDetailsSerializer.d.ts","sourceRoot":"","sources":["../../../src/serializers/notificationDetailsSerializer.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,mBAAmB,EAGpB,MAAM,kCAAkC,CAAC;AAI1C;;;GAGG;AACH,wBAAsB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAmE7F"}
@@ -26,10 +26,18 @@ async function parseNotificationDetails(bodyText) {
26
26
  if ((0, utils_js_1.isDefined)(notificationDetails["BaiduOutcomeCounts"])) {
27
27
  baiduOutcomeCounts = parseOutcomeCounts(notificationDetails["BaiduOutcomeCounts"]["Outcome"]);
28
28
  }
29
+ let browserOutcomeCounts;
30
+ if ((0, utils_js_1.isDefined)(notificationDetails["BrowserOutcomeCounts"])) {
31
+ browserOutcomeCounts = parseOutcomeCounts(notificationDetails["BrowserOutcomeCounts"]["Outcome"]);
32
+ }
29
33
  let fcmOutcomeCounts;
30
34
  if ((0, utils_js_1.isDefined)(notificationDetails["GcmOutcomeCounts"])) {
31
35
  fcmOutcomeCounts = parseOutcomeCounts(notificationDetails["GcmOutcomeCounts"]["Outcome"]);
32
36
  }
37
+ let fcmV1OutcomeCounts;
38
+ if ((0, utils_js_1.isDefined)(notificationDetails["FcmV1OutcomeCounts"])) {
39
+ fcmV1OutcomeCounts = parseOutcomeCounts(notificationDetails["FcmV1OutcomeCounts"]["Outcome"]);
40
+ }
33
41
  let xiaomiOutcomeCounts;
34
42
  if ((0, utils_js_1.isDefined)(notificationDetails["XiaomiOutcomeCounts"])) {
35
43
  xiaomiOutcomeCounts = parseOutcomeCounts(notificationDetails["XiaomiOutcomeCounts"]["Outcome"]);
@@ -51,7 +59,9 @@ async function parseNotificationDetails(bodyText) {
51
59
  apnsOutcomeCounts,
52
60
  admOutcomeCounts,
53
61
  baiduOutcomeCounts,
62
+ browserOutcomeCounts,
54
63
  fcmOutcomeCounts,
64
+ fcmV1OutcomeCounts,
55
65
  xiaomiOutcomeCounts,
56
66
  wnsOutcomeCounts,
57
67
  };
@@ -1 +1 @@
1
- {"version":3,"file":"notificationDetailsSerializer.js","sourceRoot":"","sources":["../../../src/serializers/notificationDetailsSerializer.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAOlC,gDAAoG;AACpG,8CAA2C;AAE3C;;;GAGG;AACI,KAAK,UAAU,wBAAwB,CAAC,QAAgB;IAC7D,MAAM,GAAG,GAAG,MAAM,IAAA,mBAAQ,EAAC,QAAQ,EAAE;QACnC,WAAW,EAAE,IAAI;KAClB,CAAC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E,IAAA,qBAAU,EAAC,IAAI,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;IACnF,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n NotificationDetails,\n NotificationOutcome,\n NotificationOutcomeState,\n} from \"../models/notificationDetails.js\";\nimport { getDateOrUndefined, getInteger, getStringOrUndefined, isDefined } from \"../utils/utils.js\";\nimport { parseXML } from \"@azure/core-xml\";\n\n/**\n * @internal\n * Parses a NotificationDetails from incoming XML.\n */\nexport async function parseNotificationDetails(bodyText: string): Promise<NotificationDetails> {\n const xml = await parseXML(bodyText, {\n includeRoot: true,\n });\n const notificationDetails = xml[\"NotificationDetails\"];\n\n let apnsOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"ApnsOutcomeCounts\"])) {\n apnsOutcomeCounts = parseOutcomeCounts(notificationDetails[\"ApnsOutcomeCounts\"][\"Outcome\"]);\n }\n\n let admOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"AdmOutcomeCounts\"])) {\n admOutcomeCounts = parseOutcomeCounts(notificationDetails[\"AdmOutcomeCounts\"][\"Outcome\"]);\n }\n\n let baiduOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"BaiduOutcomeCounts\"])) {\n baiduOutcomeCounts = parseOutcomeCounts(notificationDetails[\"BaiduOutcomeCounts\"][\"Outcome\"]);\n }\n\n let fcmOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"GcmOutcomeCounts\"])) {\n fcmOutcomeCounts = parseOutcomeCounts(notificationDetails[\"GcmOutcomeCounts\"][\"Outcome\"]);\n }\n\n let xiaomiOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"XiaomiOutcomeCounts\"])) {\n xiaomiOutcomeCounts = parseOutcomeCounts(notificationDetails[\"XiaomiOutcomeCounts\"][\"Outcome\"]);\n }\n\n let wnsOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"WnsOutcomeCounts\"])) {\n wnsOutcomeCounts = parseOutcomeCounts(notificationDetails[\"WnsOutcomeCounts\"][\"Outcome\"]);\n }\n\n return {\n notificationId: getStringOrUndefined(notificationDetails[\"NotificationId\"]),\n location: getStringOrUndefined(notificationDetails[\"Location\"]),\n state: getStringOrUndefined(notificationDetails[\"State\"]) as NotificationOutcomeState,\n enqueueTime: getDateOrUndefined(notificationDetails[\"EnqueueTime\"]),\n startTime: getDateOrUndefined(notificationDetails[\"StartTime\"]),\n endTime: getDateOrUndefined(notificationDetails[\"EndTime\"]),\n pnsErrorDetailsUrl: getStringOrUndefined(notificationDetails[\"PnsErrorDetailsUri\"]),\n targetPlatforms: getStringOrUndefined(notificationDetails[\"TargetPlatforms\"]),\n notificationBody: getStringOrUndefined(notificationDetails[\"NotificationBody\"]),\n apnsOutcomeCounts,\n admOutcomeCounts,\n baiduOutcomeCounts,\n fcmOutcomeCounts,\n xiaomiOutcomeCounts,\n wnsOutcomeCounts,\n };\n}\n\nfunction parseOutcomeCounts(\n counts: Record<string, any>[] | Record<string, any>,\n): NotificationOutcome[] {\n const items = Array.isArray(counts) ? counts : [counts];\n const results: NotificationOutcome[] = [];\n for (const item of items) {\n results.push({ state: item[\"Name\"], count: getInteger(item[\"Count\"], \"Count\") });\n }\n\n return results;\n}\n"]}
1
+ {"version":3,"file":"notificationDetailsSerializer.js","sourceRoot":"","sources":["../../../src/serializers/notificationDetailsSerializer.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAOlC,gDAAoG;AACpG,8CAA2C;AAE3C;;;GAGG;AACI,KAAK,UAAU,wBAAwB,CAAC,QAAgB;IAC7D,MAAM,GAAG,GAAG,MAAM,IAAA,mBAAQ,EAAC,QAAQ,EAAE;QACnC,WAAW,EAAE,IAAI;KAClB,CAAC,CAAC;IACH,MAAM,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B;QACpB,gBAAgB;QAChB,kBAAkB;QAClB,mBAAmB;QACnB,gBAAgB;KACjB,CAAC;AACJ,CAAC;AAnED,4DAmEC;AAED,SAAS,kBAAkB,CACzB,MAAmD;IAEnD,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACxD,MAAM,OAAO,GAA0B,EAAE,CAAC;IAC1C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,IAAA,qBAAU,EAAC,IAAI,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;IACnF,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n NotificationDetails,\n NotificationOutcome,\n NotificationOutcomeState,\n} from \"../models/notificationDetails.js\";\nimport { getDateOrUndefined, getInteger, getStringOrUndefined, isDefined } from \"../utils/utils.js\";\nimport { parseXML } from \"@azure/core-xml\";\n\n/**\n * @internal\n * Parses a NotificationDetails from incoming XML.\n */\nexport async function parseNotificationDetails(bodyText: string): Promise<NotificationDetails> {\n const xml = await parseXML(bodyText, {\n includeRoot: true,\n });\n const notificationDetails = xml[\"NotificationDetails\"];\n\n let apnsOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"ApnsOutcomeCounts\"])) {\n apnsOutcomeCounts = parseOutcomeCounts(notificationDetails[\"ApnsOutcomeCounts\"][\"Outcome\"]);\n }\n\n let admOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"AdmOutcomeCounts\"])) {\n admOutcomeCounts = parseOutcomeCounts(notificationDetails[\"AdmOutcomeCounts\"][\"Outcome\"]);\n }\n\n let baiduOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"BaiduOutcomeCounts\"])) {\n baiduOutcomeCounts = parseOutcomeCounts(notificationDetails[\"BaiduOutcomeCounts\"][\"Outcome\"]);\n }\n\n let browserOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"BrowserOutcomeCounts\"])) {\n browserOutcomeCounts = parseOutcomeCounts(\n notificationDetails[\"BrowserOutcomeCounts\"][\"Outcome\"],\n );\n }\n\n let fcmOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"GcmOutcomeCounts\"])) {\n fcmOutcomeCounts = parseOutcomeCounts(notificationDetails[\"GcmOutcomeCounts\"][\"Outcome\"]);\n }\n\n let fcmV1OutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"FcmV1OutcomeCounts\"])) {\n fcmV1OutcomeCounts = parseOutcomeCounts(notificationDetails[\"FcmV1OutcomeCounts\"][\"Outcome\"]);\n }\n\n let xiaomiOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"XiaomiOutcomeCounts\"])) {\n xiaomiOutcomeCounts = parseOutcomeCounts(notificationDetails[\"XiaomiOutcomeCounts\"][\"Outcome\"]);\n }\n\n let wnsOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"WnsOutcomeCounts\"])) {\n wnsOutcomeCounts = parseOutcomeCounts(notificationDetails[\"WnsOutcomeCounts\"][\"Outcome\"]);\n }\n\n return {\n notificationId: getStringOrUndefined(notificationDetails[\"NotificationId\"]),\n location: getStringOrUndefined(notificationDetails[\"Location\"]),\n state: getStringOrUndefined(notificationDetails[\"State\"]) as NotificationOutcomeState,\n enqueueTime: getDateOrUndefined(notificationDetails[\"EnqueueTime\"]),\n startTime: getDateOrUndefined(notificationDetails[\"StartTime\"]),\n endTime: getDateOrUndefined(notificationDetails[\"EndTime\"]),\n pnsErrorDetailsUrl: getStringOrUndefined(notificationDetails[\"PnsErrorDetailsUri\"]),\n targetPlatforms: getStringOrUndefined(notificationDetails[\"TargetPlatforms\"]),\n notificationBody: getStringOrUndefined(notificationDetails[\"NotificationBody\"]),\n apnsOutcomeCounts,\n admOutcomeCounts,\n baiduOutcomeCounts,\n browserOutcomeCounts,\n fcmOutcomeCounts,\n fcmV1OutcomeCounts,\n xiaomiOutcomeCounts,\n wnsOutcomeCounts,\n };\n}\n\nfunction parseOutcomeCounts(\n counts: Record<string, any>[] | Record<string, any>,\n): NotificationOutcome[] {\n const items = Array.isArray(counts) ? counts : [counts];\n const results: NotificationOutcome[] = [];\n for (const item of items) {\n results.push({ state: item[\"Name\"], count: getInteger(item[\"Count\"], \"Count\") });\n }\n\n return results;\n}\n"]}
@@ -71,6 +71,10 @@ export interface NotificationDetails {
71
71
  * FCM outcome counts per state.
72
72
  */
73
73
  fcmOutcomeCounts?: NotificationOutcome[];
74
+ /**
75
+ * FCM V1 outcome counts per state.
76
+ */
77
+ fcmV1OutcomeCounts?: NotificationOutcome[];
74
78
  /**
75
79
  * ADM outcome counts per state.
76
80
  */
@@ -1 +1 @@
1
- {"version":3,"file":"notificationDetails.d.ts","sourceRoot":"","sources":["../../../src/models/notificationDetails.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAChC,UAAU,GACV,wBAAwB,GACxB,YAAY,GACZ,WAAW,GACX,WAAW,GACX,SAAS,GACT,eAAe,GACf,WAAW,CAAC;AAEhB;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,wBAAwB,CAAC;IAEjC;;O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E;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAE9B;;OAEG;IACH,KAAK,EAAE,wBAAwB,CAAC;CACjC"}
1
+ {"version":3,"file":"notificationDetails.d.ts","sourceRoot":"","sources":["../../../src/models/notificationDetails.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAChC,UAAU,GACV,wBAAwB,GACxB,YAAY,GACZ,WAAW,GACX,WAAW,GACX,SAAS,GACT,eAAe,GACf,WAAW,CAAC;AAEhB;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,wBAAwB,CAAC;IAEjC;;OAEG;IACH,WAAW,CAAC,EAAE,IAAI,CAAC;IAEnB;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC;IAEf;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,iBAAiB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAE1C;;OAEG;IACH,gBAAgB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAEzC;;OAEG;IACH,gBAAgB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAEzC;;OAEG;IACH,kBAAkB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAE3C;;OAEG;IACH,gBAAgB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAEzC;;OAEG;IACH,kBAAkB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAE3C;;OAEG;IACH,oBAAoB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAE7C;;OAEG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,EAAE,CAAC;CAC7C;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,+BAAgC,SAAQ,wBAAwB;IAC/E;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAE9B;;OAEG;IACH,KAAK,EAAE,wBAAwB,CAAC;CACjC"}
@@ -1 +1 @@
1
- {"version":3,"file":"notificationDetails.js","sourceRoot":"","sources":["../../../src/models/notificationDetails.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Represents the notification outcome states.\n */\nexport type NotificationOutcomeState =\n | \"Enqueued\"\n | \"DetailedStateAvailable\"\n | \"Processing\"\n | \"Completed\"\n | \"Abandoned\"\n | \"Unknown\"\n | \"NoTargetFound\"\n | \"Cancelled\";\n\n/**\n * The per platform count per state.\n */\nexport interface NotificationOutcome {\n /**\n * The state of the notification.\n */\n state: string;\n\n /**\n * The count of notifications per state.\n */\n count: number;\n}\n\n/**\n * Represents Notification details.\n */\nexport interface NotificationDetails {\n /**\n * The unique notification identifier.\n */\n notificationId?: string;\n\n /**\n * The notification location.\n */\n location?: string;\n\n /**\n * The notification state.\n */\n state?: NotificationOutcomeState;\n\n /**\n * The enqueue time of the notification.\n */\n enqueueTime?: Date;\n\n /**\n * The notification send start time.\n */\n startTime?: Date;\n\n /**\n * The notification send end time.\n */\n endTime?: Date;\n\n /**\n * The notification body.\n */\n notificationBody?: string;\n\n /**\n * The notification tags.\n */\n tags?: string;\n\n /**\n * The notification platforms targeted.\n */\n targetPlatforms?: string;\n\n /**\n * The URL for the platform notification services errors.\n */\n pnsErrorDetailsUrl?: string;\n\n /**\n * APNs outcomes counts per state.\n */\n apnsOutcomeCounts?: NotificationOutcome[];\n\n /**\n * WNS outcomes counts per state.\n */\n wnsOutcomeCounts?: NotificationOutcome[];\n\n /**\n * FCM outcome counts per state.\n */\n fcmOutcomeCounts?: NotificationOutcome[];\n\n /**\n * ADM outcome counts per state.\n */\n admOutcomeCounts?: NotificationOutcome[];\n\n /**\n * Baidu outcome counts per state.\n */\n baiduOutcomeCounts?: NotificationOutcome[];\n\n /**\n * Web Push outcome counts per state.\n */\n browserOutcomeCounts?: NotificationOutcome[];\n\n /**\n * Xiaomi outcome counts per state.\n */\n xiaomiOutcomeCounts?: NotificationOutcome[];\n}\n\n/**\n * Describes a response from the Notification Hubs which includes a tracking ID, correlation ID and location.\n */\nexport interface NotificationHubsResponse {\n /**\n * The Tracking ID of the operation.\n */\n trackingId?: string;\n\n /**\n * The correlation ID of the operation.\n */\n correlationId?: string;\n\n /**\n * The location of the operation.\n */\n location?: string;\n}\n\n/**\n * Represents the result of the registration.\n */\nexport interface RegistrationResult {\n /**\n * The application platform.\n */\n applicationPlatform: string;\n\n /**\n * The PNS handle.\n */\n pnsHandle: string;\n\n /**\n * The registration ID.\n */\n registrationId: string;\n\n /**\n * The outcome of the registration.\n */\n outcome: string;\n}\n\n/**\n * Describes a response from the Notification Hubs service for send operations.\n */\nexport interface NotificationHubsMessageResponse extends NotificationHubsResponse {\n /**\n * The notification ID from the operation. Note this is only available in Standard SKU and above.\n */\n notificationId?: string;\n\n /**\n * The number of devices that successfully received the notification.\n */\n successCount: number;\n\n /**\n * The number of devices that failed to receive a notification.\n */\n failureCount: number;\n\n /**\n * The list of notification outcome results for each device registered with the hub, to which this notification was sent.\n */\n results: RegistrationResult[];\n\n /**\n * The state of this notification outcome.\n */\n state: NotificationOutcomeState;\n}\n"]}
1
+ {"version":3,"file":"notificationDetails.js","sourceRoot":"","sources":["../../../src/models/notificationDetails.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Represents the notification outcome states.\n */\nexport type NotificationOutcomeState =\n | \"Enqueued\"\n | \"DetailedStateAvailable\"\n | \"Processing\"\n | \"Completed\"\n | \"Abandoned\"\n | \"Unknown\"\n | \"NoTargetFound\"\n | \"Cancelled\";\n\n/**\n * The per platform count per state.\n */\nexport interface NotificationOutcome {\n /**\n * The state of the notification.\n */\n state: string;\n\n /**\n * The count of notifications per state.\n */\n count: number;\n}\n\n/**\n * Represents Notification details.\n */\nexport interface NotificationDetails {\n /**\n * The unique notification identifier.\n */\n notificationId?: string;\n\n /**\n * The notification location.\n */\n location?: string;\n\n /**\n * The notification state.\n */\n state?: NotificationOutcomeState;\n\n /**\n * The enqueue time of the notification.\n */\n enqueueTime?: Date;\n\n /**\n * The notification send start time.\n */\n startTime?: Date;\n\n /**\n * The notification send end time.\n */\n endTime?: Date;\n\n /**\n * The notification body.\n */\n notificationBody?: string;\n\n /**\n * The notification tags.\n */\n tags?: string;\n\n /**\n * The notification platforms targeted.\n */\n targetPlatforms?: string;\n\n /**\n * The URL for the platform notification services errors.\n */\n pnsErrorDetailsUrl?: string;\n\n /**\n * APNs outcomes counts per state.\n */\n apnsOutcomeCounts?: NotificationOutcome[];\n\n /**\n * WNS outcomes counts per state.\n */\n wnsOutcomeCounts?: NotificationOutcome[];\n\n /**\n * FCM outcome counts per state.\n */\n fcmOutcomeCounts?: NotificationOutcome[];\n\n /**\n * FCM V1 outcome counts per state.\n */\n fcmV1OutcomeCounts?: NotificationOutcome[];\n\n /**\n * ADM outcome counts per state.\n */\n admOutcomeCounts?: NotificationOutcome[];\n\n /**\n * Baidu outcome counts per state.\n */\n baiduOutcomeCounts?: NotificationOutcome[];\n\n /**\n * Web Push outcome counts per state.\n */\n browserOutcomeCounts?: NotificationOutcome[];\n\n /**\n * Xiaomi outcome counts per state.\n */\n xiaomiOutcomeCounts?: NotificationOutcome[];\n}\n\n/**\n * Describes a response from the Notification Hubs which includes a tracking ID, correlation ID and location.\n */\nexport interface NotificationHubsResponse {\n /**\n * The Tracking ID of the operation.\n */\n trackingId?: string;\n\n /**\n * The correlation ID of the operation.\n */\n correlationId?: string;\n\n /**\n * The location of the operation.\n */\n location?: string;\n}\n\n/**\n * Represents the result of the registration.\n */\nexport interface RegistrationResult {\n /**\n * The application platform.\n */\n applicationPlatform: string;\n\n /**\n * The PNS handle.\n */\n pnsHandle: string;\n\n /**\n * The registration ID.\n */\n registrationId: string;\n\n /**\n * The outcome of the registration.\n */\n outcome: string;\n}\n\n/**\n * Describes a response from the Notification Hubs service for send operations.\n */\nexport interface NotificationHubsMessageResponse extends NotificationHubsResponse {\n /**\n * The notification ID from the operation. Note this is only available in Standard SKU and above.\n */\n notificationId?: string;\n\n /**\n * The number of devices that successfully received the notification.\n */\n successCount: number;\n\n /**\n * The number of devices that failed to receive a notification.\n */\n failureCount: number;\n\n /**\n * The list of notification outcome results for each device registered with the hub, to which this notification was sent.\n */\n results: RegistrationResult[];\n\n /**\n * The state of this notification outcome.\n */\n state: NotificationOutcomeState;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"notificationDetailsSerializer.d.ts","sourceRoot":"","sources":["../../../src/serializers/notificationDetailsSerializer.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,mBAAmB,EAGpB,MAAM,kCAAkC,CAAC;AAI1C;;;GAGG;AACH,wBAAsB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAqD7F"}
1
+ {"version":3,"file":"notificationDetailsSerializer.d.ts","sourceRoot":"","sources":["../../../src/serializers/notificationDetailsSerializer.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,mBAAmB,EAGpB,MAAM,kCAAkC,CAAC;AAI1C;;;GAGG;AACH,wBAAsB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAmE7F"}
@@ -23,10 +23,18 @@ export async function parseNotificationDetails(bodyText) {
23
23
  if (isDefined(notificationDetails["BaiduOutcomeCounts"])) {
24
24
  baiduOutcomeCounts = parseOutcomeCounts(notificationDetails["BaiduOutcomeCounts"]["Outcome"]);
25
25
  }
26
+ let browserOutcomeCounts;
27
+ if (isDefined(notificationDetails["BrowserOutcomeCounts"])) {
28
+ browserOutcomeCounts = parseOutcomeCounts(notificationDetails["BrowserOutcomeCounts"]["Outcome"]);
29
+ }
26
30
  let fcmOutcomeCounts;
27
31
  if (isDefined(notificationDetails["GcmOutcomeCounts"])) {
28
32
  fcmOutcomeCounts = parseOutcomeCounts(notificationDetails["GcmOutcomeCounts"]["Outcome"]);
29
33
  }
34
+ let fcmV1OutcomeCounts;
35
+ if (isDefined(notificationDetails["FcmV1OutcomeCounts"])) {
36
+ fcmV1OutcomeCounts = parseOutcomeCounts(notificationDetails["FcmV1OutcomeCounts"]["Outcome"]);
37
+ }
30
38
  let xiaomiOutcomeCounts;
31
39
  if (isDefined(notificationDetails["XiaomiOutcomeCounts"])) {
32
40
  xiaomiOutcomeCounts = parseOutcomeCounts(notificationDetails["XiaomiOutcomeCounts"]["Outcome"]);
@@ -48,7 +56,9 @@ export async function parseNotificationDetails(bodyText) {
48
56
  apnsOutcomeCounts,
49
57
  admOutcomeCounts,
50
58
  baiduOutcomeCounts,
59
+ browserOutcomeCounts,
51
60
  fcmOutcomeCounts,
61
+ fcmV1OutcomeCounts,
52
62
  xiaomiOutcomeCounts,
53
63
  wnsOutcomeCounts,
54
64
  };
@@ -1 +1 @@
1
- {"version":3,"file":"notificationDetailsSerializer.js","sourceRoot":"","sources":["../../../src/serializers/notificationDetailsSerializer.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACpG,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,QAAgB;IAC7D,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,QAAQ,EAAE;QACnC,WAAW,EAAE,IAAI;KAClB,CAAC,CAAC;IACH,MAAM,mBAAmB,GAAG,GAAG,CAAC,qBAAqB,CAAC,CAAC;IAEvD,IAAI,iBAAoD,CAAC;IACzD,IAAI,SAAS,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC;QACxD,iBAAiB,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC9F,CAAC;IAED,IAAI,gBAAmD,CAAC;IACxD,IAAI,SAAS,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC;QACvD,gBAAgB,GAAG,kBAAkB,CAA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AC/D,OAAO,EAAE,kBAAkB,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;QAC3D,kBAAkB,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;QACnF,eAAe,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,CAAC;QAC7E,gBAAgB,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC;QAC/E,iBAAiB;QACjB,gBAAgB;QAChB,kBAAkB;QAClB,gBAAgB;QAChB,mBAAmB;QACnB,gBAAgB;KACjB,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CACzB,MAAmD;IAEnD,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACxD,MAAM,OAAO,GAA0B,EAAE,CAAC;IAC1C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;IACnF,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n NotificationDetails,\n NotificationOutcome,\n NotificationOutcomeState,\n} from \"../models/notificationDetails.js\";\nimport { getDateOrUndefined, getInteger, getStringOrUndefined, isDefined } from \"../utils/utils.js\";\nimport { parseXML } from \"@azure/core-xml\";\n\n/**\n * @internal\n * Parses a NotificationDetails from incoming XML.\n */\nexport async function parseNotificationDetails(bodyText: string): Promise<NotificationDetails> {\n const xml = await parseXML(bodyText, {\n includeRoot: true,\n });\n const notificationDetails = xml[\"NotificationDetails\"];\n\n let apnsOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"ApnsOutcomeCounts\"])) {\n apnsOutcomeCounts = parseOutcomeCounts(notificationDetails[\"ApnsOutcomeCounts\"][\"Outcome\"]);\n }\n\n let admOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"AdmOutcomeCounts\"])) {\n admOutcomeCounts = parseOutcomeCounts(notificationDetails[\"AdmOutcomeCounts\"][\"Outcome\"]);\n }\n\n let baiduOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"BaiduOutcomeCounts\"])) {\n baiduOutcomeCounts = parseOutcomeCounts(notificationDetails[\"BaiduOutcomeCounts\"][\"Outcome\"]);\n }\n\n let fcmOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"GcmOutcomeCounts\"])) {\n fcmOutcomeCounts = parseOutcomeCounts(notificationDetails[\"GcmOutcomeCounts\"][\"Outcome\"]);\n }\n\n let xiaomiOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"XiaomiOutcomeCounts\"])) {\n xiaomiOutcomeCounts = parseOutcomeCounts(notificationDetails[\"XiaomiOutcomeCounts\"][\"Outcome\"]);\n }\n\n let wnsOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"WnsOutcomeCounts\"])) {\n wnsOutcomeCounts = parseOutcomeCounts(notificationDetails[\"WnsOutcomeCounts\"][\"Outcome\"]);\n }\n\n return {\n notificationId: getStringOrUndefined(notificationDetails[\"NotificationId\"]),\n location: getStringOrUndefined(notificationDetails[\"Location\"]),\n state: getStringOrUndefined(notificationDetails[\"State\"]) as NotificationOutcomeState,\n enqueueTime: getDateOrUndefined(notificationDetails[\"EnqueueTime\"]),\n startTime: getDateOrUndefined(notificationDetails[\"StartTime\"]),\n endTime: getDateOrUndefined(notificationDetails[\"EndTime\"]),\n pnsErrorDetailsUrl: getStringOrUndefined(notificationDetails[\"PnsErrorDetailsUri\"]),\n targetPlatforms: getStringOrUndefined(notificationDetails[\"TargetPlatforms\"]),\n notificationBody: getStringOrUndefined(notificationDetails[\"NotificationBody\"]),\n apnsOutcomeCounts,\n admOutcomeCounts,\n baiduOutcomeCounts,\n fcmOutcomeCounts,\n xiaomiOutcomeCounts,\n wnsOutcomeCounts,\n };\n}\n\nfunction parseOutcomeCounts(\n counts: Record<string, any>[] | Record<string, any>,\n): NotificationOutcome[] {\n const items = Array.isArray(counts) ? counts : [counts];\n const results: NotificationOutcome[] = [];\n for (const item of items) {\n results.push({ state: item[\"Name\"], count: getInteger(item[\"Count\"], \"Count\") });\n }\n\n return results;\n}\n"]}
1
+ {"version":3,"file":"notificationDetailsSerializer.js","sourceRoot":"","sources":["../../../src/serializers/notificationDetailsSerializer.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACpG,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,QAAgB;IAC7D,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,QAAQ,EAAE;QACnC,WAAW,EAAE,IAAI;KAClB,CAAC,CAAC;IACH,MAAM,mBAAmB,GAAG,GAAG,CAAC,qBAAqB,CAAC,CAAC;IAEvD,IAAI,iBAAoD,CAAC;IACzD,IAAI,SAAS,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC;QACxD,iBAAiB,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC9F,CAAC;IAED,IAAI,gBAAmD,CAAC;IACxD,IAAI,SAAS,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC;QACvD,gBAAgB,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,kBA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O,OAAO,CAAC;AACjB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n NotificationDetails,\n NotificationOutcome,\n NotificationOutcomeState,\n} from \"../models/notificationDetails.js\";\nimport { getDateOrUndefined, getInteger, getStringOrUndefined, isDefined } from \"../utils/utils.js\";\nimport { parseXML } from \"@azure/core-xml\";\n\n/**\n * @internal\n * Parses a NotificationDetails from incoming XML.\n */\nexport async function parseNotificationDetails(bodyText: string): Promise<NotificationDetails> {\n const xml = await parseXML(bodyText, {\n includeRoot: true,\n });\n const notificationDetails = xml[\"NotificationDetails\"];\n\n let apnsOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"ApnsOutcomeCounts\"])) {\n apnsOutcomeCounts = parseOutcomeCounts(notificationDetails[\"ApnsOutcomeCounts\"][\"Outcome\"]);\n }\n\n let admOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"AdmOutcomeCounts\"])) {\n admOutcomeCounts = parseOutcomeCounts(notificationDetails[\"AdmOutcomeCounts\"][\"Outcome\"]);\n }\n\n let baiduOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"BaiduOutcomeCounts\"])) {\n baiduOutcomeCounts = parseOutcomeCounts(notificationDetails[\"BaiduOutcomeCounts\"][\"Outcome\"]);\n }\n\n let browserOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"BrowserOutcomeCounts\"])) {\n browserOutcomeCounts = parseOutcomeCounts(\n notificationDetails[\"BrowserOutcomeCounts\"][\"Outcome\"],\n );\n }\n\n let fcmOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"GcmOutcomeCounts\"])) {\n fcmOutcomeCounts = parseOutcomeCounts(notificationDetails[\"GcmOutcomeCounts\"][\"Outcome\"]);\n }\n\n let fcmV1OutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"FcmV1OutcomeCounts\"])) {\n fcmV1OutcomeCounts = parseOutcomeCounts(notificationDetails[\"FcmV1OutcomeCounts\"][\"Outcome\"]);\n }\n\n let xiaomiOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"XiaomiOutcomeCounts\"])) {\n xiaomiOutcomeCounts = parseOutcomeCounts(notificationDetails[\"XiaomiOutcomeCounts\"][\"Outcome\"]);\n }\n\n let wnsOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"WnsOutcomeCounts\"])) {\n wnsOutcomeCounts = parseOutcomeCounts(notificationDetails[\"WnsOutcomeCounts\"][\"Outcome\"]);\n }\n\n return {\n notificationId: getStringOrUndefined(notificationDetails[\"NotificationId\"]),\n location: getStringOrUndefined(notificationDetails[\"Location\"]),\n state: getStringOrUndefined(notificationDetails[\"State\"]) as NotificationOutcomeState,\n enqueueTime: getDateOrUndefined(notificationDetails[\"EnqueueTime\"]),\n startTime: getDateOrUndefined(notificationDetails[\"StartTime\"]),\n endTime: getDateOrUndefined(notificationDetails[\"EndTime\"]),\n pnsErrorDetailsUrl: getStringOrUndefined(notificationDetails[\"PnsErrorDetailsUri\"]),\n targetPlatforms: getStringOrUndefined(notificationDetails[\"TargetPlatforms\"]),\n notificationBody: getStringOrUndefined(notificationDetails[\"NotificationBody\"]),\n apnsOutcomeCounts,\n admOutcomeCounts,\n baiduOutcomeCounts,\n browserOutcomeCounts,\n fcmOutcomeCounts,\n fcmV1OutcomeCounts,\n xiaomiOutcomeCounts,\n wnsOutcomeCounts,\n };\n}\n\nfunction parseOutcomeCounts(\n counts: Record<string, any>[] | Record<string, any>,\n): NotificationOutcome[] {\n const items = Array.isArray(counts) ? counts : [counts];\n const results: NotificationOutcome[] = [];\n for (const item of items) {\n results.push({ state: item[\"Name\"], count: getInteger(item[\"Count\"], \"Count\") });\n }\n\n return results;\n}\n"]}
@@ -2060,6 +2060,10 @@ export declare interface NotificationDetails {
2060
2060
  * FCM outcome counts per state.
2061
2061
  */
2062
2062
  fcmOutcomeCounts?: NotificationOutcome[];
2063
+ /**
2064
+ * FCM V1 outcome counts per state.
2065
+ */
2066
+ fcmV1OutcomeCounts?: NotificationOutcome[];
2063
2067
  /**
2064
2068
  * ADM outcome counts per state.
2065
2069
  */
@@ -2061,6 +2061,10 @@ export declare interface NotificationDetails {
2061
2061
  * FCM outcome counts per state.
2062
2062
  */
2063
2063
  fcmOutcomeCounts?: NotificationOutcome[];
2064
+ /**
2065
+ * FCM V1 outcome counts per state.
2066
+ */
2067
+ fcmV1OutcomeCounts?: NotificationOutcome[];
2064
2068
  /**
2065
2069
  * ADM outcome counts per state.
2066
2070
  */
@@ -71,6 +71,10 @@ export interface NotificationDetails {
71
71
  * FCM outcome counts per state.
72
72
  */
73
73
  fcmOutcomeCounts?: NotificationOutcome[];
74
+ /**
75
+ * FCM V1 outcome counts per state.
76
+ */
77
+ fcmV1OutcomeCounts?: NotificationOutcome[];
74
78
  /**
75
79
  * ADM outcome counts per state.
76
80
  */
@@ -1 +1 @@
1
- {"version":3,"file":"notificationDetails.d.ts","sourceRoot":"","sources":["../../../src/models/notificationDetails.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAChC,UAAU,GACV,wBAAwB,GACxB,YAAY,GACZ,WAAW,GACX,WAAW,GACX,SAAS,GACT,eAAe,GACf,WAAW,CAAC;AAEhB;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,wBAAwB,CAAC;IAEjC;;OAEG;IACH,WAAW,CAAC,EAAE,IAAI,CAAC;IAEnB;;OAEG;IACH,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ACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAE9B;;OAEG;IACH,KAAK,EAAE,wBAAwB,CAAC;CACjC"}
1
+ {"version":3,"file":"notificationDetails.d.ts","sourceRoot":"","sources":["../../../src/models/notificationDetails.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAChC,UAAU,GACV,wBAAwB,GACxB,YAAY,GACZ,WAAW,GACX,WAAW,GACX,SAAS,GACT,eAAe,GACf,WAAW,CAAC;AAEhB;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,wBAAwB,CAAC;IAEjC;;OAEG;IACH,WAAW,CAAC,EAAE,IAAI,CAAC;IAEnB;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC;IAEf;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,iBAAiB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAE1C;;OAEG;IACH,gBAAgB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAEzC;;OAEG;IACH,gBAAgB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAEzC;;OAEG;IACH,kBAAkB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAE3C;;OAEG;IACH,gBAAgB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAEzC;;OAEG;IACH,kBAAkB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAE3C;;OAEG;IACH,oBAAoB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAE7C;;OAEG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,EAAE,CAAC;CAC7C;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,+BAAgC,SAAQ,wBAAwB;IAC/E;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAE9B;;OAEG;IACH,KAAK,EAAE,wBAAwB,CAAC;CACjC"}
@@ -1 +1 @@
1
- {"version":3,"file":"notificationDetails.js","sourceRoot":"","sources":["../../../src/models/notificationDetails.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Represents the notification outcome states.\n */\nexport type NotificationOutcomeState =\n | \"Enqueued\"\n | \"DetailedStateAvailable\"\n | \"Processing\"\n | \"Completed\"\n | \"Abandoned\"\n | \"Unknown\"\n | \"NoTargetFound\"\n | \"Cancelled\";\n\n/**\n * The per platform count per state.\n */\nexport interface NotificationOutcome {\n /**\n * The state of the notification.\n */\n state: string;\n\n /**\n * The count of notifications per state.\n */\n count: number;\n}\n\n/**\n * Represents Notification details.\n */\nexport interface NotificationDetails {\n /**\n * The unique notification identifier.\n */\n notificationId?: string;\n\n /**\n * The notification location.\n */\n location?: string;\n\n /**\n * The notification state.\n */\n state?: NotificationOutcomeState;\n\n /**\n * The enqueue time of the notification.\n */\n enqueueTime?: Date;\n\n /**\n * The notification send start time.\n */\n startTime?: Date;\n\n /**\n * The notification send end time.\n */\n endTime?: Date;\n\n /**\n * The notification body.\n */\n notificationBody?: string;\n\n /**\n * The notification tags.\n */\n tags?: string;\n\n /**\n * The notification platforms targeted.\n */\n targetPlatforms?: string;\n\n /**\n * The URL for the platform notification services errors.\n */\n pnsErrorDetailsUrl?: string;\n\n /**\n * APNs outcomes counts per state.\n */\n apnsOutcomeCounts?: NotificationOutcome[];\n\n /**\n * WNS outcomes counts per state.\n */\n wnsOutcomeCounts?: NotificationOutcome[];\n\n /**\n * FCM outcome counts per state.\n */\n fcmOutcomeCounts?: NotificationOutcome[];\n\n /**\n * ADM outcome counts per state.\n */\n admOutcomeCounts?: NotificationOutcome[];\n\n /**\n * Baidu outcome counts per state.\n */\n baiduOutcomeCounts?: NotificationOutcome[];\n\n /**\n * Web Push outcome counts per state.\n */\n browserOutcomeCounts?: NotificationOutcome[];\n\n /**\n * Xiaomi outcome counts per state.\n */\n xiaomiOutcomeCounts?: NotificationOutcome[];\n}\n\n/**\n * Describes a response from the Notification Hubs which includes a tracking ID, correlation ID and location.\n */\nexport interface NotificationHubsResponse {\n /**\n * The Tracking ID of the operation.\n */\n trackingId?: string;\n\n /**\n * The correlation ID of the operation.\n */\n correlationId?: string;\n\n /**\n * The location of the operation.\n */\n location?: string;\n}\n\n/**\n * Represents the result of the registration.\n */\nexport interface RegistrationResult {\n /**\n * The application platform.\n */\n applicationPlatform: string;\n\n /**\n * The PNS handle.\n */\n pnsHandle: string;\n\n /**\n * The registration ID.\n */\n registrationId: string;\n\n /**\n * The outcome of the registration.\n */\n outcome: string;\n}\n\n/**\n * Describes a response from the Notification Hubs service for send operations.\n */\nexport interface NotificationHubsMessageResponse extends NotificationHubsResponse {\n /**\n * The notification ID from the operation. Note this is only available in Standard SKU and above.\n */\n notificationId?: string;\n\n /**\n * The number of devices that successfully received the notification.\n */\n successCount: number;\n\n /**\n * The number of devices that failed to receive a notification.\n */\n failureCount: number;\n\n /**\n * The list of notification outcome results for each device registered with the hub, to which this notification was sent.\n */\n results: RegistrationResult[];\n\n /**\n * The state of this notification outcome.\n */\n state: NotificationOutcomeState;\n}\n"]}
1
+ {"version":3,"file":"notificationDetails.js","sourceRoot":"","sources":["../../../src/models/notificationDetails.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Represents the notification outcome states.\n */\nexport type NotificationOutcomeState =\n | \"Enqueued\"\n | \"DetailedStateAvailable\"\n | \"Processing\"\n | \"Completed\"\n | \"Abandoned\"\n | \"Unknown\"\n | \"NoTargetFound\"\n | \"Cancelled\";\n\n/**\n * The per platform count per state.\n */\nexport interface NotificationOutcome {\n /**\n * The state of the notification.\n */\n state: string;\n\n /**\n * The count of notifications per state.\n */\n count: number;\n}\n\n/**\n * Represents Notification details.\n */\nexport interface NotificationDetails {\n /**\n * The unique notification identifier.\n */\n notificationId?: string;\n\n /**\n * The notification location.\n */\n location?: string;\n\n /**\n * The notification state.\n */\n state?: NotificationOutcomeState;\n\n /**\n * The enqueue time of the notification.\n */\n enqueueTime?: Date;\n\n /**\n * The notification send start time.\n */\n startTime?: Date;\n\n /**\n * The notification send end time.\n */\n endTime?: Date;\n\n /**\n * The notification body.\n */\n notificationBody?: string;\n\n /**\n * The notification tags.\n */\n tags?: string;\n\n /**\n * The notification platforms targeted.\n */\n targetPlatforms?: string;\n\n /**\n * The URL for the platform notification services errors.\n */\n pnsErrorDetailsUrl?: string;\n\n /**\n * APNs outcomes counts per state.\n */\n apnsOutcomeCounts?: NotificationOutcome[];\n\n /**\n * WNS outcomes counts per state.\n */\n wnsOutcomeCounts?: NotificationOutcome[];\n\n /**\n * FCM outcome counts per state.\n */\n fcmOutcomeCounts?: NotificationOutcome[];\n\n /**\n * FCM V1 outcome counts per state.\n */\n fcmV1OutcomeCounts?: NotificationOutcome[];\n\n /**\n * ADM outcome counts per state.\n */\n admOutcomeCounts?: NotificationOutcome[];\n\n /**\n * Baidu outcome counts per state.\n */\n baiduOutcomeCounts?: NotificationOutcome[];\n\n /**\n * Web Push outcome counts per state.\n */\n browserOutcomeCounts?: NotificationOutcome[];\n\n /**\n * Xiaomi outcome counts per state.\n */\n xiaomiOutcomeCounts?: NotificationOutcome[];\n}\n\n/**\n * Describes a response from the Notification Hubs which includes a tracking ID, correlation ID and location.\n */\nexport interface NotificationHubsResponse {\n /**\n * The Tracking ID of the operation.\n */\n trackingId?: string;\n\n /**\n * The correlation ID of the operation.\n */\n correlationId?: string;\n\n /**\n * The location of the operation.\n */\n location?: string;\n}\n\n/**\n * Represents the result of the registration.\n */\nexport interface RegistrationResult {\n /**\n * The application platform.\n */\n applicationPlatform: string;\n\n /**\n * The PNS handle.\n */\n pnsHandle: string;\n\n /**\n * The registration ID.\n */\n registrationId: string;\n\n /**\n * The outcome of the registration.\n */\n outcome: string;\n}\n\n/**\n * Describes a response from the Notification Hubs service for send operations.\n */\nexport interface NotificationHubsMessageResponse extends NotificationHubsResponse {\n /**\n * The notification ID from the operation. Note this is only available in Standard SKU and above.\n */\n notificationId?: string;\n\n /**\n * The number of devices that successfully received the notification.\n */\n successCount: number;\n\n /**\n * The number of devices that failed to receive a notification.\n */\n failureCount: number;\n\n /**\n * The list of notification outcome results for each device registered with the hub, to which this notification was sent.\n */\n results: RegistrationResult[];\n\n /**\n * The state of this notification outcome.\n */\n state: NotificationOutcomeState;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"notificationDetailsSerializer.d.ts","sourceRoot":"","sources":["../../../src/serializers/notificationDetailsSerializer.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,mBAAmB,EAGpB,MAAM,kCAAkC,CAAC;AAI1C;;;GAGG;AACH,wBAAsB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAqD7F"}
1
+ {"version":3,"file":"notificationDetailsSerializer.d.ts","sourceRoot":"","sources":["../../../src/serializers/notificationDetailsSerializer.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,mBAAmB,EAGpB,MAAM,kCAAkC,CAAC;AAI1C;;;GAGG;AACH,wBAAsB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAmE7F"}
@@ -23,10 +23,18 @@ export async function parseNotificationDetails(bodyText) {
23
23
  if (isDefined(notificationDetails["BaiduOutcomeCounts"])) {
24
24
  baiduOutcomeCounts = parseOutcomeCounts(notificationDetails["BaiduOutcomeCounts"]["Outcome"]);
25
25
  }
26
+ let browserOutcomeCounts;
27
+ if (isDefined(notificationDetails["BrowserOutcomeCounts"])) {
28
+ browserOutcomeCounts = parseOutcomeCounts(notificationDetails["BrowserOutcomeCounts"]["Outcome"]);
29
+ }
26
30
  let fcmOutcomeCounts;
27
31
  if (isDefined(notificationDetails["GcmOutcomeCounts"])) {
28
32
  fcmOutcomeCounts = parseOutcomeCounts(notificationDetails["GcmOutcomeCounts"]["Outcome"]);
29
33
  }
34
+ let fcmV1OutcomeCounts;
35
+ if (isDefined(notificationDetails["FcmV1OutcomeCounts"])) {
36
+ fcmV1OutcomeCounts = parseOutcomeCounts(notificationDetails["FcmV1OutcomeCounts"]["Outcome"]);
37
+ }
30
38
  let xiaomiOutcomeCounts;
31
39
  if (isDefined(notificationDetails["XiaomiOutcomeCounts"])) {
32
40
  xiaomiOutcomeCounts = parseOutcomeCounts(notificationDetails["XiaomiOutcomeCounts"]["Outcome"]);
@@ -48,7 +56,9 @@ export async function parseNotificationDetails(bodyText) {
48
56
  apnsOutcomeCounts,
49
57
  admOutcomeCounts,
50
58
  baiduOutcomeCounts,
59
+ browserOutcomeCounts,
51
60
  fcmOutcomeCounts,
61
+ fcmV1OutcomeCounts,
52
62
  xiaomiOutcomeCounts,
53
63
  wnsOutcomeCounts,
54
64
  };
@@ -1 +1 @@
1
- {"version":3,"file":"notificationDetailsSerializer.js","sourceRoot":"","sources":["../../../src/serializers/notificationDetailsSerializer.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACpG,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,QAAgB;IAC7D,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,QAAQ,EAAE;QACnC,WAAW,EAAE,IAAI;KAClB,CAAC,CAAC;IACH,MAAM,mBAAmB,GAAG,GAAG,CAAC,qBAAqB,CAAC,CAAC;IAEvD,IAAI,iBAAoD,CAAC;IACzD,IAAI,SAAS,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC;QACxD,iBAAiB,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC9F,CAAC;IAED,IAAI,gBAAmD,CAAC;IACxD,IAAI,SAAS,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC;QACvD,gBAAgB,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,SAAS,CAAC,CAAC,CAA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CAAC;QAC3D,kBAAkB,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;QACnF,eAAe,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,CAAC;QAC7E,gBAAgB,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC;QAC/E,iBAAiB;QACjB,gBAAgB;QAChB,kBAAkB;QAClB,gBAAgB;QAChB,mBAAmB;QACnB,gBAAgB;KACjB,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CACzB,MAAmD;IAEnD,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACxD,MAAM,OAAO,GAA0B,EAAE,CAAC;IAC1C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;IACnF,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n NotificationDetails,\n NotificationOutcome,\n NotificationOutcomeState,\n} from \"../models/notificationDetails.js\";\nimport { getDateOrUndefined, getInteger, getStringOrUndefined, isDefined } from \"../utils/utils.js\";\nimport { parseXML } from \"@azure/core-xml\";\n\n/**\n * @internal\n * Parses a NotificationDetails from incoming XML.\n */\nexport async function parseNotificationDetails(bodyText: string): Promise<NotificationDetails> {\n const xml = await parseXML(bodyText, {\n includeRoot: true,\n });\n const notificationDetails = xml[\"NotificationDetails\"];\n\n let apnsOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"ApnsOutcomeCounts\"])) {\n apnsOutcomeCounts = parseOutcomeCounts(notificationDetails[\"ApnsOutcomeCounts\"][\"Outcome\"]);\n }\n\n let admOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"AdmOutcomeCounts\"])) {\n admOutcomeCounts = parseOutcomeCounts(notificationDetails[\"AdmOutcomeCounts\"][\"Outcome\"]);\n }\n\n let baiduOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"BaiduOutcomeCounts\"])) {\n baiduOutcomeCounts = parseOutcomeCounts(notificationDetails[\"BaiduOutcomeCounts\"][\"Outcome\"]);\n }\n\n let fcmOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"GcmOutcomeCounts\"])) {\n fcmOutcomeCounts = parseOutcomeCounts(notificationDetails[\"GcmOutcomeCounts\"][\"Outcome\"]);\n }\n\n let xiaomiOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"XiaomiOutcomeCounts\"])) {\n xiaomiOutcomeCounts = parseOutcomeCounts(notificationDetails[\"XiaomiOutcomeCounts\"][\"Outcome\"]);\n }\n\n let wnsOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"WnsOutcomeCounts\"])) {\n wnsOutcomeCounts = parseOutcomeCounts(notificationDetails[\"WnsOutcomeCounts\"][\"Outcome\"]);\n }\n\n return {\n notificationId: getStringOrUndefined(notificationDetails[\"NotificationId\"]),\n location: getStringOrUndefined(notificationDetails[\"Location\"]),\n state: getStringOrUndefined(notificationDetails[\"State\"]) as NotificationOutcomeState,\n enqueueTime: getDateOrUndefined(notificationDetails[\"EnqueueTime\"]),\n startTime: getDateOrUndefined(notificationDetails[\"StartTime\"]),\n endTime: getDateOrUndefined(notificationDetails[\"EndTime\"]),\n pnsErrorDetailsUrl: getStringOrUndefined(notificationDetails[\"PnsErrorDetailsUri\"]),\n targetPlatforms: getStringOrUndefined(notificationDetails[\"TargetPlatforms\"]),\n notificationBody: getStringOrUndefined(notificationDetails[\"NotificationBody\"]),\n apnsOutcomeCounts,\n admOutcomeCounts,\n baiduOutcomeCounts,\n fcmOutcomeCounts,\n xiaomiOutcomeCounts,\n wnsOutcomeCounts,\n };\n}\n\nfunction parseOutcomeCounts(\n counts: Record<string, any>[] | Record<string, any>,\n): NotificationOutcome[] {\n const items = Array.isArray(counts) ? counts : [counts];\n const results: NotificationOutcome[] = [];\n for (const item of items) {\n results.push({ state: item[\"Name\"], count: getInteger(item[\"Count\"], \"Count\") });\n }\n\n return results;\n}\n"]}
1
+ {"version":3,"file":"notificationDetailsSerializer.js","sourceRoot":"","sources":["../../../src/serializers/notificationDetailsSerializer.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACpG,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,QAAgB;IAC7D,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,QAAQ,EAAE;QACnC,WAAW,EAAE,IAAI;KAClB,CAAC,CAAC;IACH,MAAM,mBAAmB,GAAG,GAAG,CAAC,qBAAqB,CAAC,CAAC;IAEvD,IAAI,iBAAoD,CAAC;IACzD,IAAI,SAAS,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC;QACxD,iBAAiB,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC9F,CAAC;IAED,IAAI,gBAAmD,CAAC;IACxD,IAAI,SAAS,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC;QACvD,gBAAgB,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC5F,CAAC;IAED,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n// Licensed under the MIT license.\n\nimport {\n NotificationDetails,\n NotificationOutcome,\n NotificationOutcomeState,\n} from \"../models/notificationDetails.js\";\nimport { getDateOrUndefined, getInteger, getStringOrUndefined, isDefined } from \"../utils/utils.js\";\nimport { parseXML } from \"@azure/core-xml\";\n\n/**\n * @internal\n * Parses a NotificationDetails from incoming XML.\n */\nexport async function parseNotificationDetails(bodyText: string): Promise<NotificationDetails> {\n const xml = await parseXML(bodyText, {\n includeRoot: true,\n });\n const notificationDetails = xml[\"NotificationDetails\"];\n\n let apnsOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"ApnsOutcomeCounts\"])) {\n apnsOutcomeCounts = parseOutcomeCounts(notificationDetails[\"ApnsOutcomeCounts\"][\"Outcome\"]);\n }\n\n let admOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"AdmOutcomeCounts\"])) {\n admOutcomeCounts = parseOutcomeCounts(notificationDetails[\"AdmOutcomeCounts\"][\"Outcome\"]);\n }\n\n let baiduOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"BaiduOutcomeCounts\"])) {\n baiduOutcomeCounts = parseOutcomeCounts(notificationDetails[\"BaiduOutcomeCounts\"][\"Outcome\"]);\n }\n\n let browserOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"BrowserOutcomeCounts\"])) {\n browserOutcomeCounts = parseOutcomeCounts(\n notificationDetails[\"BrowserOutcomeCounts\"][\"Outcome\"],\n );\n }\n\n let fcmOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"GcmOutcomeCounts\"])) {\n fcmOutcomeCounts = parseOutcomeCounts(notificationDetails[\"GcmOutcomeCounts\"][\"Outcome\"]);\n }\n\n let fcmV1OutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"FcmV1OutcomeCounts\"])) {\n fcmV1OutcomeCounts = parseOutcomeCounts(notificationDetails[\"FcmV1OutcomeCounts\"][\"Outcome\"]);\n }\n\n let xiaomiOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"XiaomiOutcomeCounts\"])) {\n xiaomiOutcomeCounts = parseOutcomeCounts(notificationDetails[\"XiaomiOutcomeCounts\"][\"Outcome\"]);\n }\n\n let wnsOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"WnsOutcomeCounts\"])) {\n wnsOutcomeCounts = parseOutcomeCounts(notificationDetails[\"WnsOutcomeCounts\"][\"Outcome\"]);\n }\n\n return {\n notificationId: getStringOrUndefined(notificationDetails[\"NotificationId\"]),\n location: getStringOrUndefined(notificationDetails[\"Location\"]),\n state: getStringOrUndefined(notificationDetails[\"State\"]) as NotificationOutcomeState,\n enqueueTime: getDateOrUndefined(notificationDetails[\"EnqueueTime\"]),\n startTime: getDateOrUndefined(notificationDetails[\"StartTime\"]),\n endTime: getDateOrUndefined(notificationDetails[\"EndTime\"]),\n pnsErrorDetailsUrl: getStringOrUndefined(notificationDetails[\"PnsErrorDetailsUri\"]),\n targetPlatforms: getStringOrUndefined(notificationDetails[\"TargetPlatforms\"]),\n notificationBody: getStringOrUndefined(notificationDetails[\"NotificationBody\"]),\n apnsOutcomeCounts,\n admOutcomeCounts,\n baiduOutcomeCounts,\n browserOutcomeCounts,\n fcmOutcomeCounts,\n fcmV1OutcomeCounts,\n xiaomiOutcomeCounts,\n wnsOutcomeCounts,\n };\n}\n\nfunction parseOutcomeCounts(\n counts: Record<string, any>[] | Record<string, any>,\n): NotificationOutcome[] {\n const items = Array.isArray(counts) ? counts : [counts];\n const results: NotificationOutcome[] = [];\n for (const item of items) {\n results.push({ state: item[\"Name\"], count: getInteger(item[\"Count\"], \"Count\") });\n }\n\n return results;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure/notification-hubs",
3
- "version": "1.2.3-alpha.20240520.1",
3
+ "version": "1.2.3",
4
4
  "description": "Azure Notification Hubs SDK for JavaScript",
5
5
  "sdk-type": "client",
6
6
  "main": "./dist/commonjs/index.js",
@@ -60,20 +60,20 @@
60
60
  "sideEffects": false,
61
61
  "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
62
62
  "devDependencies": {
63
- "@azure/dev-tool": ">=1.0.0-alpha <1.0.0-alphb",
64
- "@azure/eslint-plugin-azure-sdk": ">=3.0.0-alpha <3.0.0-alphb",
63
+ "@azure/dev-tool": "^1.0.0",
64
+ "@azure/eslint-plugin-azure-sdk": "^3.0.0",
65
65
  "@azure-tools/test-recorder": "^4.0.0",
66
- "@microsoft/api-extractor": "^7.43.1",
66
+ "@microsoft/api-extractor": "^7.43.7",
67
67
  "@types/node": "^18.0.0",
68
- "@vitest/browser": "^1.5.0",
69
- "@vitest/coverage-istanbul": "^1.5.0",
68
+ "@vitest/browser": "^1.6.0",
69
+ "@vitest/coverage-istanbul": "^1.6.0",
70
70
  "dotenv": "^16.4.5",
71
71
  "eslint": "^8.57.0",
72
72
  "playwright": "^1.43.0",
73
73
  "rimraf": "^5.0.5",
74
74
  "tshy": "^1.13.1",
75
75
  "typescript": "~5.4.5",
76
- "vitest": "^1.5.0"
76
+ "vitest": "^1.6.0"
77
77
  },
78
78
  "dependencies": {
79
79
  "@azure/core-auth": "^1.7.2",
@@ -82,10 +82,10 @@
82
82
  "@azure/core-paging": "^1.6.2",
83
83
  "@azure/core-rest-pipeline": "^1.15.2",
84
84
  "@azure/core-tracing": "^1.1.2",
85
- "@azure/core-util": "^1.8.2",
85
+ "@azure/core-util": "^1.9.0",
86
86
  "@azure/core-xml": "^1.4.2",
87
87
  "@azure/logger": "^1.1.2",
88
- "@azure-rest/core-client": "^1.4.0",
88
+ "@azure-rest/core-client": "^2.0.0",
89
89
  "tslib": "^2.6.2"
90
90
  },
91
91
  "tshy": {