@azure/notification-hubs 2.0.1-alpha.20250618.1 → 2.0.1-alpha.20250718.2

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 (122) hide show
  1. package/dist/browser/api/beginSubmitNotificationHubJob.js +6 -7
  2. package/dist/browser/api/beginSubmitNotificationHubJob.js.map +1 -1
  3. package/dist/browser/api/clientContext.js +12 -5
  4. package/dist/browser/api/clientContext.js.map +1 -1
  5. package/dist/browser/api/internal/_client.js +21 -4
  6. package/dist/browser/api/internal/_client.js.map +1 -1
  7. package/dist/browser/api/internal/_listRegistrations.js +13 -31
  8. package/dist/browser/api/internal/_listRegistrations.js.map +1 -1
  9. package/dist/browser/api/listRegistrationsByChannel.js +4 -1
  10. package/dist/browser/api/listRegistrationsByChannel.js.map +1 -1
  11. package/dist/browser/api/listRegistrationsByTag.js +13 -31
  12. package/dist/browser/api/listRegistrationsByTag.js.map +1 -1
  13. package/dist/browser/auth/sasTokenCredential.js +4 -0
  14. package/dist/browser/auth/sasTokenCredential.js.map +1 -1
  15. package/dist/browser/models/installation.js +32 -8
  16. package/dist/browser/models/installation.js.map +1 -1
  17. package/dist/browser/models/notification.js +69 -13
  18. package/dist/browser/models/notification.js.map +1 -1
  19. package/dist/browser/models/registration.js +64 -16
  20. package/dist/browser/models/registration.js.map +1 -1
  21. package/dist/browser/notificationHubsClient.js +1 -0
  22. package/dist/browser/notificationHubsClient.js.map +1 -1
  23. package/dist/browser/serializers/notificationDetailsSerializer.js +6 -7
  24. package/dist/browser/serializers/notificationDetailsSerializer.js.map +1 -1
  25. package/dist/browser/serializers/notificationHubJobSerializer.js +4 -5
  26. package/dist/browser/serializers/notificationHubJobSerializer.js.map +1 -1
  27. package/dist/browser/serializers/registrationSerializer.js +185 -48
  28. package/dist/browser/serializers/registrationSerializer.js.map +1 -1
  29. package/dist/browser/utils/xmlUtils.js +1 -1
  30. package/dist/browser/utils/xmlUtils.js.map +1 -1
  31. package/dist/commonjs/api/beginSubmitNotificationHubJob.js +6 -7
  32. package/dist/commonjs/api/beginSubmitNotificationHubJob.js.map +1 -1
  33. package/dist/commonjs/api/clientContext.js +12 -5
  34. package/dist/commonjs/api/clientContext.js.map +1 -1
  35. package/dist/commonjs/api/internal/_client.js +21 -4
  36. package/dist/commonjs/api/internal/_client.js.map +1 -1
  37. package/dist/commonjs/api/internal/_listRegistrations.js +13 -31
  38. package/dist/commonjs/api/internal/_listRegistrations.js.map +1 -1
  39. package/dist/commonjs/api/listRegistrationsByChannel.js +4 -1
  40. package/dist/commonjs/api/listRegistrationsByChannel.js.map +1 -1
  41. package/dist/commonjs/api/listRegistrationsByTag.js +13 -31
  42. package/dist/commonjs/api/listRegistrationsByTag.js.map +1 -1
  43. package/dist/commonjs/auth/sasTokenCredential.js +4 -0
  44. package/dist/commonjs/auth/sasTokenCredential.js.map +1 -1
  45. package/dist/commonjs/models/installation.js +32 -8
  46. package/dist/commonjs/models/installation.js.map +1 -1
  47. package/dist/commonjs/models/notification.js +69 -13
  48. package/dist/commonjs/models/notification.js.map +1 -1
  49. package/dist/commonjs/models/registration.js +64 -16
  50. package/dist/commonjs/models/registration.js.map +1 -1
  51. package/dist/commonjs/notificationHubsClient.js +1 -0
  52. package/dist/commonjs/notificationHubsClient.js.map +1 -1
  53. package/dist/commonjs/serializers/notificationDetailsSerializer.js +6 -7
  54. package/dist/commonjs/serializers/notificationDetailsSerializer.js.map +1 -1
  55. package/dist/commonjs/serializers/notificationHubJobSerializer.js +4 -5
  56. package/dist/commonjs/serializers/notificationHubJobSerializer.js.map +1 -1
  57. package/dist/commonjs/serializers/registrationSerializer.js +185 -48
  58. package/dist/commonjs/serializers/registrationSerializer.js.map +1 -1
  59. package/dist/commonjs/tsdoc-metadata.json +11 -11
  60. package/dist/commonjs/utils/xmlUtils.js +1 -1
  61. package/dist/commonjs/utils/xmlUtils.js.map +1 -1
  62. package/dist/esm/api/beginSubmitNotificationHubJob.js +6 -7
  63. package/dist/esm/api/beginSubmitNotificationHubJob.js.map +1 -1
  64. package/dist/esm/api/clientContext.js +12 -5
  65. package/dist/esm/api/clientContext.js.map +1 -1
  66. package/dist/esm/api/internal/_client.js +21 -4
  67. package/dist/esm/api/internal/_client.js.map +1 -1
  68. package/dist/esm/api/internal/_listRegistrations.js +13 -31
  69. package/dist/esm/api/internal/_listRegistrations.js.map +1 -1
  70. package/dist/esm/api/listRegistrationsByChannel.js +4 -1
  71. package/dist/esm/api/listRegistrationsByChannel.js.map +1 -1
  72. package/dist/esm/api/listRegistrationsByTag.js +13 -31
  73. package/dist/esm/api/listRegistrationsByTag.js.map +1 -1
  74. package/dist/esm/auth/sasTokenCredential.js +4 -0
  75. package/dist/esm/auth/sasTokenCredential.js.map +1 -1
  76. package/dist/esm/models/installation.js +32 -8
  77. package/dist/esm/models/installation.js.map +1 -1
  78. package/dist/esm/models/notification.js +69 -13
  79. package/dist/esm/models/notification.js.map +1 -1
  80. package/dist/esm/models/registration.js +64 -16
  81. package/dist/esm/models/registration.js.map +1 -1
  82. package/dist/esm/notificationHubsClient.js +1 -0
  83. package/dist/esm/notificationHubsClient.js.map +1 -1
  84. package/dist/esm/serializers/notificationDetailsSerializer.js +6 -7
  85. package/dist/esm/serializers/notificationDetailsSerializer.js.map +1 -1
  86. package/dist/esm/serializers/notificationHubJobSerializer.js +4 -5
  87. package/dist/esm/serializers/notificationHubJobSerializer.js.map +1 -1
  88. package/dist/esm/serializers/registrationSerializer.js +185 -48
  89. package/dist/esm/serializers/registrationSerializer.js.map +1 -1
  90. package/dist/esm/utils/xmlUtils.js +1 -1
  91. package/dist/esm/utils/xmlUtils.js.map +1 -1
  92. package/dist/react-native/api/beginSubmitNotificationHubJob.js +6 -7
  93. package/dist/react-native/api/beginSubmitNotificationHubJob.js.map +1 -1
  94. package/dist/react-native/api/clientContext.js +12 -5
  95. package/dist/react-native/api/clientContext.js.map +1 -1
  96. package/dist/react-native/api/internal/_client.js +21 -4
  97. package/dist/react-native/api/internal/_client.js.map +1 -1
  98. package/dist/react-native/api/internal/_listRegistrations.js +13 -31
  99. package/dist/react-native/api/internal/_listRegistrations.js.map +1 -1
  100. package/dist/react-native/api/listRegistrationsByChannel.js +4 -1
  101. package/dist/react-native/api/listRegistrationsByChannel.js.map +1 -1
  102. package/dist/react-native/api/listRegistrationsByTag.js +13 -31
  103. package/dist/react-native/api/listRegistrationsByTag.js.map +1 -1
  104. package/dist/react-native/auth/sasTokenCredential.js +4 -0
  105. package/dist/react-native/auth/sasTokenCredential.js.map +1 -1
  106. package/dist/react-native/models/installation.js +32 -8
  107. package/dist/react-native/models/installation.js.map +1 -1
  108. package/dist/react-native/models/notification.js +69 -13
  109. package/dist/react-native/models/notification.js.map +1 -1
  110. package/dist/react-native/models/registration.js +64 -16
  111. package/dist/react-native/models/registration.js.map +1 -1
  112. package/dist/react-native/notificationHubsClient.js +1 -0
  113. package/dist/react-native/notificationHubsClient.js.map +1 -1
  114. package/dist/react-native/serializers/notificationDetailsSerializer.js +6 -7
  115. package/dist/react-native/serializers/notificationDetailsSerializer.js.map +1 -1
  116. package/dist/react-native/serializers/notificationHubJobSerializer.js +4 -5
  117. package/dist/react-native/serializers/notificationHubJobSerializer.js.map +1 -1
  118. package/dist/react-native/serializers/registrationSerializer.js +185 -48
  119. package/dist/react-native/serializers/registrationSerializer.js.map +1 -1
  120. package/dist/react-native/utils/xmlUtils.js +1 -1
  121. package/dist/react-native/utils/xmlUtils.js.map +1 -1
  122. package/package.json +2 -2
@@ -24,7 +24,10 @@ exports.createXiaomiTemplateRegistrationDescription = createXiaomiTemplateRegist
24
24
  * @returns A created ADM registration description.
25
25
  */
26
26
  function createAdmRegistrationDescription(description) {
27
- return Object.assign(Object.assign({}, description), { kind: "Adm" });
27
+ return {
28
+ ...description,
29
+ kind: "Adm",
30
+ };
28
31
  }
29
32
  /**
30
33
  * Creates an ADM template registration description.
@@ -32,7 +35,10 @@ function createAdmRegistrationDescription(description) {
32
35
  * @returns A created ADM template registration description.
33
36
  */
34
37
  function createAdmTemplateRegistrationDescription(description) {
35
- return Object.assign(Object.assign({}, description), { kind: "AdmTemplate" });
38
+ return {
39
+ ...description,
40
+ kind: "AdmTemplate",
41
+ };
36
42
  }
37
43
  /**
38
44
  * Creates an Apple registration description.
@@ -40,7 +46,10 @@ function createAdmTemplateRegistrationDescription(description) {
40
46
  * @returns A created Apple registration description.
41
47
  */
42
48
  function createAppleRegistrationDescription(description) {
43
- return Object.assign(Object.assign({}, description), { kind: "Apple" });
49
+ return {
50
+ ...description,
51
+ kind: "Apple",
52
+ };
44
53
  }
45
54
  /**
46
55
  * Creates an Apple template registration description.
@@ -48,7 +57,10 @@ function createAppleRegistrationDescription(description) {
48
57
  * @returns A created Apple template registration description.
49
58
  */
50
59
  function createAppleTemplateRegistrationDescription(description) {
51
- return Object.assign(Object.assign({}, description), { kind: "AppleTemplate" });
60
+ return {
61
+ ...description,
62
+ kind: "AppleTemplate",
63
+ };
52
64
  }
53
65
  /**
54
66
  * Creates a Baidu registration description.
@@ -56,7 +68,10 @@ function createAppleTemplateRegistrationDescription(description) {
56
68
  * @returns A created Baidu registration description.
57
69
  */
58
70
  function createBaiduRegistrationDescription(description) {
59
- return Object.assign(Object.assign({}, description), { kind: "Baidu" });
71
+ return {
72
+ ...description,
73
+ kind: "Baidu",
74
+ };
60
75
  }
61
76
  /**
62
77
  * Creates a Baidu template registration description.
@@ -64,7 +79,10 @@ function createBaiduRegistrationDescription(description) {
64
79
  * @returns A created Baidu template registration description.
65
80
  */
66
81
  function createBaiduTemplateRegistrationDescription(description) {
67
- return Object.assign(Object.assign({}, description), { kind: "BaiduTemplate" });
82
+ return {
83
+ ...description,
84
+ kind: "BaiduTemplate",
85
+ };
68
86
  }
69
87
  /**
70
88
  * Creates a Web Push registration description.
@@ -72,7 +90,10 @@ function createBaiduTemplateRegistrationDescription(description) {
72
90
  * @returns A created Web Push registration description.
73
91
  */
74
92
  function createBrowserRegistrationDescription(description) {
75
- return Object.assign(Object.assign({}, description), { kind: "Browser" });
93
+ return {
94
+ ...description,
95
+ kind: "Browser",
96
+ };
76
97
  }
77
98
  /**
78
99
  * Creates a Web Push registration description.
@@ -80,7 +101,10 @@ function createBrowserRegistrationDescription(description) {
80
101
  * @returns A created Web Push template registration description.
81
102
  */
82
103
  function createBrowserTemplateRegistrationDescription(description) {
83
- return Object.assign(Object.assign({}, description), { kind: "BrowserTemplate" });
104
+ return {
105
+ ...description,
106
+ kind: "BrowserTemplate",
107
+ };
84
108
  }
85
109
  /**
86
110
  * Creates a Firebase Legacy registration description.
@@ -88,7 +112,10 @@ function createBrowserTemplateRegistrationDescription(description) {
88
112
  * @returns A created GCM registration description.
89
113
  */
90
114
  function createFcmLegacyRegistrationDescription(description) {
91
- return Object.assign(Object.assign({}, description), { kind: "Gcm" });
115
+ return {
116
+ ...description,
117
+ kind: "Gcm",
118
+ };
92
119
  }
93
120
  /**
94
121
  * Creates a GCM template registration description.
@@ -96,7 +123,10 @@ function createFcmLegacyRegistrationDescription(description) {
96
123
  * @returns A created GCM template registration description.
97
124
  */
98
125
  function createFcmLegacyTemplateRegistrationDescription(description) {
99
- return Object.assign(Object.assign({}, description), { kind: "GcmTemplate" });
126
+ return {
127
+ ...description,
128
+ kind: "GcmTemplate",
129
+ };
100
130
  }
101
131
  /**
102
132
  * Creates a Firebase V1 registration description.
@@ -104,7 +134,10 @@ function createFcmLegacyTemplateRegistrationDescription(description) {
104
134
  * @returns A created FCM V1 registration description.
105
135
  */
106
136
  function createFcmV1RegistrationDescription(description) {
107
- return Object.assign(Object.assign({}, description), { kind: "FcmV1" });
137
+ return {
138
+ ...description,
139
+ kind: "FcmV1",
140
+ };
108
141
  }
