@azure/notification-hubs 2.0.3-alpha.20260304.2 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. package/dist/browser/auth/hmacSha256.d.ts +1 -1
  2. package/dist/browser/auth/hmacSha256.d.ts.map +1 -1
  3. package/dist/browser/auth/hmacSha256.js +9 -1
  4. package/dist/browser/auth/hmacSha256.js.map +1 -1
  5. package/dist/browser/index.d.ts +1 -0
  6. package/dist/browser/index.d.ts.map +1 -1
  7. package/dist/browser/index.js +1 -0
  8. package/dist/browser/index.js.map +1 -1
  9. package/dist/browser/utils/constants.js +1 -1
  10. package/dist/browser/utils/constants.js.map +1 -1
  11. package/dist/browser/utils/utils.d.ts +2 -6
  12. package/dist/browser/utils/utils.d.ts.map +1 -1
  13. package/dist/browser/utils/utils.js +3 -8
  14. package/dist/browser/utils/utils.js.map +1 -1
  15. package/dist/commonjs/api/beginSubmitNotificationHubJob.js +1 -0
  16. package/dist/commonjs/api/beginSubmitNotificationHubJob.js.map +1 -1
  17. package/dist/commonjs/api/cancelScheduledNotification.js +1 -0
  18. package/dist/commonjs/api/cancelScheduledNotification.js.map +1 -1
  19. package/dist/commonjs/api/clientContext.js +1 -0
  20. package/dist/commonjs/api/clientContext.js.map +1 -1
  21. package/dist/commonjs/api/createOrUpdateInstallation.js +1 -0
  22. package/dist/commonjs/api/createOrUpdateInstallation.js.map +1 -1
  23. package/dist/commonjs/api/createOrUpdateRegistration.js +1 -0
  24. package/dist/commonjs/api/createOrUpdateRegistration.js.map +1 -1
  25. package/dist/commonjs/api/createRegistration.js +1 -0
  26. package/dist/commonjs/api/createRegistration.js.map +1 -1
  27. package/dist/commonjs/api/createRegistrationId.js +1 -0
  28. package/dist/commonjs/api/createRegistrationId.js.map +1 -1
  29. package/dist/commonjs/api/deleteInstallation.js +1 -0
  30. package/dist/commonjs/api/deleteInstallation.js.map +1 -1
  31. package/dist/commonjs/api/deleteRegistration.js +1 -0
  32. package/dist/commonjs/api/deleteRegistration.js.map +1 -1
  33. package/dist/commonjs/api/getFeedbackContainerUrl.js +1 -0
  34. package/dist/commonjs/api/getFeedbackContainerUrl.js.map +1 -1
  35. package/dist/commonjs/api/getInstallation.js +1 -0
  36. package/dist/commonjs/api/getInstallation.js.map +1 -1
  37. package/dist/commonjs/api/getNotificationHubJob.js +1 -0
  38. package/dist/commonjs/api/getNotificationHubJob.js.map +1 -1
  39. package/dist/commonjs/api/getNotificationOutcomeDetails.js +1 -0
  40. package/dist/commonjs/api/getNotificationOutcomeDetails.js.map +1 -1
  41. package/dist/commonjs/api/getRegistration.js +1 -0
  42. package/dist/commonjs/api/getRegistration.js.map +1 -1
  43. package/dist/commonjs/api/index.js +1 -0
  44. package/dist/commonjs/api/index.js.map +1 -1
  45. package/dist/commonjs/api/internal/_client.js +1 -0
  46. package/dist/commonjs/api/internal/_client.js.map +1 -1
  47. package/dist/commonjs/api/internal/_createOrUpdateRegistrationDescription.js +1 -0
  48. package/dist/commonjs/api/internal/_createOrUpdateRegistrationDescription.js.map +1 -1
  49. package/dist/commonjs/api/internal/_listRegistrations.js +1 -0
  50. package/dist/commonjs/api/internal/_listRegistrations.js.map +1 -1
  51. package/dist/commonjs/api/internal/_scheduleNotification.js +1 -0
  52. package/dist/commonjs/api/internal/_scheduleNotification.js.map +1 -1
  53. package/dist/commonjs/api/internal/_sendNotification.js +1 -0
  54. package/dist/commonjs/api/internal/_sendNotification.js.map +1 -1
  55. package/dist/commonjs/api/listNotificationHubJobs.js +1 -0
  56. package/dist/commonjs/api/listNotificationHubJobs.js.map +1 -1
  57. package/dist/commonjs/api/listRegistrations.js +1 -0
  58. package/dist/commonjs/api/listRegistrations.js.map +1 -1
  59. package/dist/commonjs/api/listRegistrationsByChannel.js +1 -0
  60. package/dist/commonjs/api/listRegistrationsByChannel.js.map +1 -1
  61. package/dist/commonjs/api/listRegistrationsByTag.js +1 -0
  62. package/dist/commonjs/api/listRegistrationsByTag.js.map +1 -1
  63. package/dist/commonjs/api/scheduleBroadcastNotification.js +1 -0
  64. package/dist/commonjs/api/scheduleBroadcastNotification.js.map +1 -1
  65. package/dist/commonjs/api/scheduleNotification.js +1 -0
  66. package/dist/commonjs/api/scheduleNotification.js.map +1 -1
  67. package/dist/commonjs/api/sendBroadcastNotification.js +1 -0
  68. package/dist/commonjs/api/sendBroadcastNotification.js.map +1 -1
  69. package/dist/commonjs/api/sendNotification.js +1 -0
  70. package/dist/commonjs/api/sendNotification.js.map +1 -1
  71. package/dist/commonjs/api/submitNotificationHubJob.js +1 -0
  72. package/dist/commonjs/api/submitNotificationHubJob.js.map +1 -1
  73. package/dist/commonjs/api/updateInstallation.js +1 -0
  74. package/dist/commonjs/api/updateInstallation.js.map +1 -1
  75. package/dist/commonjs/api/updateRegistration.js +1 -0
  76. package/dist/commonjs/api/updateRegistration.js.map +1 -1
  77. package/dist/commonjs/auth/connectionStringUtils.js +1 -0
  78. package/dist/commonjs/auth/connectionStringUtils.js.map +1 -1
  79. package/dist/commonjs/auth/hmacSha256.d.ts.map +1 -1
  80. package/dist/commonjs/auth/hmacSha256.js +18 -3
  81. package/dist/commonjs/auth/hmacSha256.js.map +3 -3
  82. package/dist/commonjs/auth/sasTokenCredential.js +1 -0
  83. package/dist/commonjs/auth/sasTokenCredential.js.map +1 -1
  84. package/dist/commonjs/index.d.ts +1 -0
  85. package/dist/commonjs/index.d.ts.map +1 -1
  86. package/dist/commonjs/index.js +12 -0
  87. package/dist/commonjs/index.js.map +3 -3
  88. package/dist/commonjs/models/index.js +1 -0
  89. package/dist/commonjs/models/index.js.map +1 -1
  90. package/dist/commonjs/models/installation.js +1 -0
  91. package/dist/commonjs/models/installation.js.map +1 -1
  92. package/dist/commonjs/models/notification.js +1 -0
  93. package/dist/commonjs/models/notification.js.map +1 -1
  94. package/dist/commonjs/models/notificationBodyBuilder.js +1 -0
  95. package/dist/commonjs/models/notificationBodyBuilder.js.map +1 -1
  96. package/dist/commonjs/models/notificationDetails.js +1 -0
  97. package/dist/commonjs/models/notificationDetails.js.map +1 -1
  98. package/dist/commonjs/models/notificationHeaderBuilder.js +1 -0
  99. package/dist/commonjs/models/notificationHeaderBuilder.js.map +1 -1
  100. package/dist/commonjs/models/notificationHubJob.js +1 -0
  101. package/dist/commonjs/models/notificationHubJob.js.map +1 -1
  102. package/dist/commonjs/models/options.js +1 -0
  103. package/dist/commonjs/models/options.js.map +1 -1
  104. package/dist/commonjs/models/registration.js +1 -0
  105. package/dist/commonjs/models/registration.js.map +1 -1
  106. package/dist/commonjs/models/response.js +1 -0
  107. package/dist/commonjs/models/response.js.map +1 -1
  108. package/dist/commonjs/models/tagExpressionBuilder.js +1 -0
  109. package/dist/commonjs/models/tagExpressionBuilder.js.map +1 -1
  110. package/dist/commonjs/notificationHubsClient.js +1 -0
  111. package/dist/commonjs/notificationHubsClient.js.map +1 -1
  112. package/dist/commonjs/serializers/notificationDetailsSerializer.js +1 -0
  113. package/dist/commonjs/serializers/notificationDetailsSerializer.js.map +1 -1
  114. package/dist/commonjs/serializers/notificationHubJobSerializer.js +1 -0
  115. package/dist/commonjs/serializers/notificationHubJobSerializer.js.map +1 -1
  116. package/dist/commonjs/serializers/notificationOutcomeSerializer.js +1 -0
  117. package/dist/commonjs/serializers/notificationOutcomeSerializer.js.map +1 -1
  118. package/dist/commonjs/serializers/registrationSerializer.js +1 -0
  119. package/dist/commonjs/serializers/registrationSerializer.js.map +1 -1
  120. package/dist/commonjs/tsdoc-metadata.json +1 -1
  121. package/dist/commonjs/utils/constants.js +2 -1
  122. package/dist/commonjs/utils/constants.js.map +2 -2
  123. package/dist/commonjs/utils/notificationUtils.js +1 -0
  124. package/dist/commonjs/utils/notificationUtils.js.map +1 -1
  125. package/dist/commonjs/utils/optionUtils.js +1 -0
  126. package/dist/commonjs/utils/optionUtils.js.map +1 -1
  127. package/dist/commonjs/utils/registrationUtils.js +1 -0
  128. package/dist/commonjs/utils/registrationUtils.js.map +1 -1
  129. package/dist/commonjs/utils/tracing.js +1 -0
  130. package/dist/commonjs/utils/tracing.js.map +1 -1
  131. package/dist/commonjs/utils/utils.d.ts +2 -6
  132. package/dist/commonjs/utils/utils.d.ts.map +1 -1
  133. package/dist/commonjs/utils/utils.js +6 -7
  134. package/dist/commonjs/utils/utils.js.map +3 -3
  135. package/dist/commonjs/utils/xmlUtils.js +1 -0
  136. package/dist/commonjs/utils/xmlUtils.js.map +1 -1
  137. package/dist/esm/auth/hmacSha256.d.ts.map +1 -1
  138. package/dist/esm/auth/hmacSha256.js +7 -3
  139. package/dist/esm/auth/hmacSha256.js.map +1 -1
  140. package/dist/esm/index.d.ts +1 -0
  141. package/dist/esm/index.d.ts.map +1 -1
  142. package/dist/esm/index.js +1 -0
  143. package/dist/esm/index.js.map +1 -1
  144. package/dist/esm/utils/constants.js +1 -1
  145. package/dist/esm/utils/constants.js.map +1 -1
  146. package/dist/esm/utils/utils.d.ts +2 -6
  147. package/dist/esm/utils/utils.d.ts.map +1 -1
  148. package/dist/esm/utils/utils.js +3 -8
  149. package/dist/esm/utils/utils.js.map +1 -1
  150. package/dist/react-native/auth/hmacSha256.d.ts +1 -1
  151. package/dist/react-native/auth/hmacSha256.d.ts.map +1 -1
  152. package/dist/react-native/auth/hmacSha256.js +9 -1
  153. package/dist/react-native/auth/hmacSha256.js.map +1 -1
  154. package/dist/react-native/index.d.ts +1 -0
  155. package/dist/react-native/index.d.ts.map +1 -1
  156. package/dist/react-native/index.js +1 -0
  157. package/dist/react-native/index.js.map +1 -1
  158. package/dist/react-native/utils/constants.js +1 -1
  159. package/dist/react-native/utils/constants.js.map +1 -1
  160. package/dist/react-native/utils/utils.d.ts +2 -6
  161. package/dist/react-native/utils/utils.d.ts.map +1 -1
  162. package/dist/react-native/utils/utils.js +3 -8
  163. package/dist/react-native/utils/utils.js.map +1 -1
  164. package/package.json +22 -18
  165. package/dist/browser/auth/hmacSha256.common.d.ts +0 -2
  166. package/dist/browser/auth/hmacSha256.common.d.ts.map +0 -1
  167. package/dist/browser/auth/hmacSha256.common.js +0 -11
  168. package/dist/browser/auth/hmacSha256.common.js.map +0 -1
  169. package/dist/commonjs/auth/hmacSha256.common.d.ts +0 -2
  170. package/dist/commonjs/auth/hmacSha256.common.d.ts.map +0 -1
  171. package/dist/commonjs/auth/hmacSha256.common.js +0 -44
  172. package/dist/commonjs/auth/hmacSha256.common.js.map +0 -7
  173. package/dist/esm/auth/hmacSha256.common.d.ts +0 -2
  174. package/dist/esm/auth/hmacSha256.common.d.ts.map +0 -1
  175. package/dist/esm/auth/hmacSha256.common.js +0 -11
  176. package/dist/esm/auth/hmacSha256.common.js.map +0 -1
  177. package/dist/react-native/auth/hmacSha256.common.d.ts +0 -2
  178. package/dist/react-native/auth/hmacSha256.common.d.ts.map +0 -1
  179. package/dist/react-native/auth/hmacSha256.common.js +0 -11
  180. package/dist/react-native/auth/hmacSha256.common.js.map +0 -1
