@azure/notification-hubs 1.2.4-alpha.20240826.1 → 1.2.4-alpha.20240827.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 (441) hide show
  1. package/dist/browser/api/beginSubmitNotificationHubJob.js +1 -1
  2. package/dist/browser/api/beginSubmitNotificationHubJob.js.map +1 -1
  3. package/dist/browser/api/cancelScheduledNotification.js +1 -1
  4. package/dist/browser/api/cancelScheduledNotification.js.map +1 -1
  5. package/dist/browser/api/clientContext.js +1 -1
  6. package/dist/browser/api/clientContext.js.map +1 -1
  7. package/dist/browser/api/createOrUpdateInstallation.js +1 -1
  8. package/dist/browser/api/createOrUpdateInstallation.js.map +1 -1
  9. package/dist/browser/api/createOrUpdateRegistration.js +1 -1
  10. package/dist/browser/api/createOrUpdateRegistration.js.map +1 -1
  11. package/dist/browser/api/createRegistration.js +1 -1
  12. package/dist/browser/api/createRegistration.js.map +1 -1
  13. package/dist/browser/api/createRegistrationId.js +1 -1
  14. package/dist/browser/api/createRegistrationId.js.map +1 -1
  15. package/dist/browser/api/deleteInstallation.js +1 -1
  16. package/dist/browser/api/deleteInstallation.js.map +1 -1
  17. package/dist/browser/api/deleteRegistration.js +1 -1
  18. package/dist/browser/api/deleteRegistration.js.map +1 -1
  19. package/dist/browser/api/getFeedbackContainerUrl.js +1 -1
  20. package/dist/browser/api/getFeedbackContainerUrl.js.map +1 -1
  21. package/dist/browser/api/getInstallation.js +1 -1
  22. package/dist/browser/api/getInstallation.js.map +1 -1
  23. package/dist/browser/api/getNotificationHubJob.js +1 -1
  24. package/dist/browser/api/getNotificationHubJob.js.map +1 -1
  25. package/dist/browser/api/getNotificationOutcomeDetails.js +1 -1
  26. package/dist/browser/api/getNotificationOutcomeDetails.js.map +1 -1
  27. package/dist/browser/api/getRegistration.js +1 -1
  28. package/dist/browser/api/getRegistration.js.map +1 -1
  29. package/dist/browser/api/index.js +1 -1
  30. package/dist/browser/api/index.js.map +1 -1
  31. package/dist/browser/api/internal/_client.js +1 -1
  32. package/dist/browser/api/internal/_client.js.map +1 -1
  33. package/dist/browser/api/internal/_createOrUpdateRegistrationDescription.js +1 -1
  34. package/dist/browser/api/internal/_createOrUpdateRegistrationDescription.js.map +1 -1
  35. package/dist/browser/api/internal/_listRegistrations.js +1 -1
  36. package/dist/browser/api/internal/_listRegistrations.js.map +1 -1
  37. package/dist/browser/api/listNotificationHubJobs.js +1 -1
  38. package/dist/browser/api/listNotificationHubJobs.js.map +1 -1
  39. package/dist/browser/api/listRegistrations.js +1 -1
  40. package/dist/browser/api/listRegistrations.js.map +1 -1
  41. package/dist/browser/api/listRegistrationsByChannel.js +1 -1
  42. package/dist/browser/api/listRegistrationsByChannel.js.map +1 -1
  43. package/dist/browser/api/listRegistrationsByTag.js +1 -1
  44. package/dist/browser/api/listRegistrationsByTag.js.map +1 -1
  45. package/dist/browser/api/scheduleNotification.js +1 -1
  46. package/dist/browser/api/scheduleNotification.js.map +1 -1
  47. package/dist/browser/api/sendNotification.js +1 -1
  48. package/dist/browser/api/sendNotification.js.map +1 -1
  49. package/dist/browser/api/submitNotificationHubJob.js +1 -1
  50. package/dist/browser/api/submitNotificationHubJob.js.map +1 -1
  51. package/dist/browser/api/updateInstallation.js +1 -1
  52. package/dist/browser/api/updateInstallation.js.map +1 -1
  53. package/dist/browser/api/updateRegistration.js +1 -1
  54. package/dist/browser/api/updateRegistration.js.map +1 -1
  55. package/dist/browser/auth/connectionStringUtils.js +1 -1
  56. package/dist/browser/auth/connectionStringUtils.js.map +1 -1
  57. package/dist/browser/auth/hmacSha256-browser.mjs.map +1 -1
  58. package/dist/browser/auth/hmacSha256.common.js +1 -1
  59. package/dist/browser/auth/hmacSha256.common.js.map +1 -1
  60. package/dist/browser/auth/hmacSha256.js +1 -1
  61. package/dist/browser/auth/sasTokenCredential.js +1 -1
  62. package/dist/browser/auth/sasTokenCredential.js.map +1 -1
  63. package/dist/browser/index.js +1 -1
  64. package/dist/browser/index.js.map +1 -1
  65. package/dist/browser/models/index.js +1 -1
  66. package/dist/browser/models/index.js.map +1 -1
  67. package/dist/browser/models/installation.js +1 -1
  68. package/dist/browser/models/installation.js.map +1 -1
  69. package/dist/browser/models/notification.js +1 -1
  70. package/dist/browser/models/notification.js.map +1 -1
  71. package/dist/browser/models/notificationBodyBuilder.js +1 -1
  72. package/dist/browser/models/notificationBodyBuilder.js.map +1 -1
  73. package/dist/browser/models/notificationDetails.js +1 -1
  74. package/dist/browser/models/notificationDetails.js.map +1 -1
  75. package/dist/browser/models/notificationHeaderBuilder.js +1 -1
  76. package/dist/browser/models/notificationHeaderBuilder.js.map +1 -1
  77. package/dist/browser/models/notificationHubJob.js +1 -1
  78. package/dist/browser/models/notificationHubJob.js.map +1 -1
  79. package/dist/browser/models/options.js +1 -1
  80. package/dist/browser/models/options.js.map +1 -1
  81. package/dist/browser/models/registration.js +1 -1
  82. package/dist/browser/models/registration.js.map +1 -1
  83. package/dist/browser/models/response.js +1 -1
  84. package/dist/browser/models/response.js.map +1 -1
  85. package/dist/browser/models/tagExpressionBuilder.js +1 -1
  86. package/dist/browser/models/tagExpressionBuilder.js.map +1 -1
  87. package/dist/browser/notificationHubsClient.js +1 -1
  88. package/dist/browser/notificationHubsClient.js.map +1 -1
  89. package/dist/browser/serializers/notificationDetailsSerializer.js +1 -1
  90. package/dist/browser/serializers/notificationDetailsSerializer.js.map +1 -1
  91. package/dist/browser/serializers/notificationHubJobSerializer.js +1 -1
  92. package/dist/browser/serializers/notificationHubJobSerializer.js.map +1 -1
  93. package/dist/browser/serializers/notificationOutcomeSerializer.js +1 -1
  94. package/dist/browser/serializers/notificationOutcomeSerializer.js.map +1 -1
  95. package/dist/browser/serializers/registrationSerializer.js +1 -1
  96. package/dist/browser/serializers/registrationSerializer.js.map +1 -1
  97. package/dist/browser/utils/constants.js +1 -1
  98. package/dist/browser/utils/constants.js.map +1 -1
  99. package/dist/browser/utils/notificationUtils.js +1 -1
  100. package/dist/browser/utils/notificationUtils.js.map +1 -1
  101. package/dist/browser/utils/optionUtils.js +1 -1
  102. package/dist/browser/utils/optionUtils.js.map +1 -1
  103. package/dist/browser/utils/registrationUtils.js +1 -1
  104. package/dist/browser/utils/registrationUtils.js.map +1 -1
  105. package/dist/browser/utils/tracing.js +1 -1
  106. package/dist/browser/utils/tracing.js.map +1 -1
  107. package/dist/browser/utils/utils.js +1 -1
  108. package/dist/browser/utils/utils.js.map +1 -1
  109. package/dist/browser/utils/xmlUtils.js +1 -1
  110. package/dist/browser/utils/xmlUtils.js.map +1 -1
  111. package/dist/commonjs/api/beginSubmitNotificationHubJob.js +1 -1
  112. package/dist/commonjs/api/beginSubmitNotificationHubJob.js.map +1 -1
  113. package/dist/commonjs/api/cancelScheduledNotification.js +1 -1
  114. package/dist/commonjs/api/cancelScheduledNotification.js.map +1 -1
  115. package/dist/commonjs/api/clientContext.js +1 -1
  116. package/dist/commonjs/api/clientContext.js.map +1 -1
  117. package/dist/commonjs/api/createOrUpdateInstallation.js +1 -1
  118. package/dist/commonjs/api/createOrUpdateInstallation.js.map +1 -1
  119. package/dist/commonjs/api/createOrUpdateRegistration.js +1 -1
  120. package/dist/commonjs/api/createOrUpdateRegistration.js.map +1 -1
  121. package/dist/commonjs/api/createRegistration.js +1 -1
  122. package/dist/commonjs/api/createRegistration.js.map +1 -1
  123. package/dist/commonjs/api/createRegistrationId.js +1 -1
  124. package/dist/commonjs/api/createRegistrationId.js.map +1 -1
  125. package/dist/commonjs/api/deleteInstallation.js +1 -1
  126. package/dist/commonjs/api/deleteInstallation.js.map +1 -1
  127. package/dist/commonjs/api/deleteRegistration.js +1 -1
  128. package/dist/commonjs/api/deleteRegistration.js.map +1 -1
  129. package/dist/commonjs/api/getFeedbackContainerUrl.js +1 -1
  130. package/dist/commonjs/api/getFeedbackContainerUrl.js.map +1 -1
  131. package/dist/commonjs/api/getInstallation.js +1 -1
  132. package/dist/commonjs/api/getInstallation.js.map +1 -1
  133. package/dist/commonjs/api/getNotificationHubJob.js +1 -1
  134. package/dist/commonjs/api/getNotificationHubJob.js.map +1 -1
  135. package/dist/commonjs/api/getNotificationOutcomeDetails.js +1 -1
  136. package/dist/commonjs/api/getNotificationOutcomeDetails.js.map +1 -1
  137. package/dist/commonjs/api/getRegistration.js +1 -1
  138. package/dist/commonjs/api/getRegistration.js.map +1 -1
  139. package/dist/commonjs/api/index.js +1 -1
  140. package/dist/commonjs/api/index.js.map +1 -1
  141. package/dist/commonjs/api/internal/_client.js +1 -1
  142. package/dist/commonjs/api/internal/_client.js.map +1 -1
  143. package/dist/commonjs/api/internal/_createOrUpdateRegistrationDescription.js +1 -1
  144. package/dist/commonjs/api/internal/_createOrUpdateRegistrationDescription.js.map +1 -1
  145. package/dist/commonjs/api/internal/_listRegistrations.js +1 -1
  146. package/dist/commonjs/api/internal/_listRegistrations.js.map +1 -1
  147. package/dist/commonjs/api/listNotificationHubJobs.js +1 -1
  148. package/dist/commonjs/api/listNotificationHubJobs.js.map +1 -1
  149. package/dist/commonjs/api/listRegistrations.js +1 -1
  150. package/dist/commonjs/api/listRegistrations.js.map +1 -1
  151. package/dist/commonjs/api/listRegistrationsByChannel.js +1 -1
  152. package/dist/commonjs/api/listRegistrationsByChannel.js.map +1 -1
  153. package/dist/commonjs/api/listRegistrationsByTag.js +1 -1
  154. package/dist/commonjs/api/listRegistrationsByTag.js.map +1 -1
  155. package/dist/commonjs/api/scheduleNotification.js +1 -1
  156. package/dist/commonjs/api/scheduleNotification.js.map +1 -1
  157. package/dist/commonjs/api/sendNotification.js +1 -1
  158. package/dist/commonjs/api/sendNotification.js.map +1 -1
  159. package/dist/commonjs/api/submitNotificationHubJob.js +1 -1
  160. package/dist/commonjs/api/submitNotificationHubJob.js.map +1 -1
  161. package/dist/commonjs/api/updateInstallation.js +1 -1
  162. package/dist/commonjs/api/updateInstallation.js.map +1 -1
  163. package/dist/commonjs/api/updateRegistration.js +1 -1
  164. package/dist/commonjs/api/updateRegistration.js.map +1 -1
  165. package/dist/commonjs/auth/connectionStringUtils.js +1 -1
  166. package/dist/commonjs/auth/connectionStringUtils.js.map +1 -1
  167. package/dist/commonjs/auth/hmacSha256.common.js +1 -1
  168. package/dist/commonjs/auth/hmacSha256.common.js.map +1 -1
  169. package/dist/commonjs/auth/hmacSha256.js +1 -1
  170. package/dist/commonjs/auth/hmacSha256.js.map +1 -1
  171. package/dist/commonjs/auth/sasTokenCredential.js +1 -1
  172. package/dist/commonjs/auth/sasTokenCredential.js.map +1 -1
  173. package/dist/commonjs/index.js +1 -1
  174. package/dist/commonjs/index.js.map +1 -1
  175. package/dist/commonjs/models/index.js +1 -1
  176. package/dist/commonjs/models/index.js.map +1 -1
  177. package/dist/commonjs/models/installation.js +1 -1
  178. package/dist/commonjs/models/installation.js.map +1 -1
  179. package/dist/commonjs/models/notification.js +1 -1
  180. package/dist/commonjs/models/notification.js.map +1 -1
  181. package/dist/commonjs/models/notificationBodyBuilder.js +1 -1
  182. package/dist/commonjs/models/notificationBodyBuilder.js.map +1 -1
  183. package/dist/commonjs/models/notificationDetails.js +1 -1
  184. package/dist/commonjs/models/notificationDetails.js.map +1 -1
  185. package/dist/commonjs/models/notificationHeaderBuilder.js +1 -1
  186. package/dist/commonjs/models/notificationHeaderBuilder.js.map +1 -1
  187. package/dist/commonjs/models/notificationHubJob.js +1 -1
  188. package/dist/commonjs/models/notificationHubJob.js.map +1 -1
  189. package/dist/commonjs/models/options.js +1 -1
  190. package/dist/commonjs/models/options.js.map +1 -1
  191. package/dist/commonjs/models/registration.js +1 -1
  192. package/dist/commonjs/models/registration.js.map +1 -1
  193. package/dist/commonjs/models/response.js +1 -1
  194. package/dist/commonjs/models/response.js.map +1 -1
  195. package/dist/commonjs/models/tagExpressionBuilder.js +1 -1
  196. package/dist/commonjs/models/tagExpressionBuilder.js.map +1 -1
  197. package/dist/commonjs/notificationHubsClient.js +1 -1
  198. package/dist/commonjs/notificationHubsClient.js.map +1 -1
  199. package/dist/commonjs/serializers/notificationDetailsSerializer.js +1 -1
  200. package/dist/commonjs/serializers/notificationDetailsSerializer.js.map +1 -1
  201. package/dist/commonjs/serializers/notificationHubJobSerializer.js +1 -1
  202. package/dist/commonjs/serializers/notificationHubJobSerializer.js.map +1 -1
  203. package/dist/commonjs/serializers/notificationOutcomeSerializer.js +1 -1
  204. package/dist/commonjs/serializers/notificationOutcomeSerializer.js.map +1 -1
  205. package/dist/commonjs/serializers/registrationSerializer.js +1 -1
  206. package/dist/commonjs/serializers/registrationSerializer.js.map +1 -1
  207. package/dist/commonjs/utils/constants.js +1 -1
  208. package/dist/commonjs/utils/constants.js.map +1 -1
  209. package/dist/commonjs/utils/notificationUtils.js +1 -1
  210. package/dist/commonjs/utils/notificationUtils.js.map +1 -1
  211. package/dist/commonjs/utils/optionUtils.js +1 -1
  212. package/dist/commonjs/utils/optionUtils.js.map +1 -1
  213. package/dist/commonjs/utils/registrationUtils.js +1 -1
  214. package/dist/commonjs/utils/registrationUtils.js.map +1 -1
  215. package/dist/commonjs/utils/tracing.js +1 -1
  216. package/dist/commonjs/utils/tracing.js.map +1 -1
  217. package/dist/commonjs/utils/utils.js +1 -1
  218. package/dist/commonjs/utils/utils.js.map +1 -1
  219. package/dist/commonjs/utils/xmlUtils.js +1 -1
  220. package/dist/commonjs/utils/xmlUtils.js.map +1 -1
  221. package/dist/esm/api/beginSubmitNotificationHubJob.js +1 -1
  222. package/dist/esm/api/beginSubmitNotificationHubJob.js.map +1 -1
  223. package/dist/esm/api/cancelScheduledNotification.js +1 -1
  224. package/dist/esm/api/cancelScheduledNotification.js.map +1 -1
  225. package/dist/esm/api/clientContext.js +1 -1
  226. package/dist/esm/api/clientContext.js.map +1 -1
  227. package/dist/esm/api/createOrUpdateInstallation.js +1 -1
  228. package/dist/esm/api/createOrUpdateInstallation.js.map +1 -1
  229. package/dist/esm/api/createOrUpdateRegistration.js +1 -1
  230. package/dist/esm/api/createOrUpdateRegistration.js.map +1 -1
  231. package/dist/esm/api/createRegistration.js +1 -1
  232. package/dist/esm/api/createRegistration.js.map +1 -1
  233. package/dist/esm/api/createRegistrationId.js +1 -1
  234. package/dist/esm/api/createRegistrationId.js.map +1 -1
  235. package/dist/esm/api/deleteInstallation.js +1 -1
  236. package/dist/esm/api/deleteInstallation.js.map +1 -1
  237. package/dist/esm/api/deleteRegistration.js +1 -1
  238. package/dist/esm/api/deleteRegistration.js.map +1 -1
  239. package/dist/esm/api/getFeedbackContainerUrl.js +1 -1
  240. package/dist/esm/api/getFeedbackContainerUrl.js.map +1 -1
  241. package/dist/esm/api/getInstallation.js +1 -1
  242. package/dist/esm/api/getInstallation.js.map +1 -1
  243. package/dist/esm/api/getNotificationHubJob.js +1 -1
  244. package/dist/esm/api/getNotificationHubJob.js.map +1 -1
  245. package/dist/esm/api/getNotificationOutcomeDetails.js +1 -1
  246. package/dist/esm/api/getNotificationOutcomeDetails.js.map +1 -1
  247. package/dist/esm/api/getRegistration.js +1 -1
  248. package/dist/esm/api/getRegistration.js.map +1 -1
  249. package/dist/esm/api/index.js +1 -1
  250. package/dist/esm/api/index.js.map +1 -1
  251. package/dist/esm/api/internal/_client.js +1 -1
  252. package/dist/esm/api/internal/_client.js.map +1 -1
  253. package/dist/esm/api/internal/_createOrUpdateRegistrationDescription.js +1 -1
  254. package/dist/esm/api/internal/_createOrUpdateRegistrationDescription.js.map +1 -1
  255. package/dist/esm/api/internal/_listRegistrations.js +1 -1
  256. package/dist/esm/api/internal/_listRegistrations.js.map +1 -1
  257. package/dist/esm/api/listNotificationHubJobs.js +1 -1
  258. package/dist/esm/api/listNotificationHubJobs.js.map +1 -1
  259. package/dist/esm/api/listRegistrations.js +1 -1
  260. package/dist/esm/api/listRegistrations.js.map +1 -1
  261. package/dist/esm/api/listRegistrationsByChannel.js +1 -1
  262. package/dist/esm/api/listRegistrationsByChannel.js.map +1 -1
  263. package/dist/esm/api/listRegistrationsByTag.js +1 -1
  264. package/dist/esm/api/listRegistrationsByTag.js.map +1 -1
  265. package/dist/esm/api/scheduleNotification.js +1 -1
  266. package/dist/esm/api/scheduleNotification.js.map +1 -1
  267. package/dist/esm/api/sendNotification.js +1 -1
  268. package/dist/esm/api/sendNotification.js.map +1 -1
  269. package/dist/esm/api/submitNotificationHubJob.js +1 -1
  270. package/dist/esm/api/submitNotificationHubJob.js.map +1 -1
  271. package/dist/esm/api/updateInstallation.js +1 -1
  272. package/dist/esm/api/updateInstallation.js.map +1 -1
  273. package/dist/esm/api/updateRegistration.js +1 -1
  274. package/dist/esm/api/updateRegistration.js.map +1 -1
  275. package/dist/esm/auth/connectionStringUtils.js +1 -1
  276. package/dist/esm/auth/connectionStringUtils.js.map +1 -1
  277. package/dist/esm/auth/hmacSha256.common.js +1 -1
  278. package/dist/esm/auth/hmacSha256.common.js.map +1 -1
  279. package/dist/esm/auth/hmacSha256.js +1 -1
  280. package/dist/esm/auth/hmacSha256.js.map +1 -1
  281. package/dist/esm/auth/sasTokenCredential.js +1 -1
  282. package/dist/esm/auth/sasTokenCredential.js.map +1 -1
  283. package/dist/esm/index.js +1 -1
  284. package/dist/esm/index.js.map +1 -1
  285. package/dist/esm/models/index.js +1 -1
  286. package/dist/esm/models/index.js.map +1 -1
  287. package/dist/esm/models/installation.js +1 -1
  288. package/dist/esm/models/installation.js.map +1 -1
  289. package/dist/esm/models/notification.js +1 -1
  290. package/dist/esm/models/notification.js.map +1 -1
  291. package/dist/esm/models/notificationBodyBuilder.js +1 -1
  292. package/dist/esm/models/notificationBodyBuilder.js.map +1 -1
  293. package/dist/esm/models/notificationDetails.js +1 -1
  294. package/dist/esm/models/notificationDetails.js.map +1 -1
  295. package/dist/esm/models/notificationHeaderBuilder.js +1 -1
  296. package/dist/esm/models/notificationHeaderBuilder.js.map +1 -1
  297. package/dist/esm/models/notificationHubJob.js +1 -1
  298. package/dist/esm/models/notificationHubJob.js.map +1 -1
  299. package/dist/esm/models/options.js +1 -1
  300. package/dist/esm/models/options.js.map +1 -1
  301. package/dist/esm/models/registration.js +1 -1
  302. package/dist/esm/models/registration.js.map +1 -1
  303. package/dist/esm/models/response.js +1 -1
  304. package/dist/esm/models/response.js.map +1 -1
  305. package/dist/esm/models/tagExpressionBuilder.js +1 -1
  306. package/dist/esm/models/tagExpressionBuilder.js.map +1 -1
  307. package/dist/esm/notificationHubsClient.js +1 -1
  308. package/dist/esm/notificationHubsClient.js.map +1 -1
  309. package/dist/esm/serializers/notificationDetailsSerializer.js +1 -1
  310. package/dist/esm/serializers/notificationDetailsSerializer.js.map +1 -1
  311. package/dist/esm/serializers/notificationHubJobSerializer.js +1 -1
  312. package/dist/esm/serializers/notificationHubJobSerializer.js.map +1 -1
  313. package/dist/esm/serializers/notificationOutcomeSerializer.js +1 -1
  314. package/dist/esm/serializers/notificationOutcomeSerializer.js.map +1 -1
  315. package/dist/esm/serializers/registrationSerializer.js +1 -1
  316. package/dist/esm/serializers/registrationSerializer.js.map +1 -1
  317. package/dist/esm/utils/constants.js +1 -1
  318. package/dist/esm/utils/constants.js.map +1 -1
  319. package/dist/esm/utils/notificationUtils.js +1 -1
  320. package/dist/esm/utils/notificationUtils.js.map +1 -1
  321. package/dist/esm/utils/optionUtils.js +1 -1
  322. package/dist/esm/utils/optionUtils.js.map +1 -1
  323. package/dist/esm/utils/registrationUtils.js +1 -1
  324. package/dist/esm/utils/registrationUtils.js.map +1 -1
  325. package/dist/esm/utils/tracing.js +1 -1
  326. package/dist/esm/utils/tracing.js.map +1 -1
  327. package/dist/esm/utils/utils.js +1 -1
  328. package/dist/esm/utils/utils.js.map +1 -1
  329. package/dist/esm/utils/xmlUtils.js +1 -1
  330. package/dist/esm/utils/xmlUtils.js.map +1 -1
  331. package/dist/react-native/api/beginSubmitNotificationHubJob.js +1 -1
  332. package/dist/react-native/api/beginSubmitNotificationHubJob.js.map +1 -1
  333. package/dist/react-native/api/cancelScheduledNotification.js +1 -1
  334. package/dist/react-native/api/cancelScheduledNotification.js.map +1 -1
  335. package/dist/react-native/api/clientContext.js +1 -1
  336. package/dist/react-native/api/clientContext.js.map +1 -1
  337. package/dist/react-native/api/createOrUpdateInstallation.js +1 -1
  338. package/dist/react-native/api/createOrUpdateInstallation.js.map +1 -1
  339. package/dist/react-native/api/createOrUpdateRegistration.js +1 -1
  340. package/dist/react-native/api/createOrUpdateRegistration.js.map +1 -1
  341. package/dist/react-native/api/createRegistration.js +1 -1
  342. package/dist/react-native/api/createRegistration.js.map +1 -1
  343. package/dist/react-native/api/createRegistrationId.js +1 -1
  344. package/dist/react-native/api/createRegistrationId.js.map +1 -1
  345. package/dist/react-native/api/deleteInstallation.js +1 -1
  346. package/dist/react-native/api/deleteInstallation.js.map +1 -1
  347. package/dist/react-native/api/deleteRegistration.js +1 -1
  348. package/dist/react-native/api/deleteRegistration.js.map +1 -1
  349. package/dist/react-native/api/getFeedbackContainerUrl.js +1 -1
  350. package/dist/react-native/api/getFeedbackContainerUrl.js.map +1 -1
  351. package/dist/react-native/api/getInstallation.js +1 -1
  352. package/dist/react-native/api/getInstallation.js.map +1 -1
  353. package/dist/react-native/api/getNotificationHubJob.js +1 -1
  354. package/dist/react-native/api/getNotificationHubJob.js.map +1 -1
  355. package/dist/react-native/api/getNotificationOutcomeDetails.js +1 -1
  356. package/dist/react-native/api/getNotificationOutcomeDetails.js.map +1 -1
  357. package/dist/react-native/api/getRegistration.js +1 -1
  358. package/dist/react-native/api/getRegistration.js.map +1 -1
  359. package/dist/react-native/api/index.js +1 -1
  360. package/dist/react-native/api/index.js.map +1 -1
  361. package/dist/react-native/api/internal/_client.js +1 -1
  362. package/dist/react-native/api/internal/_client.js.map +1 -1
  363. package/dist/react-native/api/internal/_createOrUpdateRegistrationDescription.js +1 -1
  364. package/dist/react-native/api/internal/_createOrUpdateRegistrationDescription.js.map +1 -1
  365. package/dist/react-native/api/internal/_listRegistrations.js +1 -1
  366. package/dist/react-native/api/internal/_listRegistrations.js.map +1 -1
  367. package/dist/react-native/api/listNotificationHubJobs.js +1 -1
  368. package/dist/react-native/api/listNotificationHubJobs.js.map +1 -1
  369. package/dist/react-native/api/listRegistrations.js +1 -1
  370. package/dist/react-native/api/listRegistrations.js.map +1 -1
  371. package/dist/react-native/api/listRegistrationsByChannel.js +1 -1
  372. package/dist/react-native/api/listRegistrationsByChannel.js.map +1 -1
  373. package/dist/react-native/api/listRegistrationsByTag.js +1 -1
  374. package/dist/react-native/api/listRegistrationsByTag.js.map +1 -1
  375. package/dist/react-native/api/scheduleNotification.js +1 -1
  376. package/dist/react-native/api/scheduleNotification.js.map +1 -1
  377. package/dist/react-native/api/sendNotification.js +1 -1
  378. package/dist/react-native/api/sendNotification.js.map +1 -1
  379. package/dist/react-native/api/submitNotificationHubJob.js +1 -1
  380. package/dist/react-native/api/submitNotificationHubJob.js.map +1 -1
  381. package/dist/react-native/api/updateInstallation.js +1 -1
  382. package/dist/react-native/api/updateInstallation.js.map +1 -1
  383. package/dist/react-native/api/updateRegistration.js +1 -1
  384. package/dist/react-native/api/updateRegistration.js.map +1 -1
  385. package/dist/react-native/auth/connectionStringUtils.js +1 -1
  386. package/dist/react-native/auth/connectionStringUtils.js.map +1 -1
  387. package/dist/react-native/auth/hmacSha256-react-native.mjs.map +1 -1
  388. package/dist/react-native/auth/hmacSha256.common.js +1 -1
  389. package/dist/react-native/auth/hmacSha256.common.js.map +1 -1
  390. package/dist/react-native/auth/hmacSha256.js +1 -1
  391. package/dist/react-native/auth/sasTokenCredential.js +1 -1
  392. package/dist/react-native/auth/sasTokenCredential.js.map +1 -1
  393. package/dist/react-native/index.js +1 -1
  394. package/dist/react-native/index.js.map +1 -1
  395. package/dist/react-native/models/index.js +1 -1
  396. package/dist/react-native/models/index.js.map +1 -1
  397. package/dist/react-native/models/installation.js +1 -1
  398. package/dist/react-native/models/installation.js.map +1 -1
  399. package/dist/react-native/models/notification.js +1 -1
  400. package/dist/react-native/models/notification.js.map +1 -1
  401. package/dist/react-native/models/notificationBodyBuilder.js +1 -1
  402. package/dist/react-native/models/notificationBodyBuilder.js.map +1 -1
  403. package/dist/react-native/models/notificationDetails.js +1 -1
  404. package/dist/react-native/models/notificationDetails.js.map +1 -1
  405. package/dist/react-native/models/notificationHeaderBuilder.js +1 -1
  406. package/dist/react-native/models/notificationHeaderBuilder.js.map +1 -1
  407. package/dist/react-native/models/notificationHubJob.js +1 -1
  408. package/dist/react-native/models/notificationHubJob.js.map +1 -1
  409. package/dist/react-native/models/options.js +1 -1
  410. package/dist/react-native/models/options.js.map +1 -1
  411. package/dist/react-native/models/registration.js +1 -1
  412. package/dist/react-native/models/registration.js.map +1 -1
  413. package/dist/react-native/models/response.js +1 -1
  414. package/dist/react-native/models/response.js.map +1 -1
  415. package/dist/react-native/models/tagExpressionBuilder.js +1 -1
  416. package/dist/react-native/models/tagExpressionBuilder.js.map +1 -1
  417. package/dist/react-native/notificationHubsClient.js +1 -1
  418. package/dist/react-native/notificationHubsClient.js.map +1 -1
  419. package/dist/react-native/serializers/notificationDetailsSerializer.js +1 -1
  420. package/dist/react-native/serializers/notificationDetailsSerializer.js.map +1 -1
  421. package/dist/react-native/serializers/notificationHubJobSerializer.js +1 -1
  422. package/dist/react-native/serializers/notificationHubJobSerializer.js.map +1 -1
  423. package/dist/react-native/serializers/notificationOutcomeSerializer.js +1 -1
  424. package/dist/react-native/serializers/notificationOutcomeSerializer.js.map +1 -1
  425. package/dist/react-native/serializers/registrationSerializer.js +1 -1
  426. package/dist/react-native/serializers/registrationSerializer.js.map +1 -1
  427. package/dist/react-native/utils/constants.js +1 -1
  428. package/dist/react-native/utils/constants.js.map +1 -1
  429. package/dist/react-native/utils/notificationUtils.js +1 -1
  430. package/dist/react-native/utils/notificationUtils.js.map +1 -1
  431. package/dist/react-native/utils/optionUtils.js +1 -1
  432. package/dist/react-native/utils/optionUtils.js.map +1 -1
  433. package/dist/react-native/utils/registrationUtils.js +1 -1
  434. package/dist/react-native/utils/registrationUtils.js.map +1 -1
  435. package/dist/react-native/utils/tracing.js +1 -1
  436. package/dist/react-native/utils/tracing.js.map +1 -1
  437. package/dist/react-native/utils/utils.js +1 -1
  438. package/dist/react-native/utils/utils.js.map +1 -1
  439. package/dist/react-native/utils/xmlUtils.js +1 -1
  440. package/dist/react-native/utils/xmlUtils.js.map +1 -1
  441. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  import { listRegistrationPagingPage, listRegistrationsAll } from "./internal/_listRegistrations.js";