109
142
  /**
110
143
  * Creates a FCM V1 template registration description.
@@ -112,7 +145,10 @@ function createFcmV1RegistrationDescription(description) {
112
145
  * @returns A created FCM V1 template registration description.
113
146
  */
114
147
  function createFcmV1TemplateRegistrationDescription(description) {
115
- return Object.assign(Object.assign({}, description), { kind: "FcmV1Template" });
148
+ return {
149
+ ...description,
150
+ kind: "FcmV1Template",
151
+ };
116
152
  }
117
153
  /**
118
154
  * Creates a Windows registration description.
@@ -120,7 +156,10 @@ function createFcmV1TemplateRegistrationDescription(description) {
120
156
  * @returns A created Windows registration description.
121
157
  */
122
158
  function createWindowsRegistrationDescription(description) {
123
- return Object.assign(Object.assign({}, description), { kind: "Windows" });
159
+ return {
160
+ ...description,
161
+ kind: "Windows",
162
+ };
124
163
  }
125
164
  /**
126
165
  * Creates a Windows template registration description.
@@ -128,7 +167,10 @@ function createWindowsRegistrationDescription(description) {
128
167
  * @returns A created Windows template registration description.
129
168
  */
130
169
  function createWindowsTemplateRegistrationDescription(description) {
131
- return Object.assign(Object.assign({}, description), { kind: "WindowsTemplate" });
170
+ return {
171
+ ...description,
172
+ kind: "WindowsTemplate",
173
+ };
132
174
  }
133
175
  /**
134
176
  * Creates a Xiaomi registration description.
@@ -136,7 +178,10 @@ function createWindowsTemplateRegistrationDescription(description) {
136
178
  * @returns A created Xiaomi registration description.
137
179
  */
138
180
  function createXiaomiRegistrationDescription(description) {
139
- return Object.assign(Object.assign({}, description), { kind: "Xiaomi" });
181
+ return {
182
+ ...description,
183
+ kind: "Xiaomi",
184
+ };
140
185
  }
141
186
  /**
142
187
  * Creates a Xiaomi template registration description.
@@ -144,6 +189,9 @@ function createXiaomiRegistrationDescription(description) {
144
189
  * @returns A created Xiaomi template registration description.
145
190
  */
146
191
  function createXiaomiTemplateRegistrationDescription(description) {
147
- return Object.assign(Object.assign({}, description), { kind: "XiaomiTemplate" });
192
+ return {
193
+ ...description,
194
+ kind: "XiaomiTemplate",
195
+ };
148
196
  }
149
197
  //# sourceMappingURL=registration.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"registration.js","sourceRoot":"","sources":["../../../src/models/registration.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA+FlC,4EAOC;AAyBD,4FAOC;AA2BD,gFAOC;AAwCD,gGAOC;AA6BD,gFAOC;AAyBD,gGA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Aa,IACnB;AACJ,CAAC;AAsBD;;;;GAIG;AACH,SAAgB,kCAAkC,CAChD,WAA+C;IAE/C,uCACK,WAAW,KACd,IAAI,EAAE,OAAO,IACb;AACJ,CAAC;AAoBD;;;;GAIG;AACH,SAAgB,0CAA0C,CACxD,WAAuD;IAEvD,uCACK,WAAW,KACd,IAAI,EAAE,eAAe,IACrB;AACJ,CAAC;AAuFD;;;;GAIG;AACH,SAAgB,oCAAoC,CAClD,WAAiD;IAEjD,uCACK,WAAW,KACd,IAAI,EAAE,SAAS,IACf;AACJ,CAAC;AAyBD;;;;GAIG;AACH,SAAgB,4CAA4C,CAC1D,WAAyD;IAEzD,uCACK,WAAW,KACd,IAAI,EAAE,iBAAiB,IACvB;AACJ,CAAC;AAsBD;;;;GAIG;AACH,SAAgB,mCAAmC,CACjD,WAAgD;IAEhD,uCACK,WAAW,KACd,IAAI,EAAE,QAAQ,IACd;AACJ,CAAC;AAoBD;;;;GAIG;AACH,SAAgB,2CAA2C,CACzD,WAAwD;IAExD,uCACK,WAAW,KACd,IAAI,EAAE,gBAAgB,IACtB;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Represents the types of registration descriptions.\n */\nexport type RegistrationType =\n | \"Adm\"\n | \"AdmTemplate\"\n | \"Apple\"\n | \"AppleTemplate\"\n | \"Baidu\"\n | \"BaiduTemplate\"\n | \"Browser\"\n | \"BrowserTemplate\"\n | \"Gcm\"\n | \"GcmTemplate\"\n | \"FcmV1\"\n | \"FcmV1Template\"\n | \"Mpns\"\n | \"MpnsTemplate\"\n | \"Xiaomi\"\n | \"XiaomiTemplate\"\n | \"Windows\"\n | \"WindowsTemplate\";\n\n/**\n * Represents a registration description.\n */\nexport interface RegistrationDescriptionCommon {\n /**\n * The registration ID.\n */\n registrationId?: string;\n\n /**\n * The expiration time of the registration.\n */\n expirationTime?: Date;\n\n /**\n * The ETag associated with this description.\n */\n etag?: string;\n\n /**\n * The tags associated with the registration.\n */\n tags?: string[];\n\n /**\n * A dictionary of push variables associated with property bag.\n */\n pushVariables?: Record<string, string>;\n}\n\n/**\n * Represents the description of a template registration.\n */\nexport interface TemplateRegistrationDescription {\n /**\n * The body template.\n */\n bodyTemplate: string;\n\n /**\n * The name of the template.\n */\n templateName?: string;\n\n /**\n * Represents the description of the Amazon Device Messaging (ADM) registration.\n */\n}\nexport interface AdmRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * The Amazon Device Messaging registration identifier.\n */\n admRegistrationId: string;\n}\n\n/**\n * Represents the description of the Amazon Device Messaging (ADM) registration.\n */\nexport interface AdmRegistrationDescription extends AdmRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Adm\";\n}\n\n/**\n * Creates an ADM registration description.\n * @param description - A partial ADM registration description.\n * @returns A created ADM registration description.\n */\nexport function createAdmRegistrationDescription(\n description: AdmRegistrationDescriptionCommon,\n): AdmRegistrationDescription {\n return {\n ...description,\n kind: \"Adm\",\n };\n}\n\n/**\n * Represents the description of the Amazon Device Messaging (ADM) template registration.\n */\nexport interface AdmTemplateRegistrationDescriptionCommon\n extends AdmRegistrationDescriptionCommon,\n TemplateRegistrationDescription {}\n\n/**\n * Represents the description of the Amazon Device Messaging (ADM) template registration.\n */\nexport interface AdmTemplateRegistrationDescription\n extends AdmTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"AdmTemplate\";\n}\n\n/**\n * Creates an ADM template registration description.\n * @param description - A partial ADM template registration description.\n * @returns A created ADM template registration description.\n */\nexport function createAdmTemplateRegistrationDescription(\n description: AdmTemplateRegistrationDescriptionCommon,\n): AdmTemplateRegistrationDescription {\n return {\n ...description,\n kind: \"AdmTemplate\",\n };\n}\n\n/**\n * Represents the description of apple registration.\n */\nexport interface AppleRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * The APNs device token.\n */\n deviceToken: string;\n}\n\n/**\n * Represents the description of apple registration.\n */\nexport interface AppleRegistrationDescription extends AppleRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Apple\";\n}\n\n/**\n * Creates an Apple registration description.\n * @param description - A partial Apple registration description.\n * @returns A created Apple registration description.\n */\nexport function createAppleRegistrationDescription(\n description: AppleRegistrationDescriptionCommon,\n): AppleRegistrationDescription {\n return {\n ...description,\n kind: \"Apple\",\n };\n}\n\n/**\n * Represents the description of the Apple template registration.\n */\nexport interface AppleTemplateRegistrationDescriptionCommon\n extends AppleRegistrationDescriptionCommon,\n TemplateRegistrationDescription {\n /**\n * The expiry date.\n */\n expiry?: Date;\n\n /**\n * The notification priority.\n */\n priority?: \"10\" | \"5\";\n\n /**\n * The APNS headers.\n */\n apnsHeaders?: Record<string, string>;\n}\n\n/**\n * Represents the description of the Apple template registration.\n */\nexport interface AppleTemplateRegistrationDescription\n extends AppleTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"AppleTemplate\";\n}\n\n/**\n * Creates an Apple template registration description.\n * @param description - A partial Apple template registration description.\n * @returns A created Apple template registration description.\n */\nexport function createAppleTemplateRegistrationDescription(\n description: AppleTemplateRegistrationDescriptionCommon,\n): AppleTemplateRegistrationDescription {\n return {\n ...description,\n kind: \"AppleTemplate\",\n };\n}\n\nexport interface BaiduRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * The Baidu user identifier.\n */\n baiduUserId: string;\n\n /**\n * The Baidu channel identifier.\n */\n baiduChannelId: string;\n}\n\n/**\n * Represents a Baidu registration description.\n */\nexport interface BaiduRegistrationDescription extends BaiduRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Baidu\";\n}\n\n/**\n * Creates a Baidu registration description.\n * @param description - A partial Baidu registration description.\n * @returns A created Baidu registration description.\n */\nexport function createBaiduRegistrationDescription(\n description: BaiduRegistrationDescriptionCommon,\n): BaiduRegistrationDescription {\n return {\n ...description,\n kind: \"Baidu\",\n };\n}\n\n/**\n * Represents a Baidu template registration description.\n */\nexport interface BaiduTemplateRegistrationDescriptionCommon\n extends BaiduRegistrationDescriptionCommon,\n TemplateRegistrationDescription {}\n\n/**\n * Represents a Baidu template registration description.\n */\nexport interface BaiduTemplateRegistrationDescription\n extends BaiduTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"BaiduTemplate\";\n}\n\n/**\n * Creates a Baidu template registration description.\n * @param description - A partial Baidu template registration description.\n * @returns A created Baidu template registration description.\n */\nexport function createBaiduTemplateRegistrationDescription(\n description: BaiduTemplateRegistrationDescriptionCommon,\n): BaiduTemplateRegistrationDescription {\n return {\n ...description,\n kind: \"BaiduTemplate\",\n };\n}\n\n/**\n * Represents a Browser Push registration description.\n */\nexport interface BrowserRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * The Browser push endpoint.\n */\n endpoint: string;\n\n /**\n * The Browser push P256DH.\n */\n p256dh: string;\n\n /**\n * The Browser push auth secret.\n */\n auth: string;\n}\n\n/**\n * Represents a Browser Push registration description.\n */\nexport interface BrowserRegistrationDescription extends BrowserRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Browser\";\n}\n\n/**\n * Creates a Web Push registration description.\n * @param description - A partial Web Push registration description.\n * @returns A created Web Push registration description.\n */\nexport function createBrowserRegistrationDescription(\n description: BrowserRegistrationDescriptionCommon,\n): BrowserRegistrationDescription {\n return {\n ...description,\n kind: \"Browser\",\n };\n}\n\n/**\n * Represents a Browser Push remplate registration description.\n */\nexport interface BrowserTemplateRegistrationDescriptionCommon\n extends BrowserRegistrationDescriptionCommon,\n TemplateRegistrationDescription {}\n\n/**\n * Represents a Browser Push remplate registration description.\n */\nexport interface BrowserTemplateRegistrationDescription\n extends BrowserTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"BrowserTemplate\";\n}\n\n/**\n * Creates a Web Push registration description.\n * @param description - A partial Web Push template registration description.\n * @returns A created Web Push template registration description.\n */\nexport function createBrowserTemplateRegistrationDescription(\n description: BrowserTemplateRegistrationDescriptionCommon,\n): BrowserTemplateRegistrationDescription {\n return {\n ...description,\n kind: \"BrowserTemplate\",\n };\n}\n\n/**\n * Represents Notification Hub registration description for Google Cloud Messaging.\n */\nexport interface GcmRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * Registration id obtained from the Google Cloud Messaging service.\n */\n gcmRegistrationId: string;\n}\n\n/**\n * Represents Notification Hub registration description for Google Cloud Messaging.\n */\nexport interface GcmRegistrationDescription extends GcmRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Gcm\";\n}\n\n/**\n * Creates a Firebase Legacy registration description.\n * @param description - A partial GCM registration description.\n * @returns A created GCM registration description.\n */\nexport function createFcmLegacyRegistrationDescription(\n description: GcmRegistrationDescriptionCommon,\n): GcmRegistrationDescription {\n return {\n ...description,\n kind: \"Gcm\",\n };\n}\n\n/**\n * Represents Notification Hub template registration description for Firebase Legacy Cloud Messaging.\n */\nexport interface GcmTemplateRegistrationDescriptionCommon\n extends GcmRegistrationDescriptionCommon,\n TemplateRegistrationDescription {}\n\n/**\n * Represents Notification Hub template registration description for Firebase Legacy Cloud Messaging.\n */\nexport interface GcmTemplateRegistrationDescription\n extends GcmTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"GcmTemplate\";\n}\n\n/**\n * Creates a GCM template registration description.\n * @param description - A partial GCM template registration description.\n * @returns A created GCM template registration description.\n */\nexport function createFcmLegacyTemplateRegistrationDescription(\n description: GcmTemplateRegistrationDescriptionCommon,\n): GcmTemplateRegistrationDescription {\n return {\n ...description,\n kind: \"GcmTemplate\",\n };\n}\n\n/**\n * Represents Notification Hub registration description for Google Cloud Messaging.\n */\nexport interface FcmV1RegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * Registration id obtained from the Firebase Cloud Messaging service.\n */\n fcmV1RegistrationId: string;\n}\n\n/**\n * Represents Notification Hub registration description for Google Cloud Messaging.\n */\nexport interface FcmV1RegistrationDescription extends FcmV1RegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"FcmV1\";\n}\n\n/**\n * Creates a Firebase V1 registration description.\n * @param description - A partial FCM V1 registration description.\n * @returns A created FCM V1 registration description.\n */\nexport function createFcmV1RegistrationDescription(\n description: FcmV1RegistrationDescriptionCommon,\n): FcmV1RegistrationDescription {\n return {\n ...description,\n kind: \"FcmV1\",\n };\n}\n\n/**\n * Represents Notification Hub template registration description for Firebase V1 Cloud Messaging.\n */\nexport interface FcmV1TemplateRegistrationDescriptionCommon\n extends FcmV1RegistrationDescriptionCommon,\n TemplateRegistrationDescription {}\n\n/**\n * Represents Notification Hub template registration description for Firebase V1 Cloud Messaging.\n */\nexport interface FcmV1TemplateRegistrationDescription\n extends FcmV1TemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"FcmV1Template\";\n}\n\n/**\n * Creates a FCM V1 template registration description.\n * @param description - A partial FCM V1 template registration description.\n * @returns A created FCM V1 template registration description.\n */\nexport function createFcmV1TemplateRegistrationDescription(\n description: FcmV1TemplateRegistrationDescriptionCommon,\n): FcmV1TemplateRegistrationDescription {\n return {\n ...description,\n kind: \"FcmV1Template\",\n };\n}\n\n/**\n * Represents a Windows Phone Notification Services registration description.\n * @deprecated Windows Phone is no longer supported.\n */\nexport interface MpnsRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * The channel URI.\n */\n channelUri: string;\n}\n\n/**\n * Represents a Windows Phone Notification Services registration description.\n * @deprecated Windows Phone is no longer supported.\n */\nexport interface MpnsRegistrationDescription extends MpnsRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Mpns\";\n}\n\n/**\n * Represents a Windows Phone Notification Services template registration.\n * @deprecated Windows Phone is no longer supported.\n */\nexport interface MpnsTemplateRegistrationDescription\n extends MpnsRegistrationDescriptionCommon,\n TemplateRegistrationDescription {\n /**\n * The WNS headers.\n */\n mpnsHeaders?: Record<string, string>;\n\n /**\n * The kind of the registration.\n */\n kind: \"MpnsTemplate\";\n}\n\n/**\n * Represents a Windows Phone Notification Services template registration.\n * @deprecated Windows Phone is no longer supported.\n */\nexport interface MpnsTemplateRegistrationDescriptionCommon\n extends MpnsRegistrationDescriptionCommon,\n TemplateRegistrationDescription {\n /**\n * The WNS headers.\n */\n mpnsHeaders?: Record<string, string>;\n}\n\n/**\n * Represents a Windows Phone Notification Services template registration.\n * @deprecated Windows Phone is no longer supported.\n */\nexport interface MpnsTemplateRegistrationDescription\n extends MpnsTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"MpnsTemplate\";\n}\n\n/**\n * Represents a Windows Notification Services (WNS) registration description.\n */\nexport interface WindowsRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * The channel URI.\n */\n channelUri: string;\n}\n\n/**\n * Represents a Windows Notification Services (WNS) registration description.\n */\nexport interface WindowsRegistrationDescription extends WindowsRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Windows\";\n}\n\n/**\n * Creates a Windows registration description.\n * @param description - A partial Windows registration description.\n * @returns A created Windows registration description.\n */\nexport function createWindowsRegistrationDescription(\n description: WindowsRegistrationDescriptionCommon,\n): WindowsRegistrationDescription {\n return {\n ...description,\n kind: \"Windows\",\n };\n}\n\n/**\n * Represents a Windows Notification Services (WNS) template registration.\n */\nexport interface WindowsTemplateRegistrationDescriptionCommon\n extends WindowsRegistrationDescriptionCommon,\n TemplateRegistrationDescription {\n /**\n * The WNS headers.\n */\n wnsHeaders?: Record<string, string>;\n}\n\n/**\n * Represents a Windows Notification Services (WNS) template registration.\n */\nexport interface WindowsTemplateRegistrationDescription\n extends WindowsTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"WindowsTemplate\";\n}\n\n/**\n * Creates a Windows template registration description.\n * @param description - A partial Windows template registration description.\n * @returns A created Windows template registration description.\n */\nexport function createWindowsTemplateRegistrationDescription(\n description: WindowsTemplateRegistrationDescriptionCommon,\n): WindowsTemplateRegistrationDescription {\n return {\n ...description,\n kind: \"WindowsTemplate\",\n };\n}\n\n/**\n * Represents a Xiaomi registration description.\n */\nexport interface XiaomiRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * The Xiaomi registration ID.\n */\n xiaomiRegistrationId: string;\n}\n\n/**\n * Represents a Xiaomi registration description.\n */\nexport interface XiaomiRegistrationDescription extends XiaomiRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Xiaomi\";\n}\n\n/**\n * Creates a Xiaomi registration description.\n * @param description - A partial Xiaomi registration description.\n * @returns A created Xiaomi registration description.\n */\nexport function createXiaomiRegistrationDescription(\n description: XiaomiRegistrationDescriptionCommon,\n): XiaomiRegistrationDescription {\n return {\n ...description,\n kind: \"Xiaomi\",\n };\n}\n\n/**\n * Represents a Xiaomi template registration.\n */\nexport interface XiaomiTemplateRegistrationDescriptionCommon\n extends XiaomiRegistrationDescriptionCommon,\n TemplateRegistrationDescription {}\n\n/**\n * Represents a Windows Notification Services (WNS) template registration.\n */\nexport interface XiaomiTemplateRegistrationDescription\n extends XiaomiTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"XiaomiTemplate\";\n}\n\n/**\n * Creates a Xiaomi template registration description.\n * @param description - A partial Xiaomi template registration description.\n * @returns A created Xiaomi template registration description.\n */\nexport function createXiaomiTemplateRegistrationDescription(\n description: XiaomiTemplateRegistrationDescriptionCommon,\n): XiaomiTemplateRegistrationDescription {\n return {\n ...description,\n kind: \"XiaomiTemplate\",\n };\n}\n\n/**\n * Describes the types of registration descriptions.\n */\nexport type RegistrationDescription =\n | AdmRegistrationDescription\n | AdmTemplateRegistrationDescription\n | AppleRegistrationDescription\n | AppleTemplateRegistrationDescription\n | BaiduRegistrationDescription\n | BaiduTemplateRegistrationDescription\n | BrowserRegistrationDescription\n | BrowserTemplateRegistrationDescription\n | GcmRegistrationDescription\n | GcmTemplateRegistrationDescription\n | FcmV1RegistrationDescription\n | FcmV1TemplateRegistrationDescription\n | MpnsRegistrationDescription\n | MpnsTemplateRegistrationDescription\n | XiaomiRegistrationDescription\n | XiaomiTemplateRegistrationDescription\n | WindowsRegistrationDescription\n | WindowsTemplateRegistrationDescription;\n\n/**\n * Describes an ADM Registration channel query.\n */\nexport interface AdmRegistrationChannel {\n /**\n * The ADM Registration ID.\n */\n admRegistrationId: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"adm\";\n}\n\n/**\n * Describes an Apple Registration channel query.\n */\nexport interface AppleRegistrationChannel {\n /**\n * The APNs device token.\n */\n deviceToken: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"apple\";\n}\n\n/**\n * Describes an Baidu Registration channel query.\n */\nexport interface BaiduRegistrationChannel {\n /**\n * The Baidu Channel ID.\n */\n baiduChannelId: string;\n /**\n * The Baidu User ID.\n */\n baiduUserId: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"baidu\";\n}\n\n/**\n * Describes an Browser Registration channel query.\n */\nexport interface BrowserRegistrationChannel {\n /**\n * The Web Push endpoint URL.\n */\n endpoint: string;\n /**\n * The Web Push subscription P256DH.\n */\n p256dh: string;\n /**\n * The Web Push subscription auth secret.\n */\n auth: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"browser\";\n}\n\n/**\n * Describes an Firebase Legacy Registration channel query.\n */\nexport interface FirebaseLegacyRegistrationChannel {\n /**\n * The FCM Legacy registration ID.\n */\n gcmRegistrationId: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"gcm\";\n}\n\n/**\n * Describes an Firebase Legacy Registration channel query.\n */\nexport interface FirebaseV1RegistrationChannel {\n /**\n * The FCM V1 registration ID.\n */\n fcmV1RegistrationId: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"fcmv1\";\n}\n\n/**\n * Describes an Windows Notification Services Registration channel query.\n */\nexport interface WindowsRegistrationChannel {\n /**\n * The WNS Channel URI.\n */\n channelUri: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"windows\";\n}\n\n/**\n * Describes an Xiaomi Registration channel query.\n */\nexport interface XiaomiRegistrationChannel {\n /**\n * The Xiaomi registration ID.\n */\n xiaomiRegistrationId: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"xiaomi\";\n}\n\n/**\n * Describes a Registration query.\n */\nexport type RegistrationChannel =\n | AdmRegistrationChannel\n | AppleRegistrationChannel\n | BaiduRegistrationChannel\n | BrowserRegistrationChannel\n | FirebaseLegacyRegistrationChannel\n | FirebaseV1RegistrationChannel\n | XiaomiRegistrationChannel\n | WindowsRegistrationChannel;\n"]}