@@ -1,2 +1,2 @@
1
- export { signString } from "./hmacSha256.common.js";
1
+ export declare function signString(key: string, toSign: string): Promise<string>;
2
2
  //# sourceMappingURL=hmacSha256.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hmacSha256.d.ts","sourceRoot":"","sources":["../../../src/auth/hmacSha256.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"hmacSha256.d.ts","sourceRoot":"","sources":["../../../src/auth/hmacSha256.ts"],"names":[],"mappings":"AAKA,wBAAsB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAmB7E"}
@@ -1,4 +1,12 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- export { signString } from "./hmacSha256.common.js";
3
+ import { uint8ArrayToString } from "@azure/core-util";
4
+ export async function signString(key, toSign) {
5
+ const enc = new TextEncoder();
6
+ const algorithm = { name: "HMAC", hash: { name: "SHA-256" } };
7
+ const extractedKey = await globalThis.crypto.subtle.importKey("raw", enc.encode(key), algorithm, false, ["sign", "verify"]);
8
+ const signature = await globalThis.crypto.subtle.sign(algorithm, extractedKey, enc.encode(toSign));
9
+ const digest = uint8ArrayToString(new Uint8Array(signature), "base64");
10
+ return encodeURIComponent(digest);
11
+ }
4
12
  //# sourceMappingURL=hmacSha256.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hmacSha256.js","sourceRoot":"","sources":["../../../src/auth/hmacSha256.ts"],"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.js","sourceRoot":"","sources":["../../../src/auth/hmacSha256.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,GAAW,EAAE,MAAc;IAC1D,MAAM,GAAG,GAAG,IAAI,WAAW,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC;IAE9D,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,kBAAkB,CAAC,IAAI,UAAU,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,CAAC;IAEvE,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { uint8ArrayToString } from \"@azure/core-util\";\n\nexport async function signString(key: string, toSign: string): Promise<string> {\n const enc = new TextEncoder();\n const algorithm = { 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 = uint8ArrayToString(new Uint8Array(signature), \"base64\");\n\n return encodeURIComponent(digest);\n}\n"]}
@@ -1,3 +1,4 @@
1
+ export { RestError, isRestError } from "@azure/core-rest-pipeline";
1
2
  export * from "./notificationHubsClient.js";
2
3
  export * from "./models/index.js";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACnE,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mBAAmB,CAAC"}
@@ -1,5 +1,6 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
+ export { RestError, isRestError } from "@azure/core-rest-pipeline";
3
4
  export * from "./notificationHubsClient.js";
4
5
  export * from "./models/index.js";
5
6
  //# 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,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACnE,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mBAAmB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { RestError, isRestError } from \"@azure/core-rest-pipeline\";\nexport * from \"./notificationHubsClient.js\";\nexport * from \"./models/index.js\";\n"]}
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- export const SDK_VERSION = "2.0.3";
3
+ export const SDK_VERSION = "2.1.0";
4
4
  export const JSON_CONTENT_TYPE = "application/json;charset=utf-8";
5
5
  export const XML_CONTENT_TYPE = "application/xml";