4
4
  import { getFilterByChannel } from "../utils/registrationUtils.js";
5
5
  import { tracingClient } from "../utils/tracing.js";
@@ -1 +1 @@
1
- {"version":3,"file":"listRegistrationsByChannel.js","sourceRoot":"","sources":["../../../src/api/listRegistrationsByChannel.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAIpG,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CACxC,OAAsC,EACtC,OAA4B,EAC5B,UAAyC,EAAE;IAE3C,MAAM,UAAU,mCACX,OAAO,KACV,MAAM,EAAE,kBAAkB,CAAC,OAAO,CAAC,GACpC,CAAC;IACF,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,aAAa,CAAC,SAAS,CACtD,yDAAyD,EACzD,UAAU,CACX,CAAC;IACF,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,oBAAoB,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QAC3D,OAAO;YACL,IAAI;gBACF,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;YACrB,CAAC;YACD,CAAC,MAAM,CAAC,aAAa,CAAC;gBACpB,OAAO,IAAI,CAAC;YACd,CAAC;YACD,MAAM,EAAE,GAAG,EAAE;gBACX,OAAO,0BAA0B,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;YAC7D,CAAC;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;QAC9C,MAAM,CAAC,CAAC;IACV,CAAC;YAAS,CAAC;QACT,IAAI,CAAC,GAAG,EAAE,CAAC;IACb,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { RegistrationDescription, RegistrationChannel } from \"../models/registration.js\";\nimport { listRegistrationPagingPage, listRegistrationsAll } from \"./internal/_listRegistrations.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { RegistrationQueryLimitOptions } from \"../models/options.js\";\nimport { getFilterByChannel } from \"../utils/registrationUtils.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\n/**\n * Gets all registrations for the notification hub with the given device information and options.\n * @param context - The Notification Hubs client.\n * @param channel - The Registration channel information to query per PNS type.\n * @param options - The options for querying the registrations such as $top.\n * @returns A paged async iterable containing all of the registrations for the notification hub.\n */\nexport function listRegistrationsByChannel(\n context: NotificationHubsClientContext,\n channel: RegistrationChannel,\n options: RegistrationQueryLimitOptions = {},\n): PagedAsyncIterableIterator<RegistrationDescription> {\n const newOptions = {\n ...options,\n filter: getFilterByChannel(channel),\n };\n const { span, updatedOptions } = tracingClient.startSpan(\n \"NotificationHubsClientContext.listRegistrationsByDevice\",\n newOptions,\n );\n try {\n const iter = listRegistrationsAll(context, updatedOptions);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return listRegistrationPagingPage(context, updatedOptions);\n },\n };\n } catch (e: any) {\n span.setStatus({ status: \"error\", error: e });\n throw e;\n } finally {\n span.end();\n }\n}\n"]}
1
+ {"version":3,"file":"listRegistrationsByChannel.js","sourceRoot":"","sources":["../../../src/api/listRegistrationsByChannel.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAIpG,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CACxC,OAAsC,EACtC,OAA4B,EAC5B,UAAyC,EAAE;IAE3C,MAAM,UAAU,mCACX,OAAO,KACV,MAAM,EAAE,kBAAkB,CAAC,OAAO,CAAC,GACpC,CAAC;IACF,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,aAAa,CAAC,SAAS,CACtD,yDAAyD,EACzD,UAAU,CACX,CAAC;IACF,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,oBAAoB,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QAC3D,OAAO;YACL,IAAI;gBACF,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;YACrB,CAAC;YACD,CAAC,MAAM,CAAC,aAAa,CAAC;gBACpB,OAAO,IAAI,CAAC;YACd,CAAC;YACD,MAAM,EAAE,GAAG,EAAE;gBACX,OAAO,0BAA0B,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;YAC7D,CAAC;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;QAC9C,MAAM,CAAC,CAAC;IACV,CAAC;YAAS,CAAC;QACT,IAAI,CAAC,GAAG,EAAE,CAAC;IACb,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { RegistrationDescription, RegistrationChannel } from \"../models/registration.js\";\nimport { listRegistrationPagingPage, listRegistrationsAll } from \"./internal/_listRegistrations.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { RegistrationQueryLimitOptions } from \"../models/options.js\";\nimport { getFilterByChannel } from \"../utils/registrationUtils.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\n/**\n * Gets all registrations for the notification hub with the given device information and options.\n * @param context - The Notification Hubs client.\n * @param channel - The Registration channel information to query per PNS type.\n * @param options - The options for querying the registrations such as $top.\n * @returns A paged async iterable containing all of the registrations for the notification hub.\n */\nexport function listRegistrationsByChannel(\n context: NotificationHubsClientContext,\n channel: RegistrationChannel,\n options: RegistrationQueryLimitOptions = {},\n): PagedAsyncIterableIterator<RegistrationDescription> {\n const newOptions = {\n ...options,\n filter: getFilterByChannel(channel),\n };\n const { span, updatedOptions } = tracingClient.startSpan(\n \"NotificationHubsClientContext.listRegistrationsByDevice\",\n newOptions,\n );\n try {\n const iter = listRegistrationsAll(context, updatedOptions);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return listRegistrationPagingPage(context, updatedOptions);\n },\n };\n } catch (e: any) {\n span.setStatus({ status: \"error\", error: e });\n throw e;\n } finally {\n span.end();\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
4
4
  import { createRequest, sendRequest } from "./internal/_client.js";
5
5
  import { registrationDescriptionParser } from "../serializers/registrationSerializer.js";
@@ -1 +1 @@
1
- {"version":3,"file":"listRegistrationsByTag.js","sourceRoot":"","sources":["../../../src/api/listRegistrationsByTag.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAMnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,0CAA0C,CAAC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AW,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;IAE1D,MAAM,aAAa,GAAG,MAAM,6BAA6B,CAAC,qBAAqB,CAC7E,QAAQ,CAAC,UAAW,CACrB,CAAC;IACF,MAAM,SAAS,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IACjE,OAAO;QACL,aAAa;QACb,iBAAiB,EAAE,SAAS;KAC7B,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { RegistrationDescription } from \"../models/registration.js\";\nimport { RegistrationQueryLimitOptions } from \"../models/options.js\";\nimport { RegistrationQueryResponse } from \"../models/response.js\";\nimport { registrationDescriptionParser } from \"../serializers/registrationSerializer.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"listRegistrationsByTag\";\n\n/**\n * Lists all registrations with the matching tag.\n * @param context - The Notification Hubs client.\n * @param tag - The tag to query for matching registrations.\n * @param options - The query options such as $top.\n * @returns A paged async iterable containing the matching registrations for the notification hub.\n */\nexport function listRegistrationsByTag(\n context: NotificationHubsClientContext,\n tag: string,\n options: RegistrationQueryLimitOptions = {},\n): PagedAsyncIterableIterator<RegistrationDescription> {\n const { span, updatedOptions } = tracingClient.startSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n );\n try {\n const iter = listRegistrationsByTagAll(context, tag, updatedOptions);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return listRegistrationsByTagPagingPage(context, tag, options);\n },\n };\n } catch (e: any) {\n span.setStatus({ status: \"error\", error: e });\n throw e;\n } finally {\n span.end();\n }\n}\n\nasync function* listRegistrationsByTagAll(\n context: NotificationHubsClientContext,\n tag: string,\n options: RegistrationQueryLimitOptions,\n): AsyncIterableIterator<RegistrationDescription> {\n for await (const page of listRegistrationsByTagPagingPage(context, tag, options)) {\n yield* page;\n }\n}\n\nasync function* listRegistrationsByTagPagingPage(\n context: NotificationHubsClientContext,\n tag: string,\n options: RegistrationQueryLimitOptions,\n): AsyncIterableIterator<RegistrationDescription[]> {\n let result = await _listRegistrationsByTag(context, tag, options);\n yield result.registrations || [];\n let continuationToken = result.continuationToken;\n while (continuationToken) {\n result = await _listRegistrationsByTag(context, tag, options, continuationToken);\n continuationToken = result.continuationToken;\n yield result.registrations || [];\n }\n}\n\nasync function _listRegistrationsByTag(\n context: NotificationHubsClientContext,\n tag: string,\n options: RegistrationQueryLimitOptions,\n continuationToken?: string,\n): Promise<RegistrationQueryResponse> {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/tags/${tag}/registrations`;\n if (options.top !== undefined) {\n endpoint.searchParams.set(\"$top\", `${options.top}`);\n }\n\n if (continuationToken !== undefined) {\n endpoint.searchParams.set(\"continuationtoken\", continuationToken);\n }\n\n const headers = await context.createHeaders(OPERATION_NAME);\n const request = createRequest(endpoint, \"GET\", headers, options);\n const response = await sendRequest(context, request, 200);\n\n const registrations = await registrationDescriptionParser.parseRegistrationFeed(\n response.bodyAsText!,\n );\n const nextToken = response.headers.get(\"x-ms-continuationtoken\");\n return {\n registrations,\n continuationToken: nextToken,\n };\n}\n"]}
1
+ {"version":3,"file":"listRegistrationsByTag.js","sourceRoot":"","sources":["../../../src/api/listRegistrationsByTag.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAMnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,0CAA0C,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,cAAc,GAAG,wBAAwB,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,UAA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,UAAW,CACrB,CAAC;IACF,MAAM,SAAS,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IACjE,OAAO;QACL,aAAa;QACb,iBAAiB,EAAE,SAAS;KAC7B,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { RegistrationDescription } from \"../models/registration.js\";\nimport { RegistrationQueryLimitOptions } from \"../models/options.js\";\nimport { RegistrationQueryResponse } from \"../models/response.js\";\nimport { registrationDescriptionParser } from \"../serializers/registrationSerializer.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"listRegistrationsByTag\";\n\n/**\n * Lists all registrations with the matching tag.\n * @param context - The Notification Hubs client.\n * @param tag - The tag to query for matching registrations.\n * @param options - The query options such as $top.\n * @returns A paged async iterable containing the matching registrations for the notification hub.\n */\nexport function listRegistrationsByTag(\n context: NotificationHubsClientContext,\n tag: string,\n options: RegistrationQueryLimitOptions = {},\n): PagedAsyncIterableIterator<RegistrationDescription> {\n const { span, updatedOptions } = tracingClient.startSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n );\n try {\n const iter = listRegistrationsByTagAll(context, tag, updatedOptions);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return listRegistrationsByTagPagingPage(context, tag, options);\n },\n };\n } catch (e: any) {\n span.setStatus({ status: \"error\", error: e });\n throw e;\n } finally {\n span.end();\n }\n}\n\nasync function* listRegistrationsByTagAll(\n context: NotificationHubsClientContext,\n tag: string,\n options: RegistrationQueryLimitOptions,\n): AsyncIterableIterator<RegistrationDescription> {\n for await (const page of listRegistrationsByTagPagingPage(context, tag, options)) {\n yield* page;\n }\n}\n\nasync function* listRegistrationsByTagPagingPage(\n context: NotificationHubsClientContext,\n tag: string,\n options: RegistrationQueryLimitOptions,\n): AsyncIterableIterator<RegistrationDescription[]> {\n let result = await _listRegistrationsByTag(context, tag, options);\n yield result.registrations || [];\n let continuationToken = result.continuationToken;\n while (continuationToken) {\n result = await _listRegistrationsByTag(context, tag, options, continuationToken);\n continuationToken = result.continuationToken;\n yield result.registrations || [];\n }\n}\n\nasync function _listRegistrationsByTag(\n context: NotificationHubsClientContext,\n tag: string,\n options: RegistrationQueryLimitOptions,\n continuationToken?: string,\n): Promise<RegistrationQueryResponse> {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/tags/${tag}/registrations`;\n if (options.top !== undefined) {\n endpoint.searchParams.set(\"$top\", `${options.top}`);\n }\n\n if (continuationToken !== undefined) {\n endpoint.searchParams.set(\"continuationtoken\", continuationToken);\n }\n\n const headers = await context.createHeaders(OPERATION_NAME);\n const request = createRequest(endpoint, \"GET\", headers, options);\n const response = await sendRequest(context, request, 200);\n\n const registrations = await registrationDescriptionParser.parseRegistrationFeed(\n response.bodyAsText!,\n );\n const nextToken = response.headers.get(\"x-ms-continuationtoken\");\n return {\n registrations,\n continuationToken: nextToken,\n };\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  import { createRequest, parseNotificationSendResponse, sendRequest } from "./internal/_client.js";
4
4
  import { tracingClient } from "../utils/tracing.js";
5
5
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"scheduleNotification.js","sourceRoot":"","sources":["../../../src/api/scheduleNotification.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,aAAa,EAAE,6BAA6B,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAMlG,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAClC,OAAsC,EACtC,aAAmB,EACnB,YAA0B,EAC1B,UAAuC,EAAE;IAEzC,OAAO,aAAa,CAAC,QAAQ,CAC3B,oDAAoD,EACpD,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;QACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACtC,QAAQ,CAAC,QAAQ,IAAI,0BAA0B,CAAC;QAEhD,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,aAAa,CACzC,sBAAsB,EACtB,YAAY,CAAC,OAA4B,CAC1C,CAAC;QACF,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,aAAa,CAAC,WAAW,EAAE,CAAC,CAAC;QAChF,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;QACtD,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;QAEpE,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;YAC1B,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;QACpE,CAAC;QAED,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;QACzE,OAAO,CAAC,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC;QAEjC,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QAE1D,OAAO,6BAA6B,CAAC,QAAQ,CAAC,CAAC;IACjD,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, parseNotificationSendResponse, sendRequest } from \"./internal/_client.js\";\nimport { NonNullableRecord } from \"../utils/utils.js\";\nimport { Notification } from \"../models/notification.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { NotificationHubsMessageResponse } from \"../models/notificationDetails.js\";\nimport { ScheduleNotificationOptions } from \"../models/options.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\n/**\n * Schedules a push notification to devices that match the given tags or tag expression at the specified time.\n * NOTE: This is only available in Standard SKU Azure Notification Hubs.\n * @param context - The Notification Hubs client.\n * @param scheduledTime - The Date to send the push notification.\n * @param notification - The notification to send to the matching devices.\n * @param options - Options which include tags used to target the device for push notifications in either an array or tag expression.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function scheduleNotification(\n context: NotificationHubsClientContext,\n scheduledTime: Date,\n notification: Notification,\n options: ScheduleNotificationOptions = {},\n): Promise<NotificationHubsMessageResponse> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.scheduleNotification`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/schedulednotifications/\";\n\n const headers = await context.createHeaders(\n \"scheduleNotification\",\n notification.headers as NonNullableRecord,\n );\n headers.set(\"ServiceBusNotification-ScheduleTime\", scheduledTime.toISOString());\n headers.set(\"Content-Type\", notification.contentType);\n headers.set(\"ServiceBusNotification-Format\", notification.platform);\n\n if (options.tagExpression) {\n headers.set(\"ServiceBusNotification-Tags\", options.tagExpression);\n }\n\n const request = createRequest(endpoint, \"POST\", headers, updatedOptions);\n request.body = notification.body;\n\n const response = await sendRequest(context, request, 201);\n\n return parseNotificationSendResponse(response);\n },\n );\n}\n"]}
1
+ {"version":3,"file":"scheduleNotification.js","sourceRoot":"","sources":["../../../src/api/scheduleNotification.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,aAAa,EAAE,6BAA6B,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAMlG,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAClC,OAAsC,EACtC,aAAmB,EACnB,YAA0B,EAC1B,UAAuC,EAAE;IAEzC,OAAO,aAAa,CAAC,QAAQ,CAC3B,oDAAoD,EACpD,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;QACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACtC,QAAQ,CAAC,QAAQ,IAAI,0BAA0B,CAAC;QAEhD,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,aAAa,CACzC,sBAAsB,EACtB,YAAY,CAAC,OAA4B,CAC1C,CAAC;QACF,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,aAAa,CAAC,WAAW,EAAE,CAAC,CAAC;QAChF,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;QACtD,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;QAEpE,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;YAC1B,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;QACpE,CAAC;QAED,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;QACzE,OAAO,CAAC,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC;QAEjC,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QAE1D,OAAO,6BAA6B,CAAC,QAAQ,CAAC,CAAC;IACjD,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createRequest, parseNotificationSendResponse, sendRequest } from \"./internal/_client.js\";\nimport { NonNullableRecord } from \"../utils/utils.js\";\nimport { Notification } from \"../models/notification.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { NotificationHubsMessageResponse } from \"../models/notificationDetails.js\";\nimport { ScheduleNotificationOptions } from \"../models/options.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\n/**\n * Schedules a push notification to devices that match the given tags or tag expression at the specified time.\n * NOTE: This is only available in Standard SKU Azure Notification Hubs.\n * @param context - The Notification Hubs client.\n * @param scheduledTime - The Date to send the push notification.\n * @param notification - The notification to send to the matching devices.\n * @param options - Options which include tags used to target the device for push notifications in either an array or tag expression.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function scheduleNotification(\n context: NotificationHubsClientContext,\n scheduledTime: Date,\n notification: Notification,\n options: ScheduleNotificationOptions = {},\n): Promise<NotificationHubsMessageResponse> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.scheduleNotification`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/schedulednotifications/\";\n\n const headers = await context.createHeaders(\n \"scheduleNotification\",\n notification.headers as NonNullableRecord,\n );\n headers.set(\"ServiceBusNotification-ScheduleTime\", scheduledTime.toISOString());\n headers.set(\"Content-Type\", notification.contentType);\n headers.set(\"ServiceBusNotification-Format\", notification.platform);\n\n if (options.tagExpression) {\n headers.set(\"ServiceBusNotification-Tags\", options.tagExpression);\n }\n\n const request = createRequest(endpoint, \"POST\", headers, updatedOptions);\n request.body = notification.body;\n\n const response = await sendRequest(context, request, 201);\n\n return parseNotificationSendResponse(response);\n },\n );\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  import { createRequest, parseNotificationSendResponse, sendRequest } from "./internal/_client.js";
4
4
  import { isDirectSendNotificationOptions, isSendNotificationOptions, } from "../utils/optionUtils.js";
5
5
  import { createMultipartDirectNotification } from "../utils/notificationUtils.js";
@@ -1 +1 @@
1
- {"version":3,"file":"sendNotification.js","sourceRoot":"","sources":["../../../src/api/sendNotification.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,aAAa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,CAAC,GAAG,CAAC,+BAA+B,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;QAEpE,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;QACzE,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;QAEpB,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QAE1D,OAAO,6BAA6B,CAAC,QAAQ,CAAC,CAAC;IACjD,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { DirectSendNotificationOptions, SendNotificationOptions } from \"../models/options.js\";\nimport { createRequest, parseNotificationSendResponse, sendRequest } from \"./internal/_client.js\";\nimport {\n isDirectSendNotificationOptions,\n isSendNotificationOptions,\n} from \"../utils/optionUtils.js\";\nimport { BrowserPushChannel } from \"../models/installation.js\";\nimport { NonNullableRecord } from \"../utils/utils.js\";\nimport { Notification } from \"../models/notification.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { NotificationHubsMessageResponse } from \"../models/notificationDetails.js\";\nimport { createMultipartDirectNotification } from \"../utils/notificationUtils.js\";\nimport { randomUUID } from \"@azure/core-util\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\n/**\n * Sends push notifications to devices that match the given tags or tag expression.\n * @param context - The Notification Hubs client.\n * @param notification - The notification to send to the matching devices.\n * @param options - Options for the notification including tags, device handles and whether to enable test send.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function sendNotification(\n context: NotificationHubsClientContext,\n notification: Notification,\n options: DirectSendNotificationOptions | SendNotificationOptions = { enableTestSend: false },\n): Promise<NotificationHubsMessageResponse> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.sendNotification`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/messages/\";\n\n // Check if batch direct send\n if (isDirectSendNotificationOptions(options) && Array.isArray(options.deviceHandle)) {\n endpoint.pathname += \"$batch\";\n }\n\n // Check for test send\n if (isSendNotificationOptions(options) && options.enableTestSend) {\n endpoint.searchParams.append(\"test\", \"true\");\n }\n\n const headers = await context.createHeaders(\n \"sendNotification\",\n notification.headers as NonNullableRecord,\n );\n headers.set(\"ServiceBusNotification-Format\", notification.platform);\n\n let body = notification.body;\n let contentType: string = notification.contentType;\n\n // Check for direct batch send\n if (isDirectSendNotificationOptions(options) && Array.isArray(options.deviceHandle)) {\n endpoint.searchParams.append(\"direct\", \"true\");\n const boundary = `nh-boundary-${randomUUID()}`;\n contentType = `multipart/mixed; boundary = \"${boundary}\"`;\n body = createMultipartDirectNotification(boundary, notification, options.deviceHandle);\n } else if (isDirectSendNotificationOptions(options)) {\n endpoint.searchParams.append(\"direct\", \"true\");\n\n if (notification.platform === \"browser\") {\n const browserHandle = options.deviceHandle as BrowserPushChannel;\n headers.set(\"ServiceBusNotification-DeviceHandle\", browserHandle.endpoint);\n headers.set(\"Auth\", browserHandle.auth);\n headers.set(\"P256DH\", browserHandle.p256dh);\n } else {\n headers.set(\"ServiceBusNotification-DeviceHandle\", options.deviceHandle as string);\n }\n } else if (isSendNotificationOptions(options)) {\n if (options.tagExpression) {\n headers.set(\"ServiceBusNotification-Tags\", options.tagExpression);\n }\n }\n\n headers.set(\"Content-Type\", contentType);\n headers.set(\"ServiceBusNotification-Format\", notification.platform);\n\n const request = createRequest(endpoint, \"POST\", headers, updatedOptions);\n request.body = body;\n\n const response = await sendRequest(context, request, 201);\n\n return parseNotificationSendResponse(response);\n },\n );\n}\n"]}
1
+ {"version":3,"file":"sendNotification.js","sourceRoot":"","sources":["../../../src/api/sendNotification.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,aAAa,EAAE,6BAA6B,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAClG,OAAO,EACL,+BAA+B,EAC/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GAAG,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;QACzE,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;QAEpB,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QAE1D,OAAO,6BAA6B,CAAC,QAAQ,CAAC,CAAC;IACjD,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { DirectSendNotificationOptions, SendNotificationOptions } from \"../models/options.js\";\nimport { createRequest, parseNotificationSendResponse, sendRequest } from \"./internal/_client.js\";\nimport {\n isDirectSendNotificationOptions,\n isSendNotificationOptions,\n} from \"../utils/optionUtils.js\";\nimport { BrowserPushChannel } from \"../models/installation.js\";\nimport { NonNullableRecord } from \"../utils/utils.js\";\nimport { Notification } from \"../models/notification.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { NotificationHubsMessageResponse } from \"../models/notificationDetails.js\";\nimport { createMultipartDirectNotification } from \"../utils/notificationUtils.js\";\nimport { randomUUID } from \"@azure/core-util\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\n/**\n * Sends push notifications to devices that match the given tags or tag expression.\n * @param context - The Notification Hubs client.\n * @param notification - The notification to send to the matching devices.\n * @param options - Options for the notification including tags, device handles and whether to enable test send.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function sendNotification(\n context: NotificationHubsClientContext,\n notification: Notification,\n options: DirectSendNotificationOptions | SendNotificationOptions = { enableTestSend: false },\n): Promise<NotificationHubsMessageResponse> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.sendNotification`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/messages/\";\n\n // Check if batch direct send\n if (isDirectSendNotificationOptions(options) && Array.isArray(options.deviceHandle)) {\n endpoint.pathname += \"$batch\";\n }\n\n // Check for test send\n if (isSendNotificationOptions(options) && options.enableTestSend) {\n endpoint.searchParams.append(\"test\", \"true\");\n }\n\n const headers = await context.createHeaders(\n \"sendNotification\",\n notification.headers as NonNullableRecord,\n );\n headers.set(\"ServiceBusNotification-Format\", notification.platform);\n\n let body = notification.body;\n let contentType: string = notification.contentType;\n\n // Check for direct batch send\n if (isDirectSendNotificationOptions(options) && Array.isArray(options.deviceHandle)) {\n endpoint.searchParams.append(\"direct\", \"true\");\n const boundary = `nh-boundary-${randomUUID()}`;\n contentType = `multipart/mixed; boundary = \"${boundary}\"`;\n body = createMultipartDirectNotification(boundary, notification, options.deviceHandle);\n } else if (isDirectSendNotificationOptions(options)) {\n endpoint.searchParams.append(\"direct\", \"true\");\n\n if (notification.platform === \"browser\") {\n const browserHandle = options.deviceHandle as BrowserPushChannel;\n headers.set(\"ServiceBusNotification-DeviceHandle\", browserHandle.endpoint);\n headers.set(\"Auth\", browserHandle.auth);\n headers.set(\"P256DH\", browserHandle.p256dh);\n } else {\n headers.set(\"ServiceBusNotification-DeviceHandle\", options.deviceHandle as string);\n }\n } else if (isSendNotificationOptions(options)) {\n if (options.tagExpression) {\n headers.set(\"ServiceBusNotification-Tags\", options.tagExpression);\n }\n }\n\n headers.set(\"Content-Type\", contentType);\n headers.set(\"ServiceBusNotification-Format\", notification.platform);\n\n const request = createRequest(endpoint, \"POST\", headers, updatedOptions);\n request.body = body;\n\n const response = await sendRequest(context, request, 201);\n\n return parseNotificationSendResponse(response);\n },\n );\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  import { createRequest, sendRequest } from "./internal/_client.js";
4
4
  import { parseNotificationHubJobEntry, serializeNotificationHubJobEntry, } from "../serializers/notificationHubJobSerializer.js";
5
5
  import { tracingClient } from "../utils/tracing.js";
@@ -1 +1 @@
1
- {"version":3,"file":"submitNotificationHubJob.js","sourceRoot":"","sources":["../../../src/api/submitNotificationHubJob.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EACL,4BAA4B,EAC5B,gCAAgC,GACjC,MAAM,gDAAgD,CAAC;AAIxD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,cAAc,GAAG,0BAA0B,CAAC;AAElD;;;;;;;GAOG;AACH,MAAM,UAAU,wBAAwB,CACtC,OAAsC,EACtC,GAAuB,EACvB,UAA4B,EAAE;IAE9B,OAAO,aAAa,CAAC,QAAQ,CAC3B,iCAAiC,cAAc,EAAE,EACjD,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;QACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACtC,QAAQ,CAAC,QAAQ,IAAI,OAAO,CAAC;QAE7B,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;QAC5D,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,+CAA+C,CAAC,CAAC;QAE7E,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;QACzE,OAAO,CAAC,IAAI,GAAG,gCAAgC,CAAC,GAAG,CAAC,CAAC;QACrD,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QAE1D,OAAO,4BAA4B,CAAC,QAAQ,CAAC,UAAW,CAAC,CAAC;IAC5D,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport {\n parseNotificationHubJobEntry,\n serializeNotificationHubJobEntry,\n} from \"../serializers/notificationHubJobSerializer.js\";\nimport { NotificationHubJob } from \"../models/notificationHubJob.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"submitNotificationHubJob\";\n\n/**\n * Submits a Notification Hub Job.\n * Note: this is available to Standard SKU namespace and above.\n * @param context - The Notification Hubs client.\n * @param job - The notification hub job to submit.\n * @param options - The operation options.\n * @returns The notification hub job details including job ID and status.\n */\nexport function submitNotificationHubJob(\n context: NotificationHubsClientContext,\n job: NotificationHubJob,\n options: OperationOptions = {},\n): Promise<NotificationHubJob> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/jobs\";\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/atom+xml;type=entry;charset=utf-8\");\n\n const request = createRequest(endpoint, \"POST\", headers, updatedOptions);\n request.body = serializeNotificationHubJobEntry(job);\n const response = await sendRequest(context, request, 201);\n\n return parseNotificationHubJobEntry(response.bodyAsText!);\n },\n );\n}\n"]}
1
+ {"version":3,"file":"submitNotificationHubJob.js","sourceRoot":"","sources":["../../../src/api/submitNotificationHubJob.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EACL,4BAA4B,EAC5B,gCAAgC,GACjC,MAAM,gDAAgD,CAAC;AAIxD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,cAAc,GAAG,0BAA0B,CAAC;AAElD;;;;;;;GAOG;AACH,MAAM,UAAU,wBAAwB,CACtC,OAAsC,EACtC,GAAuB,EACvB,UAA4B,EAAE;IAE9B,OAAO,aAAa,CAAC,QAAQ,CAC3B,iCAAiC,cAAc,EAAE,EACjD,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;QACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACtC,QAAQ,CAAC,QAAQ,IAAI,OAAO,CAAC;QAE7B,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;QAC5D,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,+CAA+C,CAAC,CAAC;QAE7E,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;QACzE,OAAO,CAAC,IAAI,GAAG,gCAAgC,CAAC,GAAG,CAAC,CAAC;QACrD,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QAE1D,OAAO,4BAA4B,CAAC,QAAQ,CAAC,UAAW,CAAC,CAAC;IAC5D,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport {\n parseNotificationHubJobEntry,\n serializeNotificationHubJobEntry,\n} from \"../serializers/notificationHubJobSerializer.js\";\nimport { NotificationHubJob } from \"../models/notificationHubJob.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"submitNotificationHubJob\";\n\n/**\n * Submits a Notification Hub Job.\n * Note: this is available to Standard SKU namespace and above.\n * @param context - The Notification Hubs client.\n * @param job - The notification hub job to submit.\n * @param options - The operation options.\n * @returns The notification hub job details including job ID and status.\n */\nexport function submitNotificationHubJob(\n context: NotificationHubsClientContext,\n job: NotificationHubJob,\n options: OperationOptions = {},\n): Promise<NotificationHubJob> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/jobs\";\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/atom+xml;type=entry;charset=utf-8\");\n\n const request = createRequest(endpoint, \"POST\", headers, updatedOptions);\n request.body = serializeNotificationHubJobEntry(job);\n const response = await sendRequest(context, request, 201);\n\n return parseNotificationHubJobEntry(response.bodyAsText!);\n },\n );\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  import { createRequest, parseNotificationResponse, sendRequest } from "./internal/_client.js";
4
4
  import { tracingClient } from "../utils/tracing.js";
5
5
  const OPERATION_NAME = "updateInstallation";
@@ -1 +1 @@
1
- {"version":3,"file":"updateInstallation.js","sourceRoot":"","sources":["../../../src/api/updateInstallation.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,aAAa,EAAE,yBAAyB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAK9F,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,cAAc,GAAG,oBAAoB,CAAC;AAE5C;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAAsC,EACtC,cAAsB,EACtB,mBAAgC,EAChC,UAA4B,EAAE;IAE9B,OAAO,aAAa,CAAC,QAAQ,CAC3B,iCAAiC,cAAc,EAAE,EACjD,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;QACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACtC,QAAQ,CAAC,QAAQ,IAAI,kBAAkB,cAAc,EAAE,CAAC;QAExD,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;QAC5D,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;QAEhD,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;QAC1E,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QACnD,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QAE1D,OAAO,yBAAyB,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, parseNotificationResponse, sendRequest } from \"./internal/_client.js\";\nimport { JsonPatch } from \"../models/installation.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { NotificationHubsResponse } from \"../models/notificationDetails.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"updateInstallation\";\n\n/**\n * Updates an installation using the JSON-Patch standard in RFC6902.\n * @param context - The Notification Hubs client.\n * @param installationId - The ID of the installation to update.\n * @param installationPatches - An array of patches following the JSON-Patch standard.\n * @param options - Configuration options for the patch installation operation.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function updateInstallation(\n context: NotificationHubsClientContext,\n installationId: string,\n installationPatches: JsonPatch[],\n options: OperationOptions = {},\n): Promise<NotificationHubsResponse> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/installations/${installationId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/json\");\n\n const request = createRequest(endpoint, \"PATCH\", headers, updatedOptions);\n request.body = JSON.stringify(installationPatches);\n const response = await sendRequest(context, request, 200);\n\n return parseNotificationResponse(response);\n },\n );\n}\n"]}
1
+ {"version":3,"file":"updateInstallation.js","sourceRoot":"","sources":["../../../src/api/updateInstallation.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,aAAa,EAAE,yBAAyB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAK9F,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,cAAc,GAAG,oBAAoB,CAAC;AAE5C;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAAsC,EACtC,cAAsB,EACtB,mBAAgC,EAChC,UAA4B,EAAE;IAE9B,OAAO,aAAa,CAAC,QAAQ,CAC3B,iCAAiC,cAAc,EAAE,EACjD,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;QACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACtC,QAAQ,CAAC,QAAQ,IAAI,kBAAkB,cAAc,EAAE,CAAC;QAExD,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;QAC5D,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;QAEhD,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;QAC1E,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QACnD,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QAE1D,OAAO,yBAAyB,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createRequest, parseNotificationResponse, sendRequest } from \"./internal/_client.js\";\nimport { JsonPatch } from \"../models/installation.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { NotificationHubsResponse } from \"../models/notificationDetails.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"updateInstallation\";\n\n/**\n * Updates an installation using the JSON-Patch standard in RFC6902.\n * @param context - The Notification Hubs client.\n * @param installationId - The ID of the installation to update.\n * @param installationPatches - An array of patches following the JSON-Patch standard.\n * @param options - Configuration options for the patch installation operation.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function updateInstallation(\n context: NotificationHubsClientContext,\n installationId: string,\n installationPatches: JsonPatch[],\n options: OperationOptions = {},\n): Promise<NotificationHubsResponse> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/installations/${installationId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/json\");\n\n const request = createRequest(endpoint, \"PATCH\", headers, updatedOptions);\n request.body = JSON.stringify(installationPatches);\n const response = await sendRequest(context, request, 200);\n\n return parseNotificationResponse(response);\n },\n );\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  import { RestError } from "@azure/core-rest-pipeline";
4
4
  import { createOrUpdateRegistrationDescription } from "./internal/_createOrUpdateRegistrationDescription.js";
5
5
  import { tracingClient } from "../utils/tracing.js";
@@ -1 +1 @@
1
- {"version":3,"file":"updateRegistration.js","sourceRoot":"","sources":["../../../src/api/updateRegistration.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAKlC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,qCAAqC,EAAE,MAAM,sDAAsD,CAAC;AAC7G,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,cAAc,GAAG,oBAAoB,CAAC;AAE5C;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAAsC,EACtC,YAAqC,EACrC,UAA4B,EAAE;IAE9B,OAAO,aAAa,CAAC,QAAQ,CAC3B,iCAAiC,cAAc,EAAE,EACjD,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;QACvB,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;YACvB,MAAM,IAAI,SAAS,CAAC,0CAA0C,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC;QACvF,CAAC;QACD,OAAO,qCAAqC,CAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC;IAChG,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { RegistrationDescription } from \"../models/registration.js\";\nimport { RestError } from \"@azure/core-rest-pipeline\";\nimport { createOrUpdateRegistrationDescription } from \"./internal/_createOrUpdateRegistrationDescription.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"updateRegistration\";\n\n/**\n * Updates an existing registration.\n * @param context - The Notification Hubs client.\n * @param registration - The registration to update.\n * @param options - The operation options.\n * @returns The updated registration description.\n */\nexport function updateRegistration(\n context: NotificationHubsClientContext,\n registration: RegistrationDescription,\n options: OperationOptions = {},\n): Promise<RegistrationDescription> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n if (!registration.etag) {\n throw new RestError(\"ETag is required for registration update\", { statusCode: 400 });\n }\n return createOrUpdateRegistrationDescription(context, registration, \"update\", updatedOptions);\n },\n );\n}\n"]}
1
+ {"version":3,"file":"updateRegistration.js","sourceRoot":"","sources":["../../../src/api/updateRegistration.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAKlC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,qCAAqC,EAAE,MAAM,sDAAsD,CAAC;AAC7G,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,cAAc,GAAG,oBAAoB,CAAC;AAE5C;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAAsC,EACtC,YAAqC,EACrC,UAA4B,EAAE;IAE9B,OAAO,aAAa,CAAC,QAAQ,CAC3B,iCAAiC,cAAc,EAAE,EACjD,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;QACvB,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;YACvB,MAAM,IAAI,SAAS,CAAC,0CAA0C,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC;QACvF,CAAC;QACD,OAAO,qCAAqC,CAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC;IAChG,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { RegistrationDescription } from \"../models/registration.js\";\nimport { RestError } from \"@azure/core-rest-pipeline\";\nimport { createOrUpdateRegistrationDescription } from \"./internal/_createOrUpdateRegistrationDescription.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"updateRegistration\";\n\n/**\n * Updates an existing registration.\n * @param context - The Notification Hubs client.\n * @param registration - The registration to update.\n * @param options - The operation options.\n * @returns The updated registration description.\n */\nexport function updateRegistration(\n context: NotificationHubsClientContext,\n registration: RegistrationDescription,\n options: OperationOptions = {},\n): Promise<RegistrationDescription> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n if (!registration.etag) {\n throw new RestError(\"ETag is required for registration update\", { statusCode: 400 });\n }\n return createOrUpdateRegistrationDescription(context, registration, \"update\", updatedOptions);\n },\n );\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  import { SasTokenCredential } from "./sasTokenCredential.js";
4
4
  /**
5
5
  * Parses the connection string and returns an object of type T.
@@ -1 +1 @@
1
- {"version":3,"file":"connectionStringUtils.js","sourceRoot":"","sources":["../../../src/auth/connectionStringUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAO7D;;;;;;;;;;;;;GAaG;AACH,SAAS,qBAAqB,CAAI,gBAAwB;IACxD,MAAM,MAAM,GAA4B,EAAE,CAAC;IAC3C,MAAM,KAAK,GAAG,gBAAgB,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAEjD,KAAK,IAAI,IAAI,IAAI,KAAK,EAAE,CAAC;QACvB,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAEnB,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;YAChB,qBAAqB;YACrB,SAAS;QACX,CAAC;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACrC,IAAI,UAAU,KAAK,CAAC,CAAC,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CACb,8FAA8F,CAC/F,CAAC;QACJ,CAAC;QAED,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,IAAI,EAAE,CAAC;QACjD,IAAI,GAAG,KAAK,EAAE,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;QAC7E,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAEpD,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,OAAO,MAAa,CAAC;AACvB,CAAC;AAwBD;;;;;GAKG;AACH,MAAM,UAAU,mCAAmC,CACjD,eAAuB,EACvB,mBAA2B;IAE3B,OAAO,IAAI,kBAAkB,CAAC,EAAE,eAAe,EAAE,mBAAmB,EAAE,CAAC,CAAC;AAC1E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qCAAqC,CACnD,gBAAwB;IAExB,MAAM,YAAY,GAAG,qBAAqB,CAIvC,gBAAgB,CAAC,CAAC;IACrB,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACpE,CAAC;IAED,IAAI,YAAY,CAAC,eAAe,IAAI,CAAC,YAAY,CAAC,mBAAmB,EAAE,CAAC;QACtE,MAAM,IAAI,KAAK,CAAC,yEAAyE,CAAC,CAAC;IAC7F,CAAC;SAAM,IAAI,CAAC,YAAY,CAAC,eAAe,IAAI,YAAY,CAAC,mBAAmB,EAAE,CAAC;QAC7E,MAAM,IAAI,KAAK,CACb,iFAAiF,CAClF,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAA+C;QACzD,QAAQ,EAAE,YAAY,CAAC,QAAQ;QAC/B,eAAe,EAAE,YAAY,CAAC,eAAgB;QAC9C,mBAAmB,EAAE,YAAY,CAAC,mBAAoB;KACvD,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { SasTokenCredential } from \"./sasTokenCredential.js\";\n\n/**\n * Defines an object with possible properties defined in T.\n */\nexport type ParsedOutput<T> = { [P in keyof T]: T[P] };\n\n/**\n * Parses the connection string and returns an object of type T.\n *\n * Connection strings have the following syntax:\n *\n * ConnectionString ::= `Part { \";\" Part } [ \";\" ] [ WhiteSpace ]`\n * Part ::= [ PartLiteral [ \"=\" PartLiteral ] ]\n * PartLiteral ::= [ WhiteSpace ] Literal [ WhiteSpace ]\n * Literal ::= ? any sequence of characters except ; or = or WhiteSpace ?\n * WhiteSpace ::= ? all whitespace characters including `\\r` and `\\n` ?\n *\n * @param connectionString - The connection string to be parsed.\n * @returns ParsedOutput<T>.\n */\nfunction parseConnectionString<T>(connectionString: string): ParsedOutput<T> {\n const output: { [k: string]: string } = {};\n const parts = connectionString.trim().split(\";\");\n\n for (let part of parts) {\n part = part.trim();\n\n if (part === \"\") {\n // parts can be empty\n continue;\n }\n\n const splitIndex = part.indexOf(\"=\");\n if (splitIndex === -1) {\n throw new Error(\n \"Connection string malformed: each part of the connection string must have an `=` assignment.\",\n );\n }\n\n const key = part.substring(0, splitIndex).trim();\n if (key === \"\") {\n throw new Error(\"Connection string malformed: missing key for assignment\");\n }\n\n const value = part.substring(splitIndex + 1).trim();\n\n output[key] = value;\n }\n\n return output as any;\n}\n\n/**\n * The set of properties that comprise a Notification Hubs connection string.\n */\nexport interface NotificationHubsConnectionStringProperties {\n /**\n * The value for \"Endpoint\" in the connection string.\n */\n endpoint: string;\n /**\n * The value for \"SharedAccessKey\" in the connection string. This along with the \"SharedAccessKeyName\"\n * in the connection string is used to generate a SharedAccessSignature which can be used authorize\n * the connection to the service.\n */\n sharedAccessKey: string;\n /**\n * The value for \"SharedAccessKeyName\" in the connection string. This along with the \"SharedAccessKey\"\n * in the connection string is used to generate a SharedAccessSignature which can be used authorize\n * the connection to the service.\n */\n sharedAccessKeyName: string;\n}\n\n/**\n * Creates a SasTokenCredential from a shared access key and shared access key name.\n * @param sharedAccessKey - The shared access key value.\n * @param sharedAccessKeyName - The shared access key name.\n * @returns A SasTokenCredential with the given shared access token information.\n */\nexport function createTokenCredentialFromConnection(\n sharedAccessKey: string,\n sharedAccessKeyName: string,\n): SasTokenCredential {\n return new SasTokenCredential({ sharedAccessKey, sharedAccessKeyName });\n}\n\n/**\n * Parses given connection string into the different properties applicable to Azure Service Bus.\n * The properties are useful to then construct a ServiceBusClient.\n * @param connectionString - The connection string associated with the Shared Access Policy created\n * for the Service Bus namespace, queue or topic.\n */\nexport function parseNotificationHubsConnectionString(\n connectionString: string,\n): NotificationHubsConnectionStringProperties {\n const parsedResult = parseConnectionString<{\n Endpoint: string;\n SharedAccessKey?: string;\n SharedAccessKeyName?: string;\n }>(connectionString);\n if (!parsedResult.Endpoint) {\n throw new Error(\"Connection string should have an Endpoint key.\");\n }\n\n if (parsedResult.SharedAccessKey && !parsedResult.SharedAccessKeyName) {\n throw new Error(\"Connection string with SharedAccessKey should have SharedAccessKeyName.\");\n } else if (!parsedResult.SharedAccessKey && parsedResult.SharedAccessKeyName) {\n throw new Error(\n \"Connection string with SharedAccessKeyName should have SharedAccessKey as well.\",\n );\n }\n\n const output: NotificationHubsConnectionStringProperties = {\n endpoint: parsedResult.Endpoint,\n sharedAccessKey: parsedResult.SharedAccessKey!,\n sharedAccessKeyName: parsedResult.SharedAccessKeyName!,\n };\n\n return output;\n}\n"]}
1
+ {"version":3,"file":"connectionStringUtils.js","sourceRoot":"","sources":["../../../src/auth/connectionStringUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAO7D;;;;;;;;;;;;;GAaG;AACH,SAAS,qBAAqB,CAAI,gBAAwB;IACxD,MAAM,MAAM,GAA4B,EAAE,CAAC;IAC3C,MAAM,KAAK,GAAG,gBAAgB,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAEjD,KAAK,IAAI,IAAI,IAAI,KAAK,EAAE,CAAC;QACvB,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAEnB,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;YAChB,qBAAqB;YACrB,SAAS;QACX,CAAC;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;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C/B,eAAe,EAAE,YAAY,CAAC,eAAgB;QAC9C,mBAAmB,EAAE,YAAY,CAAC,mBAAoB;KACvD,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { SasTokenCredential } from \"./sasTokenCredential.js\";\n\n/**\n * Defines an object with possible properties defined in T.\n */\nexport type ParsedOutput<T> = { [P in keyof T]: T[P] };\n\n/**\n * Parses the connection string and returns an object of type T.\n *\n * Connection strings have the following syntax:\n *\n * ConnectionString ::= `Part { \";\" Part } [ \";\" ] [ WhiteSpace ]`\n * Part ::= [ PartLiteral [ \"=\" PartLiteral ] ]\n * PartLiteral ::= [ WhiteSpace ] Literal [ WhiteSpace ]\n * Literal ::= ? any sequence of characters except ; or = or WhiteSpace ?\n * WhiteSpace ::= ? all whitespace characters including `\\r` and `\\n` ?\n *\n * @param connectionString - The connection string to be parsed.\n * @returns ParsedOutput<T>.\n */\nfunction parseConnectionString<T>(connectionString: string): ParsedOutput<T> {\n const output: { [k: string]: string } = {};\n const parts = connectionString.trim().split(\";\");\n\n for (let part of parts) {\n part = part.trim();\n\n if (part === \"\") {\n // parts can be empty\n continue;\n }\n\n const splitIndex = part.indexOf(\"=\");\n if (splitIndex === -1) {\n throw new Error(\n \"Connection string malformed: each part of the connection string must have an `=` assignment.\",\n );\n }\n\n const key = part.substring(0, splitIndex).trim();\n if (key === \"\") {\n throw new Error(\"Connection string malformed: missing key for assignment\");\n }\n\n const value = part.substring(splitIndex + 1).trim();\n\n output[key] = value;\n }\n\n return output as any;\n}\n\n/**\n * The set of properties that comprise a Notification Hubs connection string.\n */\nexport interface NotificationHubsConnectionStringProperties {\n /**\n * The value for \"Endpoint\" in the connection string.\n */\n endpoint: string;\n /**\n * The value for \"SharedAccessKey\" in the connection string. This along with the \"SharedAccessKeyName\"\n * in the connection string is used to generate a SharedAccessSignature which can be used authorize\n * the connection to the service.\n */\n sharedAccessKey: string;\n /**\n * The value for \"SharedAccessKeyName\" in the connection string. This along with the \"SharedAccessKey\"\n * in the connection string is used to generate a SharedAccessSignature which can be used authorize\n * the connection to the service.\n */\n sharedAccessKeyName: string;\n}\n\n/**\n * Creates a SasTokenCredential from a shared access key and shared access key name.\n * @param sharedAccessKey - The shared access key value.\n * @param sharedAccessKeyName - The shared access key name.\n * @returns A SasTokenCredential with the given shared access token information.\n */\nexport function createTokenCredentialFromConnection(\n sharedAccessKey: string,\n sharedAccessKeyName: string,\n): SasTokenCredential {\n return new SasTokenCredential({ sharedAccessKey, sharedAccessKeyName });\n}\n\n/**\n * Parses given connection string into the different properties applicable to Azure Service Bus.\n * The properties are useful to then construct a ServiceBusClient.\n * @param connectionString - The connection string associated with the Shared Access Policy created\n * for the Service Bus namespace, queue or topic.\n */\nexport function parseNotificationHubsConnectionString(\n connectionString: string,\n): NotificationHubsConnectionStringProperties {\n const parsedResult = parseConnectionString<{\n Endpoint: string;\n SharedAccessKey?: string;\n SharedAccessKeyName?: string;\n }>(connectionString);\n if (!parsedResult.Endpoint) {\n throw new Error(\"Connection string should have an Endpoint key.\");\n }\n\n if (parsedResult.SharedAccessKey && !parsedResult.SharedAccessKeyName) {\n throw new Error(\"Connection string with SharedAccessKey should have SharedAccessKeyName.\");\n } else if (!parsedResult.SharedAccessKey && parsedResult.SharedAccessKeyName) {\n throw new Error(\n \"Connection string with SharedAccessKeyName should have SharedAccessKey as well.\",\n );\n }\n\n const output: NotificationHubsConnectionStringProperties = {\n endpoint: parsedResult.Endpoint,\n sharedAccessKey: parsedResult.SharedAccessKey!,\n sharedAccessKeyName: parsedResult.SharedAccessKeyName!,\n };\n\n return output;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"hmacSha256-browser.mjs","sourceRoot":"","sources":["../../../src/auth/hmacSha256-browser.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport { signString } from \"./hmacSha256.common.js\";\n"]}
1
+ {"version":3,"file":"hmacSha256-browser.mjs","sourceRoot":"","sources":["../../../src/auth/hmacSha256-browser.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { signString } from \"./hmacSha256.common.js\";\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  export async function signString(key, toSign) {
4
4
  const enc = new TextEncoder();
5
5
  const algorithm = { name: "HMAC", hash: { name: "SHA-256" } };
@@ -1 +1 @@
1
- {"version":3,"file":"hmacSha256.common.js","sourceRoot":"","sources":["../../../src/auth/hmacSha256.common.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAiClC,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,GAAW,EAAE,MAAc;IAC1D,MAAM,GAAG,GAAG,IAAI,WAAW,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAqB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC;IAEhF,MAAM,YAAY,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAC3D,KAAK,EACL,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,EACf,SAAS,EACT,KAAK,EACL,CAAC,MAAM,EAAE,QAAQ,CAAC,CACnB,CAAC;IACF,MAAM,SAAS,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CACnD,SAAS,EACT,YAAY,EACZ,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CACnB,CAAC;IACF,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAEvE,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\ndeclare global {\n interface HmacImportParams {\n name: string;\n hash: { name: string };\n }\n\n interface CryptoKey {\n algorithm: HmacImportParams;\n type: string;\n extractable: boolean;\n usages: string[];\n }\n\n function btoa(input: string): string;\n}\n\ndeclare const globalThis: {\n crypto: {\n subtle: {\n importKey(\n format: string,\n keyData: Uint8Array,\n algorithm: HmacImportParams,\n extractable: boolean,\n usages: string[],\n ): Promise<CryptoKey>;\n sign(algorithm: HmacImportParams, key: CryptoKey, data: Uint8Array): Promise<ArrayBuffer>;\n };\n };\n};\n\nexport async function signString(key: string, toSign: string): Promise<string> {\n const enc = new TextEncoder();\n const algorithm: HmacImportParams = { name: \"HMAC\", hash: { name: \"SHA-256\" } };\n\n const extractedKey = await globalThis.crypto.subtle.importKey(\n \"raw\",\n enc.encode(key),\n algorithm,\n false,\n [\"sign\", \"verify\"],\n );\n const signature = await globalThis.crypto.subtle.sign(\n algorithm,\n extractedKey,\n enc.encode(toSign),\n );\n const digest = btoa(String.fromCharCode(...new Uint8Array(signature)));\n\n return encodeURIComponent(digest);\n}\n"]}
1
+ {"version":3,"file":"hmacSha256.common.js","sourceRoot":"","sources":["../../../src/auth/hmacSha256.common.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAiClC,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,GAAW,EAAE,MAAc;IAC1D,MAAM,GAAG,GAAG,IAAI,WAAW,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAqB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC;IAEhF,MAAM,YAAY,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAC3D,KAAK,EACL,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,EACf,SAAS,EACT,KAAK,EACL,CAAC,MAAM,EAAE,QAAQ,CAAC,CACnB,CAAC;IACF,MAAM,SAAS,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CACnD,SAAS,EACT,YAAY,EACZ,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CACnB,CAAC;IACF,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAEvE,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\ndeclare global {\n interface HmacImportParams {\n name: string;\n hash: { name: string };\n }\n\n interface CryptoKey {\n algorithm: HmacImportParams;\n type: string;\n extractable: boolean;\n usages: string[];\n }\n\n function btoa(input: string): string;\n}\n\ndeclare const globalThis: {\n crypto: {\n subtle: {\n importKey(\n format: string,\n keyData: Uint8Array,\n algorithm: HmacImportParams,\n extractable: boolean,\n usages: string[],\n ): Promise<CryptoKey>;\n sign(algorithm: HmacImportParams, key: CryptoKey, data: Uint8Array): Promise<ArrayBuffer>;\n };\n };\n};\n\nexport async function signString(key: string, toSign: string): Promise<string> {\n const enc = new TextEncoder();\n const algorithm: HmacImportParams = { name: \"HMAC\", hash: { name: \"SHA-256\" } };\n\n const extractedKey = await globalThis.crypto.subtle.importKey(\n \"raw\",\n enc.encode(key),\n algorithm,\n false,\n [\"sign\", \"verify\"],\n );\n const signature = await globalThis.crypto.subtle.sign(\n algorithm,\n extractedKey,\n enc.encode(toSign),\n );\n const digest = btoa(String.fromCharCode(...new Uint8Array(signature)));\n\n return encodeURIComponent(digest);\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  export { signString } from "./hmacSha256.common.js";
4
4
  //# sourceMappingURL=hmacSha256-browser.mjs.map
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  import { signString } from "./hmacSha256.js";
4
4
  /**
5
5
  * A TokenProvider that generates a Sas token:
@@ -1 +1 @@
1
- {"version":3,"file":"sasTokenCredential.js","sourceRoot":"","sources":["../../../src/auth/sasTokenCredential.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAiB7C;;;;;GAKG;AACH,MAAM,OAAO,kBAAkB;IAM7B;;;OAGG;IACH,YAAY,UAA8B;QACxC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,QAAQ,CAAC,MAAyB;QACtC,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QAC5D,OAAO,WAAW,CAChB,IAAI,CAAC,WAAW,CAAC,mBAAmB,EACpC,IAAI,CAAC,WAAW,CAAC,eAAe,EAChC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,EACpC,QAAQ,CACT,CAAC;IACJ,CAAC;CACF;AAED;;;;;;;GAOG;AACH,KAAK,UAAU,WAAW,CACxB,OAAe,EACf,GAAW,EACX,MAAc,EACd,QAAgB;IAEhB,QAAQ,GAAG,kBAAkB,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;IACtD,OAAO,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACtC,MAAM,YAAY,GAAG,QAAQ,GAAG,IAAI,GAAG,MAAM,CAAC;IAC9C,MAAM,GAAG,GAAG,MAAM,UAAU,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IAEhD,OAAO;QACL,KAAK,EAAE,4BAA4B,QAAQ,QAAQ,GAAG,OAAO,MAAM,QAAQ,OAAO,EAAE;QACpF,kBAAkB,EAAE,MAAM;KAC3B,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AccessToken, TokenCredential } from \"@azure/core-auth\";\nimport { signString } from \"./hmacSha256.js\";\n\n/**\n * Represents a named key credential.\n */\nexport interface NamedKeyCredential {\n /**\n * The Shared Access Signature key name.\n */\n sharedAccessKeyName: string;\n\n /**\n * The Shared Access Signature key value.\n */\n sharedAccessKey: string;\n}\n\n/**\n * A TokenProvider that generates a Sas token:\n * `SharedAccessSignature sr=<resource>&sig=<signature>&se=<expiry>&skn=<keyname>`\n *\n * @internal\n */\nexport class SasTokenCredential implements TokenCredential {\n /**\n * The SASCredential containing the key name and secret key value.\n */\n private _credential: NamedKeyCredential;\n\n /**\n * Initializes a new instance of SasTokenProvider\n * @param credential - The source `NamedKeyCredential` or `SASCredential`.\n */\n constructor(credential: NamedKeyCredential) {\n this._credential = credential;\n }\n\n /**\n * Gets the sas token for the specified audience\n * @param scopes - The scope for which the token is desired.\n */\n async getToken(scopes: string | string[]): Promise<AccessToken | null> {\n const audience = Array.isArray(scopes) ? scopes[0] : scopes;\n return createToken(\n this._credential.sharedAccessKeyName,\n this._credential.sharedAccessKey,\n Math.floor(Date.now() / 1000) + 3600,\n audience,\n );\n }\n}\n\n/**\n * Creates the sas token based on the provided information.\n * @param keyName - The shared access key name.\n * @param key - The shared access key.\n * @param expiry - The time period in unix time after which the token will expire.\n * @param audience - The audience for which the token is desired.\n * @internal\n */\nasync function createToken(\n keyName: string,\n key: string,\n expiry: number,\n audience: string,\n): Promise<AccessToken> {\n audience = encodeURIComponent(audience.toLowerCase());\n keyName = encodeURIComponent(keyName);\n const stringToSign = audience + \"\\n\" + expiry;\n const sig = await signString(key, stringToSign);\n\n return {\n token: `SharedAccessSignature sr=${audience}&sig=${sig}&se=${expiry}&skn=${keyName}`,\n expiresOnTimestamp: expiry,\n };\n}\n"]}
1
+ {"version":3,"file":"sasTokenCredential.js","sourceRoot":"","sources":["../../../src/auth/sasTokenCredential.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAiB7C;;;;;GAKG;AACH,MAAM,OAAO,kBAAkB;IAM7B;;;OAGG;IACH,YAAY,UAA8B;QACxC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,QAAQ,CAAC,MAAyB;QACtC,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QAC5D,OAAO,WAAW,CAChB,IAAI,CAAC,WAAW,CAAC,mBAAmB,EACpC,IAAI,CAAC,WAAW,CAAC,eAAe,EAChC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,EACpC,QAAQ,CACT,CAAC;IACJ,CAAC;CACF;AAED;;;;;;;GAOG;AACH,KAAK,UAAU,WAAW,CACxB,OAAe,EACf,GAAW,EACX,MAAc,EACd,QAAgB;IAEhB,QAAQ,GAAG,kBAAkB,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;IACtD,OAAO,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACtC,MAAM,YAAY,GAAG,QAAQ,GAAG,IAAI,GAAG,MAAM,CAAC;IAC9C,MAAM,GAAG,GAAG,MAAM,UAAU,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IAEhD,OAAO;QACL,KAAK,EAAE,4BAA4B,QAAQ,QAAQ,GAAG,OAAO,MAAM,QAAQ,OAAO,EAAE;QACpF,kBAAkB,EAAE,MAAM;KAC3B,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AccessToken, TokenCredential } from \"@azure/core-auth\";\nimport { signString } from \"./hmacSha256.js\";\n\n/**\n * Represents a named key credential.\n */\nexport interface NamedKeyCredential {\n /**\n * The Shared Access Signature key name.\n */\n sharedAccessKeyName: string;\n\n /**\n * The Shared Access Signature key value.\n */\n sharedAccessKey: string;\n}\n\n/**\n * A TokenProvider that generates a Sas token:\n * `SharedAccessSignature sr=<resource>&sig=<signature>&se=<expiry>&skn=<keyname>`\n *\n * @internal\n */\nexport class SasTokenCredential implements TokenCredential {\n /**\n * The SASCredential containing the key name and secret key value.\n */\n private _credential: NamedKeyCredential;\n\n /**\n * Initializes a new instance of SasTokenProvider\n * @param credential - The source `NamedKeyCredential` or `SASCredential`.\n */\n constructor(credential: NamedKeyCredential) {\n this._credential = credential;\n }\n\n /**\n * Gets the sas token for the specified audience\n * @param scopes - The scope for which the token is desired.\n */\n async getToken(scopes: string | string[]): Promise<AccessToken | null> {\n const audience = Array.isArray(scopes) ? scopes[0] : scopes;\n return createToken(\n this._credential.sharedAccessKeyName,\n this._credential.sharedAccessKey,\n Math.floor(Date.now() / 1000) + 3600,\n audience,\n );\n }\n}\n\n/**\n * Creates the sas token based on the provided information.\n * @param keyName - The shared access key name.\n * @param key - The shared access key.\n * @param expiry - The time period in unix time after which the token will expire.\n * @param audience - The audience for which the token is desired.\n * @internal\n */\nasync function createToken(\n keyName: string,\n key: string,\n expiry: number,\n audience: string,\n): Promise<AccessToken> {\n audience = encodeURIComponent(audience.toLowerCase());\n keyName = encodeURIComponent(keyName);\n const stringToSign = audience + \"\\n\" + expiry;\n const sig = await signString(key, stringToSign);\n\n return {\n token: `SharedAccessSignature sr=${audience}&sig=${sig}&se=${expiry}&skn=${keyName}`,\n expiresOnTimestamp: expiry,\n };\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  export * from "./notificationHubsClient.js";
4
4
  export * from "./models/index.js";
5
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mBAAmB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport * from \"./notificationHubsClient.js\";\nexport * from \"./models/index.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mBAAmB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport * from \"./notificationHubsClient.js\";\nexport * from \"./models/index.js\";\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  export * from "./installation.js";
4
4
  export * from "./notification.js";
5
5
  export * from "./notificationBodyBuilder.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,2BAA2B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport * from \"./installation.js\";\nexport * from \"./notification.js\";\nexport * from \"./notificationBodyBuilder.js\";\nexport * from \"./notificationHeaderBuilder.js\";\nexport * from \"./notificationDetails.js\";\nexport * from \"./notificationHubJob.js\";\nexport * from \"./options.js\";\nexport * from \"./registration.js\";\nexport * from \"./response.js\";\nexport * from \"./tagExpressionBuilder.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,2BAA2B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport * from \"./installation.js\";\nexport * from \"./notification.js\";\nexport * from \"./notificationBodyBuilder.js\";\nexport * from \"./notificationHeaderBuilder.js\";\nexport * from \"./notificationDetails.js\";\nexport * from \"./notificationHubJob.js\";\nexport * from \"./options.js\";\nexport * from \"./registration.js\";\nexport * from \"./response.js\";\nexport * from \"./tagExpressionBuilder.js\";\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  /**
4
4
  * Creates an Apple based installation.
5
5
  * @param installation - A partial installation used to create the Apple installation.
@@ -1 +1 @@
1
- {"version":3,"file":"installation.js","sourceRoot":"","sources":["../../../src/models/installation.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAmElC;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAqC;IAC3E,uCACK,YAAY,KACf,QAAQ,EAAE,MAAM,IAChB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,YAAqC;IACzE,uCACK,YAAY,KACf,QAAQ,EAAE,KAAK,IACf;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAqC;IAC3E,uCACK,YAAY,KACf,QAAQ,EAAE,OAAO,IACjB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CACzC,YAAqC;IAErC,uCACK,YAAY,KACf,QAAQ,EAAE,KAAK,IACf;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAqC;IAC3E,uCACK,YAAY,KACf,QAAQ,EAAE,OAAO,IACjB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CACtC,YAAqC;IAErC,uCACK,YAAY,KACf,QAAQ,EAAE,QAAQ,IAClB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CACvC,YAAqC;IAErC,uCACK,YAAY,KACf,QAAQ,EAAE,KAAK,IACf;AACJ,CAAC;AA0CD;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CACvC,YAAuC;IAEvC,uCACK,YAAY,KACf,QAAQ,EAAE,SAAS,IACnB;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Represents an installation for a device for Notification Hubs.\n */\nexport interface InstallationCommon {\n /**\n * The ID for the installation.\n */\n installationId: string;\n\n /**\n * The User ID for the installation used for targeting.\n */\n userId?: string;\n\n /**\n * The installation expiration time.\n */\n readonly expirationTime?: string;\n\n /**\n * The last update date of the installation.\n */\n readonly lastUpdate?: string;\n\n /**\n * The tags used for targeting this installation.\n */\n tags?: string[];\n\n /**\n * The templates for the installation.\n */\n templates?: Record<string, InstallationTemplate>;\n\n /**\n * This parameter is true if the PNS expired the channel.\n */\n readonly pushChannelExpired?: boolean;\n\n /**\n * The push variables for the installation.\n */\n pushVariables?: Record<string, string>;\n}\n\n/**\n * Represents an installation with a string based device token.\n */\nexport interface DeviceTokenInstallation extends InstallationCommon {\n /**\n * The push channel for a device.\n */\n pushChannel: string;\n}\n\n/**\n * Represents an Apple APNs based installation.\n */\nexport interface AppleInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"apns\";\n}\n\n/**\n * Creates an Apple based installation.\n * @param installation - A partial installation used to create the Apple installation.\n * @returns The newly created Apple installation.\n */\nexport function createAppleInstallation(installation: DeviceTokenInstallation): AppleInstallation {\n return {\n ...installation,\n platform: \"apns\",\n };\n}\n\n/**\n * Represents an Amazon Device Messaging (ADM) based installation.\n */\nexport interface AdmInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"adm\";\n}\n\n/**\n * Creates an Amazon Device Messaging (ADM) based installation.\n * @param installation - A partial installation used to create the ADM installation.\n * @returns The newly created ADM installation.\n */\nexport function createAdmInstallation(installation: DeviceTokenInstallation): AdmInstallation {\n return {\n ...installation,\n platform: \"adm\",\n };\n}\n\n/**\n * Represents a Baidu based installation.\n */\nexport interface BaiduInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"baidu\";\n}\n\n/**\n * Creates a Baidu based installation.\n * @param installation - A partial installation used to create the Baidu installation.\n * @returns The newly created Baidu installation.\n */\nexport function createBaiduInstallation(installation: DeviceTokenInstallation): BaiduInstallation {\n return {\n ...installation,\n platform: \"baidu\",\n };\n}\n\n/**\n * Represents a Firebase Legacy HTTP installation.\n */\nexport interface FcmLegacyInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"gcm\";\n}\n\n/**\n * Creates a Firebase legacy HTTP based installation.\n * @param installation - A partial installation used to create the Firebase Legacy HTTP installation.\n * @returns The newly created Baidu installation.\n */\nexport function createFcmLegacyInstallation(\n installation: DeviceTokenInstallation,\n): FcmLegacyInstallation {\n return {\n ...installation,\n platform: \"gcm\",\n };\n}\n\n/**\n * Represents an Firebase V1 Cloud Messaging based installation.\n */\nexport interface FcmV1Installation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"fcmv1\";\n}\n\n/**\n * Creates an Firebase V1 Cloud Messaging based installation.\n * @param installation - A partial installation used to create the Firebase V1 Cloud Messaging installation.\n * @returns The newly created Firebase V1 Cloud Messaging installation.\n */\nexport function createFcmV1Installation(installation: DeviceTokenInstallation): FcmV1Installation {\n return {\n ...installation,\n platform: \"fcmv1\",\n };\n}\n\n/**\n * Represents a Xiaomi based installation.\n */\nexport interface XiaomiInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"xiaomi\";\n}\n\n/**\n * Creates a Xiaomi based installation.\n * @param installation - A partial installation used to create the Xiaomi installation.\n * @returns The newly created Xiaomi installation.\n */\nexport function createXiaomiInstallation(\n installation: DeviceTokenInstallation,\n): XiaomiInstallation {\n return {\n ...installation,\n platform: \"xiaomi\",\n };\n}\n\n/**\n * Represents a Windows Notification Services (WNS) based installation.\n */\nexport interface WindowsInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"wns\";\n}\n\n/**\n * Creates a Windows Notification Services (WNS) based installation.\n * @param installation - A partial installation used to create the WNS installation.\n * @returns The newly created WNS installation.\n */\nexport function createWindowsInstallation(\n installation: DeviceTokenInstallation,\n): WindowsInstallation {\n return {\n ...installation,\n platform: \"wns\",\n };\n}\n\n/**\n * Represents the push channel for a Browser Push installation.\n */\nexport interface BrowserPushChannel {\n /**\n * The P256DH for the browser push installation.\n */\n p256dh: string;\n\n /**\n * The auth secret for the browser push installation.\n */\n auth: string;\n\n /**\n * The endpoint URL for the browser push installation.\n */\n endpoint: string;\n}\n\n/**\n * Represents a Browser/Web Push based installation.\n */\nexport interface BrowserInstallationCommon extends InstallationCommon {\n /**\n * The push channel for the Web Push API.\n */\n pushChannel: BrowserPushChannel;\n}\n\n/**\n * Represents a Browser/Web Push based installation.\n */\nexport interface BrowserInstallation extends BrowserInstallationCommon {\n /**\n * The platform for the installation.\n */\n platform: \"browser\";\n}\n\n/**\n * Creates a Web Push based installation.\n * @param installation - A partial installation used to create the Web Push installation.\n * @returns The newly created Web Push installation.\n */\nexport function createBrowserInstallation(\n installation: BrowserInstallationCommon,\n): BrowserInstallation {\n return {\n ...installation,\n platform: \"browser\",\n };\n}\n\n/**\n * Represents the types of installations available in Notification Hubs.\n */\nexport type Installation =\n | AppleInstallation\n | AdmInstallation\n | BaiduInstallation\n | BrowserInstallation\n | FcmLegacyInstallation\n | FcmV1Installation\n | XiaomiInstallation\n | WindowsInstallation;\n\n/**\n * Represents an installation template.\n */\nexport interface InstallationTemplate {\n /**\n * The body for the installation template.\n */\n body: string;\n\n /**\n * Headers to include for the template send.\n */\n headers: Record<string, string>;\n\n /**\n * The tags to include for the template.\n */\n tags?: string[];\n}\n\n/**\n * Represents the JSON Patch types of add, remove and replace.\n */\nexport type JsonPatchOperation = \"add\" | \"remove\" | \"replace\";\n\n/**\n * Represents a patch operation.\n */\nexport interface JsonPatch {\n /**\n * The patch operation.\n */\n op: JsonPatchOperation;\n\n /**\n * The path for the patch operation.\n */\n path: string;\n\n /**\n * The value to add or replace for the operation.\n */\n value?: string;\n}\n\n/**\n * Represents the types of push channels available for Notification Hubs.\n */\nexport type PushHandle = BrowserPushChannel | string;\n"]}
1
+ {"version":3,"file":"installation.js","sourceRoot":"","sources":["../../../src/models/installation.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAmElC;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAqC;IAC3E,uCACK,YAAY,KACf,QAAQ,EAAE,MAAM,IAChB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,YAAqC;IACzE,uCACK,YAAY,KACf,QAAQ,EAAE,KAAK,IACf;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAqC;IAC3E,uCACK,YAAY,KACf,QAAQ,EAAE,OAAO,IACjB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CACzC,YAAqC;IAErC,uCACK,YAAY,KACf,QAAQ,EAAE,KAAK,IACf;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAqC;IAC3E,uCACK,YAAY,KACf,QAAQ,EAAE,OAAO,IACjB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CACtC,YAAqC;IAErC,uCACK,YAAY,KACf,QAAQ,EAAE,QAAQ,IAClB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CACvC,YAAqC;IAErC,uCACK,YAAY,KACf,QAAQ,EAAE,KAAK,IACf;AACJ,CAAC;AA0CD;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CACvC,YAAuC;IAEvC,uCACK,YAAY,KACf,QAAQ,EAAE,SAAS,IACnB;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Represents an installation for a device for Notification Hubs.\n */\nexport interface InstallationCommon {\n /**\n * The ID for the installation.\n */\n installationId: string;\n\n /**\n * The User ID for the installation used for targeting.\n */\n userId?: string;\n\n /**\n * The installation expiration time.\n */\n readonly expirationTime?: string;\n\n /**\n * The last update date of the installation.\n */\n readonly lastUpdate?: string;\n\n /**\n * The tags used for targeting this installation.\n */\n tags?: string[];\n\n /**\n * The templates for the installation.\n */\n templates?: Record<string, InstallationTemplate>;\n\n /**\n * This parameter is true if the PNS expired the channel.\n */\n readonly pushChannelExpired?: boolean;\n\n /**\n * The push variables for the installation.\n */\n pushVariables?: Record<string, string>;\n}\n\n/**\n * Represents an installation with a string based device token.\n */\nexport interface DeviceTokenInstallation extends InstallationCommon {\n /**\n * The push channel for a device.\n */\n pushChannel: string;\n}\n\n/**\n * Represents an Apple APNs based installation.\n */\nexport interface AppleInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"apns\";\n}\n\n/**\n * Creates an Apple based installation.\n * @param installation - A partial installation used to create the Apple installation.\n * @returns The newly created Apple installation.\n */\nexport function createAppleInstallation(installation: DeviceTokenInstallation): AppleInstallation {\n return {\n ...installation,\n platform: \"apns\",\n };\n}\n\n/**\n * Represents an Amazon Device Messaging (ADM) based installation.\n */\nexport interface AdmInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"adm\";\n}\n\n/**\n * Creates an Amazon Device Messaging (ADM) based installation.\n * @param installation - A partial installation used to create the ADM installation.\n * @returns The newly created ADM installation.\n */\nexport function createAdmInstallation(installation: DeviceTokenInstallation): AdmInstallation {\n return {\n ...installation,\n platform: \"adm\",\n };\n}\n\n/**\n * Represents a Baidu based installation.\n */\nexport interface BaiduInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"baidu\";\n}\n\n/**\n * Creates a Baidu based installation.\n * @param installation - A partial installation used to create the Baidu installation.\n * @returns The newly created Baidu installation.\n */\nexport function createBaiduInstallation(installation: DeviceTokenInstallation): BaiduInstallation {\n return {\n ...installation,\n platform: \"baidu\",\n };\n}\n\n/**\n * Represents a Firebase Legacy HTTP installation.\n */\nexport interface FcmLegacyInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"gcm\";\n}\n\n/**\n * Creates a Firebase legacy HTTP based installation.\n * @param installation - A partial installation used to create the Firebase Legacy HTTP installation.\n * @returns The newly created Baidu installation.\n */\nexport function createFcmLegacyInstallation(\n installation: DeviceTokenInstallation,\n): FcmLegacyInstallation {\n return {\n ...installation,\n platform: \"gcm\",\n };\n}\n\n/**\n * Represents an Firebase V1 Cloud Messaging based installation.\n */\nexport interface FcmV1Installation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"fcmv1\";\n}\n\n/**\n * Creates an Firebase V1 Cloud Messaging based installation.\n * @param installation - A partial installation used to create the Firebase V1 Cloud Messaging installation.\n * @returns The newly created Firebase V1 Cloud Messaging installation.\n */\nexport function createFcmV1Installation(installation: DeviceTokenInstallation): FcmV1Installation {\n return {\n ...installation,\n platform: \"fcmv1\",\n };\n}\n\n/**\n * Represents a Xiaomi based installation.\n */\nexport interface XiaomiInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"xiaomi\";\n}\n\n/**\n * Creates a Xiaomi based installation.\n * @param installation - A partial installation used to create the Xiaomi installation.\n * @returns The newly created Xiaomi installation.\n */\nexport function createXiaomiInstallation(\n installation: DeviceTokenInstallation,\n): XiaomiInstallation {\n return {\n ...installation,\n platform: \"xiaomi\",\n };\n}\n\n/**\n * Represents a Windows Notification Services (WNS) based installation.\n */\nexport interface WindowsInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"wns\";\n}\n\n/**\n * Creates a Windows Notification Services (WNS) based installation.\n * @param installation - A partial installation used to create the WNS installation.\n * @returns The newly created WNS installation.\n */\nexport function createWindowsInstallation(\n installation: DeviceTokenInstallation,\n): WindowsInstallation {\n return {\n ...installation,\n platform: \"wns\",\n };\n}\n\n/**\n * Represents the push channel for a Browser Push installation.\n */\nexport interface BrowserPushChannel {\n /**\n * The P256DH for the browser push installation.\n */\n p256dh: string;\n\n /**\n * The auth secret for the browser push installation.\n */\n auth: string;\n\n /**\n * The endpoint URL for the browser push installation.\n */\n endpoint: string;\n}\n\n/**\n * Represents a Browser/Web Push based installation.\n */\nexport interface BrowserInstallationCommon extends InstallationCommon {\n /**\n * The push channel for the Web Push API.\n */\n pushChannel: BrowserPushChannel;\n}\n\n/**\n * Represents a Browser/Web Push based installation.\n */\nexport interface BrowserInstallation extends BrowserInstallationCommon {\n /**\n * The platform for the installation.\n */\n platform: \"browser\";\n}\n\n/**\n * Creates a Web Push based installation.\n * @param installation - A partial installation used to create the Web Push installation.\n * @returns The newly created Web Push installation.\n */\nexport function createBrowserInstallation(\n installation: BrowserInstallationCommon,\n): BrowserInstallation {\n return {\n ...installation,\n platform: \"browser\",\n };\n}\n\n/**\n * Represents the types of installations available in Notification Hubs.\n */\nexport type Installation =\n | AppleInstallation\n | AdmInstallation\n | BaiduInstallation\n | BrowserInstallation\n | FcmLegacyInstallation\n | FcmV1Installation\n | XiaomiInstallation\n | WindowsInstallation;\n\n/**\n * Represents an installation template.\n */\nexport interface InstallationTemplate {\n /**\n * The body for the installation template.\n */\n body: string;\n\n /**\n * Headers to include for the template send.\n */\n headers: Record<string, string>;\n\n /**\n * The tags to include for the template.\n */\n tags?: string[];\n}\n\n/**\n * Represents the JSON Patch types of add, remove and replace.\n */\nexport type JsonPatchOperation = \"add\" | \"remove\" | \"replace\";\n\n/**\n * Represents a patch operation.\n */\nexport interface JsonPatch {\n /**\n * The patch operation.\n */\n op: JsonPatchOperation;\n\n /**\n * The path for the patch operation.\n */\n path: string;\n\n /**\n * The value to add or replace for the operation.\n */\n value?: string;\n}\n\n/**\n * Represents the types of push channels available for Notification Hubs.\n */\nexport type PushHandle = BrowserPushChannel | string;\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  import * as Constants from "../utils/constants.js";
4
4
  function isString(value) {
5
5
  return typeof value === "string" || value instanceof String;
@@ -1 +1 @@
1
- {"version":3,"file":"notification.js","sourceRoot":"","sources":["../../../src/models/notification.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AASnD,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,YAAY,MAAM,CAAC;AAC9D,CAAC;AAmED;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAqC;IAC3E,MAAM,IAAI,GAAG,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,CA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CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,CAAC,OAAO,GAAG,EAAE,CAAC;IACtB,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE,CAAC;QAC7C,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,aAAa,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;IAC9D,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport * as Constants from \"../utils/constants.js\";\nimport {\n AdmNativeMessage,\n AppleNativeMessage,\n FirebaseLegacyNativeMessage,\n FirebaseV1NativeMessage,\n} from \"./notificationBodyBuilder.js\";\nimport { AppleHeaders, WindowsHeaders } from \"./notificationHeaderBuilder.js\";\n\nfunction isString(value: unknown): value is string {\n return typeof value === \"string\" || value instanceof String;\n}\n\n/**\n * Represents a notification that can be sent to a device.\n */\nexport interface NotificationCommon {\n /**\n * The body for the push notification.\n */\n body: string;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: Record<string, unknown>;\n}\n\n/**\n * The common notification parameters to accept a string body or JSON body.\n */\nexport interface NotificationCommonParams {\n /**\n * The body for the push notification.\n */\n body: string | unknown;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: Record<string, unknown>;\n}\n\n/**\n * Represents a JSON notification hub.\n */\nexport interface JsonNotification extends NotificationCommon {\n /**\n * The content type for the push notification.\n */\n contentType: \"application/json;charset=utf-8\";\n}\n\n/**\n * Represents an Apple APNs push notification.\n */\nexport interface AppleNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"apple\";\n}\n\n/**\n * Represents an Apple notification that can be sent to a device.\n */\nexport interface AppleNotificationParams {\n /**\n * The body for the push notification.\n */\n body: string | AppleNativeMessage;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: AppleHeaders;\n}\n\n/**\n * Creates a notification to send to an Apple device.\n * @param notification - A partial message used to create a message for Apple.\n * @returns A newly created Apple.\n */\nexport function createAppleNotification(notification: AppleNotificationParams): AppleNotification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"apple\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents an Amazon Device Messaging (ADM) push notification.\n */\nexport interface AdmNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"adm\";\n}\n\n/**\n * Represents an ADM notification that can be sent to a device.\n */\nexport interface AdmNotificationParams {\n /**\n * The body for the push notification.\n */\n body: string | AdmNativeMessage;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: Record<string, string>;\n}\n\n/**\n * Creates a notification to send to an Amazon Device Messaging device.\n * @param notification - A partial message used to create a message for Amazon Device Messaging.\n * @returns A newly created Amazon Device Messaging.\n */\nexport function createAdmNotification(notification: AdmNotificationParams): AdmNotification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"adm\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents a Baidu push notification.\n */\nexport interface BaiduNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"baidu\";\n}\n\n/**\n * Creates a notification to send to a Baidu registered device.\n * @param notification - A partial message used to create a message for Baidu.\n * @returns A newly created Baidu.\n */\nexport function createBaiduNotification(notification: NotificationCommonParams): BaiduNotification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"baidu\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents a Browser push notification.\n */\nexport interface BrowserNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"browser\";\n}\n\n/**\n * Creates a notification to send to a browser.\n * @param notification - A partial message used to create a message for a browser.\n * @returns A newly created Web Push browser.\n */\nexport function createBrowserNotification(\n notification: NotificationCommonParams,\n): BrowserNotification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"browser\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents a Firebase legacy HTTP push notification.\n */\nexport interface FcmLegacyNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"gcm\";\n}\n\n/**\n * Represents an Firebase Legacy notification that can be sent to a device.\n */\nexport interface FcmLegacyNotificationParams {\n /**\n * The body for the push notification.\n */\n body: string | FirebaseLegacyNativeMessage;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: Record<string, string>;\n}\n\n/**\n * Creates a notification to send to Firebase.\n * @param notification - A partial message used to create a message for Firebase.\n * @returns A newly created Firebase notification.\n */\nexport function createFcmLegacyNotification(\n notification: FcmLegacyNotificationParams,\n): FcmLegacyNotification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"gcm\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents an Firebase V1 API notification that can be sent to a device.\n */\nexport interface FcmV1Notification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"fcmv1\";\n}\n\n/**\n * Represents an Firebase V1 notification that can be sent to a device.\n */\nexport interface FcmV1NotificationParams {\n /**\n * The body for the push notification.\n */\n body: string | FirebaseV1NativeMessage;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: Record<string, string>;\n}\n\n/**\n * Creates a notification to send to Firebase.\n * @param notification - A partial message used to create a message for Firebase.\n * @returns A newly created Firebase notification.\n */\nexport function createFcmV1Notification(notification: FcmV1NotificationParams): FcmV1Notification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"fcmv1\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents a Xiaomi push notification.\n */\nexport interface XiaomiNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"xiaomi\";\n}\n\n/**\n * Creates a notification to send to Xiaomi.\n * @param notification - A partial message used to create a message for Xiaomi.\n * @returns A newly created Xiaomi notification.\n */\nexport function createXiaomiNotification(\n notification: NotificationCommonParams,\n): XiaomiNotification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"xiaomi\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents a template based push notification.\n */\nexport interface TemplateNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"template\";\n}\n\n/**\n * Creates a template notification.\n * @param notification - A partial message used to be used for a template notification.\n * @returns A newly created Firebase.\n */\nexport function createTemplateNotification(\n notification: NotificationCommonParams,\n): TemplateNotification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"template\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents the possible WNS content-types.\n */\nexport type WindowsContentType = \"application/xml\" | \"application/octet-stream\";\n\n/**\n * Represents a Windows Notification Services (WNS) push notification.\n */\nexport interface WindowsNotification extends NotificationCommon {\n /**\n * The platform for the push notification.\n */\n platform: \"windows\";\n\n /**\n * The content type for the push notification.\n */\n contentType: WindowsContentType;\n}\n\n/**\n * Represents a WNS notification that can be sent to a device.\n */\nexport interface WnsNotificationParams {\n /**\n * The body for the push notification.\n */\n body: string;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: WindowsHeaders;\n}\n\n/**\n * Creates a notification to send to WNS.\n * @param notification - The WNS notification to send.\n * @returns A newly created WNS message.\n */\nexport function createWindowsNotification(\n notification: WnsNotificationParams,\n): WindowsNotification {\n if (notification?.headers && notification.headers[\"X-WNS-Type\"]) {\n const wnsType = notification.headers[\"X-WNS-Type\"];\n switch (wnsType) {\n case Constants.WNS_TOAST:\n return createWindowsToastNotification(notification);\n case Constants.WNS_TITLE:\n return createWindowsTileNotification(notification);\n case Constants.WNS_BADGE:\n return createWindowsBadgeNotification(notification);\n case Constants.WNS_RAW:\n return createWindowsRawNotification(notification);\n default:\n throw new Error(`Invalid WNS type: ${wnsType}`);\n }\n } else {\n throw new Error(`Missing WNS type in headers`);\n }\n}\n\n/**\n * Creates a badge message to send to WNS.\n * @param notification - A partial message used to create a badge message for WNS.\n * @returns A newly created WNS badge.\n */\nexport function createWindowsBadgeNotification(\n notification: WnsNotificationParams,\n): WindowsNotification {\n const result: WindowsNotification = {\n ...notification,\n platform: \"windows\",\n contentType: Constants.XML_CONTENT_TYPE,\n };\n\n if (!result.headers) {\n result.headers = {};\n }\n\n if (!result.headers[Constants.WNS_TYPE_NAME]) {\n result.headers[Constants.WNS_TYPE_NAME] = Constants.WNS_BADGE;\n }\n\n return result;\n}\n\n/**\n * Creates a tile message to send to WNS.\n * @param notification - A partial message used to create a tile message for WNS.\n * @returns A newly created WNS tile.\n */\nexport function createWindowsTileNotification(\n notification: WnsNotificationParams,\n): WindowsNotification {\n const result: WindowsNotification = {\n ...notification,\n platform: \"windows\",\n contentType: Constants.XML_CONTENT_TYPE,\n };\n\n if (!result.headers) {\n result.headers = {};\n }\n\n if (!result.headers[Constants.WNS_TYPE_NAME]) {\n result.headers[Constants.WNS_TYPE_NAME] = Constants.WNS_TITLE;\n }\n\n return result;\n}\n\n/**\n * Creates a toast message to send to WNS.\n * @param notification - A partial message used to create a toast message for WNS.\n * @returns A newly created WNS toast.\n */\nexport function createWindowsToastNotification(\n notification: WnsNotificationParams,\n): WindowsNotification {\n const result: WindowsNotification = {\n ...notification,\n platform: \"windows\",\n contentType: Constants.XML_CONTENT_TYPE,\n };\n\n if (!result.headers) {\n result.headers = {};\n }\n\n if (!result.headers[Constants.WNS_TYPE_NAME]) {\n result.headers[Constants.WNS_TYPE_NAME] = Constants.WNS_TOAST;\n }\n\n return result;\n}\n\n/**\n * Creates a notification to send to WNS in wns/raw format..\n * @param notification - A partial message used to create a message for WNS in XML format.\n * @returns A newly created WNS message using XML.\n */\nexport function createWindowsRawNotification(\n notification: WnsNotificationParams,\n): WindowsNotification {\n const result: WindowsNotification = {\n ...notification,\n platform: \"windows\",\n contentType: Constants.STREAM_CONTENT_TYPE,\n };\n\n if (!result.headers) {\n result.headers = {};\n }\n\n if (!result.headers[Constants.WNS_TYPE_NAME]) {\n result.headers[Constants.WNS_TYPE_NAME] = Constants.WNS_RAW;\n }\n\n return result;\n}\n\n/**\n * Represents the possible push notification messages types.\n */\nexport type Notification =\n | AppleNotification\n | AdmNotification\n | BaiduNotification\n | BrowserNotification\n | FcmLegacyNotification\n | FcmV1Notification\n | XiaomiNotification\n | WindowsNotification\n | TemplateNotification;\n"]}
1
+ {"version":3,"file":"notification.js","sourceRoot":"","sources":["../../../src/models/notification.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AASnD,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,YAAY,MAAM,CAAC;AAC9D,CAAC;AAmED;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAqC;IAC3E,MAAM,IAAI,GAAG,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IAEjG,uCACK,YAAY,KACf,IAAI,EACJ,QAAQ,EAAE,OAAO,EACjB,WAAW,EAAE,SAAS,CAAC,iBAAiB,IACxC;AACJ,CAAC;AA2BD;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,YAAmC;IACvE,MAAM,IAAI,GAAG,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IAEjG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,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,aAAa,CAAC,GAAG,SAAS,CAAC,SAAS,CAAC;IAChE,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,8BAA8B,CAC5C,YAAmC;IAEnC,MAAM,MAAM,mCACP,YAAY,KACf,QAAQ,EAAE,SAAS,EACnB,WAAW,EAAE,SAAS,CAAC,gBAAgB,GACxC,CAAC;IAEF,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,CAAC,OAAO,GAAG,EAAE,CAAC;IACtB,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE,CAAC;QAC7C,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,aAAa,CAAC,GAAG,SAAS,CAAC,SAAS,CAAC;IAChE,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,4BAA4B,CAC1C,YAAmC;IAEnC,MAAM,MAAM,mCACP,YAAY,KACf,QAAQ,EAAE,SAAS,EACnB,WAAW,EAAE,SAAS,CAAC,mBAAmB,GAC3C,CAAC;IAEF,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,CAAC,OAAO,GAAG,EAAE,CAAC;IACtB,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE,CAAC;QAC7C,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,aAAa,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;IAC9D,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport * as Constants from \"../utils/constants.js\";\nimport {\n AdmNativeMessage,\n AppleNativeMessage,\n FirebaseLegacyNativeMessage,\n FirebaseV1NativeMessage,\n} from \"./notificationBodyBuilder.js\";\nimport { AppleHeaders, WindowsHeaders } from \"./notificationHeaderBuilder.js\";\n\nfunction isString(value: unknown): value is string {\n return typeof value === \"string\" || value instanceof String;\n}\n\n/**\n * Represents a notification that can be sent to a device.\n */\nexport interface NotificationCommon {\n /**\n * The body for the push notification.\n */\n body: string;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: Record<string, unknown>;\n}\n\n/**\n * The common notification parameters to accept a string body or JSON body.\n */\nexport interface NotificationCommonParams {\n /**\n * The body for the push notification.\n */\n body: string | unknown;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: Record<string, unknown>;\n}\n\n/**\n * Represents a JSON notification hub.\n */\nexport interface JsonNotification extends NotificationCommon {\n /**\n * The content type for the push notification.\n */\n contentType: \"application/json;charset=utf-8\";\n}\n\n/**\n * Represents an Apple APNs push notification.\n */\nexport interface AppleNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"apple\";\n}\n\n/**\n * Represents an Apple notification that can be sent to a device.\n */\nexport interface AppleNotificationParams {\n /**\n * The body for the push notification.\n */\n body: string | AppleNativeMessage;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: AppleHeaders;\n}\n\n/**\n * Creates a notification to send to an Apple device.\n * @param notification - A partial message used to create a message for Apple.\n * @returns A newly created Apple.\n */\nexport function createAppleNotification(notification: AppleNotificationParams): AppleNotification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"apple\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents an Amazon Device Messaging (ADM) push notification.\n */\nexport interface AdmNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"adm\";\n}\n\n/**\n * Represents an ADM notification that can be sent to a device.\n */\nexport interface AdmNotificationParams {\n /**\n * The body for the push notification.\n */\n body: string | AdmNativeMessage;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: Record<string, string>;\n}\n\n/**\n * Creates a notification to send to an Amazon Device Messaging device.\n * @param notification - A partial message used to create a message for Amazon Device Messaging.\n * @returns A newly created Amazon Device Messaging.\n */\nexport function createAdmNotification(notification: AdmNotificationParams): AdmNotification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"adm\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents a Baidu push notification.\n */\nexport interface BaiduNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"baidu\";\n}\n\n/**\n * Creates a notification to send to a Baidu registered device.\n * @param notification - A partial message used to create a message for Baidu.\n * @returns A newly created Baidu.\n */\nexport function createBaiduNotification(notification: NotificationCommonParams): BaiduNotification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"baidu\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents a Browser push notification.\n */\nexport interface BrowserNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"browser\";\n}\n\n/**\n * Creates a notification to send to a browser.\n * @param notification - A partial message used to create a message for a browser.\n * @returns A newly created Web Push browser.\n */\nexport function createBrowserNotification(\n notification: NotificationCommonParams,\n): BrowserNotification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"browser\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents a Firebase legacy HTTP push notification.\n */\nexport interface FcmLegacyNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"gcm\";\n}\n\n/**\n * Represents an Firebase Legacy notification that can be sent to a device.\n */\nexport interface FcmLegacyNotificationParams {\n /**\n * The body for the push notification.\n */\n body: string | FirebaseLegacyNativeMessage;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: Record<string, string>;\n}\n\n/**\n * Creates a notification to send to Firebase.\n * @param notification - A partial message used to create a message for Firebase.\n * @returns A newly created Firebase notification.\n */\nexport function createFcmLegacyNotification(\n notification: FcmLegacyNotificationParams,\n): FcmLegacyNotification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"gcm\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents an Firebase V1 API notification that can be sent to a device.\n */\nexport interface FcmV1Notification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"fcmv1\";\n}\n\n/**\n * Represents an Firebase V1 notification that can be sent to a device.\n */\nexport interface FcmV1NotificationParams {\n /**\n * The body for the push notification.\n */\n body: string | FirebaseV1NativeMessage;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: Record<string, string>;\n}\n\n/**\n * Creates a notification to send to Firebase.\n * @param notification - A partial message used to create a message for Firebase.\n * @returns A newly created Firebase notification.\n */\nexport function createFcmV1Notification(notification: FcmV1NotificationParams): FcmV1Notification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"fcmv1\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents a Xiaomi push notification.\n */\nexport interface XiaomiNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"xiaomi\";\n}\n\n/**\n * Creates a notification to send to Xiaomi.\n * @param notification - A partial message used to create a message for Xiaomi.\n * @returns A newly created Xiaomi notification.\n */\nexport function createXiaomiNotification(\n notification: NotificationCommonParams,\n): XiaomiNotification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"xiaomi\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents a template based push notification.\n */\nexport interface TemplateNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"template\";\n}\n\n/**\n * Creates a template notification.\n * @param notification - A partial message used to be used for a template notification.\n * @returns A newly created Firebase.\n */\nexport function createTemplateNotification(\n notification: NotificationCommonParams,\n): TemplateNotification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"template\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents the possible WNS content-types.\n */\nexport type WindowsContentType = \"application/xml\" | \"application/octet-stream\";\n\n/**\n * Represents a Windows Notification Services (WNS) push notification.\n */\nexport interface WindowsNotification extends NotificationCommon {\n /**\n * The platform for the push notification.\n */\n platform: \"windows\";\n\n /**\n * The content type for the push notification.\n */\n contentType: WindowsContentType;\n}\n\n/**\n * Represents a WNS notification that can be sent to a device.\n */\nexport interface WnsNotificationParams {\n /**\n * The body for the push notification.\n */\n body: string;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: WindowsHeaders;\n}\n\n/**\n * Creates a notification to send to WNS.\n * @param notification - The WNS notification to send.\n * @returns A newly created WNS message.\n */\nexport function createWindowsNotification(\n notification: WnsNotificationParams,\n): WindowsNotification {\n if (notification?.headers && notification.headers[\"X-WNS-Type\"]) {\n const wnsType = notification.headers[\"X-WNS-Type\"];\n switch (wnsType) {\n case Constants.WNS_TOAST:\n return createWindowsToastNotification(notification);\n case Constants.WNS_TITLE:\n return createWindowsTileNotification(notification);\n case Constants.WNS_BADGE:\n return createWindowsBadgeNotification(notification);\n case Constants.WNS_RAW:\n return createWindowsRawNotification(notification);\n default:\n throw new Error(`Invalid WNS type: ${wnsType}`);\n }\n } else {\n throw new Error(`Missing WNS type in headers`);\n }\n}\n\n/**\n * Creates a badge message to send to WNS.\n * @param notification - A partial message used to create a badge message for WNS.\n * @returns A newly created WNS badge.\n */\nexport function createWindowsBadgeNotification(\n notification: WnsNotificationParams,\n): WindowsNotification {\n const result: WindowsNotification = {\n ...notification,\n platform: \"windows\",\n contentType: Constants.XML_CONTENT_TYPE,\n };\n\n if (!result.headers) {\n result.headers = {};\n }\n\n if (!result.headers[Constants.WNS_TYPE_NAME]) {\n result.headers[Constants.WNS_TYPE_NAME] = Constants.WNS_BADGE;\n }\n\n return result;\n}\n\n/**\n * Creates a tile message to send to WNS.\n * @param notification - A partial message used to create a tile message for WNS.\n * @returns A newly created WNS tile.\n */\nexport function createWindowsTileNotification(\n notification: WnsNotificationParams,\n): WindowsNotification {\n const result: WindowsNotification = {\n ...notification,\n platform: \"windows\",\n contentType: Constants.XML_CONTENT_TYPE,\n };\n\n if (!result.headers) {\n result.headers = {};\n }\n\n if (!result.headers[Constants.WNS_TYPE_NAME]) {\n result.headers[Constants.WNS_TYPE_NAME] = Constants.WNS_TITLE;\n }\n\n return result;\n}\n\n/**\n * Creates a toast message to send to WNS.\n * @param notification - A partial message used to create a toast message for WNS.\n * @returns A newly created WNS toast.\n */\nexport function createWindowsToastNotification(\n notification: WnsNotificationParams,\n): WindowsNotification {\n const result: WindowsNotification = {\n ...notification,\n platform: \"windows\",\n contentType: Constants.XML_CONTENT_TYPE,\n };\n\n if (!result.headers) {\n result.headers = {};\n }\n\n if (!result.headers[Constants.WNS_TYPE_NAME]) {\n result.headers[Constants.WNS_TYPE_NAME] = Constants.WNS_TOAST;\n }\n\n return result;\n}\n\n/**\n * Creates a notification to send to WNS in wns/raw format..\n * @param notification - A partial message used to create a message for WNS in XML format.\n * @returns A newly created WNS message using XML.\n */\nexport function createWindowsRawNotification(\n notification: WnsNotificationParams,\n): WindowsNotification {\n const result: WindowsNotification = {\n ...notification,\n platform: \"windows\",\n contentType: Constants.STREAM_CONTENT_TYPE,\n };\n\n if (!result.headers) {\n result.headers = {};\n }\n\n if (!result.headers[Constants.WNS_TYPE_NAME]) {\n result.headers[Constants.WNS_TYPE_NAME] = Constants.WNS_RAW;\n }\n\n return result;\n}\n\n/**\n * Represents the possible push notification messages types.\n */\nexport type Notification =\n | AppleNotification\n | AdmNotification\n | BaiduNotification\n | BrowserNotification\n | FcmLegacyNotification\n | FcmV1Notification\n | XiaomiNotification\n | WindowsNotification\n | TemplateNotification;\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  import { stringifyXML } from "@azure/core-xml";
4
4
  /**
5
5
  * Creates an APNs native message to send to Notification Hubs.