1
+ {"version":3,"file":"registration.js","sourceRoot":"","sources":["../../../src/models/registration.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA+FlC,4EAOC;AAyBD,4FAOC;AA2BD,gFAOC;AAwCD,gGAOC;AA6BD,gFAOC;AAyBD,gGAOC;AAqCD,oFAOC;AAyBD,oGAOC;AA2BD,wFAOC;AAyBD,wGAOC;AA2BD,gFAOC;AAyBD,gGAOC;AA4FD,oFAOC;AA8BD,oGAOC;AA2BD,kFAOC;AAyBD,kGAOC;AA3lBD;;;;GAIG;AACH,SAAgB,gCAAgC,CAC9C,WAA6C;IAE7C,OAAO;QACL,GAAG,WAAW;QACd,IAAI,EAAE,KAAK;KACZ,CAAC;AACJ,CAAC;AAoBD;;;;GAIG;AACH,SAAgB,wCAAwC,CACtD,WAAqD;IAErD,OAAO;QACL,GAAG,WAAW;QACd,IAAI,EAAE,aAAa;KACpB,CAAC;AACJ,CAAC;AAsBD;;;;GAIG;AACH,SAAgB,kCAAkC,CAChD,WAA+C;IAE/C,OAAO;QACL,GAAG,WAAW;QACd,IAAI,EAAE,OAAO;KACd,CAAC;AACJ,CAAC;AAmCD;;;;GAIG;AACH,SAAgB,0CAA0C,CACxD,WAAuD;IAEvD,OAAO;QACL,GAAG,WAAW;QACd,IAAI,EAAE,eAAe;KACtB,CAAC;AACJ,CAAC;AAwBD;;;;GAIG;AACH,SAAg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xB,CAAC;AACJ,CAAC;AAsBD;;;;GAIG;AACH,SAAgB,mCAAmC,CACjD,WAAgD;IAEhD,OAAO;QACL,GAAG,WAAW;QACd,IAAI,EAAE,QAAQ;KACf,CAAC;AACJ,CAAC;AAoBD;;;;GAIG;AACH,SAAgB,2CAA2C,CACzD,WAAwD;IAExD,OAAO;QACL,GAAG,WAAW;QACd,IAAI,EAAE,gBAAgB;KACvB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Represents the types of registration descriptions.\n */\nexport type RegistrationType =\n | \"Adm\"\n | \"AdmTemplate\"\n | \"Apple\"\n | \"AppleTemplate\"\n | \"Baidu\"\n | \"BaiduTemplate\"\n | \"Browser\"\n | \"BrowserTemplate\"\n | \"Gcm\"\n | \"GcmTemplate\"\n | \"FcmV1\"\n | \"FcmV1Template\"\n | \"Mpns\"\n | \"MpnsTemplate\"\n | \"Xiaomi\"\n | \"XiaomiTemplate\"\n | \"Windows\"\n | \"WindowsTemplate\";\n\n/**\n * Represents a registration description.\n */\nexport interface RegistrationDescriptionCommon {\n /**\n * The registration ID.\n */\n registrationId?: string;\n\n /**\n * The expiration time of the registration.\n */\n expirationTime?: Date;\n\n /**\n * The ETag associated with this description.\n */\n etag?: string;\n\n /**\n * The tags associated with the registration.\n */\n tags?: string[];\n\n /**\n * A dictionary of push variables associated with property bag.\n */\n pushVariables?: Record<string, string>;\n}\n\n/**\n * Represents the description of a template registration.\n */\nexport interface TemplateRegistrationDescription {\n /**\n * The body template.\n */\n bodyTemplate: string;\n\n /**\n * The name of the template.\n */\n templateName?: string;\n\n /**\n * Represents the description of the Amazon Device Messaging (ADM) registration.\n */\n}\nexport interface AdmRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * The Amazon Device Messaging registration identifier.\n */\n admRegistrationId: string;\n}\n\n/**\n * Represents the description of the Amazon Device Messaging (ADM) registration.\n */\nexport interface AdmRegistrationDescription extends AdmRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Adm\";\n}\n\n/**\n * Creates an ADM registration description.\n * @param description - A partial ADM registration description.\n * @returns A created ADM registration description.\n */\nexport function createAdmRegistrationDescription(\n description: AdmRegistrationDescriptionCommon,\n): AdmRegistrationDescription {\n return {\n ...description,\n kind: \"Adm\",\n };\n}\n\n/**\n * Represents the description of the Amazon Device Messaging (ADM) template registration.\n */\nexport interface AdmTemplateRegistrationDescriptionCommon\n extends AdmRegistrationDescriptionCommon,\n TemplateRegistrationDescription {}\n\n/**\n * Represents the description of the Amazon Device Messaging (ADM) template registration.\n */\nexport interface AdmTemplateRegistrationDescription\n extends AdmTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"AdmTemplate\";\n}\n\n/**\n * Creates an ADM template registration description.\n * @param description - A partial ADM template registration description.\n * @returns A created ADM template registration description.\n */\nexport function createAdmTemplateRegistrationDescription(\n description: AdmTemplateRegistrationDescriptionCommon,\n): AdmTemplateRegistrationDescription {\n return {\n ...description,\n kind: \"AdmTemplate\",\n };\n}\n\n/**\n * Represents the description of apple registration.\n */\nexport interface AppleRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * The APNs device token.\n */\n deviceToken: string;\n}\n\n/**\n * Represents the description of apple registration.\n */\nexport interface AppleRegistrationDescription extends AppleRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Apple\";\n}\n\n/**\n * Creates an Apple registration description.\n * @param description - A partial Apple registration description.\n * @returns A created Apple registration description.\n */\nexport function createAppleRegistrationDescription(\n description: AppleRegistrationDescriptionCommon,\n): AppleRegistrationDescription {\n return {\n ...description,\n kind: \"Apple\",\n };\n}\n\n/**\n * Represents the description of the Apple template registration.\n */\nexport interface AppleTemplateRegistrationDescriptionCommon\n extends AppleRegistrationDescriptionCommon,\n TemplateRegistrationDescription {\n /**\n * The expiry date.\n */\n expiry?: Date;\n\n /**\n * The notification priority.\n */\n priority?: \"10\" | \"5\";\n\n /**\n * The APNS headers.\n */\n apnsHeaders?: Record<string, string>;\n}\n\n/**\n * Represents the description of the Apple template registration.\n */\nexport interface AppleTemplateRegistrationDescription\n extends AppleTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"AppleTemplate\";\n}\n\n/**\n * Creates an Apple template registration description.\n * @param description - A partial Apple template registration description.\n * @returns A created Apple template registration description.\n */\nexport function createAppleTemplateRegistrationDescription(\n description: AppleTemplateRegistrationDescriptionCommon,\n): AppleTemplateRegistrationDescription {\n return {\n ...description,\n kind: \"AppleTemplate\",\n };\n}\n\nexport interface BaiduRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * The Baidu user identifier.\n */\n baiduUserId: string;\n\n /**\n * The Baidu channel identifier.\n */\n baiduChannelId: string;\n}\n\n/**\n * Represents a Baidu registration description.\n */\nexport interface BaiduRegistrationDescription extends BaiduRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Baidu\";\n}\n\n/**\n * Creates a Baidu registration description.\n * @param description - A partial Baidu registration description.\n * @returns A created Baidu registration description.\n */\nexport function createBaiduRegistrationDescription(\n description: BaiduRegistrationDescriptionCommon,\n): BaiduRegistrationDescription {\n return {\n ...description,\n kind: \"Baidu\",\n };\n}\n\n/**\n * Represents a Baidu template registration description.\n */\nexport interface BaiduTemplateRegistrationDescriptionCommon\n extends BaiduRegistrationDescriptionCommon,\n TemplateRegistrationDescription {}\n\n/**\n * Represents a Baidu template registration description.\n */\nexport interface BaiduTemplateRegistrationDescription\n extends BaiduTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"BaiduTemplate\";\n}\n\n/**\n * Creates a Baidu template registration description.\n * @param description - A partial Baidu template registration description.\n * @returns A created Baidu template registration description.\n */\nexport function createBaiduTemplateRegistrationDescription(\n description: BaiduTemplateRegistrationDescriptionCommon,\n): BaiduTemplateRegistrationDescription {\n return {\n ...description,\n kind: \"BaiduTemplate\",\n };\n}\n\n/**\n * Represents a Browser Push registration description.\n */\nexport interface BrowserRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * The Browser push endpoint.\n */\n endpoint: string;\n\n /**\n * The Browser push P256DH.\n */\n p256dh: string;\n\n /**\n * The Browser push auth secret.\n */\n auth: string;\n}\n\n/**\n * Represents a Browser Push registration description.\n */\nexport interface BrowserRegistrationDescription extends BrowserRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Browser\";\n}\n\n/**\n * Creates a Web Push registration description.\n * @param description - A partial Web Push registration description.\n * @returns A created Web Push registration description.\n */\nexport function createBrowserRegistrationDescription(\n description: BrowserRegistrationDescriptionCommon,\n): BrowserRegistrationDescription {\n return {\n ...description,\n kind: \"Browser\",\n };\n}\n\n/**\n * Represents a Browser Push remplate registration description.\n */\nexport interface BrowserTemplateRegistrationDescriptionCommon\n extends BrowserRegistrationDescriptionCommon,\n TemplateRegistrationDescription {}\n\n/**\n * Represents a Browser Push remplate registration description.\n */\nexport interface BrowserTemplateRegistrationDescription\n extends BrowserTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"BrowserTemplate\";\n}\n\n/**\n * Creates a Web Push registration description.\n * @param description - A partial Web Push template registration description.\n * @returns A created Web Push template registration description.\n */\nexport function createBrowserTemplateRegistrationDescription(\n description: BrowserTemplateRegistrationDescriptionCommon,\n): BrowserTemplateRegistrationDescription {\n return {\n ...description,\n kind: \"BrowserTemplate\",\n };\n}\n\n/**\n * Represents Notification Hub registration description for Google Cloud Messaging.\n */\nexport interface GcmRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * Registration id obtained from the Google Cloud Messaging service.\n */\n gcmRegistrationId: string;\n}\n\n/**\n * Represents Notification Hub registration description for Google Cloud Messaging.\n */\nexport interface GcmRegistrationDescription extends GcmRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Gcm\";\n}\n\n/**\n * Creates a Firebase Legacy registration description.\n * @param description - A partial GCM registration description.\n * @returns A created GCM registration description.\n */\nexport function createFcmLegacyRegistrationDescription(\n description: GcmRegistrationDescriptionCommon,\n): GcmRegistrationDescription {\n return {\n ...description,\n kind: \"Gcm\",\n };\n}\n\n/**\n * Represents Notification Hub template registration description for Firebase Legacy Cloud Messaging.\n */\nexport interface GcmTemplateRegistrationDescriptionCommon\n extends GcmRegistrationDescriptionCommon,\n TemplateRegistrationDescription {}\n\n/**\n * Represents Notification Hub template registration description for Firebase Legacy Cloud Messaging.\n */\nexport interface GcmTemplateRegistrationDescription\n extends GcmTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"GcmTemplate\";\n}\n\n/**\n * Creates a GCM template registration description.\n * @param description - A partial GCM template registration description.\n * @returns A created GCM template registration description.\n */\nexport function createFcmLegacyTemplateRegistrationDescription(\n description: GcmTemplateRegistrationDescriptionCommon,\n): GcmTemplateRegistrationDescription {\n return {\n ...description,\n kind: \"GcmTemplate\",\n };\n}\n\n/**\n * Represents Notification Hub registration description for Google Cloud Messaging.\n */\nexport interface FcmV1RegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * Registration id obtained from the Firebase Cloud Messaging service.\n */\n fcmV1RegistrationId: string;\n}\n\n/**\n * Represents Notification Hub registration description for Google Cloud Messaging.\n */\nexport interface FcmV1RegistrationDescription extends FcmV1RegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"FcmV1\";\n}\n\n/**\n * Creates a Firebase V1 registration description.\n * @param description - A partial FCM V1 registration description.\n * @returns A created FCM V1 registration description.\n */\nexport function createFcmV1RegistrationDescription(\n description: FcmV1RegistrationDescriptionCommon,\n): FcmV1RegistrationDescription {\n return {\n ...description,\n kind: \"FcmV1\",\n };\n}\n\n/**\n * Represents Notification Hub template registration description for Firebase V1 Cloud Messaging.\n */\nexport interface FcmV1TemplateRegistrationDescriptionCommon\n extends FcmV1RegistrationDescriptionCommon,\n TemplateRegistrationDescription {}\n\n/**\n * Represents Notification Hub template registration description for Firebase V1 Cloud Messaging.\n */\nexport interface FcmV1TemplateRegistrationDescription\n extends FcmV1TemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"FcmV1Template\";\n}\n\n/**\n * Creates a FCM V1 template registration description.\n * @param description - A partial FCM V1 template registration description.\n * @returns A created FCM V1 template registration description.\n */\nexport function createFcmV1TemplateRegistrationDescription(\n description: FcmV1TemplateRegistrationDescriptionCommon,\n): FcmV1TemplateRegistrationDescription {\n return {\n ...description,\n kind: \"FcmV1Template\",\n };\n}\n\n/**\n * Represents a Windows Phone Notification Services registration description.\n * @deprecated Windows Phone is no longer supported.\n */\nexport interface MpnsRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * The channel URI.\n */\n channelUri: string;\n}\n\n/**\n * Represents a Windows Phone Notification Services registration description.\n * @deprecated Windows Phone is no longer supported.\n */\nexport interface MpnsRegistrationDescription extends MpnsRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Mpns\";\n}\n\n/**\n * Represents a Windows Phone Notification Services template registration.\n * @deprecated Windows Phone is no longer supported.\n */\nexport interface MpnsTemplateRegistrationDescription\n extends MpnsRegistrationDescriptionCommon,\n TemplateRegistrationDescription {\n /**\n * The WNS headers.\n */\n mpnsHeaders?: Record<string, string>;\n\n /**\n * The kind of the registration.\n */\n kind: \"MpnsTemplate\";\n}\n\n/**\n * Represents a Windows Phone Notification Services template registration.\n * @deprecated Windows Phone is no longer supported.\n */\nexport interface MpnsTemplateRegistrationDescriptionCommon\n extends MpnsRegistrationDescriptionCommon,\n TemplateRegistrationDescription {\n /**\n * The WNS headers.\n */\n mpnsHeaders?: Record<string, string>;\n}\n\n/**\n * Represents a Windows Phone Notification Services template registration.\n * @deprecated Windows Phone is no longer supported.\n */\nexport interface MpnsTemplateRegistrationDescription\n extends MpnsTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"MpnsTemplate\";\n}\n\n/**\n * Represents a Windows Notification Services (WNS) registration description.\n */\nexport interface WindowsRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * The channel URI.\n */\n channelUri: string;\n}\n\n/**\n * Represents a Windows Notification Services (WNS) registration description.\n */\nexport interface WindowsRegistrationDescription extends WindowsRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Windows\";\n}\n\n/**\n * Creates a Windows registration description.\n * @param description - A partial Windows registration description.\n * @returns A created Windows registration description.\n */\nexport function createWindowsRegistrationDescription(\n description: WindowsRegistrationDescriptionCommon,\n): WindowsRegistrationDescription {\n return {\n ...description,\n kind: \"Windows\",\n };\n}\n\n/**\n * Represents a Windows Notification Services (WNS) template registration.\n */\nexport interface WindowsTemplateRegistrationDescriptionCommon\n extends WindowsRegistrationDescriptionCommon,\n TemplateRegistrationDescription {\n /**\n * The WNS headers.\n */\n wnsHeaders?: Record<string, string>;\n}\n\n/**\n * Represents a Windows Notification Services (WNS) template registration.\n */\nexport interface WindowsTemplateRegistrationDescription\n extends WindowsTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"WindowsTemplate\";\n}\n\n/**\n * Creates a Windows template registration description.\n * @param description - A partial Windows template registration description.\n * @returns A created Windows template registration description.\n */\nexport function createWindowsTemplateRegistrationDescription(\n description: WindowsTemplateRegistrationDescriptionCommon,\n): WindowsTemplateRegistrationDescription {\n return {\n ...description,\n kind: \"WindowsTemplate\",\n };\n}\n\n/**\n * Represents a Xiaomi registration description.\n */\nexport interface XiaomiRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * The Xiaomi registration ID.\n */\n xiaomiRegistrationId: string;\n}\n\n/**\n * Represents a Xiaomi registration description.\n */\nexport interface XiaomiRegistrationDescription extends XiaomiRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Xiaomi\";\n}\n\n/**\n * Creates a Xiaomi registration description.\n * @param description - A partial Xiaomi registration description.\n * @returns A created Xiaomi registration description.\n */\nexport function createXiaomiRegistrationDescription(\n description: XiaomiRegistrationDescriptionCommon,\n): XiaomiRegistrationDescription {\n return {\n ...description,\n kind: \"Xiaomi\",\n };\n}\n\n/**\n * Represents a Xiaomi template registration.\n */\nexport interface XiaomiTemplateRegistrationDescriptionCommon\n extends XiaomiRegistrationDescriptionCommon,\n TemplateRegistrationDescription {}\n\n/**\n * Represents a Windows Notification Services (WNS) template registration.\n */\nexport interface XiaomiTemplateRegistrationDescription\n extends XiaomiTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"XiaomiTemplate\";\n}\n\n/**\n * Creates a Xiaomi template registration description.\n * @param description - A partial Xiaomi template registration description.\n * @returns A created Xiaomi template registration description.\n */\nexport function createXiaomiTemplateRegistrationDescription(\n description: XiaomiTemplateRegistrationDescriptionCommon,\n): XiaomiTemplateRegistrationDescription {\n return {\n ...description,\n kind: \"XiaomiTemplate\",\n };\n}\n\n/**\n * Describes the types of registration descriptions.\n */\nexport type RegistrationDescription =\n | AdmRegistrationDescription\n | AdmTemplateRegistrationDescription\n | AppleRegistrationDescription\n | AppleTemplateRegistrationDescription\n | BaiduRegistrationDescription\n | BaiduTemplateRegistrationDescription\n | BrowserRegistrationDescription\n | BrowserTemplateRegistrationDescription\n | GcmRegistrationDescription\n | GcmTemplateRegistrationDescription\n | FcmV1RegistrationDescription\n | FcmV1TemplateRegistrationDescription\n | MpnsRegistrationDescription\n | MpnsTemplateRegistrationDescription\n | XiaomiRegistrationDescription\n | XiaomiTemplateRegistrationDescription\n | WindowsRegistrationDescription\n | WindowsTemplateRegistrationDescription;\n\n/**\n * Describes an ADM Registration channel query.\n */\nexport interface AdmRegistrationChannel {\n /**\n * The ADM Registration ID.\n */\n admRegistrationId: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"adm\";\n}\n\n/**\n * Describes an Apple Registration channel query.\n */\nexport interface AppleRegistrationChannel {\n /**\n * The APNs device token.\n */\n deviceToken: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"apple\";\n}\n\n/**\n * Describes an Baidu Registration channel query.\n */\nexport interface BaiduRegistrationChannel {\n /**\n * The Baidu Channel ID.\n */\n baiduChannelId: string;\n /**\n * The Baidu User ID.\n */\n baiduUserId: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"baidu\";\n}\n\n/**\n * Describes an Browser Registration channel query.\n */\nexport interface BrowserRegistrationChannel {\n /**\n * The Web Push endpoint URL.\n */\n endpoint: string;\n /**\n * The Web Push subscription P256DH.\n */\n p256dh: string;\n /**\n * The Web Push subscription auth secret.\n */\n auth: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"browser\";\n}\n\n/**\n * Describes an Firebase Legacy Registration channel query.\n */\nexport interface FirebaseLegacyRegistrationChannel {\n /**\n * The FCM Legacy registration ID.\n */\n gcmRegistrationId: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"gcm\";\n}\n\n/**\n * Describes an Firebase Legacy Registration channel query.\n */\nexport interface FirebaseV1RegistrationChannel {\n /**\n * The FCM V1 registration ID.\n */\n fcmV1RegistrationId: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"fcmv1\";\n}\n\n/**\n * Describes an Windows Notification Services Registration channel query.\n */\nexport interface WindowsRegistrationChannel {\n /**\n * The WNS Channel URI.\n */\n channelUri: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"windows\";\n}\n\n/**\n * Describes an Xiaomi Registration channel query.\n */\nexport interface XiaomiRegistrationChannel {\n /**\n * The Xiaomi registration ID.\n */\n xiaomiRegistrationId: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"xiaomi\";\n}\n\n/**\n * Describes a Registration query.\n */\nexport type RegistrationChannel =\n | AdmRegistrationChannel\n | AppleRegistrationChannel\n | BaiduRegistrationChannel\n | BrowserRegistrationChannel\n | FirebaseLegacyRegistrationChannel\n | FirebaseV1RegistrationChannel\n | XiaomiRegistrationChannel\n | WindowsRegistrationChannel;\n"]}
@@ -33,6 +33,7 @@ const updateRegistration_js_1 = require("./api/updateRegistration.js");
33
33
  * messages to devices.