6
6
  export const STREAM_CONTENT_TYPE = "application/octet-stream";
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAW,OAAO,CAAC;AAE3C,MAAM,CAAC,MAAM,iBAAiB,GAAG,gCAAgC,CAAC;AAClE,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAClD,MAAM,CAAC,MAAM,mBAAmB,GAAG,0BAA0B,CAAC;AAE9D,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,CAAC;AAC1C,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC;AACjC,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC;AACrC,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAC;AACpC,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const SDK_VERSION: string = \"2.0.3\";\n\nexport const JSON_CONTENT_TYPE = \"application/json;charset=utf-8\";\nexport const XML_CONTENT_TYPE = \"application/xml\";\nexport const STREAM_CONTENT_TYPE = \"application/octet-stream\";\n\nexport const WNS_TYPE_NAME = \"X-WNS-Type\";\nexport const WNS_RAW = \"wns/raw\";\nexport const WNS_BADGE = \"wns/badge\";\nexport const WNS_TITLE = \"wns/tile\";\nexport const WNS_TOAST = \"wns/toast\";\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAW,OAAO,CAAC;AAE3C,MAAM,CAAC,MAAM,iBAAiB,GAAG,gCAAgC,CAAC;AAClE,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAClD,MAAM,CAAC,MAAM,mBAAmB,GAAG,0BAA0B,CAAC;AAE9D,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,CAAC;AAC1C,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC;AACjC,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC;AACrC,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAC;AACpC,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const SDK_VERSION: string = \"2.1.0\";\n\nexport const JSON_CONTENT_TYPE = \"application/json;charset=utf-8\";\nexport const XML_CONTENT_TYPE = \"application/xml\";\nexport const STREAM_CONTENT_TYPE = \"application/octet-stream\";\n\nexport const WNS_TYPE_NAME = \"X-WNS-Type\";\nexport const WNS_RAW = \"wns/raw\";\nexport const WNS_BADGE = \"wns/badge\";\nexport const WNS_TITLE = \"wns/tile\";\nexport const WNS_TOAST = \"wns/toast\";\n"]}
@@ -1,9 +1,5 @@
1
- /**
2
- * Helper TypeGuard that checks if something is defined or not.
3
- * @param thing - Anything
4
- * @internal
5
- */
6
- export declare function isDefined<T>(thing: T | undefined | null): thing is T;
1
+ import { isDefined } from "@azure/core-util";
2
+ export { isDefined };
7
3
  /**
8
4
  * Helper TypeGuard that checks if something is a string or not.
9
5
  * @param thing - Anything
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/utils/utils.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,SAAS,GAAG,IAAI,GAAG,KAAK,IAAI,CAAC,CAEpE;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAExD;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CAQxE;AAED;;;;GAIG;AAEH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,CAKnE;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CAQzE;AAED;;;;GAIG;AAEH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,CAMpE;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CAQvE;AAED;;;;GAIG;AAEH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,GAAG,GAAG,M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MAAM,GAAG,MAAM,CAQvE;AAED;;;;GAIG;AAEH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,CAMlE;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,IAAI,CAQnE;AAED;;;;GAIG;AAEH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,CAO/D;AAED;;;GAGG;AAEH,wBAAgB,kBAAkB,CAAC,KAAK,CAAC,EAAE,GAAG,GAAG,MAAM,EAAE,GAAG,SAAS,CAMpE;AAED,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAChE,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC"}
@@ -1,13 +1,8 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- /**
4
- * Helper TypeGuard that checks if something is defined or not.
5
- * @param thing - Anything
6
- * @internal
7
- */
8
- export function isDefined(thing) {
9
- return typeof thing !== "undefined" && thing !== null;
10
- }
3
+ import { isDefined } from "@azure/core-util";
4
+ // Re-export isDefined from core-util for convenience
5
+ export { isDefined };
11
6
  /**
12
7
  * Helper TypeGuard that checks if something is a string or not.
13
8
  * @param thing - Anything
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/utils/utils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAI,KAA2B;IACtD,OAAO,OAAO,KAAK,KAAK,WAAW,IAAI,KAAK,KAAK,IAAI,CAAC;AACxD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,OAAO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ED;;;GAGG;AACH,6EAA6E;AAC7E,MAAM,UAAU,kBAAkB,CAAC,KAAW;IAC5C,MAAM,MAAM,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAC3C,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Helper TypeGuard that checks if something is defined or not.\n * @param thing - Anything\n * @internal\n */\nexport function isDefined<T>(thing: T | undefined | null): thing is T {\n return typeof thing !== \"undefined\" && thing !== null;\n}\n\n/**\n * Helper TypeGuard that checks if something is a string or not.\n * @param thing - Anything\n * @internal\n */\nexport function isString(thing: unknown): thing is string {\n return typeof thing === \"string\" || thing instanceof String;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `string` value from given string,\n * or throws error if undefined.\n */\nexport function getString(value: unknown, nameOfProperty: string): string {\n const result = getStringOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a string value and not undefined.`,\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `string` value from given input,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getStringOrUndefined(value: any): string | undefined {\n if (!isDefined(value)) {\n return undefined;\n }\n return value.toString();\n}\n\n/**\n * @internal\n * Helper utility to retrieve `integer` value from given string,\n * or throws error if undefined.\n */\nexport function getInteger(value: unknown, nameOfProperty: string): number {\n const result = getIntegerOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a number value and not undefined.`,\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `integer` value from given string,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getIntegerOrUndefined(value: any): number | undefined {\n if (!isDefined(value)) {\n return undefined;\n }\n const result = parseInt(value.toString());\n return isNaN(result) ? undefined : result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `float` value from given string,\n * or throws error if undefined.\n */\nexport function getFloat(value: unknown, nameOfProperty: string): number {\n const result = getFloatOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a number value and not undefined.`,\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `float` value from given string,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getFloatOrUndefined(value: any): number | undefined {\n if (!isDefined(value)) {\n return undefined;\n }\n const result = parseFloat(value.toString());\n return Number.isNaN(result) ? undefined : result;\n}\n\n/**\n * @internal\n * Helper utility to convert ISO-8601 time into Date type.\n */\nexport function getDate(value: string, nameOfProperty: string): Date {\n const result = getDateOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a Date value and not undefined.`,\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to convert ISO-8601 time into Date type,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getDateOrUndefined(value: any): Date | undefined {\n const stringValue = getStringOrUndefined(value);\n if (stringValue === undefined) {\n return undefined;\n }\n const result = new Date(stringValue.toString());\n return Number.isNaN(+result) ? undefined : result;\n}\n\n/**\n * @internal\n * Helper utility to parse tags from a comma separated string.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getTagsOrUndefined(value?: any): string[] | undefined {\n const result = getStringOrUndefined(value);\n if (result === undefined) {\n return undefined;\n }\n return result.split(\",\");\n}\n\nexport type NullableRecord = Record<string, string | undefined>;\nexport type NonNullableRecord = Record<string, NonNullable<NullableRecord[string]>>;\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/utils/utils.ts"],"names":[],"m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D,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;IAChD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;AACpD,CAAC;AAED;;;GAGG;AACH,6EAA6E;AAC7E,MAAM,UAAU,kBAAkB,CAAC,KAAW;IAC5C,MAAM,MAAM,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAC3C,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { isDefined } from \"@azure/core-util\";\n\n// Re-export isDefined from core-util for convenience\nexport { isDefined };\n\n/**\n * Helper TypeGuard that checks if something is a string or not.\n * @param thing - Anything\n * @internal\n */\nexport function isString(thing: unknown): thing is string {\n return typeof thing === \"string\" || thing instanceof String;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `string` value from given string,\n * or throws error if undefined.\n */\nexport function getString(value: unknown, nameOfProperty: string): string {\n const result = getStringOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a string value and not undefined.`,\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `string` value from given input,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getStringOrUndefined(value: any): string | undefined {\n if (!isDefined(value)) {\n return undefined;\n }\n return value.toString();\n}\n\n/**\n * @internal\n * Helper utility to retrieve `integer` value from given string,\n * or throws error if undefined.\n */\nexport function getInteger(value: unknown, nameOfProperty: string): number {\n const result = getIntegerOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a number value and not undefined.`,\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `integer` value from given string,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getIntegerOrUndefined(value: any): number | undefined {\n if (!isDefined(value)) {\n return undefined;\n }\n const result = parseInt(value.toString());\n return isNaN(result) ? undefined : result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `float` value from given string,\n * or throws error if undefined.\n */\nexport function getFloat(value: unknown, nameOfProperty: string): number {\n const result = getFloatOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a number value and not undefined.`,\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `float` value from given string,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getFloatOrUndefined(value: any): number | undefined {\n if (!isDefined(value)) {\n return undefined;\n }\n const result = parseFloat(value.toString());\n return Number.isNaN(result) ? undefined : result;\n}\n\n/**\n * @internal\n * Helper utility to convert ISO-8601 time into Date type.\n */\nexport function getDate(value: string, nameOfProperty: string): Date {\n const result = getDateOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a Date value and not undefined.`,\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to convert ISO-8601 time into Date type,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getDateOrUndefined(value: any): Date | undefined {\n const stringValue = getStringOrUndefined(value);\n if (stringValue === undefined) {\n return undefined;\n }\n const result = new Date(stringValue.toString());\n return Number.isNaN(+result) ? undefined : result;\n}\n\n/**\n * @internal\n * Helper utility to parse tags from a comma separated string.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getTagsOrUndefined(value?: any): string[] | undefined {\n const result = getStringOrUndefined(value);\n if (result === undefined) {\n return undefined;\n }\n return result.split(\",\");\n}\n\nexport type NullableRecord = Record<string, string | undefined>;\nexport type NonNullableRecord = Record<string, NonNullable<NullableRecord[string]>>;\n"]}
@@ -135,3 +135,4 @@ async function beginSubmitNotificationHubJob(context, notificationHubJob, polled
135
135
  0 && (module.exports = {
136
136
  beginSubmitNotificationHubJob
137
137
  });
138
+ //# sourceMappingURL=beginSubmitNotificationHubJob.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["/mnt/vss/_work/1/s/sdk/notificationhubs/notification-hubs/src/api/beginSubmitNotificationHubJob.ts"],
3
+ "sources": ["../../../src/api/beginSubmitNotificationHubJob.ts"],
4
4
  "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type { CancelOnProgress, OperationState, PollerLike } from \"@azure/core-lro\";\nimport type { NotificationHubJob, NotificationHubJobPoller } from \"../models/notificationHubJob.js\";\nimport type { NotificationHubsClientContext } from \"./index.js\";\nimport type { PolledOperationOptions } from \"../models/options.js\";\nimport { delay } from \"@azure/core-util\";\nimport { getNotificationHubJob } from \"./getNotificationHubJob.js\";\nimport { submitNotificationHubJob } from \"./submitNotificationHubJob.js\";\n\n/**\n * Submits a Notification Hub job and creates a poller to poll for results.\n * @param context - The Notification Hubs client.\n * @param notificationHubJob - The Notification Hub import/export job to start.\n * @param options - The operation options.\n * @returns A poller which can be called to poll until completion of the job.\n */\nexport async function beginSubmitNotificationHubJob(\n context: NotificationHubsClientContext,\n notificationHubJob: NotificationHubJob,\n polledOperationOptions: PolledOperationOptions = {},\n): Promise<NotificationHubJobPoller> {\n let submittedJob = await submitNotificationHubJob(\n context,\n notificationHubJob,\n polledOperationOptions,\n );\n\n type Handler = (state: OperationState<NotificationHubJob>) => void;\n\n const state: OperationState<NotificationHubJob> = {\n status: \"notStarted\",\n };\n\n const progressCallbacks = new Map<symbol, Handler>();\n const processProgressCallbacks = async (): Promise<void> =>\n progressCallbacks.forEach((h) => h(state));\n let resultPromise: Promise<NotificationHubJob> | undefined;\n const abortController = new AbortController();\n const currentPollIntervalInMs = polledOperationOptions.updateIntervalInMs ?? 2000;\n\n const poller: PollerLike<OperationState<NotificationHubJob>, NotificationHubJob> = {\n async poll(options?: {\n abortSignal?: AbortSignalLike;\n }): Promise<OperationState<NotificationHubJob>> {\n submittedJob = await getNotificationHubJob(context, submittedJob.jobId!, options);\n if (submittedJob.status === \"Running\" || submittedJob.status === \"Started\") {\n state.status = \"running\";\n }\n\n if (submittedJob.status === \"Completed\") {\n state.status = \"succeeded\";\n state.result = submittedJob;\n }\n\n if (submittedJob.status === \"Failed\") {\n state.status = \"failed\";\n state.error = new Error(submittedJob.failure);\n }\n\n await processProgressCallbacks();\n\n if (state.status === \"canceled\") {\n throw new Error(\"Operation was canceled\");\n }\n if (state.status === \"failed\") {\n throw state.error;\n }\n\n return state;\n },\n\n pollUntilDone(pollOptions?: { abortSignal?: AbortSignalLike }): Promise<NotificationHubJob> {\n return (resultPromise ??= (async () => {\n const { abortSignal: inputAbortSignal } = pollOptions || {};\n // In the future we can use AbortSignal.any() instead\n function abortListener(): void {\n abortController.abort();\n }\n const abortSignal = abortController.signal;\n if (inputAbortSignal?.aborted) {\n abortController.abort();\n } else if (!abortSignal.aborted) {\n inputAbortSignal?.addEventListener(\"abort\", abortListener, { once: true });\n }\n\n try {\n if (!poller.isDone) {\n await poller.poll({ abortSignal });\n while (!poller.isDone) {\n await delay(currentPollIntervalInMs, { abortSignal });\n await poller.poll({ abortSignal });\n }\n }\n } finally {\n inputAbortSignal?.removeEventListener(\"abort\", abortListener);\n }\n switch (state.status) {\n case \"succeeded\":\n return poller.result as NotificationHubJob;\n case \"canceled\":\n throw new Error(\"Operation was canceled\");\n case \"failed\":\n throw state.error;\n case \"notStarted\":\n case \"running\":\n throw new Error(`Polling completed without succeeding or failing`);\n }\n })().finally(() => {\n resultPromise = undefined;\n }));\n },\n\n onProgress(callback: (state: OperationState<NotificationHubJob>) => void): CancelOnProgress {\n const s = Symbol();\n progressCallbacks.set(s, callback);\n\n return () => progressCallbacks.delete(s);\n },\n\n get isDone(): boolean {\n return [\"succeeded\", \"failed\", \"canceled\"].includes(state.status);\n },\n\n get operationState(): OperationState<NotificationHubJob> | undefined {\n return state;\n },\n\n get result(): NotificationHubJob | undefined {\n return state.result;\n },\n\n async serialize(): Promise<string> {\n return JSON.stringify({ state });\n },\n\n async submitted() {\n // No-op\n return;\n },\n\n then<TResult1 = NotificationHubJob, TResult2 = never>(\n onfulfilled?:\n | ((value: NotificationHubJob) => TResult1 | PromiseLike<TResult1>)\n | undefined\n | null,\n onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null,\n ): Promise<TResult1 | TResult2> {\n return poller.pollUntilDone().then(onfulfilled, onrejected);\n },\n catch<TResult2 = never>(\n onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null,\n ): Promise<NotificationHubJob | TResult2> {\n return poller.pollUntilDone().catch(onrejected);\n },\n finally(onfinally?: (() => void) | undefined | null): Promise<NotificationHubJob> {\n return poller.pollUntilDone().finally(onfinally);\n },\n [Symbol.toStringTag]: \"Poller\",\n };\n\n return poller;\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,uBAAsB;AACtB,mCAAsC;AACtC,sCAAyC;AASzC,eAAsB,8BACpB,SACA,oBACA,yBAAiD,CAAC,GACf;AACnC,MAAI,eAAe,UAAM;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAIA,QAAM,QAA4C;AAAA,IAChD,QAAQ;AAAA,EACV;AAEA,QAAM,oBAAoB,oBAAI,IAAqB;AACnD,QAAM,2BAA2B,YAC/B,kBAAkB,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC;AAC3C,MAAI;AACJ,QAAM,kBAAkB,IAAI,gBAAgB;AAC5C,QAAM,0BAA0B,uBAAuB,sBAAsB;AAE7E,QAAM,SAA6E;AAA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ChB,KAAK;AACH,kBAAM,IAAI,MAAM,wBAAwB;AAAA,UAC1C,KAAK;AACH,kBAAM,MAAM;AAAA,UACd,KAAK;AAAA,UACL,KAAK;AACH,kBAAM,IAAI,MAAM,iDAAiD;AAAA,QACrE;AAAA,MACF,GAAG,EAAE,QAAQ,MAAM;AACjB,wBAAgB;AAAA,MAClB,CAAC;AAAA,IACH;AAAA,IAEA,WAAW,UAAiF;AAC1F,YAAM,IAAI,uBAAO;AACjB,wBAAkB,IAAI,GAAG,QAAQ;AAEjC,aAAO,MAAM,kBAAkB,OAAO,CAAC;AAAA,IACzC;AAAA,IAEA,IAAI,SAAkB;AACpB,aAAO,CAAC,aAAa,UAAU,UAAU,EAAE,SAAS,MAAM,MAAM;AAAA,IAClE;AAAA,IAEA,IAAI,iBAAiE;AACnE,aAAO;AAAA,IACT;AAAA,IAEA,IAAI,SAAyC;AAC3C,aAAO,MAAM;AAAA,IACf;AAAA,IAEA,MAAM,YAA6B;AACjC,aAAO,KAAK,UAAU,EAAE,MAAM,CAAC;AAAA,IACjC;AAAA,IAEA,MAAM,YAAY;AAEhB;AAAA,IACF;AAAA,IAEA,KACE,aAIA,YAC8B;AAC9B,aAAO,OAAO,cAAc,EAAE,KAAK,aAAa,UAAU;AAAA,IAC5D;AAAA,IACA,MACE,YACwC;AACxC,aAAO,OAAO,cAAc,EAAE,MAAM,UAAU;AAAA,IAChD;AAAA,IACA,QAAQ,WAA0E;AAChF,aAAO,OAAO,cAAc,EAAE,QAAQ,SAAS;AAAA,IACjD;AAAA,IACA,CAAC,OAAO,WAAW,GAAG;AAAA,EACxB;AAEA,SAAO;AACT;",
6
6
  "names": []
@@ -41,3 +41,4 @@ function cancelScheduledNotification(context, notificationId, options = {}) {
41
41
  0 && (module.exports = {
42
42
  cancelScheduledNotification
43
43
  });
44
+ //# sourceMappingURL=cancelScheduledNotification.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["/mnt/vss/_work/1/s/sdk/notificationhubs/notification-hubs/src/api/cancelScheduledNotification.ts"],
3
+ "sources": ["../../../src/api/cancelScheduledNotification.ts"],
4
4
  "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createRequest, parseNotificationSendResponse, sendRequest } from \"./internal/_client.js\";\nimport type { NotificationHubsClientContext } from \"./index.js\";\nimport type { NotificationHubsResponse } from \"../models/notificationDetails.js\";\nimport type { OperationOptions } from \"@azure-rest/core-client\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"cancelScheduledNotification\";\n\n/**\n * Cancels the scheduled notification with the given notification ID.\n * NOTE: This is only available in Standard SKU Azure Notification Hubs.\n * @param context - The Notification Hubs client.\n * @param notificationId - The notification ID from the scheduled notification.\n * @param options - The operation options.\n * @returns A notification hub response with correlation ID and tracking ID.\n */\nexport function cancelScheduledNotification(\n context: NotificationHubsClientContext,\n notificationId: string,\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 += `/schedulednotifications/${notificationId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n const request = createRequest(endpoint, \"DELETE\", headers, updatedOptions);\n\n const response = await sendRequest(context, request, 200);\n\n return parseNotificationSendResponse(response);\n },\n );\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAA0E;AAI1E,qBAA8B;AAE9B,MAAM,iBAAiB;AAUhB,SAAS,4BACd,SACA,gBACA,UAA4B,CAAC,GACM;AACnC,SAAO,6BAAc;AAAA,IACnB,iCAAiC,cAAc;AAAA,IAC/C;AAAA,IACA,OAAO,mBAAmB;AACxB,YAAM,WAAW,QAAQ,WAAW;AACpC,eAAS,YAAY,2BAA2B,cAAc;AAE9D,YAAM,UAAU,MAAM,QAAQ,cAAc,cAAc;AAC1D,YAAM,cAAU,6BAAc,UAAU,UAAU,SAAS,cAAc;AAEzE,YAAM,WAAW,UAAM,2BAAY,SAAS,SAAS,GAAG;AAExD,iBAAO,6CAA8B,QAAQ;AAAA,IAC/C;AAAA,EACF;AACF;",
6
6
  "names": []
@@ -90,3 +90,4 @@ class NotificationHubsServiceClient {
90
90
  0 && (module.exports = {
91
91
  createClientContext
92
92
  });
93
+ //# sourceMappingURL=clientContext.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["/mnt/vss/_work/1/s/sdk/notificationhubs/notification-hubs/src/api/clientContext.ts"],
3
+ "sources": ["../../../src/api/clientContext.ts"],
4
4
  "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport * as constants from \"../utils/constants.js\";\nimport type {\n HttpClient,\n HttpHeaders,\n PipelineRequest,\n PipelineResponse,\n} from \"@azure/core-rest-pipeline\";\nimport { RestError, createDefaultHttpClient, createHttpHeaders } from \"@azure/core-rest-pipeline\";\nimport {\n createTokenCredentialFromConnection,\n parseNotificationHubsConnectionString,\n} from \"../auth/connectionStringUtils.js\";\nimport type { NotificationHubsClientOptions } from \"../models/options.js\";\nimport type { SasTokenCredential } from \"../auth/sasTokenCredential.js\";\nimport type { Client } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\n\nconst API_VERSION = \"2020-06\";\n\n/**\n * Represents the Notification Hubs SDK client context.\n */\nexport interface NotificationHubsClientContext {\n /**\n * @internal\n */\n sendRequest(request: PipelineRequest): Promise<PipelineResponse>;\n\n /**\n * @internal\n */\n createHeaders(operationName: string, rawHeaders?: Record<string, string>): Promise<HttpHeaders>;\n\n /**\n * @internal\n */\n requestUrl(): URL;\n}\n\n/**\n * Creates a NotificationHubClient from the Access Policy connection string and hub name.\n * @param connectionString - The Access Policy connection string for the notification hub.\n * @param hubName - The notification hub name.\n * @returns A NotificationHubsClientContext initialized from the connection string and hub name.\n */\nexport function createClientContext(\n connectionString: string,\n hubName: string,\n options: NotificationHubsClientOptions = {},\n): NotificationHubsClientContext {\n return new NotificationHubsServiceClient(connectionString, hubName, options);\n}\n\nclass NotificationHubsServiceClient implements NotificationHubsClientContext {\n sasTokenCredential: SasTokenCredential;\n baseUrl: string;\n hubName: string;\n client: Client;\n httpClient: HttpClient;\n\n constructor(\n connectionString: string,\n hubName: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: NotificationHubsClientOptions = {},\n ) {\n this.hubName = hubName;\n\n const parsedConnection = parseNotificationHubsConnectionString(connectionString);\n // Node doesn't allow change in protocol but browsers do, so doing a string replace\n this.baseUrl = parsedConnection.endpoint.replace(\"sb://\", \"https://\");\n this.sasTokenCredential = createTokenCredentialFromConnection(\n parsedConnection.sharedAccessKey,\n parsedConnection.sharedAccessKeyName,\n );\n\n const packageDetails = `azsdk-js-notificationhubs/${constants.SDK_VERSION}`;\n const userAgentPrefix = options.userAgentOptions?.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n this.httpClient = options?.httpClient ?? createDefaultHttpClient();\n this.client = getClient(this.baseUrl, {\n userAgentOptions: {\n userAgentPrefix,\n },\n ...options,\n });\n }\n\n async createHeaders(\n operationName: string,\n rawHeaders?: Record<string, string>,\n ): Promise<HttpHeaders> {\n const authorization = await this.sasTokenCredential.getToken(this.baseUrl);\n if (!authorization) {\n throw new RestError(\"Failed to get the authorization header\", { statusCode: 401 });\n }\n\n const headers = createHttpHeaders(rawHeaders);\n headers.set(\"Authorization\", authorization.token);\n headers.set(\"x-ms-version\", API_VERSION);\n headers.set(\n \"x-ms-azsdk-telemetry\",\n `class=NotificationHubsServiceClient;method=${operationName}`,\n );\n\n return headers;\n }\n\n sendRequest(request: PipelineRequest): Promise<PipelineResponse> {\n return this.client.pipeline.sendRequest(this.httpClient, request);\n }\n\n requestUrl(): URL {\n const url = new URL(this.baseUrl);\n url.pathname = this.hubName;\n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AAA,MACN;AAAA,MACA,8CAA8C,aAAa;AAAA,IAC7D;AAEA,WAAO;AAAA,EACT;AAAA,EAEA,YAAY,SAAqD;AAC/D,WAAO,KAAK,OAAO,SAAS,YAAY,KAAK,YAAY,OAAO;AAAA,EAClE;AAAA,EAEA,aAAkB;AAChB,UAAM,MAAM,IAAI,IAAI,KAAK,OAAO;AAChC,QAAI,WAAW,KAAK;AACpB,QAAI,aAAa,IAAI,eAAe,WAAW;AAE/C,WAAO;AAAA,EACT;AACF;",
6
6
  "names": []
@@ -43,3 +43,4 @@ function createOrUpdateInstallation(context, installation, options = {}) {
43
43
  0 && (module.exports = {
44
44
  createOrUpdateInstallation
45
45
  });
46
+ //# sourceMappingURL=createOrUpdateInstallation.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["/mnt/vss/_work/1/s/sdk/notificationhubs/notification-hubs/src/api/createOrUpdateInstallation.ts"],
3
+ "sources": ["../../../src/api/createOrUpdateInstallation.ts"],
4
4
  "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createRequest, parseNotificationResponse, sendRequest } from \"./internal/_client.js\";\nimport type { Installation } from \"../models/installation.js\";\nimport type { NotificationHubsClientContext } from \"./index.js\";\nimport type { NotificationHubsResponse } from \"../models/notificationDetails.js\";\nimport type { OperationOptions } from \"@azure-rest/core-client\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"createOrUpdateInstallation\";\n\n/**\n * Creates or overwrites an installation to a Notification Hub.\n * @param context - The Notification Hubs client.\n * @param installation - The installation to create or overwrite.\n * @param options - Configuration options for the create or update installation operation.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function createOrUpdateInstallation(\n context: NotificationHubsClientContext,\n installation: Installation,\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/${installation.installationId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/json\");\n\n const request = createRequest(endpoint, \"PUT\", headers, updatedOptions);\n request.body = JSON.stringify(installation);\n\n const response = await sendRequest(context, request, 200);\n\n return parseNotificationResponse(response);\n },\n );\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAsE;AAKtE,qBAA8B;AAE9B,MAAM,iBAAiB;AAShB,SAAS,2BACd,SACA,cACA,UAA4B,CAAC,GACM;AACnC,SAAO,6BAAc;AAAA,IACnB,iCAAiC,cAAc;AAAA,IAC/C;AAAA,IACA,OAAO,mBAAmB;AACxB,YAAM,WAAW,QAAQ,WAAW;AACpC,eAAS,YAAY,kBAAkB,aAAa,cAAc;AAElE,YAAM,UAAU,MAAM,QAAQ,cAAc,cAAc;AAC1D,cAAQ,IAAI,gBAAgB,kBAAkB;AAE9C,YAAM,cAAU,6BAAc,UAAU,OAAO,SAAS,cAAc;AACtE,cAAQ,OAAO,KAAK,UAAU,YAAY;AAE1C,YAAM,WAAW,UAAM,2BAAY,SAAS,SAAS,GAAG;AAExD,iBAAO,yCAA0B,QAAQ;AAAA,IAC3C;AAAA,EACF;AACF;",
6
6
  "names": []
@@ -41,3 +41,4 @@ function createOrUpdateRegistration(context, registration, options = {}) {
41
41
  0 && (module.exports = {
42
42
  createOrUpdateRegistration
43
43
  });
44
+ //# sourceMappingURL=createOrUpdateRegistration.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["/mnt/vss/_work/1/s/sdk/notificationhubs/notification-hubs/src/api/createOrUpdateRegistration.ts"],
3
+ "sources": ["../../../src/api/createOrUpdateRegistration.ts"],
4
4
  "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { NotificationHubsClientContext } from \"./index.js\";\nimport type { OperationOptions } from \"@azure-rest/core-client\";\nimport type { RegistrationDescription } from \"../models/registration.js\";\nimport { createOrUpdateRegistrationDescription } from \"./internal/_createOrUpdateRegistrationDescription.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"createOrUpdateRegistration\";\n\n/**\n * Creates or updates a registration.\n * @param context - The Notification Hubs client.\n * @param registration - The registration to create or update.\n * @param options - The operation options.\n * @returns The created or updated registration description.\n */\nexport function createOrUpdateRegistration(\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 return createOrUpdateRegistrationDescription(\n context,\n registration,\n \"createOrUpdate\",\n updatedOptions,\n );\n },\n );\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,mDAAsD;AACtD,qBAA8B;AAE9B,MAAM,iBAAiB;AAShB,SAAS,2BACd,SACA,cACA,UAA4B,CAAC,GACK;AAClC,SAAO,6BAAc;AAAA,IACnB,iCAAiC,cAAc;AAAA,IAC/C;AAAA,IACA,OAAO,mBAAmB;AACxB,iBAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;",
6
6
  "names": []
@@ -42,3 +42,4 @@ function createRegistration(context, registration, options = {}) {
42
42
  0 && (module.exports = {
43
43
  createRegistration
44
44
  });
45
+ //# sourceMappingURL=createRegistration.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["/mnt/vss/_work/1/s/sdk/notificationhubs/notification-hubs/src/api/createRegistration.ts"],
3
+ "sources": ["../../../src/api/createRegistration.ts"],
4
4
  "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { NotificationHubsClientContext } from \"./index.js\";\nimport type { OperationOptions } from \"@azure-rest/core-client\";\nimport type { 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 = \"createRegistration\";\n\n/**\n * Creates a new registration. This method generates a registration ID,\n * which you can subsequently use to retrieve, update, and delete this registration.\n * @param context - The Notification Hubs client.\n * @param registration - The registration to create.\n * @param options - Options for creating a new registration.\n * @returns The newly created registration description.\n */\nexport function createRegistration(\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.registrationId) {\n throw new RestError(\"registrationId must not be set during a create operation\", {\n statusCode: 400,\n });\n }\n\n return createOrUpdateRegistrationDescription(context, registration, \"create\", updatedOptions);\n },\n );\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,gCAA0B;AAC1B,mDAAsD;AACtD,qBAA8B;AAE9B,MAAM,iBAAiB;AAUhB,SAAS,mBACd,SACA,cACA,UAA4B,CAAC,GACK;AAClC,SAAO,6BAAc;AAAA,IACnB,iCAAiC,cAAc;AAAA,IAC/C;AAAA,IACA,OAAO,mBAAmB;AACxB,UAAI,aAAa,gBAAgB;AAC/B,cAAM,IAAI,oCAAU,4DAA4D;AAAA,UAC9E,YAAY;AAAA,QACd,CAAC;AAAA,MACH;AAEA,iBAAO,oFAAsC,SAAS,cAAc,UAAU,cAAc;AAAA,IAC9F;AAAA,EACF;AACF;",
6
6
  "names": []
@@ -53,3 +53,4 @@ function createRegistrationId(context, options = {}) {
53
53
  0 && (module.exports = {
54
54
  createRegistrationId
55
55
  });
56
+ //# sourceMappingURL=createRegistrationId.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["/mnt/vss/_work/1/s/sdk/notificationhubs/notification-hubs/src/api/createRegistrationId.ts"],
3
+ "sources": ["../../../src/api/createRegistrationId.ts"],
4
4
  "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport type { NotificationHubsClientContext } from \"./index.js\";\nimport type { OperationOptions } from \"@azure-rest/core-client\";\nimport { RestError } from \"@azure/core-rest-pipeline\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"createRegistrationId\";\n\n/**\n * Creates a new registration ID.\n * @param context - The Notification Hubs client.\n * @param options - The options for creating a new registration ID.\n * @returns The newly created registration ID.\n */\nexport function createRegistrationId(\n context: NotificationHubsClientContext,\n options: OperationOptions = {},\n): Promise<string> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/registrationIDs\";\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/xml;type=entry;charset=utf-8\");\n\n const request = createRequest(endpoint, \"POST\", headers, updatedOptions);\n const response = await sendRequest(context, request, 201);\n\n // In the form: https://{namespace}.servicebus.windows.net/{NotificationHub}/registrations/<registrationId>\n const locationHeader = response.headers.get(\"Location\");\n if (!locationHeader || !locationHeader.startsWith(\"https://\")) {\n throw new RestError(`Location header ${locationHeader} is an invalid URL`, {\n statusCode: 500,\n request,\n response,\n });\n }\n const locationUrl = new URL(locationHeader!);\n const registrationId = locationUrl.pathname.split(\"/\")[3];\n\n return registrationId;\n },\n );\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAA2C;AAG3C,gCAA0B;AAC1B,qBAA8B;AAE9B,MAAM,iBAAiB;AAQhB,SAAS,qBACd,SACA,UAA4B,CAAC,GACZ;AACjB,SAAO,6BAAc;AAAA,IACnB,iCAAiC,cAAc;AAAA,IAC/C;AAAA,IACA,OAAO,mBAAmB;AACxB,YAAM,WAAW,QAAQ,WAAW;AACpC,eAAS,YAAY;AAErB,YAAM,UAAU,MAAM,QAAQ,cAAc,cAAc;AAC1D,cAAQ,IAAI,gBAAgB,0CAA0C;AAEtE,YAAM,cAAU,6BAAc,UAAU,QAAQ,SAAS,cAAc;AACvE,YAAM,WAAW,UAAM,2BAAY,SAAS,SAAS,GAAG;AAGxD,YAAM,iBAAiB,SAAS,QAAQ,IAAI,UAAU;AACtD,UAAI,CAAC,kBAAkB,CAAC,eAAe,WAAW,UAAU,GAAG;AAC7D,cAAM,IAAI,oCAAU,mBAAmB,cAAc,sBAAsB;AAAA,UACzE,YAAY;AAAA,UACZ;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AACA,YAAM,cAAc,IAAI,IAAI,cAAe;AAC3C,YAAM,iBAAiB,YAAY,SAAS,MAAM,GAAG,EAAE,CAAC;AAExD,aAAO;AAAA,IACT;AAAA,EACF;AACF;",
6
6
  "names": []
@@ -41,3 +41,4 @@ function deleteInstallation(context, installationId, options = {}) {
41
41
  0 && (module.exports = {
42
42
  deleteInstallation
43
43
  });
44
+ //# sourceMappingURL=deleteInstallation.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["/mnt/vss/_work/1/s/sdk/notificationhubs/notification-hubs/src/api/deleteInstallation.ts"],
3
+ "sources": ["../../../src/api/deleteInstallation.ts"],
4
4
  "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createRequest, parseNotificationResponse, sendRequest } from \"./internal/_client.js\";\nimport type { NotificationHubsClientContext } from \"./index.js\";\nimport type { NotificationHubsResponse } from \"../models/notificationDetails.js\";\nimport type { OperationOptions } from \"@azure-rest/core-client\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"deleteInstallation\";\n\n/**\n * Deletes an installation from a Notification Hub.\n * @param context - The Notification Hubs client.\n * @param installationId - The installation ID of the installation to delete.\n * @param options - Configuration options for the installation delete operation.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function deleteInstallation(\n context: NotificationHubsClientContext,\n installationId: string,\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 const request = createRequest(endpoint, \"DELETE\", headers, updatedOptions);\n const response = await sendRequest(context, request, 204);\n\n return parseNotificationResponse(response);\n },\n );\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAsE;AAItE,qBAA8B;AAE9B,MAAM,iBAAiB;AAShB,SAAS,mBACd,SACA,gBACA,UAA4B,CAAC,GACM;AACnC,SAAO,6BAAc;AAAA,IACnB,iCAAiC,cAAc;AAAA,IAC/C;AAAA,IACA,OAAO,mBAAmB;AACxB,YAAM,WAAW,QAAQ,WAAW;AACpC,eAAS,YAAY,kBAAkB,cAAc;AAErD,YAAM,UAAU,MAAM,QAAQ,cAAc,cAAc;AAC1D,YAAM,cAAU,6BAAc,UAAU,UAAU,SAAS,cAAc;AACzE,YAAM,WAAW,UAAM,2BAAY,SAAS,SAAS,GAAG;AAExD,iBAAO,yCAA0B,QAAQ;AAAA,IAC3C;AAAA,EACF;AACF;",
6
6
  "names": []
@@ -44,3 +44,4 @@ function deleteRegistration(context, registrationId, options = {}) {
44
44
  0 && (module.exports = {
45
45
  deleteRegistration
46
46
  });
47
+ //# sourceMappingURL=deleteRegistration.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["/mnt/vss/_work/1/s/sdk/notificationhubs/notification-hubs/src/api/deleteRegistration.ts"],
3
+ "sources": ["../../../src/api/deleteRegistration.ts"],
4
4
  "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createRequest, parseNotificationResponse, sendRequest } from \"./internal/_client.js\";\nimport type { EntityOperationOptions } from \"../models/options.js\";\nimport type { NotificationHubsClientContext } from \"./index.js\";\nimport type { NotificationHubsResponse } from \"../models/notificationDetails.js\";\nimport { isDefined } from \"../utils/utils.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"deleteRegistration\";\n\n/**\n * Deletes a registration with the given registration ID.\n * @param context - The Notification Hubs client.\n * @param registrationId - The registration ID of the registration to delete.\n * @param options - The options for delete operations including the ETag\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function deleteRegistration(\n context: NotificationHubsClientContext,\n registrationId: string,\n options: EntityOperationOptions = {},\n): Promise<NotificationHubsResponse> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/registrations/${registrationId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/atom+xml;type=entry;charset=utf-8\");\n headers.set(\"If-Match\", isDefined(options.etag) ? `\"${options.etag}\"` : \"*\");\n\n const request = createRequest(endpoint, \"DELETE\", headers, updatedOptions);\n const response = await sendRequest(context, request, 200);\n\n return parseNotificationResponse(response);\n },\n );\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAsE;AAItE,mBAA0B;AAC1B,qBAA8B;AAE9B,MAAM,iBAAiB;AAShB,SAAS,mBACd,SACA,gBACA,UAAkC,CAAC,GACA;AACnC,SAAO,6BAAc;AAAA,IACnB,iCAAiC,cAAc;AAAA,IAC/C;AAAA,IACA,OAAO,mBAAmB;AACxB,YAAM,WAAW,QAAQ,WAAW;AACpC,eAAS,YAAY,kBAAkB,cAAc;AAErD,YAAM,UAAU,MAAM,QAAQ,cAAc,cAAc;AAC1D,cAAQ,IAAI,gBAAgB,+CAA+C;AAC3E,cAAQ,IAAI,gBAAY,wBAAU,QAAQ,IAAI,IAAI,IAAI,QAAQ,IAAI,MAAM,GAAG;AAE3E,YAAM,cAAU,6BAAc,UAAU,UAAU,SAAS,cAAc;AACzE,YAAM,WAAW,UAAM,2BAAY,SAAS,SAAS,GAAG;AAExD,iBAAO,yCAA0B,QAAQ;AAAA,IAC3C;AAAA,EACF;AACF;",
6
6
  "names": []
@@ -42,3 +42,4 @@ function getFeedbackContainerUrl(context, options = {}) {
42
42
  0 && (module.exports = {
43
43
  getFeedbackContainerUrl
44
44
  });
45
+ //# sourceMappingURL=getFeedbackContainerUrl.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["/mnt/vss/_work/1/s/sdk/notificationhubs/notification-hubs/src/api/getFeedbackContainerUrl.ts"],
3
+ "sources": ["../../../src/api/getFeedbackContainerUrl.ts"],
4
4
  "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport type { NotificationHubsClientContext } from \"./index.js\";\nimport type { OperationOptions } from \"@azure-rest/core-client\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"getFeedbackContainerUrl\";\n\n/**\n * Retrieves an Azure Storage container URL. The container has feedback data for the notification hub.\n * The caller can then use the Azure Storage Services SDK to retrieve the contents of the container.\n * @param context - The Notification Hubs client.\n * @param options - The options for getting the push notification feedback container URL.\n * @returns The URL of the Azure Storage Container containing the feedback data.\n */\nexport function getFeedbackContainerUrl(\n context: NotificationHubsClientContext,\n options: OperationOptions = {},\n): Promise<string> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/feedbackcontainer\";\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/xml;type=entry;charset=utf-8\");\n\n const request = createRequest(endpoint, \"GET\", headers, updatedOptions);\n const response = await sendRequest(context, request, 200);\n\n return response.bodyAsText!;\n },\n );\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAA2C;AAG3C,qBAA8B;AAE9B,MAAM,iBAAiB;AAShB,SAAS,wBACd,SACA,UAA4B,CAAC,GACZ;AACjB,SAAO,6BAAc;AAAA,IACnB,iCAAiC,cAAc;AAAA,IAC/C;AAAA,IACA,OAAO,mBAAmB;AACxB,YAAM,WAAW,QAAQ,WAAW;AACpC,eAAS,YAAY;AAErB,YAAM,UAAU,MAAM,QAAQ,cAAc,cAAc;AAC1D,cAAQ,IAAI,gBAAgB,0CAA0C;AAEtE,YAAM,cAAU,6BAAc,UAAU,OAAO,SAAS,cAAc;AACtE,YAAM,WAAW,UAAM,2BAAY,SAAS,SAAS,GAAG;AAExD,aAAO,SAAS;AAAA,IAClB;AAAA,EACF;AACF;",
6
6
  "names": []
@@ -42,3 +42,4 @@ function getInstallation(context, installationId, options = {}) {
42
42
  0 && (module.exports = {
43
43
  getInstallation
44
44
  });
45
+ //# sourceMappingURL=getInstallation.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["/mnt/vss/_work/1/s/sdk/notificationhubs/notification-hubs/src/api/getInstallation.ts"],
3
+ "sources": ["../../../src/api/getInstallation.ts"],
4
4
  "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport type { Installation } from \"../models/installation.js\";\nimport type { NotificationHubsClientContext } from \"./index.js\";\nimport type { OperationOptions } from \"@azure-rest/core-client\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"getInstallation\";\n\n/**\n * Gets an Azure Notification Hub installation by the installation ID.\n * @param context - The Notification Hubs client.\n * @param installationId - The ID of the installation to get.\n * @param options - Configuration options for the get installation operation.\n * @returns The installation that matches the installation ID.\n */\nexport function getInstallation(\n context: NotificationHubsClientContext,\n installationId: string,\n options: OperationOptions = {},\n): Promise<Installation> {\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, \"GET\", headers, updatedOptions);\n const response = await sendRequest(context, request, 200);\n\n return JSON.parse(response.bodyAsText!) as Installation;\n },\n );\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAA2C;AAI3C,qBAA8B;AAE9B,MAAM,iBAAiB;AAShB,SAAS,gBACd,SACA,gBACA,UAA4B,CAAC,GACN;AACvB,SAAO,6BAAc;AAAA,IACnB,iCAAiC,cAAc;AAAA,IAC/C;AAAA,IACA,OAAO,mBAAmB;AACxB,YAAM,WAAW,QAAQ,WAAW;AACpC,eAAS,YAAY,kBAAkB,cAAc;AAErD,YAAM,UAAU,MAAM,QAAQ,cAAc,cAAc;AAC1D,cAAQ,IAAI,gBAAgB,kBAAkB;AAE9C,YAAM,cAAU,6BAAc,UAAU,OAAO,SAAS,cAAc;AACtE,YAAM,WAAW,UAAM,2BAAY,SAAS,SAAS,GAAG;AAExD,aAAO,KAAK,MAAM,SAAS,UAAW;AAAA,IACxC;AAAA,EACF;AACF;",
6
6
  "names": []
@@ -43,3 +43,4 @@ function getNotificationHubJob(context, jobId, options = {}) {
43
43
  0 && (module.exports = {
44
44
  getNotificationHubJob
45
45
  });
46
+ //# sourceMappingURL=getNotificationHubJob.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["/mnt/vss/_work/1/s/sdk/notificationhubs/notification-hubs/src/api/getNotificationHubJob.ts"],
3
+ "sources": ["../../../src/api/getNotificationHubJob.ts"],
4
4
  "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport type { NotificationHubJob } from \"../models/notificationHubJob.js\";\nimport type { NotificationHubsClientContext } from \"./index.js\";\nimport type { OperationOptions } from \"@azure-rest/core-client\";\nimport { parseNotificationHubJobEntry } from \"../serializers/notificationHubJobSerializer.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"getNotificationHubJob\";\n\n/**\n * Gets a Notification Hub Job by the ID.\n * @param context - The Notification Hubs client.\n * @param jobId - The Notification Hub Job ID.\n * @param options - The operation options.\n * @returns The Notification Hub Job with the matching ID.\n */\nexport function getNotificationHubJob(\n context: NotificationHubsClientContext,\n jobId: string,\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/${jobId}`;\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, \"GET\", headers, updatedOptions);\n const response = await sendRequest(context, request, 200);\n\n return parseNotificationHubJobEntry(response.bodyAsText!);\n },\n );\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAA2C;AAI3C,0CAA6C;AAC7C,qBAA8B;AAE9B,MAAM,iBAAiB;AAShB,SAAS,sBACd,SACA,OACA,UAA4B,CAAC,GACA;AAC7B,SAAO,6BAAc;AAAA,IACnB,iCAAiC,cAAc;AAAA,IAC/C;AAAA,IACA,OAAO,mBAAmB;AACxB,YAAM,WAAW,QAAQ,WAAW;AACpC,eAAS,YAAY,SAAS,KAAK;AAEnC,YAAM,UAAU,MAAM,QAAQ,cAAc,cAAc;AAC1D,cAAQ,IAAI,gBAAgB,+CAA+C;AAE3E,YAAM,cAAU,6BAAc,UAAU,OAAO,SAAS,cAAc;AACtE,YAAM,WAAW,UAAM,2BAAY,SAAS,SAAS,GAAG;AAExD,iBAAO,kEAA6B,SAAS,UAAW;AAAA,IAC1D;AAAA,EACF;AACF;",
6
6
  "names": []
@@ -42,3 +42,4 @@ function getNotificationOutcomeDetails(context, notificationId, options = {}) {
42
42
  0 && (module.exports = {
43
43
  getNotificationOutcomeDetails
44
44
  });
45
+ //# sourceMappingURL=getNotificationOutcomeDetails.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["/mnt/vss/_work/1/s/sdk/notificationhubs/notification-hubs/src/api/getNotificationOutcomeDetails.ts"],
3
+ "sources": ["../../../src/api/getNotificationOutcomeDetails.ts"],
4
4
  "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport type { NotificationDetails } from \"../models/notificationDetails.js\";\nimport type { NotificationHubsClientContext } from \"./index.js\";\nimport type { OperationOptions } from \"@azure-rest/core-client\";\nimport { parseNotificationDetails } from \"../serializers/notificationDetailsSerializer.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"getNotificationOutcomeDetails\";\n\n/**\n * Retrieves the results of a send operation. This can retrieve intermediate results if the send is being processed\n * or final results if the Send* has completed. This API can only be called for Standard SKU and above.\n * @param context - The Notification Hubs client.\n * @param notificationId - The notification ID returned from the send operation.\n * @param options - The operation options.\n * @returns The results of the send operation.\n */\nexport function getNotificationOutcomeDetails(\n context: NotificationHubsClientContext,\n notificationId: string,\n options: OperationOptions = {},\n): Promise<NotificationDetails> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/messages/${notificationId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n const request = createRequest(endpoint, \"GET\", headers, updatedOptions);\n const response = await sendRequest(context, request, 200);\n\n return parseNotificationDetails(response.bodyAsText!);\n },\n );\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAA2C;AAI3C,2CAAyC;AACzC,qBAA8B;AAE9B,MAAM,iBAAiB;AAUhB,SAAS,8BACd,SACA,gBACA,UAA4B,CAAC,GACC;AAC9B,SAAO,6BAAc;AAAA,IACnB,iCAAiC,cAAc;AAAA,IAC/C;AAAA,IACA,OAAO,mBAAmB;AACxB,YAAM,WAAW,QAAQ,WAAW;AACpC,eAAS,YAAY,aAAa,cAAc;AAEhD,YAAM,UAAU,MAAM,QAAQ,cAAc,cAAc;AAC1D,YAAM,cAAU,6BAAc,UAAU,OAAO,SAAS,cAAc;AACtE,YAAM,WAAW,UAAM,2BAAY,SAAS,SAAS,GAAG;AAExD,iBAAO,+DAAyB,SAAS,UAAW;AAAA,IACtD;AAAA,EACF;AACF;",
6
6
  "names": []
@@ -43,3 +43,4 @@ function getRegistration(context, registrationId, options = {}) {
43
43
  0 && (module.exports = {
44
44
  getRegistration
45
45
  });
46
+ //# sourceMappingURL=getRegistration.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["/mnt/vss/_work/1/s/sdk/notificationhubs/notification-hubs/src/api/getRegistration.ts"],
3
+ "sources": ["../../../src/api/getRegistration.ts"],
4
4
  "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport type { NotificationHubsClientContext } from \"./index.js\";\nimport type { OperationOptions } from \"@azure-rest/core-client\";\nimport type { RegistrationDescription } from \"../models/registration.js\";\nimport { registrationDescriptionParser } from \"../serializers/registrationSerializer.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"getRegistration\";\n\n/**\n * Gets a registration by the given registration ID.\n * @param context - The Notification Hubs client.\n * @param registrationId - The ID of the registration to get.\n * @param options - The options for getting a registration by ID.\n * @returns A RegistrationDescription that has the given registration ID.\n */\nexport function getRegistration(\n context: NotificationHubsClientContext,\n registrationId: string,\n options: OperationOptions = {},\n): Promise<RegistrationDescription> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/registrations/${registrationId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/xml;type=entry;charset=utf-8\");\n\n const request = createRequest(endpoint, \"GET\", headers, updatedOptions);\n const response = await sendRequest(context, request, 200);\n\n return registrationDescriptionParser.parseRegistrationEntry(response.bodyAsText!);\n },\n );\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAA2C;AAI3C,oCAA8C;AAC9C,qBAA8B;AAE9B,MAAM,iBAAiB;AAShB,SAAS,gBACd,SACA,gBACA,UAA4B,CAAC,GACK;AAClC,SAAO,6BAAc;AAAA,IACnB,iCAAiC,cAAc;AAAA,IAC/C;AAAA,IACA,OAAO,mBAAmB;AACxB,YAAM,WAAW,QAAQ,WAAW;AACpC,eAAS,YAAY,kBAAkB,cAAc;AAErD,YAAM,UAAU,MAAM,QAAQ,cAAc,cAAc;AAC1D,cAAQ,IAAI,gBAAgB,0CAA0C;AAEtE,YAAM,cAAU,6BAAc,UAAU,OAAO,SAAS,cAAc;AACtE,YAAM,WAAW,UAAM,2BAAY,SAAS,SAAS,GAAG;AAExD,aAAO,4DAA8B,uBAAuB,SAAS,UAAW;AAAA,IAClF;AAAA,EACF;AACF;",
6
6
  "names": []
@@ -67,3 +67,4 @@ __reExport(api_exports, require("./updateRegistration.js"), module.exports);
67
67
  ...require("./updateInstallation.js"),
68
68
  ...require("./updateRegistration.js")
69
69
  });
70
+ //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["/mnt/vss/_work/1/s/sdk/notificationhubs/notification-hubs/src/api/index.ts"],
3
+ "sources": ["../../../src/api/index.ts"],
4
4
  "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport * from \"./clientContext.js\";\nexport * from \"./beginSubmitNotificationHubJob.js\";\nexport * from \"./cancelScheduledNotification.js\";\nexport * from \"./createOrUpdateInstallation.js\";\nexport * from \"./createOrUpdateRegistration.js\";\nexport * from \"./createRegistration.js\";\nexport * from \"./createRegistrationId.js\";\nexport * from \"./deleteInstallation.js\";\nexport * from \"./deleteRegistration.js\";\nexport * from \"./getFeedbackContainerUrl.js\";\nexport * from \"./getInstallation.js\";\nexport * from \"./getNotificationHubJob.js\";\nexport * from \"./getNotificationOutcomeDetails.js\";\nexport * from \"./getRegistration.js\";\nexport * from \"./listNotificationHubJobs.js\";\nexport * from \"./listRegistrations.js\";\nexport * from \"./listRegistrationsByChannel.js\";\nexport * from \"./listRegistrationsByTag.js\";\nexport * from \"./scheduleBroadcastNotification.js\";\nexport * from \"./scheduleNotification.js\";\nexport * from \"./sendBroadcastNotification.js\";\nexport * from \"./sendNotification.js\";\nexport * from \"./submitNotificationHubJob.js\";\nexport * from \"./updateInstallation.js\";\nexport * from \"./updateRegistration.js\";\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAGA,wBAAc,+BAHd;AAIA,wBAAc,+CAJd;AAKA,wBAAc,6CALd;AAMA,wBAAc,4CANd;AAOA,wBAAc,4CAPd;AAQA,wBAAc,oCARd;AASA,wBAAc,sCATd;AAUA,wBAAc,oCAVd;AAWA,wBAAc,oCAXd;AAYA,wBAAc,yCAZd;AAaA,wBAAc,iCAbd;AAcA,wBAAc,uCAdd;AAeA,wBAAc,+CAfd;AAgBA,wBAAc,iCAhBd;AAiBA,wBAAc,yCAjBd;AAkBA,wBAAc,mCAlBd;AAmBA,wBAAc,4CAnBd;AAoBA,wBAAc,wCApBd;AAqBA,wBAAc,+CArBd;AAsBA,wBAAc,sCAtBd;AAuBA,wBAAc,2CAvBd;AAwBA,wBAAc,kCAxBd;AAyBA,wBAAc,0CAzBd;AA0BA,wBAAc,oCA1Bd;AA2BA,wBAAc,oCA3Bd;",
6
6
  "names": []
@@ -108,3 +108,4 @@ async function sendRequest(context, request, successStatusCode) {
108
108
  parseNotificationSendResponse,
109
109
  sendRequest
110
110
  });
111
+ //# sourceMappingURL=_client.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["/mnt/vss/_work/1/s/sdk/notificationhubs/notification-hubs/src/api/internal/_client.ts"],
3
+ "sources": ["../../../../src/api/internal/_client.ts"],
4
4
  "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n HttpHeaders,\n HttpMethods,\n PipelineRequest,\n PipelineResponse,\n} from \"@azure/core-rest-pipeline\";\nimport { RestError, createPipelineRequest } from \"@azure/core-rest-pipeline\";\nimport type {\n NotificationHubsMessageResponse,\n NotificationHubsResponse,\n} from \"../../models/notificationDetails.js\";\nimport type { NotificationHubsClientContext } from \"../index.js\";\nimport type { OperationOptions } from \"@azure-rest/core-client\";\nimport { isDefined } from \"../../utils/utils.js\";\nimport { parseNotificationOutcome } from \"../../serializers/notificationOutcomeSerializer.js\";\nimport { parseXMLError } from \"../../utils/xmlUtils.js\";\n\nexport function createRequest(\n endpoint: URL,\n method: HttpMethods,\n headers: HttpHeaders,\n options: OperationOptions,\n): PipelineRequest {\n return createPipelineRequest({\n ...options.tracingOptions,\n ...options.requestOptions,\n url: endpoint.toString(),\n abortSignal: options.abortSignal,\n method,\n headers,\n });\n}\n\n/**\n * Parses the HTTP response and creates a NotificationHubsResponse with header information from the operation.\n * @param response - The HTTP response used to populate the result.\n * @returns A NotificationHubsResponse with header information from the operation.\n */\nexport function parseNotificationResponse(response: PipelineResponse): NotificationHubsResponse {\n const correlationId = response.headers.get(\"x-ms-correlation-request-id\");\n const trackingId = response.headers.get(\"TrackingId\");\n const location = response.headers.get(\"Location\");\n\n return {\n correlationId,\n trackingId,\n location,\n };\n}\n\n/**\n * Parses the HTTP response and creates a NotificationHubsMessageResponse with results from the notification.\n * @param response - The HTTP response used to populate the result.\n * @returns A NotificationHubsMessageResponse with results from the notification.\n */\nexport async function parseNotificationSendResponse(\n response: PipelineResponse,\n): Promise<NotificationHubsMessageResponse> {\n const result = parseNotificationResponse(response);\n let notificationId: string | undefined;\n if (result.location) {\n const locationUrl = new URL(result.location);\n notificationId = locationUrl.pathname.split(\"/\")[3];\n }\n\n const requestUrl = new URL(response.request.url);\n const isTestSend = requestUrl.searchParams.has(\"test\");\n const isDirectSend = requestUrl.searchParams.has(\"direct\");\n\n // Only broadcast/tag based sends are supported for test send\n const responseBody = response.bodyAsText;\n if (isTestSend && !isDirectSend && isDefined(responseBody)) {\n const outcome = await parseNotificationOutcome(responseBody);\n return {\n ...result,\n ...outcome,\n notificationId,\n };\n } else {\n return createDefaultResponse(result, notificationId);\n }\n}\n\nfunction createDefaultResponse(\n response: NotificationHubsResponse,\n notificationId?: string,\n): NotificationHubsMessageResponse {\n return {\n ...response,\n notificationId,\n successCount: 0,\n failureCount: 0,\n results: [],\n state: \"Enqueued\",\n };\n}\n\n/**\n * Sends a request through the client context.\n * @param context - The client context to use.\n * @param request - The HTTP request to send.\n * @param successStatusCode - A status code or list of status codes to check for success.\n * @returns The HTTP Response.\n */\nexport async function sendRequest(\n context: NotificationHubsClientContext,\n request: PipelineRequest,\n successStatusCode: number | number[],\n): Promise<PipelineResponse> {\n const statuses: number[] = Array.isArray(successStatusCode)\n ? successStatusCode\n : [successStatusCode];\n\n const response = await context.sendRequest(request);\n\n if (!statuses.some((statusCode) => statusCode === response.status)) {\n const responseBody = response.bodyAsText;\n let details: string | undefined;\n if (isDefined(responseBody)) {\n details = await parseXMLError(responseBody);\n }\n\n let errorMessage: string | undefined;\n if (isDefined(details)) {\n errorMessage = `operations failed with: ${details}`;\n } else {\n errorMessage = `operation failed with status ${response.status}`;\n }\n\n throw new RestError(errorMessage, {\n statusCode: response.status,\n response,\n });\n }\n\n return response;\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,gCAAiD;AAOjD,mBAA0B;AAC1B,2CAAyC;AACzC,sBAA8B;AAEvB,SAAS,cACd,UACA,QACA,SACA,SACiB;AACjB,aAAO,iDAAsB;AAAA,IAC3B,GAAG,QAAQ;AAAA,IACX,GAAG,QAAQ;AAAA,IACX,KAAK,SAAS,SAAS;AAAA,IACvB,aAAa,QAAQ;AAAA,IACrB;AAAA,IACA;AAAA,EACF,CAAC;AACH;AAOO,SAAS,0BAA0B,UAAsD;AAC9F,QAAM,gBAAgB,SAAS,QAAQ,IAAI,6BAA6B;AACxE,QAAM,aAAa,SAAS,QAAQ,IAAI,YAAY;AACpD,QAAM,WAAW,SAAS,QAAQ,IAAI,UAAU;AAEhD,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAOA,eAAsB,8BACpB,UAC0C;AAC1C,QAAM,SAAS,0BAA0B,QAAQ;AACjD,MAAI;AACJ,MAAI,OAAO,UAAU;AACnB,UAAM,cAAc,IAAI,IAAI,OAAO,QAAQ;AAC3C,qBAAiB,YAAY,SAAS,MAAM,GAAG,EAAE,CAAC;AAAA,EACpD;AAEA,QAAM,aAAa,IAAI,IAAI,SAAS,QAAQ,GAAG;AAC/C,QAAM,aAAa,WAAW,aAAa,IAAI,MAAM;AACrD,QAAM,eAAe,WAAW,aAAa,IAAI,QAAQ;AAGzD,QAAM,eAAe,SAAS;AAC9B,MAAI,cAAc,CAAC,oBAAgB,wBAAU,YAAY,GAAG;AAC1D,UAAM,UAAU,UAAM,+DAAyB,YAAY;AAC3D,WAAO;AAAA,MACL,GAAG;AAAA,MACH,GAAG;AAAA,MACH;AAAA,IACF;AAAA,EACF,OAAO;AACL,WAAO,sBAAsB,QAAQ,cAAc;AAAA,EACrD;AACF;AAEA,SAAS,sBACP,UACA,gBACiC;AACjC,SAAO;AAAA,IACL,GAAG;AAAA,IACH;AAAA,IACA,cAAc;AAAA,IACd,cAAc;AAAA,IACd,SAAS,CAAC;AAAA,IACV,OAAO;AAAA,EACT;AACF;AASA,eAAsB,YACpB,SACA,SACA,mBAC2B;AAC3B,QAAM,WAAqB,MAAM,QAAQ,iBAAiB,IACtD,oBACA,CAAC,iBAAiB;AAEtB,QAAM,WAAW,MAAM,QAAQ,YAAY,OAAO;AAElD,MAAI,CAAC,SAAS,KAAK,CAAC,eAAe,eAAe,SAAS,MAAM,GAAG;AAClE,UAAM,eAAe,SAAS;AAC9B,QAAI;AACJ,YAAI,wBAAU,YAAY,GAAG;AAC3B,gBAAU,UAAM,+BAAc,YAAY;AAAA,IAC5C;AAEA,QAAI;AACJ,YAAI,wBAAU,OAAO,GAAG;AACtB,qBAAe,2BAA2B,OAAO;AAAA,IACnD,OAAO;AACL,qBAAe,gCAAgC,SAAS,MAAM;AAAA,IAChE;AAEA,UAAM,IAAI,oCAAU,cAAc;AAAA,MAChC,YAAY,SAAS;AAAA,MACrB;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO;AACT;",
6
6
  "names": []
@@ -48,3 +48,4 @@ async function createOrUpdateRegistrationDescription(context, registration, oper
48
48
  0 && (module.exports = {
49
49
  createOrUpdateRegistrationDescription
50
50
  });
51
+ //# sourceMappingURL=_createOrUpdateRegistrationDescription.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["/mnt/vss/_work/1/s/sdk/notificationhubs/notification-hubs/src/api/internal/_createOrUpdateRegistrationDescription.ts"],
3
+ "sources": ["../../../../src/api/internal/_createOrUpdateRegistrationDescription.ts"],
4
4
  "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createRequest, sendRequest } from \"./_client.js\";\nimport {\n registrationDescriptionParser,\n registrationDescriptionSerializer,\n} from \"../../serializers/registrationSerializer.js\";\nimport type { HttpMethods } from \"@azure/core-rest-pipeline\";\nimport type { NotificationHubsClientContext } from \"../index.js\";\nimport type { OperationOptions } from \"@azure-rest/core-client\";\nimport type { RegistrationDescription } from \"../../models/registration.js\";\nimport { isDefined } from \"../../utils/utils.js\";\n\n/**\n * @internal\n */\nexport async function createOrUpdateRegistrationDescription(\n context: NotificationHubsClientContext,\n registration: RegistrationDescription,\n operationName: \"create\" | \"createOrUpdate\" | \"update\",\n options: OperationOptions,\n): Promise<RegistrationDescription> {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/registrations\";\n let httpMethod: HttpMethods = \"POST\";\n\n if (operationName === \"createOrUpdate\" || operationName === \"update\") {\n endpoint.pathname += `/${registration.registrationId}`;\n httpMethod = \"PUT\";\n }\n\n const etag = registration.etag;\n\n // Clear out readonly properties\n registration.registrationId = undefined;\n registration.etag = undefined;\n\n const headers = await context.createHeaders(`${operationName}Registration`);\n headers.set(\"Content-Type\", \"application/atom+xml;type=entry;charset=utf-8\");\n\n if (operationName === \"update\") {\n headers.set(\"If-Match\", isDefined(etag) ? `\"${etag}\"` : \"*\");\n }\n\n const request = createRequest(endpoint, httpMethod, headers, options);\n request.body = registrationDescriptionSerializer.serializeRegistrationDescription(registration);\n const response = await sendRequest(context, request, [200, 201]);\n\n return registrationDescriptionParser.parseRegistrationEntry(response.bodyAsText!);\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAA2C;AAC3C,oCAGO;AAKP,mBAA0B;AAK1B,eAAsB,sCACpB,SACA,cACA,eACA,SACkC;AAClC,QAAM,WAAW,QAAQ,WAAW;AACpC,WAAS,YAAY;AACrB,MAAI,aAA0B;AAE9B,MAAI,kBAAkB,oBAAoB,kBAAkB,UAAU;AACpE,aAAS,YAAY,IAAI,aAAa,cAAc;AACpD,iBAAa;AAAA,EACf;AAEA,QAAM,OAAO,aAAa;AAG1B,eAAa,iBAAiB;AAC9B,eAAa,OAAO;AAEpB,QAAM,UAAU,MAAM,QAAQ,cAAc,GAAG,aAAa,cAAc;AAC1E,UAAQ,IAAI,gBAAgB,+CAA+C;AAE3E,MAAI,kBAAkB,UAAU;AAC9B,YAAQ,IAAI,gBAAY,wBAAU,IAAI,IAAI,IAAI,IAAI,MAAM,GAAG;AAAA,EAC7D;AAEA,QAAM,cAAU,6BAAc,UAAU,YAAY,SAAS,OAAO;AACpE,UAAQ,OAAO,gEAAkC,iCAAiC,YAAY;AAC9F,QAAM,WAAW,UAAM,2BAAY,SAAS,SAAS,CAAC,KAAK,GAAG,CAAC;AAE/D,SAAO,4DAA8B,uBAAuB,SAAS,UAAW;AAClF;",
6
6
  "names": []
@@ -67,3 +67,4 @@ async function _listRegistrations(context, options, continuationToken) {
67
67
  listRegistrationPagingPage,
68
68
  listRegistrationsAll
69
69
  });
70
+ //# sourceMappingURL=_listRegistrations.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["/mnt/vss/_work/1/s/sdk/notificationhubs/notification-hubs/src/api/internal/_listRegistrations.ts"],
3
+ "sources": ["../../../../src/api/internal/_listRegistrations.ts"],
4
4
  "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createRequest, sendRequest } from \"./_client.js\";\nimport type { NotificationHubsClientContext } from \"../index.js\";\nimport type { RegistrationDescription } from \"../../models/registration.js\";\nimport type { RegistrationQueryOptions } from \"../../models/options.js\";\nimport type { RegistrationQueryResponse } from \"../../models/response.js\";\nimport { registrationDescriptionParser } from \"../../serializers/registrationSerializer.js\";\n\nexport async function* listRegistrationsAll(\n context: NotificationHubsClientContext,\n options: RegistrationQueryOptions,\n): AsyncIterableIterator<RegistrationDescription> {\n for await (const page of listRegistrationPagingPage(context, options)) {\n yield* page;\n }\n}\n\nexport async function* listRegistrationPagingPage(\n context: NotificationHubsClientContext,\n options: RegistrationQueryOptions,\n): AsyncIterableIterator<RegistrationDescription[]> {\n let result = await _listRegistrations(context, options);\n yield result.registrations || [];\n let continuationToken = result.continuationToken;\n while (continuationToken) {\n result = await _listRegistrations(context, options, continuationToken);\n continuationToken = result.continuationToken;\n yield result.registrations || [];\n }\n}\n\nasync function _listRegistrations(\n context: NotificationHubsClientContext,\n options: RegistrationQueryOptions,\n continuationToken?: string,\n): Promise<RegistrationQueryResponse> {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/registrations\";\n if (options.top !== undefined) {\n endpoint.searchParams.set(\"$top\", `${options.top}`);\n }\n\n if (options.filter !== undefined) {\n endpoint.searchParams.set(\"$filter\", options.filter);\n }\n\n if (continuationToken !== undefined) {\n endpoint.searchParams.set(\"continuationtoken\", continuationToken);\n }\n\n const headers = await context.createHeaders(\"listRegistrations\");\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"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAA2C;AAK3C,oCAA8C;AAE9C,gBAAuB,qBACrB,SACA,SACgD;AAChD,mBAAiB,QAAQ,2BAA2B,SAAS,OAAO,GAAG;AACrE,WAAO;AAAA,EACT;AACF;AAEA,gBAAuB,2BACrB,SACA,SACkD;AAClD,MAAI,SAAS,MAAM,mBAAmB,SAAS,OAAO;AACtD,QAAM,OAAO,iBAAiB,CAAC;AAC/B,MAAI,oBAAoB,OAAO;AAC/B,SAAO,mBAAmB;AACxB,aAAS,MAAM,mBAAmB,SAAS,SAAS,iBAAiB;AACrE,wBAAoB,OAAO;AAC3B,UAAM,OAAO,iBAAiB,CAAC;AAAA,EACjC;AACF;AAEA,eAAe,mBACb,SACA,SACA,mBACoC;AACpC,QAAM,WAAW,QAAQ,WAAW;AACpC,WAAS,YAAY;AACrB,MAAI,QAAQ,QAAQ,QAAW;AAC7B,aAAS,aAAa,IAAI,QAAQ,GAAG,QAAQ,GAAG,EAAE;AAAA,EACpD;AAEA,MAAI,QAAQ,WAAW,QAAW;AAChC,aAAS,aAAa,IAAI,WAAW,QAAQ,MAAM;AAAA,EACrD;AAEA,MAAI,sBAAsB,QAAW;AACnC,aAAS,aAAa,IAAI,qBAAqB,iBAAiB;AAAA,EAClE;AAEA,QAAM,UAAU,MAAM,QAAQ,cAAc,mBAAmB;AAC/D,QAAM,cAAU,6BAAc,UAAU,OAAO,SAAS,OAAO;AAC/D,QAAM,WAAW,UAAM,2BAAY,SAAS,SAAS,GAAG;AAExD,QAAM,gBAAgB,MAAM,4DAA8B;AAAA,IACxD,SAAS;AAAA,EACX;AACA,QAAM,YAAY,SAAS,QAAQ,IAAI,wBAAwB;AAC/D,SAAO;AAAA,IACL;AAAA,IACA,mBAAmB;AAAA,EACrB;AACF;",
6
6
  "names": []
@@ -50,3 +50,4 @@ function scheduleNotificationInternal(context, scheduledTime, notification, opti
50
50
  0 && (module.exports = {
51
51
  scheduleNotificationInternal
52
52
  });
53
+ //# sourceMappingURL=_scheduleNotification.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["/mnt/vss/_work/1/s/sdk/notificationhubs/notification-hubs/src/api/internal/_scheduleNotification.ts"],
3
+ "sources": ["../../../../src/api/internal/_scheduleNotification.ts"],
4
4
  "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createRequest, parseNotificationSendResponse, sendRequest } from \"./_client.js\";\nimport type { NonNullableRecord } from \"../../utils/utils.js\";\nimport type { Notification } from \"../../models/notification.js\";\nimport type { NotificationHubsClientContext } from \"../index.js\";\nimport type { NotificationHubsMessageResponse } from \"../../models/notificationDetails.js\";\nimport { tracingClient } from \"../../utils/tracing.js\";\nimport type { OperationOptions } from \"@azure-rest/core-client\";\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 scheduleNotificationInternal(\n context: NotificationHubsClientContext,\n scheduledTime: Date,\n notification: Notification,\n options: OperationOptions,\n method: string,\n tagExpression?: string,\n): Promise<NotificationHubsMessageResponse> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${method}`,\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 if (tagExpression) {\n headers.set(\"ServiceBusNotification-Tags\", 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"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAA0E;AAK1E,qBAA8B;AAYvB,SAAS,6BACd,SACA,eACA,cACA,SACA,QACA,eAC0C;AAC1C,SAAO,6BAAc;AAAA,IACnB,iCAAiC,MAAM;AAAA,IACvC;AAAA,IACA,OAAO,mBAAmB;AACxB,YAAM,WAAW,QAAQ,WAAW;AACpC,eAAS,YAAY;AAErB,YAAM,UAAU,MAAM,QAAQ;AAAA,QAC5B;AAAA,QACA,aAAa;AAAA,MACf;AACA,cAAQ,IAAI,uCAAuC,cAAc,YAAY,CAAC;AAC9E,cAAQ,IAAI,gBAAgB,aAAa,WAAW;AACpD,cAAQ,IAAI,iCAAiC,aAAa,QAAQ;AAClE,UAAI,eAAe;AACjB,gBAAQ,IAAI,+BAA+B,aAAa;AAAA,MAC1D;AAEA,YAAM,cAAU,6BAAc,UAAU,QAAQ,SAAS,cAAc;AACvE,cAAQ,OAAO,aAAa;AAE5B,YAAM,WAAW,UAAM,2BAAY,SAAS,SAAS,GAAG;AAExD,iBAAO,6CAA8B,QAAQ;AAAA,IAC/C;AAAA,EACF;AACF;",
6
6
  "names": []