@azure/notification-hubs 1.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +749 -0
  3. package/dist/index.js +2235 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist-esm/src/client/cancelScheduledNotification.js +23 -0
  6. package/dist-esm/src/client/cancelScheduledNotification.js.map +1 -0
  7. package/dist-esm/src/client/createOrUpdateInstallation.js +24 -0
  8. package/dist-esm/src/client/createOrUpdateInstallation.js.map +1 -0
  9. package/dist-esm/src/client/createOrUpdateRegistration.js +17 -0
  10. package/dist-esm/src/client/createOrUpdateRegistration.js.map +1 -0
  11. package/dist-esm/src/client/createRegistration.js +24 -0
  12. package/dist-esm/src/client/createRegistration.js.map +1 -0
  13. package/dist-esm/src/client/createRegistrationId.js +26 -0
  14. package/dist-esm/src/client/createRegistrationId.js.map +1 -0
  15. package/dist-esm/src/client/deleteInstallation.js +22 -0
  16. package/dist-esm/src/client/deleteInstallation.js.map +1 -0
  17. package/dist-esm/src/client/deleteRegistration.js +25 -0
  18. package/dist-esm/src/client/deleteRegistration.js.map +1 -0
  19. package/dist-esm/src/client/getFeedbackContainerUrl.js +23 -0
  20. package/dist-esm/src/client/getFeedbackContainerUrl.js.map +1 -0
  21. package/dist-esm/src/client/getInstallation.js +23 -0
  22. package/dist-esm/src/client/getInstallation.js.map +1 -0
  23. package/dist-esm/src/client/getNotificationHubJob.js +24 -0
  24. package/dist-esm/src/client/getNotificationHubJob.js.map +1 -0
  25. package/dist-esm/src/client/getNotificationOutcomeDetails.js +24 -0
  26. package/dist-esm/src/client/getNotificationOutcomeDetails.js.map +1 -0
  27. package/dist-esm/src/client/getRegistration.js +24 -0
  28. package/dist-esm/src/client/getRegistration.js.map +1 -0
  29. package/dist-esm/src/client/index.js +44 -0
  30. package/dist-esm/src/client/index.js.map +1 -0
  31. package/dist-esm/src/client/internal/_client.js +75 -0
  32. package/dist-esm/src/client/internal/_client.js.map +1 -0
  33. package/dist-esm/src/client/internal/_createOrUpdateRegistrationDescription.js +31 -0
  34. package/dist-esm/src/client/internal/_createOrUpdateRegistrationDescription.js.map +1 -0
  35. package/dist-esm/src/client/internal/_scheduleNotificationPayload.js +37 -0
  36. package/dist-esm/src/client/internal/_scheduleNotificationPayload.js.map +1 -0
  37. package/dist-esm/src/client/internal/_sendNotificationPayload.js +51 -0
  38. package/dist-esm/src/client/internal/_sendNotificationPayload.js.map +1 -0
  39. package/dist-esm/src/client/listNotificationHubJobs.js +23 -0
  40. package/dist-esm/src/client/listNotificationHubJobs.js.map +1 -0
  41. package/dist-esm/src/client/listRegistrations.js +89 -0
  42. package/dist-esm/src/client/listRegistrations.js.map +1 -0
  43. package/dist-esm/src/client/listRegistrationsByTag.js +87 -0
  44. package/dist-esm/src/client/listRegistrationsByTag.js.map +1 -0
  45. package/dist-esm/src/client/scheduleBroadcastNotification.js +17 -0
  46. package/dist-esm/src/client/scheduleBroadcastNotification.js.map +1 -0
  47. package/dist-esm/src/client/scheduleNotification.js +18 -0
  48. package/dist-esm/src/client/scheduleNotification.js.map +1 -0
  49. package/dist-esm/src/client/sendBroadcastNotification.js +15 -0
  50. package/dist-esm/src/client/sendBroadcastNotification.js.map +1 -0
  51. package/dist-esm/src/client/sendDirectNotification.js +16 -0
  52. package/dist-esm/src/client/sendDirectNotification.js.map +1 -0
  53. package/dist-esm/src/client/sendNotification.js +16 -0
  54. package/dist-esm/src/client/sendNotification.js.map +1 -0
  55. package/dist-esm/src/client/submitNotificationHubJob.js +26 -0
  56. package/dist-esm/src/client/submitNotificationHubJob.js.map +1 -0
  57. package/dist-esm/src/client/updateInstallation.js +25 -0
  58. package/dist-esm/src/client/updateInstallation.js.map +1 -0
  59. package/dist-esm/src/client/updateRegistration.js +21 -0
  60. package/dist-esm/src/client/updateRegistration.js.map +1 -0
  61. package/dist-esm/src/index.js +12 -0
  62. package/dist-esm/src/index.js.map +1 -0
  63. package/dist-esm/src/models/installation.js +51 -0
  64. package/dist-esm/src/models/installation.js.map +1 -0
  65. package/dist-esm/src/models/notification.js +104 -0
  66. package/dist-esm/src/models/notification.js.map +1 -0
  67. package/dist-esm/src/models/notificationBuilder.js +169 -0
  68. package/dist-esm/src/models/notificationBuilder.js.map +1 -0
  69. package/dist-esm/src/models/notificationDetails.js +4 -0
  70. package/dist-esm/src/models/notificationDetails.js.map +1 -0
  71. package/dist-esm/src/models/notificationHubJob.js +4 -0
  72. package/dist-esm/src/models/notificationHubJob.js.map +1 -0
  73. package/dist-esm/src/models/options.js +4 -0
  74. package/dist-esm/src/models/options.js.map +1 -0
  75. package/dist-esm/src/models/registration.js +135 -0
  76. package/dist-esm/src/models/registration.js.map +1 -0
  77. package/dist-esm/src/models/response.js +4 -0
  78. package/dist-esm/src/models/response.js.map +1 -0
  79. package/dist-esm/src/notificationHubsClient.js +251 -0
  80. package/dist-esm/src/notificationHubsClient.js.map +1 -0
  81. package/dist-esm/src/serializers/notificationDetailsSerializer.js +58 -0
  82. package/dist-esm/src/serializers/notificationDetailsSerializer.js.map +1 -0
  83. package/dist-esm/src/serializers/notificationHubJobSerializer.js +74 -0
  84. package/dist-esm/src/serializers/notificationHubJobSerializer.js.map +1 -0
  85. package/dist-esm/src/serializers/registrationSerializer.js +375 -0
  86. package/dist-esm/src/serializers/registrationSerializer.js.map +1 -0
  87. package/dist-esm/src/utils/connectionStringUtils.js +37 -0
  88. package/dist-esm/src/utils/connectionStringUtils.js.map +1 -0
  89. package/dist-esm/src/utils/constants.js +11 -0
  90. package/dist-esm/src/utils/constants.js.map +1 -0
  91. package/dist-esm/src/utils/retryPolicy.js +144 -0
  92. package/dist-esm/src/utils/retryPolicy.js.map +1 -0
  93. package/dist-esm/src/utils/tracing.js +13 -0
  94. package/dist-esm/src/utils/tracing.js.map +1 -0
  95. package/dist-esm/src/utils/utils.js +130 -0
  96. package/dist-esm/src/utils/utils.js.map +1 -0
  97. package/dist-esm/src/utils/xmlUtils.js +101 -0
  98. package/dist-esm/src/utils/xmlUtils.js.map +1 -0
  99. package/package.json +144 -0
  100. package/types/3.1/notification-hubs.d.ts +1728 -0
  101. package/types/latest/notification-hubs.d.ts +1840 -0
  102. package/types/latest/tsdoc-metadata.json +11 -0
  103. package/types/src/client/cancelScheduledNotification.d.ts +13 -0
  104. package/types/src/client/cancelScheduledNotification.d.ts.map +1 -0
  105. package/types/src/client/createOrUpdateInstallation.d.ts +13 -0
  106. package/types/src/client/createOrUpdateInstallation.d.ts.map +1 -0
  107. package/types/src/client/createOrUpdateRegistration.d.ts +12 -0
  108. package/types/src/client/createOrUpdateRegistration.d.ts.map +1 -0
  109. package/types/src/client/createRegistration.d.ts +13 -0
  110. package/types/src/client/createRegistration.d.ts.map +1 -0
  111. package/types/src/client/createRegistrationId.d.ts +10 -0
  112. package/types/src/client/createRegistrationId.d.ts.map +1 -0
  113. package/types/src/client/deleteInstallation.d.ts +12 -0
  114. package/types/src/client/deleteInstallation.d.ts.map +1 -0
  115. package/types/src/client/deleteRegistration.d.ts +12 -0
  116. package/types/src/client/deleteRegistration.d.ts.map +1 -0
  117. package/types/src/client/getFeedbackContainerUrl.d.ts +11 -0
  118. package/types/src/client/getFeedbackContainerUrl.d.ts.map +1 -0
  119. package/types/src/client/getInstallation.d.ts +12 -0
  120. package/types/src/client/getInstallation.d.ts.map +1 -0
  121. package/types/src/client/getNotificationHubJob.d.ts +12 -0
  122. package/types/src/client/getNotificationHubJob.d.ts.map +1 -0
  123. package/types/src/client/getNotificationOutcomeDetails.d.ts +13 -0
  124. package/types/src/client/getNotificationOutcomeDetails.d.ts.map +1 -0
  125. package/types/src/client/getRegistration.d.ts +12 -0
  126. package/types/src/client/getRegistration.d.ts.map +1 -0
  127. package/types/src/client/index.d.ts +41 -0
  128. package/types/src/client/index.d.ts.map +1 -0
  129. package/types/src/client/internal/_client.d.ts +26 -0
  130. package/types/src/client/internal/_client.d.ts.map +1 -0
  131. package/types/src/client/internal/_createOrUpdateRegistrationDescription.d.ts +8 -0
  132. package/types/src/client/internal/_createOrUpdateRegistrationDescription.d.ts.map +1 -0
  133. package/types/src/client/internal/_scheduleNotificationPayload.d.ts +9 -0
  134. package/types/src/client/internal/_scheduleNotificationPayload.d.ts.map +1 -0
  135. package/types/src/client/internal/_sendNotificationPayload.d.ts +10 -0
  136. package/types/src/client/internal/_sendNotificationPayload.d.ts.map +1 -0
  137. package/types/src/client/listNotificationHubJobs.d.ts +11 -0
  138. package/types/src/client/listNotificationHubJobs.d.ts.map +1 -0
  139. package/types/src/client/listRegistrations.d.ts +12 -0
  140. package/types/src/client/listRegistrations.d.ts.map +1 -0
  141. package/types/src/client/listRegistrationsByTag.d.ts +13 -0
  142. package/types/src/client/listRegistrationsByTag.d.ts.map +1 -0
  143. package/types/src/client/scheduleBroadcastNotification.d.ts +16 -0
  144. package/types/src/client/scheduleBroadcastNotification.d.ts.map +1 -0
  145. package/types/src/client/scheduleNotification.d.ts +17 -0
  146. package/types/src/client/scheduleNotification.d.ts.map +1 -0
  147. package/types/src/client/sendBroadcastNotification.d.ts +14 -0
  148. package/types/src/client/sendBroadcastNotification.d.ts.map +1 -0
  149. package/types/src/client/sendDirectNotification.d.ts +16 -0
  150. package/types/src/client/sendDirectNotification.d.ts.map +1 -0
  151. package/types/src/client/sendNotification.d.ts +15 -0
  152. package/types/src/client/sendNotification.d.ts.map +1 -0
  153. package/types/src/client/submitNotificationHubJob.d.ts +13 -0
  154. package/types/src/client/submitNotificationHubJob.d.ts.map +1 -0
  155. package/types/src/client/updateInstallation.d.ts +14 -0
  156. package/types/src/client/updateInstallation.d.ts.map +1 -0
  157. package/types/src/client/updateRegistration.d.ts +12 -0
  158. package/types/src/client/updateRegistration.d.ts.map +1 -0
  159. package/types/src/index.d.ts +10 -0
  160. package/types/src/index.d.ts.map +1 -0
  161. package/types/src/models/installation.d.ts +200 -0
  162. package/types/src/models/installation.d.ts.map +1 -0
  163. package/types/src/models/notification.d.ts +166 -0
  164. package/types/src/models/notification.d.ts.map +1 -0
  165. package/types/src/models/notificationBuilder.d.ts +546 -0
  166. package/types/src/models/notificationBuilder.d.ts.map +1 -0
  167. package/types/src/models/notificationDetails.d.ts +87 -0
  168. package/types/src/models/notificationDetails.d.ts.map +1 -0
  169. package/types/src/models/notificationHubJob.d.ts +104 -0
  170. package/types/src/models/notificationHubJob.d.ts.map +1 -0
  171. package/types/src/models/options.d.ts +43 -0
  172. package/types/src/models/options.d.ts.map +1 -0
  173. package/types/src/models/registration.d.ts +368 -0
  174. package/types/src/models/registration.d.ts.map +1 -0
  175. package/types/src/models/response.d.ts +41 -0
  176. package/types/src/models/response.d.ts.map +1 -0
  177. package/types/src/notificationHubsClient.d.ts +190 -0
  178. package/types/src/notificationHubsClient.d.ts.map +1 -0
  179. package/types/src/serializers/notificationDetailsSerializer.d.ts +7 -0
  180. package/types/src/serializers/notificationDetailsSerializer.d.ts.map +1 -0
  181. package/types/src/serializers/notificationHubJobSerializer.d.ts +21 -0
  182. package/types/src/serializers/notificationHubJobSerializer.d.ts.map +1 -0
  183. package/types/src/serializers/registrationSerializer.d.ts +193 -0
  184. package/types/src/serializers/registrationSerializer.d.ts.map +1 -0
  185. package/types/src/utils/connectionStringUtils.d.ts +37 -0
  186. package/types/src/utils/connectionStringUtils.d.ts.map +1 -0
  187. package/types/src/utils/constants.d.ts +9 -0
  188. package/types/src/utils/constants.d.ts.map +1 -0
  189. package/types/src/utils/retryPolicy.d.ts +72 -0
  190. package/types/src/utils/retryPolicy.d.ts.map +1 -0
  191. package/types/src/utils/tracing.d.ts +6 -0
  192. package/types/src/utils/tracing.d.ts.map +1 -0
  193. package/types/src/utils/utils.d.ts +65 -0
  194. package/types/src/utils/utils.d.ts.map +1 -0
  195. package/types/src/utils/xmlUtils.d.ts +46 -0
  196. package/types/src/utils/xmlUtils.d.ts.map +1 -0