34
34
  */
35
35
  class NotificationHubsClient {
36
+ _client;
36
37
  /**
37
38
  * Creates a new instance of the NotificationClient with a connection string, hub name and options.
38
39
  * @param connectionString - The Notification Hub Access Policy connection string.
@@ -1 +1 @@
1
- {"version":3,"file":"notificationHubsClient.js","sourceRoot":"","sources":["../../src/notificationHubsClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAoBlC,6DAA6D;AAK7D,6FAA8H;AAC9H,yFAAwH;AACxH,uFAAqH;AACrH,uFAAqH;AACrH,2EAAmG;AACnG,uEAA6F;AAC7F,uEAA6F;AAC7F,uEAAiE;AACjE,iFAA4G;AAC5G,iEAAoF;AACpF,6EAAsG;AACtG,6FAA8H;AAC9H,iEAAoF;AACpF,iFAA4G;AAC5G,uFAAqH;AACrH,+EAAyG;AACzG,qEAA0F;AAC1F,6FAA8H;AAC9H,2EAAmG;AACnG,qFAAkH;AAClH,mEAAuF;AACvF,mFAA+G;AAC/G,uEAA6F;AAC7F,uEAA6F;AAE7F;;;GAGG;AACH,MAAa,sBAAsB;IAGjC;;;;;OAKG;IACH,YACE,gBAAwB,EACxB,OAAe,EACf,UAAyC,EAAE;QAE3C,IAAI,CAAC,OAAO,GAAG,IAAA,sCAAmB,EAAC,gBAAgB,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACzE,CAAC;IAED;;;;;OAKG;IACH,0BAA0B,CACxB,YAA0B,EAC1B,UAA4B,EAAE;QAE9B,OAAO,IAAA,0DAAgC,EAAC,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;OAKG;IACH,kBAAkB,CAChB,cAAsB,EACtB,UAA4B,EAAE;QAE9B,OAAO,IAAA,0CAAwB,EAAC,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;IACzE,CAAC;IAED;;;;;OAKG;IACH,eAAe,CAAC,cAAsB,EAAE,UAA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;IAED;;;;;OAKG;IACH,2BAA2B,CACzB,cAAsB,EACtB,UAA4B,EAAE;QAE9B,OAAO,IAAA,4DAAiC,EAAC,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;IAClF,CAAC;IAED;;;;;OAKG;IACH,uBAAuB,CAAC,UAA4B,EAAE;QACpD,OAAO,IAAA,oDAA6B,EAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;IAED;;;;;;OAMG;IACH,6BAA6B,CAC3B,cAAsB,EACtB,UAA4B,EAAE;QAE9B,OAAO,IAAA,gEAAmC,EAAC,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;IACpF,CAAC;IAED;;;;;OAKG;IACH,qBAAqB,CACnB,KAAa,EACb,UAA4B,EAAE;QAE9B,OAAO,IAAA,gDAA2B,EAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACnE,CAAC;IAED;;;;;OAKG;IACH,6BAA6B,CAC3B,kBAAsC;IACtC,8DAA8D;IAC9D,UAAkC,EAAE;QAEpC,OAAO,IAAA,gEAAmC,EAAC,IAAI,CAAC,OAAO,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAAC;IACxF,CAAC;IAED;;;;;OAKG;IACH,wBAAwB,CACtB,GAAuB,EACvB,UAA4B,EAAE;QAE9B,OAAO,IAAA,sDAA8B,EAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;IAED;;;;OAIG;IACH,uBAAuB,CAAC,UAA4B,EAAE;QACpD,OAAO,IAAA,oDAA6B,EAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;CACF;AAzUD,wDAyUC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n BroadcastSendNotificationOptions,\n DirectSendNotificationOptions,\n EntityOperationOptions,\n NotificationHubsClientOptions,\n PolledOperationOptions,\n RegistrationQueryLimitOptions,\n ScheduleNotificationOptions,\n SendNotificationOptions,\n} from \"./models/options.js\";\nimport type { Installation, JsonPatch } from \"./models/installation.js\";\nimport type {\n NotificationDetails,\n NotificationHubsMessageResponse,\n NotificationHubsResponse,\n} from \"./models/notificationDetails.js\";\nimport type { NotificationHubJob, NotificationHubJobPoller } from \"./models/notificationHubJob.js\";\nimport type { NotificationHubsClientContext } from \"./api/clientContext.js\";\nimport { createClientContext } from \"./api/clientContext.js\";\nimport type { RegistrationDescription, RegistrationChannel } from \"./models/registration.js\";\nimport type { Notification } from \"./models/notification.js\";\nimport type { OperationOptions } from \"@azure-rest/core-client\";\nimport type { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { beginSubmitNotificationHubJob as beginSubmitNotificationHubJobMethod } from \"./api/beginSubmitNotificationHubJob.js\";\nimport { cancelScheduledNotification as cancelScheduledNotificationMethod } from \"./api/cancelScheduledNotification.js\";\nimport { createOrUpdateInstallation as createOrUpdateInstallationMethod } from \"./api/createOrUpdateInstallation.js\";\nimport { createOrUpdateRegistration as createOrUpdateRegistrationMethod } from \"./api/createOrUpdateRegistration.js\";\nimport { createRegistrationId as createRegistrationIdMethod } from \"./api/createRegistrationId.js\";\nimport { createRegistration as createRegistrationMethod } from \"./api/createRegistration.js\";\nimport { deleteInstallation as deleteInstallationMethod } from \"./api/deleteInstallation.js\";\nimport { deleteRegistration } from \"./api/deleteRegistration.js\";\nimport { getFeedbackContainerUrl as getFeedbackContainerUrlMethod } from \"./api/getFeedbackContainerUrl.js\";\nimport { getInstallation as getInstallationMethod } from \"./api/getInstallation.js\";\nimport { getNotificationHubJob as getNotificationHubJobMethod } from \"./api/getNotificationHubJob.js\";\nimport { getNotificationOutcomeDetails as getNotificationOutcomeDetailsMethod } from \"./api/getNotificationOutcomeDetails.js\";\nimport { getRegistration as getRegistrationMethod } from \"./api/getRegistration.js\";\nimport { listNotificationHubJobs as listNotificationHubJobsMethod } from \"./api/listNotificationHubJobs.js\";\nimport { listRegistrationsByChannel as listRegistrationsByChannelMethod } from \"./api/listRegistrationsByChannel.js\";\nimport { listRegistrationsByTag as listRegistrationsByTagMethod } from \"./api/listRegistrationsByTag.js\";\nimport { listRegistrations as listRegistrationsMethod } from \"./api/listRegistrations.js\";\nimport { scheduleBroadcastNotification as scheduleBroadcastNotificationMethod } from \"./api/scheduleBroadcastNotification.js\";\nimport { scheduleNotification as scheduleNotificationMethod } from \"./api/scheduleNotification.js\";\nimport { sendBroadcastNotification as sendBroadcastNotificationMethod } from \"./api/sendBroadcastNotification.js\";\nimport { sendNotification as sendNotificationMethod } from \"./api/sendNotification.js\";\nimport { submitNotificationHubJob as submitNotificationHubJobMethod } from \"./api/submitNotificationHubJob.js\";\nimport { updateInstallation as updateInstallationMethod } from \"./api/updateInstallation.js\";\nimport { updateRegistration as updateRegistrationMethod } from \"./api/updateRegistration.js\";\n\n/**\n * This represents a client for Azure Notification Hubs to manage installations and send\n * messages to devices.\n */\nexport class NotificationHubsClient {\n private _client: NotificationHubsClientContext;\n\n /**\n * Creates a new instance of the NotificationClient with a connection string, hub name and options.\n * @param connectionString - The Notification Hub Access Policy connection string.\n * @param hubName - The name of the Azure Notification Hub.\n * @param options - Options for configuring the Azure Notification Hubs client.\n */\n constructor(\n connectionString: string,\n hubName: string,\n options: NotificationHubsClientOptions = {},\n ) {\n this._client = createClientContext(connectionString, hubName, options);\n }\n\n /**\n * Creates or overwrites an installation to a Notification Hub.\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 */\n createOrUpdateInstallation(\n installation: Installation,\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return createOrUpdateInstallationMethod(this._client, installation, options);\n }\n\n /**\n * Deletes an installation from a Notification Hub.\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 */\n deleteInstallation(\n installationId: string,\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return deleteInstallationMethod(this._client, installationId, options);\n }\n\n /**\n * Gets an Azure Notification Hub installation by the installation ID.\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 */\n getInstallation(installationId: string, options: OperationOptions = {}): Promise<Installation> {\n return getInstallationMethod(this._client, installationId, options);\n }\n\n /**\n * Updates an installation using the JSON-Patch standard in RFC6902.\n * @param installationId - The ID of the installation to update.\n * @param patches - An array of patches following the JSON-Patch standard.\n * @param options - Configuration options for the patch installation operation.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n updateInstallation(\n installationId: string,\n patches: JsonPatch[],\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return updateInstallationMethod(this._client, installationId, patches, options);\n }\n\n /**\n * Creates a new registration ID.\n * @param options - The options for creating a new registration ID.\n * @returns The newly created registration ID.\n */\n createRegistrationId(options: OperationOptions = {}): Promise<string> {\n return createRegistrationIdMethod(this._client, options);\n }\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 registration - The registration to create.\n * @param options - Options for creating a new registration.\n * @returns The newly created registration description.\n */\n createRegistration(\n registration: RegistrationDescription,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return createRegistrationMethod(this._client, registration, options);\n }\n\n /**\n * Creates or updates a registration.\n * @param registration - The registration to create or update.\n * @param options - The operation options.\n * @returns The created or updated registration description.\n */\n createOrUpdateRegistration(\n registration: RegistrationDescription,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return createOrUpdateRegistrationMethod(this._client, registration, options);\n }\n\n /**\n * Updates an existing registration.\n * @param registration - The registration to update.\n * @param options - The operation options.\n * @returns The updated registration description.\n */\n updateRegistration(\n registration: RegistrationDescription,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return updateRegistrationMethod(this._client, registration, options);\n }\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 */\n deleteRegistration(\n registrationId: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: EntityOperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return deleteRegistration(this._client, registrationId, options);\n }\n\n /**\n * Gets a registration by the given registration ID.\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 */\n getRegistration(\n registrationId: string,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return getRegistrationMethod(this._client, registrationId, options);\n }\n\n /**\n * Gets all registrations for the notification hub with the given query options.\n * @param options - The options for querying the registrations such as $top.\n * @returns A paged async iterable containing all of the registrations for the notification hub.\n */\n listRegistrations(\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: RegistrationQueryLimitOptions = {},\n ): PagedAsyncIterableIterator<RegistrationDescription> {\n return listRegistrationsMethod(this._client, options);\n }\n\n /**\n * Gets all registrations for the notification hub with the given device information and options.\n * @param channel - The registration channel information to query per PNS type.\n * @param options - The options for querying the registrations such as $top.\n * @returns A paged async iterable containing all of the registrations for the notification hub.\n */\n listRegistrationsByChannel(\n channel: RegistrationChannel,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: RegistrationQueryLimitOptions = {},\n ): PagedAsyncIterableIterator<RegistrationDescription> {\n return listRegistrationsByChannelMethod(this._client, channel, options);\n }\n\n /**\n * Lists all registrations with the matching tag.\n * @param tag - The tag to query for matching registrations.\n * @param options - The query options such as $top.\n * @returns A paged async iterable containing the matching registrations for the notification hub.\n */\n listRegistrationsByTag(\n tag: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: RegistrationQueryLimitOptions = {},\n ): PagedAsyncIterableIterator<RegistrationDescription> {\n return listRegistrationsByTagMethod(this._client, tag, options);\n }\n\n /**\n * Sends push notifications to devices all devices.\n * @param notification - The notification to send to all devices.\n * @param options - Options for the notification including whether to enable test send.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n sendBroadcastNotification(\n notification: Notification,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: BroadcastSendNotificationOptions = {},\n ): Promise<NotificationHubsMessageResponse> {\n return sendBroadcastNotificationMethod(this._client, notification, options);\n }\n\n /**\n * Sends push notifications to devices that match the given tags or tag expression.\n * @param notification - The notification to send to the matching devices.\n * @param options - Options for the notification including tags, device handles and whether to enable test send.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n sendNotification(\n notification: Notification,\n options: DirectSendNotificationOptions | SendNotificationOptions,\n ): Promise<NotificationHubsMessageResponse> {\n return sendNotificationMethod(this._client, notification, options);\n }\n\n /**\n * Schedules a push notification to all devices at the specified time.\n * NOTE: This is only available in Standard SKU Azure Notification Hubs.\n * @param scheduledTime - The Date to send the push notification.\n * @param notification - The notification to send to the matching devices.\n * @param options - The operation options.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n scheduleBroadcastNotification(\n scheduledTime: Date,\n notification: Notification,\n options: OperationOptions = {},\n ): Promise<NotificationHubsMessageResponse> {\n return scheduleBroadcastNotificationMethod(this._client, scheduledTime, notification, options);\n }\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 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 */\n scheduleNotification(\n scheduledTime: Date,\n notification: Notification,\n options: ScheduleNotificationOptions,\n ): Promise<NotificationHubsMessageResponse> {\n return scheduleNotificationMethod(this._client, scheduledTime, notification, options);\n }\n\n /**\n * Cancels the scheduled notification with the given notification ID.\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 */\n cancelScheduledNotification(\n notificationId: string,\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return cancelScheduledNotificationMethod(this._client, notificationId, options);\n }\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 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 */\n getFeedbackContainerUrl(options: OperationOptions = {}): Promise<string> {\n return getFeedbackContainerUrlMethod(this._client, options);\n }\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 notificationId - The notification ID returned from the send operation.\n * @param options - The operation options.\n * @returns The results of the send operation.\n */\n getNotificationOutcomeDetails(\n notificationId: string,\n options: OperationOptions = {},\n ): Promise<NotificationDetails> {\n return getNotificationOutcomeDetailsMethod(this._client, notificationId, options);\n }\n\n /**\n * Gets a Notification Hub Job by the ID.\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 */\n getNotificationHubJob(\n jobId: string,\n options: OperationOptions = {},\n ): Promise<NotificationHubJob> {\n return getNotificationHubJobMethod(this._client, jobId, options);\n }\n\n /**\n * Submits a Notification Hub job and creates a poller to poll for results.\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 */\n beginSubmitNotificationHubJob(\n notificationHubJob: NotificationHubJob,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: PolledOperationOptions = {},\n ): Promise<NotificationHubJobPoller> {\n return beginSubmitNotificationHubJobMethod(this._client, notificationHubJob, options);\n }\n\n /**\n * Submits a Notification Hub Job. Note this is available to Standard SKU namespace and above.\n * @param job - The notification hub job to submit.\n * @param options - The operation options.\n * @returns The notification hub job details including job ID and status.\n */\n submitNotificationHubJob(\n job: NotificationHubJob,\n options: OperationOptions = {},\n ): Promise<NotificationHubJob> {\n return submitNotificationHubJobMethod(this._client, job, options);\n }\n\n /**\n * Gets all Notification Hub Jobs for this Notification Hub.\n * @param options - The operation options.\n * @returns An array of all Notification Hub Jobs for this Notification Hub.\n */\n listNotificationHubJobs(options: OperationOptions = {}): Promise<NotificationHubJob[]> {\n return listNotificationHubJobsMethod(this._client, options);\n }\n}\n"]}
1
+ {"version":3,"file":"notificationHubsClient.js","sourceRoot":"","sources":["../../src/notificationHubsClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAoBlC,6DAA6D;AAK7D,6FAA8H;AAC9H,yFAAwH;AACxH,uFAAqH;AACrH,uFAAqH;AACrH,2EAAmG;AACnG,uEAA6F;AAC7F,uEAA6F;AAC7F,uEAAiE;AACjE,iFAA4G;AAC5G,iEAAoF;AACpF,6EAAsG;AACtG,6FAA8H;AAC9H,iEAAoF;AACpF,iFAA4G;AAC5G,uFAAqH;AACrH,+EAAyG;AACzG,qEAA0F;AAC1F,6FAA8H;AAC9H,2EAAmG;AACnG,qFAAkH;AAClH,mEAAuF;AACvF,mFAA+G;AAC/G,uEAA6F;AAC7F,uEAA6F;AAE7F;;;GAGG;AACH,MAAa,sBAAsB;IACzB,OAAO,CAAgC;IAE/C;;;;;OAKG;IACH,YACE,gBAAwB,EACxB,OAAe,EACf,UAAyC,EAAE;QAE3C,IAAI,CAAC,OAAO,GAAG,IAAA,sCAAmB,EAAC,gBAAgB,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACzE,CAAC;IAED;;;;;OAKG;IACH,0BAA0B,CACxB,YAA0B,EAC1B,UAA4B,EAAE;QAE9B,OAAO,IAAA,0DAAgC,EAAC,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;OAK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B,EAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;CACF;AAzUD,wDAyUC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n BroadcastSendNotificationOptions,\n DirectSendNotificationOptions,\n EntityOperationOptions,\n NotificationHubsClientOptions,\n PolledOperationOptions,\n RegistrationQueryLimitOptions,\n ScheduleNotificationOptions,\n SendNotificationOptions,\n} from \"./models/options.js\";\nimport type { Installation, JsonPatch } from \"./models/installation.js\";\nimport type {\n NotificationDetails,\n NotificationHubsMessageResponse,\n NotificationHubsResponse,\n} from \"./models/notificationDetails.js\";\nimport type { NotificationHubJob, NotificationHubJobPoller } from \"./models/notificationHubJob.js\";\nimport type { NotificationHubsClientContext } from \"./api/clientContext.js\";\nimport { createClientContext } from \"./api/clientContext.js\";\nimport type { RegistrationDescription, RegistrationChannel } from \"./models/registration.js\";\nimport type { Notification } from \"./models/notification.js\";\nimport type { OperationOptions } from \"@azure-rest/core-client\";\nimport type { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { beginSubmitNotificationHubJob as beginSubmitNotificationHubJobMethod } from \"./api/beginSubmitNotificationHubJob.js\";\nimport { cancelScheduledNotification as cancelScheduledNotificationMethod } from \"./api/cancelScheduledNotification.js\";\nimport { createOrUpdateInstallation as createOrUpdateInstallationMethod } from \"./api/createOrUpdateInstallation.js\";\nimport { createOrUpdateRegistration as createOrUpdateRegistrationMethod } from \"./api/createOrUpdateRegistration.js\";\nimport { createRegistrationId as createRegistrationIdMethod } from \"./api/createRegistrationId.js\";\nimport { createRegistration as createRegistrationMethod } from \"./api/createRegistration.js\";\nimport { deleteInstallation as deleteInstallationMethod } from \"./api/deleteInstallation.js\";\nimport { deleteRegistration } from \"./api/deleteRegistration.js\";\nimport { getFeedbackContainerUrl as getFeedbackContainerUrlMethod } from \"./api/getFeedbackContainerUrl.js\";\nimport { getInstallation as getInstallationMethod } from \"./api/getInstallation.js\";\nimport { getNotificationHubJob as getNotificationHubJobMethod } from \"./api/getNotificationHubJob.js\";\nimport { getNotificationOutcomeDetails as getNotificationOutcomeDetailsMethod } from \"./api/getNotificationOutcomeDetails.js\";\nimport { getRegistration as getRegistrationMethod } from \"./api/getRegistration.js\";\nimport { listNotificationHubJobs as listNotificationHubJobsMethod } from \"./api/listNotificationHubJobs.js\";\nimport { listRegistrationsByChannel as listRegistrationsByChannelMethod } from \"./api/listRegistrationsByChannel.js\";\nimport { listRegistrationsByTag as listRegistrationsByTagMethod } from \"./api/listRegistrationsByTag.js\";\nimport { listRegistrations as listRegistrationsMethod } from \"./api/listRegistrations.js\";\nimport { scheduleBroadcastNotification as scheduleBroadcastNotificationMethod } from \"./api/scheduleBroadcastNotification.js\";\nimport { scheduleNotification as scheduleNotificationMethod } from \"./api/scheduleNotification.js\";\nimport { sendBroadcastNotification as sendBroadcastNotificationMethod } from \"./api/sendBroadcastNotification.js\";\nimport { sendNotification as sendNotificationMethod } from \"./api/sendNotification.js\";\nimport { submitNotificationHubJob as submitNotificationHubJobMethod } from \"./api/submitNotificationHubJob.js\";\nimport { updateInstallation as updateInstallationMethod } from \"./api/updateInstallation.js\";\nimport { updateRegistration as updateRegistrationMethod } from \"./api/updateRegistration.js\";\n\n/**\n * This represents a client for Azure Notification Hubs to manage installations and send\n * messages to devices.\n */\nexport class NotificationHubsClient {\n private _client: NotificationHubsClientContext;\n\n /**\n * Creates a new instance of the NotificationClient with a connection string, hub name and options.\n * @param connectionString - The Notification Hub Access Policy connection string.\n * @param hubName - The name of the Azure Notification Hub.\n * @param options - Options for configuring the Azure Notification Hubs client.\n */\n constructor(\n connectionString: string,\n hubName: string,\n options: NotificationHubsClientOptions = {},\n ) {\n this._client = createClientContext(connectionString, hubName, options);\n }\n\n /**\n * Creates or overwrites an installation to a Notification Hub.\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 */\n createOrUpdateInstallation(\n installation: Installation,\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return createOrUpdateInstallationMethod(this._client, installation, options);\n }\n\n /**\n * Deletes an installation from a Notification Hub.\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 */\n deleteInstallation(\n installationId: string,\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return deleteInstallationMethod(this._client, installationId, options);\n }\n\n /**\n * Gets an Azure Notification Hub installation by the installation ID.\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 */\n getInstallation(installationId: string, options: OperationOptions = {}): Promise<Installation> {\n return getInstallationMethod(this._client, installationId, options);\n }\n\n /**\n * Updates an installation using the JSON-Patch standard in RFC6902.\n * @param installationId - The ID of the installation to update.\n * @param patches - An array of patches following the JSON-Patch standard.\n * @param options - Configuration options for the patch installation operation.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n updateInstallation(\n installationId: string,\n patches: JsonPatch[],\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return updateInstallationMethod(this._client, installationId, patches, options);\n }\n\n /**\n * Creates a new registration ID.\n * @param options - The options for creating a new registration ID.\n * @returns The newly created registration ID.\n */\n createRegistrationId(options: OperationOptions = {}): Promise<string> {\n return createRegistrationIdMethod(this._client, options);\n }\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 registration - The registration to create.\n * @param options - Options for creating a new registration.\n * @returns The newly created registration description.\n */\n createRegistration(\n registration: RegistrationDescription,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return createRegistrationMethod(this._client, registration, options);\n }\n\n /**\n * Creates or updates a registration.\n * @param registration - The registration to create or update.\n * @param options - The operation options.\n * @returns The created or updated registration description.\n */\n createOrUpdateRegistration(\n registration: RegistrationDescription,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return createOrUpdateRegistrationMethod(this._client, registration, options);\n }\n\n /**\n * Updates an existing registration.\n * @param registration - The registration to update.\n * @param options - The operation options.\n * @returns The updated registration description.\n */\n updateRegistration(\n registration: RegistrationDescription,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return updateRegistrationMethod(this._client, registration, options);\n }\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 */\n deleteRegistration(\n registrationId: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: EntityOperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return deleteRegistration(this._client, registrationId, options);\n }\n\n /**\n * Gets a registration by the given registration ID.\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 */\n getRegistration(\n registrationId: string,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return getRegistrationMethod(this._client, registrationId, options);\n }\n\n /**\n * Gets all registrations for the notification hub with the given query options.\n * @param options - The options for querying the registrations such as $top.\n * @returns A paged async iterable containing all of the registrations for the notification hub.\n */\n listRegistrations(\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: RegistrationQueryLimitOptions = {},\n ): PagedAsyncIterableIterator<RegistrationDescription> {\n return listRegistrationsMethod(this._client, options);\n }\n\n /**\n * Gets all registrations for the notification hub with the given device information and options.\n * @param channel - The registration channel information to query per PNS type.\n * @param options - The options for querying the registrations such as $top.\n * @returns A paged async iterable containing all of the registrations for the notification hub.\n */\n listRegistrationsByChannel(\n channel: RegistrationChannel,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: RegistrationQueryLimitOptions = {},\n ): PagedAsyncIterableIterator<RegistrationDescription> {\n return listRegistrationsByChannelMethod(this._client, channel, options);\n }\n\n /**\n * Lists all registrations with the matching tag.\n * @param tag - The tag to query for matching registrations.\n * @param options - The query options such as $top.\n * @returns A paged async iterable containing the matching registrations for the notification hub.\n */\n listRegistrationsByTag(\n tag: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: RegistrationQueryLimitOptions = {},\n ): PagedAsyncIterableIterator<RegistrationDescription> {\n return listRegistrationsByTagMethod(this._client, tag, options);\n }\n\n /**\n * Sends push notifications to devices all devices.\n * @param notification - The notification to send to all devices.\n * @param options - Options for the notification including whether to enable test send.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n sendBroadcastNotification(\n notification: Notification,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: BroadcastSendNotificationOptions = {},\n ): Promise<NotificationHubsMessageResponse> {\n return sendBroadcastNotificationMethod(this._client, notification, options);\n }\n\n /**\n * Sends push notifications to devices that match the given tags or tag expression.\n * @param notification - The notification to send to the matching devices.\n * @param options - Options for the notification including tags, device handles and whether to enable test send.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n sendNotification(\n notification: Notification,\n options: DirectSendNotificationOptions | SendNotificationOptions,\n ): Promise<NotificationHubsMessageResponse> {\n return sendNotificationMethod(this._client, notification, options);\n }\n\n /**\n * Schedules a push notification to all devices at the specified time.\n * NOTE: This is only available in Standard SKU Azure Notification Hubs.\n * @param scheduledTime - The Date to send the push notification.\n * @param notification - The notification to send to the matching devices.\n * @param options - The operation options.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n scheduleBroadcastNotification(\n scheduledTime: Date,\n notification: Notification,\n options: OperationOptions = {},\n ): Promise<NotificationHubsMessageResponse> {\n return scheduleBroadcastNotificationMethod(this._client, scheduledTime, notification, options);\n }\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 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 */\n scheduleNotification(\n scheduledTime: Date,\n notification: Notification,\n options: ScheduleNotificationOptions,\n ): Promise<NotificationHubsMessageResponse> {\n return scheduleNotificationMethod(this._client, scheduledTime, notification, options);\n }\n\n /**\n * Cancels the scheduled notification with the given notification ID.\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 */\n cancelScheduledNotification(\n notificationId: string,\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return cancelScheduledNotificationMethod(this._client, notificationId, options);\n }\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 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 */\n getFeedbackContainerUrl(options: OperationOptions = {}): Promise<string> {\n return getFeedbackContainerUrlMethod(this._client, options);\n }\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 notificationId - The notification ID returned from the send operation.\n * @param options - The operation options.\n * @returns The results of the send operation.\n */\n getNotificationOutcomeDetails(\n notificationId: string,\n options: OperationOptions = {},\n ): Promise<NotificationDetails> {\n return getNotificationOutcomeDetailsMethod(this._client, notificationId, options);\n }\n\n /**\n * Gets a Notification Hub Job by the ID.\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 */\n getNotificationHubJob(\n jobId: string,\n options: OperationOptions = {},\n ): Promise<NotificationHubJob> {\n return getNotificationHubJobMethod(this._client, jobId, options);\n }\n\n /**\n * Submits a Notification Hub job and creates a poller to poll for results.\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 */\n beginSubmitNotificationHubJob(\n notificationHubJob: NotificationHubJob,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: PolledOperationOptions = {},\n ): Promise<NotificationHubJobPoller> {\n return beginSubmitNotificationHubJobMethod(this._client, notificationHubJob, options);\n }\n\n /**\n * Submits a Notification Hub Job. Note this is available to Standard SKU namespace and above.\n * @param job - The notification hub job to submit.\n * @param options - The operation options.\n * @returns The notification hub job details including job ID and status.\n */\n submitNotificationHubJob(\n job: NotificationHubJob,\n options: OperationOptions = {},\n ): Promise<NotificationHubJob> {\n return submitNotificationHubJobMethod(this._client, job, options);\n }\n\n /**\n * Gets all Notification Hub Jobs for this Notification Hub.\n * @param options - The operation options.\n * @returns An array of all Notification Hub Jobs for this Notification Hub.\n */\n listNotificationHubJobs(options: OperationOptions = {}): Promise<NotificationHubJob[]> {\n return listNotificationHubJobsMethod(this._client, options);\n }\n}\n"]}
@@ -10,7 +10,6 @@ const core_xml_1 = require("@azure/core-xml");
10
10
  * Parses a NotificationDetails from incoming XML.
11
11
  */
12
12
  async function parseNotificationDetails(bodyText) {
13
- var _a, _b, _c, _d, _e, _f;
14
13
  const xml = await (0, core_xml_1.parseXML)(bodyText, {
15
14
  includeRoot: true,
16
15
  });
@@ -48,15 +47,15 @@ async function parseNotificationDetails(bodyText) {
48
47
  wnsOutcomeCounts = parseOutcomeCounts(notificationDetails["WnsOutcomeCounts"]["Outcome"]);
49
48
  }
50
49
  return {
51
- notificationId: (_a = (0, utils_js_1.getStringOrUndefined)(notificationDetails["NotificationId"])) === null || _a === void 0 ? void 0 : _a.trim(),
52
- location: (_b = (0, utils_js_1.getStringOrUndefined)(notificationDetails["Location"])) === null || _b === void 0 ? void 0 : _b.trim(),
53
- state: (_c = (0, utils_js_1.getStringOrUndefined)(notificationDetails["State"])) === null || _c === void 0 ? void 0 : _c.trim(),
50
+ notificationId: (0, utils_js_1.getStringOrUndefined)(notificationDetails["NotificationId"])?.trim(),
51
+ location: (0, utils_js_1.getStringOrUndefined)(notificationDetails["Location"])?.trim(),
52
+ state: (0, utils_js_1.getStringOrUndefined)(notificationDetails["State"])?.trim(),
54
53
  enqueueTime: (0, utils_js_1.getDateOrUndefined)(notificationDetails["EnqueueTime"]),
55
54
  startTime: (0, utils_js_1.getDateOrUndefined)(notificationDetails["StartTime"]),
56
55
  endTime: (0, utils_js_1.getDateOrUndefined)(notificationDetails["EndTime"]),
57
- pnsErrorDetailsUrl: (_d = (0, utils_js_1.getStringOrUndefined)(notificationDetails["PnsErrorDetailsUri"])) === null || _d === void 0 ? void 0 : _d.trim(),
58
- targetPlatforms: (_e = (0, utils_js_1.getStringOrUndefined)(notificationDetails["TargetPlatforms"])) === null || _e === void 0 ? void 0 : _e.trim(),
59
- notificationBody: (_f = (0, utils_js_1.getStringOrUndefined)(notificationDetails["NotificationBody"])) === null || _f === void 0 ? void 0 : _f.trim(),
56
+ pnsErrorDetailsUrl: (0, utils_js_1.getStringOrUndefined)(notificationDetails["PnsErrorDetailsUri"])?.trim(),
57
+ targetPlatforms: (0, utils_js_1.getStringOrUndefined)(notificationDetails["TargetPlatforms"])?.trim(),
58
+ notificationBody: (0, utils_js_1.getStringOrUndefined)(notificationDetails["NotificationBody"])?.trim(),
60
59
  apnsOutcomeCounts,
61
60
  admOutcomeCounts,
62
61
  baiduOutcomeCounts,
@@ -1 +1 @@
1
- {"version":3,"file":"notificationDetailsSerializer.js","sourceRoot":"","sources":["../../../src/serializers/notificationDetailsSerializer.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAclC,4DAmEC;AA1ED,gDAAoG;AACpG,8CAA2C;AAE3C;;;GAGG;AACI,KAAK,UAAU,wBAAwB,CAAC,QAAgB;;IAC7D,MAAM,GAAG,GAAG,MAAM,IAAA,mBAAQ,EAAC,QAAQ,EAAE;QACnC,WAAW,EAAE,IAAI;KAClB,CAAC,CAAC;IACH,MAAM,mBAAmB,GAAG,GAAG,CAAC,qBAAqB,CAAC,CAAC;IAEvD,IAAI,iBAAoD,CAAC;IACzD,IAAI,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,EAAE;QACvF,iBAAiB;QACjB,gBAAgB;QAChB,kBAAkB;QAClB,oBAAoB;QACpB,gBAAgB;QAChB,kBAAkB;QAClB,mBAAmB;QACnB,gBAAgB;KACjB,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CACzB,MAAmD;IAEnD,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACxD,MAAM,OAAO,GAA0B,EAAE,CAAC;IAC1C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,IAAA,qBAAU,EAAC,IAAI,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;IACnF,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n NotificationDetails,\n NotificationOutcome,\n NotificationOutcomeState,\n} from \"../models/notificationDetails.js\";\nimport { getDateOrUndefined, getInteger, getStringOrUndefined, isDefined } from \"../utils/utils.js\";\nimport { parseXML } from \"@azure/core-xml\";\n\n/**\n * @internal\n * Parses a NotificationDetails from incoming XML.\n */\nexport async function parseNotificationDetails(bodyText: string): Promise<NotificationDetails> {\n const xml = await parseXML(bodyText, {\n includeRoot: true,\n });\n const notificationDetails = xml[\"NotificationDetails\"];\n\n let apnsOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"ApnsOutcomeCounts\"])) {\n apnsOutcomeCounts = parseOutcomeCounts(notificationDetails[\"ApnsOutcomeCounts\"][\"Outcome\"]);\n }\n\n let admOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"AdmOutcomeCounts\"])) {\n admOutcomeCounts = parseOutcomeCounts(notificationDetails[\"AdmOutcomeCounts\"][\"Outcome\"]);\n }\n\n let baiduOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"BaiduOutcomeCounts\"])) {\n baiduOutcomeCounts = parseOutcomeCounts(notificationDetails[\"BaiduOutcomeCounts\"][\"Outcome\"]);\n }\n\n let browserOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"BrowserOutcomeCounts\"])) {\n browserOutcomeCounts = parseOutcomeCounts(\n notificationDetails[\"BrowserOutcomeCounts\"][\"Outcome\"],\n );\n }\n\n let fcmOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"GcmOutcomeCounts\"])) {\n fcmOutcomeCounts = parseOutcomeCounts(notificationDetails[\"GcmOutcomeCounts\"][\"Outcome\"]);\n }\n\n let fcmV1OutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"FcmV1OutcomeCounts\"])) {\n fcmV1OutcomeCounts = parseOutcomeCounts(notificationDetails[\"FcmV1OutcomeCounts\"][\"Outcome\"]);\n }\n\n let xiaomiOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"XiaomiOutcomeCounts\"])) {\n xiaomiOutcomeCounts = parseOutcomeCounts(notificationDetails[\"XiaomiOutcomeCounts\"][\"Outcome\"]);\n }\n\n let wnsOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"WnsOutcomeCounts\"])) {\n wnsOutcomeCounts = parseOutcomeCounts(notificationDetails[\"WnsOutcomeCounts\"][\"Outcome\"]);\n }\n\n return {\n notificationId: getStringOrUndefined(notificationDetails[\"NotificationId\"])?.trim(),\n location: getStringOrUndefined(notificationDetails[\"Location\"])?.trim(),\n state: getStringOrUndefined(notificationDetails[\"State\"])?.trim() as NotificationOutcomeState,\n enqueueTime: getDateOrUndefined(notificationDetails[\"EnqueueTime\"]),\n startTime: getDateOrUndefined(notificationDetails[\"StartTime\"]),\n endTime: getDateOrUndefined(notificationDetails[\"EndTime\"]),\n pnsErrorDetailsUrl: getStringOrUndefined(notificationDetails[\"PnsErrorDetailsUri\"])?.trim(),\n targetPlatforms: getStringOrUndefined(notificationDetails[\"TargetPlatforms\"])?.trim(),\n notificationBody: getStringOrUndefined(notificationDetails[\"NotificationBody\"])?.trim(),\n apnsOutcomeCounts,\n admOutcomeCounts,\n baiduOutcomeCounts,\n browserOutcomeCounts,\n fcmOutcomeCounts,\n fcmV1OutcomeCounts,\n xiaomiOutcomeCounts,\n wnsOutcomeCounts,\n };\n}\n\nfunction parseOutcomeCounts(\n counts: Record<string, any>[] | Record<string, any>,\n): NotificationOutcome[] {\n const items = Array.isArray(counts) ? counts : [counts];\n const results: NotificationOutcome[] = [];\n for (const item of items) {\n results.push({ state: item[\"Name\"], count: getInteger(item[\"Count\"], \"Count\") });\n }\n\n return results;\n}\n"]}
1
+ {"version":3,"file":"notificationDetailsSerializer.js","sourceRoot":"","sources":["../../../src/serializers/notificationDetailsSerializer.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAclC,4DAmEC;AA1ED,gDAAoG;AACpG,8CAA2C;AAE3C;;;GAGG;AACI,KAAK,UAAU,wBAAwB,CAAC,QAAgB;IAC7D,MAAM,GAAG,GAAG,MAAM,IAAA,mBAAQ,EAAC,QAAQ,EAAE;QACnC,WAAW,EAAE,IAAI;KAClB,CAAC,CAAC;IACH,MAAM,mBAAmB,GAAG,GAAG,CAAC,qBAAqB,CAAC,CAAC;IAEvD,IAAI,iBAAoD,CAAC;IACzD,IAAI,IAAA,oBAAS,EAAC,mBAAmB,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC;QACxD,iBAAiB,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC9F,CAAC;IAED,IAAI,gBAAmD,CAAC;IACxD,IAAI,IAAA,oBAAS,EAAC,mBAAmB,CAAC,kBAAkB,CAAC,C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AC;IACxD,MAAM,OAAO,GAA0B,EAAE,CAAC;IAC1C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,IAAA,qBAAU,EAAC,IAAI,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;IACnF,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n NotificationDetails,\n NotificationOutcome,\n NotificationOutcomeState,\n} from \"../models/notificationDetails.js\";\nimport { getDateOrUndefined, getInteger, getStringOrUndefined, isDefined } from \"../utils/utils.js\";\nimport { parseXML } from \"@azure/core-xml\";\n\n/**\n * @internal\n * Parses a NotificationDetails from incoming XML.\n */\nexport async function parseNotificationDetails(bodyText: string): Promise<NotificationDetails> {\n const xml = await parseXML(bodyText, {\n includeRoot: true,\n });\n const notificationDetails = xml[\"NotificationDetails\"];\n\n let apnsOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"ApnsOutcomeCounts\"])) {\n apnsOutcomeCounts = parseOutcomeCounts(notificationDetails[\"ApnsOutcomeCounts\"][\"Outcome\"]);\n }\n\n let admOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"AdmOutcomeCounts\"])) {\n admOutcomeCounts = parseOutcomeCounts(notificationDetails[\"AdmOutcomeCounts\"][\"Outcome\"]);\n }\n\n let baiduOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"BaiduOutcomeCounts\"])) {\n baiduOutcomeCounts = parseOutcomeCounts(notificationDetails[\"BaiduOutcomeCounts\"][\"Outcome\"]);\n }\n\n let browserOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"BrowserOutcomeCounts\"])) {\n browserOutcomeCounts = parseOutcomeCounts(\n notificationDetails[\"BrowserOutcomeCounts\"][\"Outcome\"],\n );\n }\n\n let fcmOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"GcmOutcomeCounts\"])) {\n fcmOutcomeCounts = parseOutcomeCounts(notificationDetails[\"GcmOutcomeCounts\"][\"Outcome\"]);\n }\n\n let fcmV1OutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"FcmV1OutcomeCounts\"])) {\n fcmV1OutcomeCounts = parseOutcomeCounts(notificationDetails[\"FcmV1OutcomeCounts\"][\"Outcome\"]);\n }\n\n let xiaomiOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"XiaomiOutcomeCounts\"])) {\n xiaomiOutcomeCounts = parseOutcomeCounts(notificationDetails[\"XiaomiOutcomeCounts\"][\"Outcome\"]);\n }\n\n let wnsOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"WnsOutcomeCounts\"])) {\n wnsOutcomeCounts = parseOutcomeCounts(notificationDetails[\"WnsOutcomeCounts\"][\"Outcome\"]);\n }\n\n return {\n notificationId: getStringOrUndefined(notificationDetails[\"NotificationId\"])?.trim(),\n location: getStringOrUndefined(notificationDetails[\"Location\"])?.trim(),\n state: getStringOrUndefined(notificationDetails[\"State\"])?.trim() as NotificationOutcomeState,\n enqueueTime: getDateOrUndefined(notificationDetails[\"EnqueueTime\"]),\n startTime: getDateOrUndefined(notificationDetails[\"StartTime\"]),\n endTime: getDateOrUndefined(notificationDetails[\"EndTime\"]),\n pnsErrorDetailsUrl: getStringOrUndefined(notificationDetails[\"PnsErrorDetailsUri\"])?.trim(),\n targetPlatforms: getStringOrUndefined(notificationDetails[\"TargetPlatforms\"])?.trim(),\n notificationBody: getStringOrUndefined(notificationDetails[\"NotificationBody\"])?.trim(),\n apnsOutcomeCounts,\n admOutcomeCounts,\n baiduOutcomeCounts,\n browserOutcomeCounts,\n fcmOutcomeCounts,\n fcmV1OutcomeCounts,\n xiaomiOutcomeCounts,\n wnsOutcomeCounts,\n };\n}\n\nfunction parseOutcomeCounts(\n counts: Record<string, any>[] | Record<string, any>,\n): NotificationOutcome[] {\n const items = Array.isArray(counts) ? counts : [counts];\n const results: NotificationOutcome[] = [];\n for (const item of items) {\n results.push({ state: item[\"Name\"], count: getInteger(item[\"Count\"], \"Count\") });\n }\n\n return results;\n}\n"]}
@@ -60,7 +60,6 @@ function createInputOutputProperties(content) {
60
60
  return props;
61
61
  }
62
62
  function createNotificationHubJob(content) {
63
- var _a, _b, _c, _d;
64
63
  let outputProperties;
65
64
  if ((0, utils_js_1.isDefined)(content["OutputProperties"])) {
66
65
  outputProperties = createInputOutputProperties(content["OutputProperties"]);
@@ -70,13 +69,13 @@ function createNotificationHubJob(content) {
70
69
  inputProperties = createInputOutputProperties(content["InputProperties"]);
71
70
  }
72
71
  return {
73
- jobId: (_a = (0, utils_js_1.getStringOrUndefined)(content["JobId"])) === null || _a === void 0 ? void 0 : _a.trim(),
72
+ jobId: (0, utils_js_1.getStringOrUndefined)(content["JobId"])?.trim(),
74
73
  type: (0, utils_js_1.getString)(content["Type"], "type").trim(),
75
- status: (_b = (0, utils_js_1.getStringOrUndefined)(content["Status"])) === null || _b === void 0 ? void 0 : _b.trim(),
74
+ status: (0, utils_js_1.getStringOrUndefined)(content["Status"])?.trim(),
76
75
  progress: (0, utils_js_1.getFloatOrUndefined)(content["Progress"]),
77
76
  outputContainerUrl: (0, utils_js_1.getString)(content["OutputContainerUri"], "outputContainerUrl").trim(),
78
- importFileUrl: (_c = (0, utils_js_1.getStringOrUndefined)(content["ImportFileUri"])) === null || _c === void 0 ? void 0 : _c.trim(),
79
- failure: (_d = (0, utils_js_1.getStringOrUndefined)(content["Failure"])) === null || _d === void 0 ? void 0 : _d.trim(),
77
+ importFileUrl: (0, utils_js_1.getStringOrUndefined)(content["ImportFileUri"])?.trim(),
78
+ failure: (0, utils_js_1.getStringOrUndefined)(content["Failure"])?.trim(),
80
79
  createdAt: (0, utils_js_1.getDateOrUndefined)(content["CreatedAt"]),
81
80
  updatedAt: (0, utils_js_1.getDateOrUndefined)(content["UpdatedAt"]),
82
81
  inputProperties,
@@ -1 +1 @@
1
- {"version":3,"file":"notificationHubJobSerializer.js","sourceRoot":"","sources":["../../../src/serializers/notificationHubJobSerializer.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAuBlC,4EAUC;AAOD,oEAIC;AAOD,kEAeC;AA3DD,gDAM2B;AAC3B,8CAAyD;AACzD,sDAAiE;AAEjE;;;;;GAKG;AACH,SAAgB,gCAAgC,CAAC,KAAyB;IACxE,MAAM,GAAG,GAAwB;QAC/B,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,kBAAkB,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,kBAAkB,EAAE;QACzD,aAAa,EAAE,IAAA,oBAAS,EAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,SAAS;KAC7F,CAAC;IAEF,MAAM,aAAa,GAAG,IAAA,uCAAyB,EAAC,oBAAoB,EAAE,GAAG,CAAC,CAAC;IAE3E,OAAO,IAAA,uBAAY,EAAC,aAAa,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC,CAAC;AACtF,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,4BAA4B,CAAC,QAAgB;IACjE,MAAM,GAAG,GAAG,MAAM,IAAA,mBAAQ,EAAC,QAAQ,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5D,MAAM,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC;IACrD,OAAO,wBAAwB,CAAC,OAAO,CAAC,CAAC;AAC3C,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,2BAA2B,CAAC,QAAgB;IAChE,MAAM,GAAG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G,2BAA2B,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAC9E,CAAC;IAED,IAAI,eAAmD,CAAC;IACxD,IAAI,IAAA,oBAAS,EAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,EAAE,CAAC;QAC1C,eAAe,GAAG,2BAA2B,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAC5E,CAAC;IAED,OAAO;QACL,KAAK,EAAE,MAAA,IAAA,+BAAoB,EAAC,OAAO,CAAC,OAAO,CAAC,CAAC,0CAAE,IAAI,EAAE;QACrD,IAAI,EAAE,IAAA,oBAAS,EAAC,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,IAAI,EAA4B;QACzE,MAAM,EAAE,MAAA,IAAA,+BAAoB,EAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,0CAAE,IAAI,EAA8B;QACnF,QAAQ,EAAE,IAAA,8BAAmB,EAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAClD,kBAAkB,EAAE,IAAA,oBAAS,EAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC,CAAC,IAAI,EAAE;QACzF,aAAa,EAAE,MAAA,IAAA,+BAAoB,EAAC,OAAO,CAAC,eAAe,CAAC,CAAC,0CAAE,IAAI,EAAE;QACrE,OAAO,EAAE,MAAA,IAAA,+BAAoB,EAAC,OAAO,CAAC,SAAS,CAAC,CAAC,0CAAE,IAAI,EAAE;QACzD,SAAS,EAAE,IAAA,6BAAkB,EAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QACnD,SAAS,EAAE,IAAA,6BAAkB,EAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QACnD,eAAe;QACf,gBAAgB;KACjB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n NotificationHubJob,\n NotificationHubJobStatus,\n NotificationHubJobType,\n} from \"../models/notificationHubJob.js\";\nimport {\n getDateOrUndefined,\n getFloatOrUndefined,\n getString,\n getStringOrUndefined,\n isDefined,\n} from \"../utils/utils.js\";\nimport { parseXML, stringifyXML } from \"@azure/core-xml\";\nimport { serializeToAtomXmlRequest } from \"../utils/xmlUtils.js\";\n\n/**\n * @internal\n * Serializes a NotificationHubJob into an Atom XML entry.\n * @param entry - The NotificationHubJob to turn into an Atom XML entry.\n * @returns An Atom XML entry containing the notification hub job.\n */\nexport function serializeNotificationHubJobEntry(entry: NotificationHubJob): string {\n const job: Record<string, any> = {\n Type: entry.type,\n OutputContainerUri: { __cdata: entry.outputContainerUrl },\n ImportFileUri: isDefined(entry.importFileUrl) ? { __cdata: entry.importFileUrl } : undefined,\n };\n\n const requestObject = serializeToAtomXmlRequest(\"NotificationHubJob\", job);\n\n return stringifyXML(requestObject, { rootName: \"entry\", cdataPropName: \"__cdata\" });\n}\n\n/**\n * Parses an Atom XML of an notification hub job entry.\n * @param bodyText - The incoming Atom XML entry to parse into a notification hub job.\n * @returns A parsed NotificationHubJob.\n */\nexport async function parseNotificationHubJobEntry(bodyText: string): Promise<NotificationHubJob> {\n const xml = await parseXML(bodyText, { includeRoot: true });\n const content = xml.entry.content.NotificationHubJob;\n return createNotificationHubJob(content);\n}\n\n/**\n * Parses an Atom XML feed of notification hub jobs.\n * @param bodyText - The incoming Atom XML feed to parse into notification hub jobs.\n * @returns A list of notification hub jobs.\n */\nexport async function parseNotificationHubJobFeed(bodyText: string): Promise<NotificationHubJob[]> {\n const xml = await parseXML(bodyText, { includeRoot: true });\n const results: NotificationHubJob[] = [];\n\n if (!isDefined(xml.feed.entry)) {\n return results;\n }\n\n const entries = Array.isArray(xml.feed.entry) ? xml.feed.entry : [xml.feed.entry];\n\n for (const item of entries) {\n results.push(createNotificationHubJob(item.content.NotificationHubJob));\n }\n\n return results;\n}\n\nfunction createInputOutputProperties(content: Record<string, any>): Record<string, string> {\n const props: Record<string, string> = {};\n\n const keyValues = content[\"d3p1:KeyValueOfstringstring\"];\n const keyValueArray = Array.isArray(keyValues) ? keyValues : [keyValues];\n for (const item of keyValueArray) {\n props[item[\"d3p1:Key\"]] = item[\"d3p1:Value\"];\n }\n\n return props;\n}\n\nfunction createNotificationHubJob(content: Record<string, any>): NotificationHubJob {\n let outputProperties: Record<string, string> | undefined;\n if (isDefined(content[\"OutputProperties\"])) {\n outputProperties = createInputOutputProperties(content[\"OutputProperties\"]);\n }\n\n let inputProperties: Record<string, string> | undefined;\n if (isDefined(content[\"InputProperties\"])) {\n inputProperties = createInputOutputProperties(content[\"InputProperties\"]);\n }\n\n return {\n jobId: getStringOrUndefined(content[\"JobId\"])?.trim(),\n type: getString(content[\"Type\"], \"type\").trim() as NotificationHubJobType,\n status: getStringOrUndefined(content[\"Status\"])?.trim() as NotificationHubJobStatus,\n progress: getFloatOrUndefined(content[\"Progress\"]),\n outputContainerUrl: getString(content[\"OutputContainerUri\"], \"outputContainerUrl\").trim(),\n importFileUrl: getStringOrUndefined(content[\"ImportFileUri\"])?.trim(),\n failure: getStringOrUndefined(content[\"Failure\"])?.trim(),\n createdAt: getDateOrUndefined(content[\"CreatedAt\"]),\n updatedAt: getDateOrUndefined(content[\"UpdatedAt\"]),\n inputProperties,\n outputProperties,\n };\n}\n"]}
1
+ {"version":3,"file":"notificationHubJobSerializer.js","sourceRoot":"","sources":["../../../src/serializers/notificationHubJobSerializer.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAuBlC,4EAUC;AAOD,oEAIC;AAOD,kEAeC;AA3DD,gDAM2B;AAC3B,8CAAyD;AACzD,sDAAiE;AAEjE;;;;;GAKG;AACH,SAAgB,gCAAgC,CAAC,KAAyB;IACxE,MAAM,GAAG,GAAwB;QAC/B,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,kBAAkB,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,kBAAkB,EAAE;QACzD,aAAa,EAAE,IAAA,oBAAS,EAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,C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AC,UAAU,CAAC,CAAC;QAClD,kBAAkB,EAAE,IAAA,oBAAS,EAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC,CAAC,IAAI,EAAE;QACzF,aAAa,EAAE,IAAA,+BAAoB,EAAC,OAAO,CAAC,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE;QACrE,OAAO,EAAE,IAAA,+BAAoB,EAAC,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE;QACzD,SAAS,EAAE,IAAA,6BAAkB,EAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QACnD,SAAS,EAAE,IAAA,6BAAkB,EAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QACnD,eAAe;QACf,gBAAgB;KACjB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n NotificationHubJob,\n NotificationHubJobStatus,\n NotificationHubJobType,\n} from \"../models/notificationHubJob.js\";\nimport {\n getDateOrUndefined,\n getFloatOrUndefined,\n getString,\n getStringOrUndefined,\n isDefined,\n} from \"../utils/utils.js\";\nimport { parseXML, stringifyXML } from \"@azure/core-xml\";\nimport { serializeToAtomXmlRequest } from \"../utils/xmlUtils.js\";\n\n/**\n * @internal\n * Serializes a NotificationHubJob into an Atom XML entry.\n * @param entry - The NotificationHubJob to turn into an Atom XML entry.\n * @returns An Atom XML entry containing the notification hub job.\n */\nexport function serializeNotificationHubJobEntry(entry: NotificationHubJob): string {\n const job: Record<string, any> = {\n Type: entry.type,\n OutputContainerUri: { __cdata: entry.outputContainerUrl },\n ImportFileUri: isDefined(entry.importFileUrl) ? { __cdata: entry.importFileUrl } : undefined,\n };\n\n const requestObject = serializeToAtomXmlRequest(\"NotificationHubJob\", job);\n\n return stringifyXML(requestObject, { rootName: \"entry\", cdataPropName: \"__cdata\" });\n}\n\n/**\n * Parses an Atom XML of an notification hub job entry.\n * @param bodyText - The incoming Atom XML entry to parse into a notification hub job.\n * @returns A parsed NotificationHubJob.\n */\nexport async function parseNotificationHubJobEntry(bodyText: string): Promise<NotificationHubJob> {\n const xml = await parseXML(bodyText, { includeRoot: true });\n const content = xml.entry.content.NotificationHubJob;\n return createNotificationHubJob(content);\n}\n\n/**\n * Parses an Atom XML feed of notification hub jobs.\n * @param bodyText - The incoming Atom XML feed to parse into notification hub jobs.\n * @returns A list of notification hub jobs.\n */\nexport async function parseNotificationHubJobFeed(bodyText: string): Promise<NotificationHubJob[]> {\n const xml = await parseXML(bodyText, { includeRoot: true });\n const results: NotificationHubJob[] = [];\n\n if (!isDefined(xml.feed.entry)) {\n return results;\n }\n\n const entries = Array.isArray(xml.feed.entry) ? xml.feed.entry : [xml.feed.entry];\n\n for (const item of entries) {\n results.push(createNotificationHubJob(item.content.NotificationHubJob));\n }\n\n return results;\n}\n\nfunction createInputOutputProperties(content: Record<string, any>): Record<string, string> {\n const props: Record<string, string> = {};\n\n const keyValues = content[\"d3p1:KeyValueOfstringstring\"];\n const keyValueArray = Array.isArray(keyValues) ? keyValues : [keyValues];\n for (const item of keyValueArray) {\n props[item[\"d3p1:Key\"]] = item[\"d3p1:Value\"];\n }\n\n return props;\n}\n\nfunction createNotificationHubJob(content: Record<string, any>): NotificationHubJob {\n let outputProperties: Record<string, string> | undefined;\n if (isDefined(content[\"OutputProperties\"])) {\n outputProperties = createInputOutputProperties(content[\"OutputProperties\"]);\n }\n\n let inputProperties: Record<string, string> | undefined;\n if (isDefined(content[\"InputProperties\"])) {\n inputProperties = createInputOutputProperties(content[\"InputProperties\"]);\n }\n\n return {\n jobId: getStringOrUndefined(content[\"JobId\"])?.trim(),\n type: getString(content[\"Type\"], \"type\").trim() as NotificationHubJobType,\n status: getStringOrUndefined(content[\"Status\"])?.trim() as NotificationHubJobStatus,\n progress: getFloatOrUndefined(content[\"Progress\"]),\n outputContainerUrl: getString(content[\"OutputContainerUri\"], \"outputContainerUrl\").trim(),\n importFileUrl: getStringOrUndefined(content[\"ImportFileUri\"])?.trim(),\n failure: getStringOrUndefined(content[\"Failure\"])?.trim(),\n createdAt: getDateOrUndefined(content[\"CreatedAt\"]),\n updatedAt: getDateOrUndefined(content[\"UpdatedAt\"]),\n inputProperties,\n outputProperties,\n };\n}\n"]}