@@ -0,0 +1,200 @@
1
+ /**
2
+ * Represents an installation for a device for Notification Hubs.
3
+ */
4
+ export interface InstallationCommon {
5
+ /**
6
+ * The ID for the installation.
7
+ */
8
+ installationId: string;
9
+ /**
10
+ * The User ID for the installation used for targeting.
11
+ */
12
+ userId?: string;
13
+ /**
14
+ * The installation expiration time.
15
+ */
16
+ readonly expirationTime?: string;
17
+ /**
18
+ * The last update date of the installation.
19
+ */
20
+ readonly lastUpdate?: string;
21
+ /**
22
+ * The platform for the installation.
23
+ */
24
+ platform: "apns" | "adm" | "baidu" | "browser" | "gcm" | "wns";
25
+ /**
26
+ * The tags used for targeting this installation.
27
+ */
28
+ tags?: string[];
29
+ /**
30
+ * The templates for the installation.
31
+ */
32
+ templates?: Record<string, InstallationTemplate>;
33
+ }
34
+ /**
35
+ * Represents an installation with a string based device token.
36
+ */
37
+ export interface DeviceTokenInstallation extends InstallationCommon {
38
+ /**
39
+ * The push channel for a device.
40
+ */
41
+ pushChannel: string;
42
+ }
43
+ /**
44
+ * Represents an Apple APNs based installation.
45
+ */
46
+ export interface AppleInstallation extends DeviceTokenInstallation {
47
+ /**
48
+ * The platform for the installation.
49
+ */
50
+ platform: "apns";
51
+ }
52
+ /**
53
+ * Creates an Apple based installation.
54
+ * @param installation - A partial installation used to create the Apple installation.
55
+ * @returns The newly created Apple installation.
56
+ */
57
+ export declare function createAppleInstallation(installation: Omit<AppleInstallation, "platform">): AppleInstallation;
58
+ /**
59
+ * Represents an Amazon Device Messaging (ADM) based installation.
60
+ */
61
+ export interface AdmInstallation extends DeviceTokenInstallation {
62
+ /**
63
+ * The platform for the installation.
64
+ */
65
+ platform: "adm";
66
+ }
67
+ /**
68
+ * Creates an Amazon Device Messaging (ADM) based installation.
69
+ * @param installation - A partial installation used to create the ADM installation.
70
+ * @returns The newly created ADM installation.
71
+ */
72
+ export declare function createAdmInstallation(installation: Omit<AdmInstallation, "platform">): AdmInstallation;
73
+ /**
74
+ * Represents a Baidu based installation.
75
+ */
76
+ export interface BaiduInstallation extends DeviceTokenInstallation {
77
+ /**
78
+ * The platform for the installation.
79
+ */
80
+ platform: "baidu";
81
+ }
82
+ /**
83
+ * Creates a Baidu based installation.
84
+ * @param installation - A partial installation used to create the Baidu installation.
85
+ * @returns The newly created Baidu installation.
86
+ */
87
+ export declare function createBaiduInstallation(installation: Omit<BaiduInstallation, "platform">): BaiduInstallation;
88
+ /**
89
+ * Represents a Firebase Legacy HTTP installation.
90
+ */
91
+ export interface FirebaseLegacyInstallation extends DeviceTokenInstallation {
92
+ /**
93
+ * The platform for the installation.
94
+ */
95
+ platform: "gcm";
96
+ }
97
+ /**
98
+ * Creates a Firebase legacy HTTP based installation.
99
+ * @param installation - A partial installation used to create the Firebase Legacy HTTP installation.
100
+ * @returns The newly created Baidu installation.
101
+ */
102
+ export declare function createFirebaseLegacyInstallation(installation: Omit<FirebaseLegacyInstallation, "platform">): FirebaseLegacyInstallation;
103
+ /**
104
+ * Represents a Windows Notification Services (WNS) based installation.
105
+ */
106
+ export interface WindowsInstallation extends DeviceTokenInstallation {
107
+ /**
108
+ * The platform for the installation.
109
+ */
110
+ platform: "wns";
111
+ }
112
+ /**
113
+ * Creates a Windows Notification Services (WNS) based installation.
114
+ * @param installation - A partial installation used to create the WNS installation.
115
+ * @returns The newly created WNS installation.
116
+ */
117
+ export declare function createWindowsInstallation(installation: Omit<WindowsInstallation, "platform">): WindowsInstallation;
118
+ /**
119
+ * Represents the push channel for a Browser Push installation.
120
+ */
121
+ export interface BrowserPushChannel {
122
+ /**
123
+ * The P256DH for the browser push installation.
124
+ */
125
+ p256dh: string;
126
+ /**
127
+ * The auth secret for the browser push installation.
128
+ */
129
+ auth: string;
130
+ /**
131
+ * The endpoint URL for the browser push installation.
132
+ */
133
+ endpoint: string;
134
+ }
135
+ /**
136
+ * Represents a Browser/Web Push based installation.
137
+ */
138
+ export interface BrowserInstallation extends InstallationCommon {
139
+ /**
140
+ * The push channel for the Web Push API.
141
+ */
142
+ pushChannel: BrowserPushChannel;
143
+ /**
144
+ * The platform for the installation.
145
+ */
146
+ platform: "browser";
147
+ }
148
+ /**
149
+ * Creates a Web Push based installation.
150
+ * @param installation - A partial installation used to create the Web Push installation.
151
+ * @returns The newly created Web Push installation.
152
+ */
153
+ export declare function createBrowserInstallation(installation: Omit<BrowserInstallation, "platform">): BrowserInstallation;
154
+ /**
155
+ * Represents the types of installations available in Notification Hubs.
156
+ */
157
+ export declare type Installation = AppleInstallation | AdmInstallation | BaiduInstallation | BrowserInstallation | FirebaseLegacyInstallation | WindowsInstallation;
158
+ /**
159
+ * Represents an installation template.
160
+ */
161
+ export interface InstallationTemplate {
162
+ /**
163
+ * The body for the installation template.
164
+ */
165
+ body: string;
166
+ /**
167
+ * Headers to include for the template send.
168
+ */
169
+ headers: Record<string, string>;
170
+ /**
171
+ * The tags to include for the template.
172
+ */
173
+ tags?: string[];
174
+ }
175
+ /**
176
+ * Represents the JSON Patch types of add, remove and replace.
177
+ */
178
+ export declare type JsonPatchOperation = "add" | "remove" | "replace";
179
+ /**
180
+ * Represents a patch operation.
181
+ */
182
+ export interface JsonPatch {
183
+ /**
184
+ * The patch operation.
185
+ */
186
+ op: JsonPatchOperation;
187
+ /**
188
+ * The path for the patch operation.
189
+ */
190
+ path: string;
191
+ /**
192
+ * The value to add or replace for the operation.
193
+ */
194
+ value?: string;
195
+ }
196
+ /**
197
+ * Represents the types of push channels available for Notification Hubs.
198
+ */
199
+ export declare type PushHandle = BrowserPushChannel | string;
200
+ //# sourceMappingURL=installation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../../../src/models/installation.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAEjC;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,QAAQ,EAAE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B,GAAG,MAAM,CAAC"}
@@ -0,0 +1,166 @@
1
+ /**
2
+ * Represents a notification hub.
3
+ */
4
+ export interface NotificationCommon {
5
+ /**
6
+ * The body for the push notification.
7
+ */
8
+ body: string;
9
+ /**
10
+ * The headers to include for the push notification.
11
+ */
12
+ headers?: Record<string, string>;
13
+ /**
14
+ * The platform for the push notification.
15
+ */
16
+ platform: string;
17
+ /**
18
+ * The content type for the push notification.
19
+ */
20
+ contentType: string;
21
+ }
22
+ /**
23
+ * Represents a JSON notification hub.
24
+ */
25
+ export interface JsonNotification extends NotificationCommon {
26
+ /**
27
+ * The content type for the push notification.
28
+ */
29
+ contentType: "application/json;charset=utf-8";
30
+ }
31
+ /**
32
+ * Represents an Apple APNs push notification.
33
+ */
34
+ export interface AppleNotification extends JsonNotification {
35
+ /**
36
+ * The platform for the push notification.
37
+ */
38
+ platform: "apple";
39
+ }
40
+ /**
41
+ * Creates a notification to send to an Apple device.
42
+ * @param notification - A partial message used to create a message for Apple.
43
+ * @returns A newly created Apple.
44
+ */
45
+ export declare function createAppleNotification(notification: Omit<AppleNotification, "platform" | "contentType">): AppleNotification;
46
+ /**
47
+ * Represents an Amazon Device Messaging (ADM) push notification.
48
+ */
49
+ export interface AdmNotification extends JsonNotification {
50
+ /**
51
+ * The platform for the push notification.
52
+ */
53
+ platform: "adm";
54
+ }
55
+ /**
56
+ * Creates a notification to send to an Amazon Device Messaging device.
57
+ * @param notification - A partial message used to create a message for Amazon Device Messaging.
58
+ * @returns A newly created Amazon Device Messaging.
59
+ */
60
+ export declare function createAdmNotification(notification: Omit<AdmNotification, "platform" | "contentType">): AdmNotification;
61
+ /**
62
+ * Represents a Baidu push notification.
63
+ */
64
+ export interface BaiduNotification extends JsonNotification {
65
+ /**
66
+ * The platform for the push notification.
67
+ */
68
+ platform: "baidu";
69
+ }
70
+ /**
71
+ * Creates a notification to send to a Baidu registered device.
72
+ * @param notification - A partial message used to create a message for Baidu.
73
+ * @returns A newly created Baidu.
74
+ */
75
+ export declare function createBaiduNotification(notification: Omit<BaiduNotification, "platform" | "contentType">): BaiduNotification;
76
+ /**
77
+ * Represents a Browser push notification.
78
+ */
79
+ export interface BrowserNotification extends JsonNotification {
80
+ /**
81
+ * The platform for the push notification.
82
+ */
83
+ platform: "browser";
84
+ }
85
+ /**
86
+ * Creates a notification to send to a browser.
87
+ * @param notification - A partial message used to create a message for a browser.
88
+ * @returns A newly created Web Push browser.
89
+ */
90
+ export declare function createBrowserNotification(notification: Omit<BrowserNotification, "platform" | "contentType">): BrowserNotification;
91
+ /**
92
+ * Represents a Firebase legacy HTTP push notification.
93
+ */
94
+ export interface FirebaseLegacyNotification extends JsonNotification {
95
+ /**
96
+ * The platform for the push notification.
97
+ */
98
+ platform: "gcm";
99
+ }
100
+ /**
101
+ * Creates a notification to send to Firebase.
102
+ * @param notification - A partial message used to create a message for Firebase.
103
+ * @returns A newly created Firebase.
104
+ */
105
+ export declare function createFirebaseLegacyNotification(notification: Omit<FirebaseLegacyNotification, "platform" | "contentType">): FirebaseLegacyNotification;
106
+ /**
107
+ * Represents a template based push notification.
108
+ */
109
+ export interface TemplateNotification extends JsonNotification {
110
+ /**
111
+ * The platform for the push notification.
112
+ */
113
+ platform: "template";
114
+ }
115
+ /**
116
+ * Creates a notification to send to Firebase.
117
+ * @param notification - A partial message used to create a message for Firebase.
118
+ * @returns A newly created Firebase.
119
+ */
120
+ export declare function createTemplateNotification(notification: Omit<TemplateNotification, "platform" | "contentType">): TemplateNotification;
121
+ /**
122
+ * Represents the possible WNS content-types.
123
+ */
124
+ export declare type WindowsContentType = "application/xml" | "application/octet-stream";
125
+ /**
126
+ * Represents a Windows Notification Services (WNS) push notification.
127
+ */
128
+ export interface WindowsNotification extends NotificationCommon {
129
+ /**
130
+ * The platform for the push notification.
131
+ */
132
+ platform: "wns";
133
+ /**
134
+ * The content type for the push notification.
135
+ */
136
+ contentType: WindowsContentType;
137
+ }
138
+ /**
139
+ * Creates a badge message to send to WNS.
140
+ * @param notification - A partial message used to create a badge message for WNS.
141
+ * @returns A newly created WNS badge.
142
+ */
143
+ export declare function createWindowsBadgeNotification(notification: Omit<WindowsNotification, "platform" | "contentType">): WindowsNotification;
144
+ /**
145
+ * Creates a tile message to send to WNS.
146
+ * @param notification - A partial message used to create a tile message for WNS.
147
+ * @returns A newly created WNS tile.
148
+ */
149
+ export declare function createWindowsTileNotification(notification: Omit<WindowsNotification, "platform" | "contentType">): WindowsNotification;
150
+ /**
151
+ * Creates a toast message to send to WNS.
152
+ * @param notification - A partial message used to create a toast message for WNS.
153
+ * @returns A newly created WNS toast.
154
+ */
155
+ export declare function createWindowsToastNotification(notification: Omit<WindowsNotification, "platform" | "contentType">): WindowsNotification;
156
+ /**
157
+ * Creates a notification to send to WNS in wns/raw format..
158
+ * @param notification - A partial message used to create a message for WNS in XML format.
159
+ * @returns A newly created WNS message using XML.
160
+ */
161
+ export declare function createWindowsRawNotification(notification: Omit<WindowsNotification, "platform" | "contentType">): WindowsNotification;
162
+ /**
163
+ * Represents the possible push notification messages types.
164
+ */
165
+ export declare type Notification = AppleNotification | AdmNotification | BaiduNotification | BrowserNotification | FirebaseLegacyNotification | WindowsNotification | TemplateNotification;
166
+ //# sourceMappingURL=notification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../../src/models/notification.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEjC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;IAC1D;;OAEG;IACH,WAAW,EAAE,gCAAgC,CAAC;CAC/C;AAED;;GAEG;AACH,MAA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