@esri/hub-common 15.37.1 → 15.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/dist/esm/discussions/api/channels/channels.js +188 -0
  2. package/dist/esm/discussions/api/channels/channels.js.map +1 -1
  3. package/dist/esm/discussions/api/index.js +8 -2
  4. package/dist/esm/discussions/api/index.js.map +1 -1
  5. package/dist/esm/discussions/api/posts/index.js +2 -0
  6. package/dist/esm/discussions/api/posts/index.js.map +1 -0
  7. package/dist/esm/discussions/api/posts/posts.js +225 -0
  8. package/dist/esm/discussions/api/posts/posts.js.map +1 -0
  9. package/dist/esm/discussions/api/reactions/index.js +2 -0
  10. package/dist/esm/discussions/api/reactions/index.js.map +1 -0
  11. package/dist/esm/discussions/api/reactions/reactions.js +53 -0
  12. package/dist/esm/discussions/api/reactions/reactions.js.map +1 -0
  13. package/dist/esm/discussions/api/utils/channel-permission.js +359 -0
  14. package/dist/esm/discussions/api/utils/channel-permission.js.map +1 -0
  15. package/dist/esm/discussions/api/utils/channels/can-create-channel-v2.js +13 -0
  16. package/dist/esm/discussions/api/utils/channels/can-create-channel-v2.js.map +1 -0
  17. package/dist/esm/discussions/api/utils/channels/can-create-channel.js +54 -0
  18. package/dist/esm/discussions/api/utils/channels/can-create-channel.js.map +1 -0
  19. package/dist/esm/discussions/api/utils/channels/can-delete-channel-v2.js +17 -0
  20. package/dist/esm/discussions/api/utils/channels/can-delete-channel-v2.js.map +1 -0
  21. package/dist/esm/discussions/api/utils/channels/can-delete-channel.js +17 -0
  22. package/dist/esm/discussions/api/utils/channels/can-delete-channel.js.map +1 -0
  23. package/dist/esm/discussions/api/utils/channels/can-edit-channel-v2.js +19 -0
  24. package/dist/esm/discussions/api/utils/channels/can-edit-channel-v2.js.map +1 -0
  25. package/dist/esm/discussions/api/utils/channels/can-edit-channel.js +17 -0
  26. package/dist/esm/discussions/api/utils/channels/can-edit-channel.js.map +1 -0
  27. package/dist/esm/discussions/api/utils/channels/can-modify-channel.js +18 -0
  28. package/dist/esm/discussions/api/utils/channels/can-modify-channel.js.map +1 -0
  29. package/dist/esm/discussions/api/utils/channels/can-post-to-channel.js +57 -0
  30. package/dist/esm/discussions/api/utils/channels/can-post-to-channel.js.map +1 -0
  31. package/dist/esm/discussions/api/utils/channels/can-read-channel-v2.js +18 -0
  32. package/dist/esm/discussions/api/utils/channels/can-read-channel-v2.js.map +1 -0
  33. package/dist/esm/discussions/api/utils/channels/can-read-channel.js +52 -0
  34. package/dist/esm/discussions/api/utils/channels/can-read-channel.js.map +1 -0
  35. package/dist/esm/discussions/api/utils/channels/channel-to-dto-map.js +11 -0
  36. package/dist/esm/discussions/api/utils/channels/channel-to-dto-map.js.map +1 -0
  37. package/dist/esm/discussions/api/utils/channels/index.js +13 -0
  38. package/dist/esm/discussions/api/utils/channels/index.js.map +1 -0
  39. package/dist/esm/discussions/api/utils/channels/is-authorized-to-modify-channel-by-legacy-permissions.js +44 -0
  40. package/dist/esm/discussions/api/utils/channels/is-authorized-to-modify-channel-by-legacy-permissions.js.map +1 -0
  41. package/dist/esm/discussions/api/utils/platform.js +44 -0
  42. package/dist/esm/discussions/api/utils/platform.js.map +1 -0
  43. package/dist/esm/discussions/api/utils/portal-privilege.js +35 -0
  44. package/dist/esm/discussions/api/utils/portal-privilege.js.map +1 -0
  45. package/dist/esm/discussions/api/utils/posts/can-create-post-v2.js +20 -0
  46. package/dist/esm/discussions/api/utils/posts/can-create-post-v2.js.map +1 -0
  47. package/dist/esm/discussions/api/utils/posts/can-create-post.js +52 -0
  48. package/dist/esm/discussions/api/utils/posts/can-create-post.js.map +1 -0
  49. package/dist/esm/discussions/api/utils/posts/can-create-reply-v2.js +19 -0
  50. package/dist/esm/discussions/api/utils/posts/can-create-reply-v2.js.map +1 -0
  51. package/dist/esm/discussions/api/utils/posts/can-create-reply.js +52 -0
  52. package/dist/esm/discussions/api/utils/posts/can-create-reply.js.map +1 -0
  53. package/dist/esm/discussions/api/utils/posts/can-delete-post-v2.js +24 -0
  54. package/dist/esm/discussions/api/utils/posts/can-delete-post-v2.js.map +1 -0
  55. package/dist/esm/discussions/api/utils/posts/can-delete-post.js +28 -0
  56. package/dist/esm/discussions/api/utils/posts/can-delete-post.js.map +1 -0
  57. package/dist/esm/discussions/api/utils/posts/can-edit-post-status-v2.js +16 -0
  58. package/dist/esm/discussions/api/utils/posts/can-edit-post-status-v2.js.map +1 -0
  59. package/dist/esm/discussions/api/utils/posts/can-edit-post-status.js +61 -0
  60. package/dist/esm/discussions/api/utils/posts/can-edit-post-status.js.map +1 -0
  61. package/dist/esm/discussions/api/utils/posts/can-edit-post-v2.js +19 -0
  62. package/dist/esm/discussions/api/utils/posts/can-edit-post-v2.js.map +1 -0
  63. package/dist/esm/discussions/api/utils/posts/can-edit-post.js +62 -0
  64. package/dist/esm/discussions/api/utils/posts/can-edit-post.js.map +1 -0
  65. package/dist/esm/discussions/api/utils/posts/index.js +15 -0
  66. package/dist/esm/discussions/api/utils/posts/index.js.map +1 -0
  67. package/dist/esm/discussions/api/utils/posts/parse-discussion-uri.js +38 -0
  68. package/dist/esm/discussions/api/utils/posts/parse-discussion-uri.js.map +1 -0
  69. package/dist/esm/discussions/api/utils/posts/parse-mentioned-users.js +19 -0
  70. package/dist/esm/discussions/api/utils/posts/parse-mentioned-users.js.map +1 -0
  71. package/dist/esm/discussions/api/utils/reactions/can-create-reaction-v2.js +27 -0
  72. package/dist/esm/discussions/api/utils/reactions/can-create-reaction-v2.js.map +1 -0
  73. package/dist/esm/discussions/api/utils/reactions/can-create-reaction.js +28 -0
  74. package/dist/esm/discussions/api/utils/reactions/can-create-reaction.js.map +1 -0
  75. package/dist/esm/discussions/api/utils/reactions/index.js +3 -0
  76. package/dist/esm/discussions/api/utils/reactions/index.js.map +1 -0
  77. package/dist/esm/discussions/constants.js +1 -0
  78. package/dist/esm/discussions/constants.js.map +1 -1
  79. package/dist/node/discussions/api/channels/channels.js +205 -1
  80. package/dist/node/discussions/api/channels/channels.js.map +1 -1
  81. package/dist/node/discussions/api/index.js +8 -2
  82. package/dist/node/discussions/api/index.js.map +1 -1
  83. package/dist/node/discussions/api/posts/index.js +5 -0
  84. package/dist/node/discussions/api/posts/index.js.map +1 -0
  85. package/dist/node/discussions/api/posts/posts.js +244 -0
  86. package/dist/node/discussions/api/posts/posts.js.map +1 -0
  87. package/dist/node/discussions/api/reactions/index.js +5 -0
  88. package/dist/node/discussions/api/reactions/index.js.map +1 -0
  89. package/dist/node/discussions/api/reactions/reactions.js +60 -0
  90. package/dist/node/discussions/api/reactions/reactions.js.map +1 -0
  91. package/dist/node/discussions/api/utils/channel-permission.js +363 -0
  92. package/dist/node/discussions/api/utils/channel-permission.js.map +1 -0
  93. package/dist/node/discussions/api/utils/channels/can-create-channel-v2.js +17 -0
  94. package/dist/node/discussions/api/utils/channels/can-create-channel-v2.js.map +1 -0
  95. package/dist/node/discussions/api/utils/channels/can-create-channel.js +58 -0
  96. package/dist/node/discussions/api/utils/channels/can-create-channel.js.map +1 -0
  97. package/dist/node/discussions/api/utils/channels/can-delete-channel-v2.js +21 -0
  98. package/dist/node/discussions/api/utils/channels/can-delete-channel-v2.js.map +1 -0
  99. package/dist/node/discussions/api/utils/channels/can-delete-channel.js +21 -0
  100. package/dist/node/discussions/api/utils/channels/can-delete-channel.js.map +1 -0
  101. package/dist/node/discussions/api/utils/channels/can-edit-channel-v2.js +23 -0
  102. package/dist/node/discussions/api/utils/channels/can-edit-channel-v2.js.map +1 -0
  103. package/dist/node/discussions/api/utils/channels/can-edit-channel.js +21 -0
  104. package/dist/node/discussions/api/utils/channels/can-edit-channel.js.map +1 -0
  105. package/dist/node/discussions/api/utils/channels/can-modify-channel.js +22 -0
  106. package/dist/node/discussions/api/utils/channels/can-modify-channel.js.map +1 -0
  107. package/dist/node/discussions/api/utils/channels/can-post-to-channel.js +61 -0
  108. package/dist/node/discussions/api/utils/channels/can-post-to-channel.js.map +1 -0
  109. package/dist/node/discussions/api/utils/channels/can-read-channel-v2.js +22 -0
  110. package/dist/node/discussions/api/utils/channels/can-read-channel-v2.js.map +1 -0
  111. package/dist/node/discussions/api/utils/channels/can-read-channel.js +57 -0
  112. package/dist/node/discussions/api/utils/channels/can-read-channel.js.map +1 -0
  113. package/dist/node/discussions/api/utils/channels/channel-to-dto-map.js +15 -0
  114. package/dist/node/discussions/api/utils/channels/channel-to-dto-map.js.map +1 -0
  115. package/dist/node/discussions/api/utils/channels/index.js +26 -0
  116. package/dist/node/discussions/api/utils/channels/index.js.map +1 -0
  117. package/dist/node/discussions/api/utils/channels/is-authorized-to-modify-channel-by-legacy-permissions.js +48 -0
  118. package/dist/node/discussions/api/utils/channels/is-authorized-to-modify-channel-by-legacy-permissions.js.map +1 -0
  119. package/dist/node/discussions/api/utils/platform.js +53 -0
  120. package/dist/node/discussions/api/utils/platform.js.map +1 -0
  121. package/dist/node/discussions/api/utils/portal-privilege.js +41 -0
  122. package/dist/node/discussions/api/utils/portal-privilege.js.map +1 -0
  123. package/dist/node/discussions/api/utils/posts/can-create-post-v2.js +24 -0
  124. package/dist/node/discussions/api/utils/posts/can-create-post-v2.js.map +1 -0
  125. package/dist/node/discussions/api/utils/posts/can-create-post.js +56 -0
  126. package/dist/node/discussions/api/utils/posts/can-create-post.js.map +1 -0
  127. package/dist/node/discussions/api/utils/posts/can-create-reply-v2.js +23 -0
  128. package/dist/node/discussions/api/utils/posts/can-create-reply-v2.js.map +1 -0
  129. package/dist/node/discussions/api/utils/posts/can-create-reply.js +56 -0
  130. package/dist/node/discussions/api/utils/posts/can-create-reply.js.map +1 -0
  131. package/dist/node/discussions/api/utils/posts/can-delete-post-v2.js +28 -0
  132. package/dist/node/discussions/api/utils/posts/can-delete-post-v2.js.map +1 -0
  133. package/dist/node/discussions/api/utils/posts/can-delete-post.js +32 -0
  134. package/dist/node/discussions/api/utils/posts/can-delete-post.js.map +1 -0
  135. package/dist/node/discussions/api/utils/posts/can-edit-post-status-v2.js +20 -0
  136. package/dist/node/discussions/api/utils/posts/can-edit-post-status-v2.js.map +1 -0
  137. package/dist/node/discussions/api/utils/posts/can-edit-post-status.js +66 -0
  138. package/dist/node/discussions/api/utils/posts/can-edit-post-status.js.map +1 -0
  139. package/dist/node/discussions/api/utils/posts/can-edit-post-v2.js +23 -0
  140. package/dist/node/discussions/api/utils/posts/can-edit-post-v2.js.map +1 -0
  141. package/dist/node/discussions/api/utils/posts/can-edit-post.js +67 -0
  142. package/dist/node/discussions/api/utils/posts/can-edit-post.js.map +1 -0
  143. package/dist/node/discussions/api/utils/posts/index.js +31 -0
  144. package/dist/node/discussions/api/utils/posts/index.js.map +1 -0
  145. package/dist/node/discussions/api/utils/posts/parse-discussion-uri.js +42 -0
  146. package/dist/node/discussions/api/utils/posts/parse-discussion-uri.js.map +1 -0
  147. package/dist/node/discussions/api/utils/posts/parse-mentioned-users.js +23 -0
  148. package/dist/node/discussions/api/utils/posts/parse-mentioned-users.js.map +1 -0
  149. package/dist/node/discussions/api/utils/reactions/can-create-reaction-v2.js +31 -0
  150. package/dist/node/discussions/api/utils/reactions/can-create-reaction-v2.js.map +1 -0
  151. package/dist/node/discussions/api/utils/reactions/can-create-reaction.js +32 -0
  152. package/dist/node/discussions/api/utils/reactions/can-create-reaction.js.map +1 -0
  153. package/dist/node/discussions/api/utils/reactions/index.js +7 -0
  154. package/dist/node/discussions/api/utils/reactions/index.js.map +1 -0
  155. package/dist/node/discussions/constants.js +2 -1
  156. package/dist/node/discussions/constants.js.map +1 -1
  157. package/dist/types/discussions/api/channels/channels.d.ts +140 -1
  158. package/dist/types/discussions/api/index.d.ts +8 -2
  159. package/dist/types/discussions/api/posts/index.d.ts +1 -0
  160. package/dist/types/discussions/api/posts/posts.d.ts +146 -0
  161. package/dist/types/discussions/api/reactions/index.d.ts +1 -0
  162. package/dist/types/discussions/api/reactions/reactions.d.ts +38 -0
  163. package/dist/types/discussions/api/utils/channel-permission.d.ts +39 -0
  164. package/dist/types/discussions/api/utils/channels/can-create-channel-v2.d.ts +10 -0
  165. package/dist/types/discussions/api/utils/channels/can-create-channel.d.ts +11 -0
  166. package/dist/types/discussions/api/utils/channels/can-delete-channel-v2.d.ts +10 -0
  167. package/dist/types/discussions/api/utils/channels/can-delete-channel.d.ts +11 -0
  168. package/dist/types/discussions/api/utils/channels/can-edit-channel-v2.d.ts +11 -0
  169. package/dist/types/discussions/api/utils/channels/can-edit-channel.d.ts +11 -0
  170. package/dist/types/discussions/api/utils/channels/can-modify-channel.d.ts +11 -0
  171. package/dist/types/discussions/api/utils/channels/can-post-to-channel.d.ts +11 -0
  172. package/dist/types/discussions/api/utils/channels/can-read-channel-v2.d.ts +11 -0
  173. package/dist/types/discussions/api/utils/channels/can-read-channel.d.ts +22 -0
  174. package/dist/types/discussions/api/utils/channels/channel-to-dto-map.d.ts +6 -0
  175. package/dist/types/discussions/api/utils/channels/index.d.ts +10 -0
  176. package/dist/types/discussions/api/utils/channels/is-authorized-to-modify-channel-by-legacy-permissions.d.ts +11 -0
  177. package/dist/types/discussions/api/utils/platform.d.ts +26 -0
  178. package/dist/types/discussions/api/utils/portal-privilege.d.ts +17 -0
  179. package/dist/types/discussions/api/utils/posts/can-create-post-v2.d.ts +10 -0
  180. package/dist/types/discussions/api/utils/posts/can-create-post.d.ts +12 -0
  181. package/dist/types/discussions/api/utils/posts/can-create-reply-v2.d.ts +9 -0
  182. package/dist/types/discussions/api/utils/posts/can-create-reply.d.ts +12 -0
  183. package/dist/types/discussions/api/utils/posts/can-delete-post-v2.d.ts +11 -0
  184. package/dist/types/discussions/api/utils/posts/can-delete-post.d.ts +12 -0
  185. package/dist/types/discussions/api/utils/posts/can-edit-post-status-v2.d.ts +9 -0
  186. package/dist/types/discussions/api/utils/posts/can-edit-post-status.d.ts +20 -0
  187. package/dist/types/discussions/api/utils/posts/can-edit-post-v2.d.ts +10 -0
  188. package/dist/types/discussions/api/utils/posts/can-edit-post.d.ts +22 -0
  189. package/dist/types/discussions/api/utils/posts/index.d.ts +12 -0
  190. package/dist/types/discussions/api/utils/posts/parse-discussion-uri.d.ts +9 -0
  191. package/dist/types/discussions/api/utils/posts/parse-mentioned-users.d.ts +6 -0
  192. package/dist/types/discussions/api/utils/reactions/can-create-reaction-v2.d.ts +12 -0
  193. package/dist/types/discussions/api/utils/reactions/can-create-reaction.d.ts +13 -0
  194. package/dist/types/discussions/api/utils/reactions/index.d.ts +2 -0
  195. package/dist/types/discussions/constants.d.ts +1 -0
  196. package/package.json +1 -1
@@ -1,3 +1,4 @@
1
+ /* tslint:disable unified-signatures */
1
2
  import { discussionsApiRequest, discussionsApiRequestV2, } from "../discussions-api-request";
2
3
  /**
3
4
  * Search for Channels in the Discussions API. Channels define the capabilities,
@@ -24,4 +25,191 @@ export function searchChannelsV2(options) {
24
25
  options.httpMethod = "GET";
25
26
  return discussionsApiRequestV2(`/channels`, options);
26
27
  }
28
+ /**
29
+ * create channel
30
+ *
31
+ * @deprecated replace with createChannelV2 for v2 discussions
32
+ * @export
33
+ * @param {ICreateChannelParams} options
34
+ * @return {*} {Promise<IChannel>}
35
+ */
36
+ export function createChannel(options) {
37
+ options.httpMethod = "POST";
38
+ return discussionsApiRequest(`/channels`, options);
39
+ }
40
+ /**
41
+ * fetch channel
42
+ *
43
+ * @deprecated replace with fetchChannelV2 for v2 discussions
44
+ * @export
45
+ * @param {IFetchChannelParams} options
46
+ * @return {*} {Promise<IChannel>}
47
+ */
48
+ export function fetchChannel(options) {
49
+ options.httpMethod = "GET";
50
+ return discussionsApiRequest(`/channels/${options.channelId}`, options);
51
+ }
52
+ /**
53
+ * update channel
54
+ *
55
+ * @deprecated replace with updateChannelV2 for v2 discussions
56
+ * @export
57
+ * @param {IUpdateChannelParams} options
58
+ * @return {*} {Promise<IChannel>}
59
+ */
60
+ export function updateChannel(options) {
61
+ options.httpMethod = "PATCH";
62
+ return discussionsApiRequest(`/channels/${options.channelId}`, options);
63
+ }
64
+ /**
65
+ * remove channel
66
+ *
67
+ * @deprecated replace with removeChannelV2 for v2 discussions
68
+ * @export
69
+ * @param {IRemoveChannelParams} options
70
+ * @return {*}
71
+ */
72
+ export function removeChannel(options) {
73
+ options.httpMethod = "DELETE";
74
+ return discussionsApiRequest(`/channels/${options.channelId}`, options);
75
+ }
76
+ /**
77
+ * get channel opt out status
78
+ *
79
+ * @deprecated replace with fetchChannelNotifcationOptOutV2 for v2 discussions
80
+ * @export
81
+ * @param {IFetchChannelNotificationOptOutParams} options
82
+ * @return {*}
83
+ */
84
+ export function fetchChannelNotifcationOptOut(options) {
85
+ options.httpMethod = "GET";
86
+ return discussionsApiRequest(`/channels/${options.channelId}/notifications/opt-out`, options);
87
+ }
88
+ /**
89
+ * opt out of channel notifs
90
+ *
91
+ * @deprecated replace with createChannelNotificationOptOutV2 for v2 discussions
92
+ * @export
93
+ * @param {ICreateChannelNotificationOptOutParams} options
94
+ * @return {*}
95
+ */
96
+ export function createChannelNotificationOptOut(options) {
97
+ options.httpMethod = "POST";
98
+ return discussionsApiRequest(`/channels/${options.channelId}/notifications/opt-out`, options);
99
+ }
100
+ /**
101
+ * remove channel notifs
102
+ *
103
+ * @deprecated replace with removeChannelNotificationOptOutV2 for v2 discussions
104
+ * @export
105
+ * @param {IRemoveChannelNotificationOptOutParams} options
106
+ * @return {*}
107
+ */
108
+ export function removeChannelNotificationOptOut(options) {
109
+ options.httpMethod = "DELETE";
110
+ return discussionsApiRequest(`/channels/${options.channelId}/notifications/opt-out`, options);
111
+ }
112
+ /**
113
+ * remove all posts in a channel
114
+ *
115
+ * @deprecated replace with removeChannelActivityV2 for v2 discussions
116
+ * @export
117
+ * @param {IRemoveChannelActivityParams} options
118
+ * @return {*}
119
+ */
120
+ export function removeChannelActivity(options) {
121
+ options.httpMethod = "DELETE";
122
+ return discussionsApiRequest(`/channels/${options.channelId}/activity`, options);
123
+ }
124
+ /*******************************
125
+ * V2
126
+ *******************************/
127
+ /**
128
+ * create channel v2
129
+ *
130
+ * @export
131
+ * @param {ICreateChannelParamsV2} options
132
+ * @return {*} {Promise<IChannel>}
133
+ */
134
+ export function createChannelV2(options) {
135
+ options.httpMethod = "POST";
136
+ return discussionsApiRequestV2(`/channels`, options);
137
+ }
138
+ /**
139
+ * fetch channel V2
140
+ *
141
+ * @export
142
+ * @param {IFetchChannelParams} options
143
+ * @return {*} {Promise<IChannel>}
144
+ */
145
+ export function fetchChannelV2(options) {
146
+ options.httpMethod = "GET";
147
+ return discussionsApiRequestV2(`/channels/${options.channelId}`, options);
148
+ }
149
+ /**
150
+ * update channel V2
151
+ *
152
+ * @export
153
+ * @param {IUpdateChannelParamsV2} options
154
+ * @return {*} {Promise<IChannel>}
155
+ */
156
+ export function updateChannelV2(options) {
157
+ options.httpMethod = "PATCH";
158
+ return discussionsApiRequestV2(`/channels/${options.channelId}`, options);
159
+ }
160
+ /**
161
+ * remove channel V2
162
+ *
163
+ * @export
164
+ * @param {IRemoveChannelParams} options
165
+ * @return {*}
166
+ */
167
+ export function removeChannelV2(options) {
168
+ options.httpMethod = "DELETE";
169
+ return discussionsApiRequestV2(`/channels/${options.channelId}`, options);
170
+ }
171
+ /**
172
+ * get channel opt out status V2
173
+ *
174
+ * @export
175
+ * @param {IFetchChannelNotificationOptOutParams} options
176
+ * @return {*}
177
+ */
178
+ export function fetchChannelNotifcationOptOutV2(options) {
179
+ options.httpMethod = "GET";
180
+ return discussionsApiRequestV2(`/channels/${options.channelId}/notifications/opt-out`, options);
181
+ }
182
+ /**
183
+ * opt out of channel notifs V2
184
+ *
185
+ * @export
186
+ * @param {ICreateChannelNotificationOptOutParams} options
187
+ * @return {*}
188
+ */
189
+ export function createChannelNotificationOptOutV2(options) {
190
+ options.httpMethod = "POST";
191
+ return discussionsApiRequestV2(`/channels/${options.channelId}/notifications/opt-out`, options);
192
+ }
193
+ /**
194
+ * remove channel notifs V2
195
+ *
196
+ * @export
197
+ * @param {IRemoveChannelNotificationOptOutParams} options
198
+ * @return {*}
199
+ */
200
+ export function removeChannelNotificationOptOutV2(options) {
201
+ options.httpMethod = "DELETE";
202
+ return discussionsApiRequestV2(`/channels/${options.channelId}/notifications/opt-out`, options);
203
+ }
204
+ /**
205
+ * remove all posts in a channel V2
206
+ *
207
+ * @export
208
+ * @param {IRemoveChannelActivityParams} options
209
+ * @return {*}
210
+ */
211
+ export function removeChannelActivityV2(options) {
212
+ options.httpMethod = "DELETE";
213
+ return discussionsApiRequestV2(`/channels/${options.channelId}/activity`, options);
214
+ }
27
215
  //# sourceMappingURL=channels.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"channels.js","sourceRoot":"","sources":["../../../../../src/discussions/api/channels/channels.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AAGpC;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAC5B,OAA8B;IAE9B,OAAO,CAAC,UAAU,GAAG,KAAK,CAAC;IAC3B,OAAO,qBAAqB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AACrD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAC9B,OAA8B;IAE9B,OAAO,CAAC,UAAU,GAAG,KAAK,CAAC;IAC3B,OAAO,uBAAuB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AACvD,CAAC"}
1
+ {"version":3,"file":"channels.js","sourceRoot":"","sources":["../../../../../src/discussions/api/channels/channels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,OAAO,EACL,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AAqBpC;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAC5B,OAA8B;IAE9B,OAAO,CAAC,UAAU,GAAG,KAAK,CAAC;IAC3B,OAAO,qBAAqB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AACrD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAC9B,OAA8B;IAE9B,OAAO,CAAC,UAAU,GAAG,KAAK,CAAC;IAC3B,OAAO,uB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,uBAAuB,CAC5B,aAAa,OAAO,CAAC,SAAS,wBAAwB,EACtD,OAAO,CACR,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iCAAiC,CAC/C,OAA+C;IAE/C,OAAO,CAAC,UAAU,GAAG,MAAM,CAAC;IAC5B,OAAO,uBAAuB,CAC5B,aAAa,OAAO,CAAC,SAAS,wBAAwB,EACtD,OAAO,CACR,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iCAAiC,CAC/C,OAA+C;IAE/C,OAAO,CAAC,UAAU,GAAG,QAAQ,CAAC;IAC9B,OAAO,uBAAuB,CAC5B,aAAa,OAAO,CAAC,SAAS,wBAAwB,EACtD,OAAO,CACR,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CACrC,OAAqC;IAErC,OAAO,CAAC,UAAU,GAAG,QAAQ,CAAC;IAC9B,OAAO,uBAAuB,CAC5B,aAAa,OAAO,CAAC,SAAS,WAAW,EACzC,OAAO,CACR,CAAC;AACJ,CAAC"}
@@ -1,5 +1,11 @@
1
- export * from "./channels";
2
- export * from "./settings";
3
1
  export * from "./types";
4
2
  export * from "./discussions-api-request";
3
+ export * from "./channels";
4
+ export * from "./settings";
5
+ export * from "./posts";
6
+ export * from "./reactions";
7
+ export * from "./utils/channels";
8
+ export * from "./utils/posts";
9
+ export * from "./utils/reactions/";
10
+ export * from "./utils/platform";
5
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/discussions/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/discussions/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,2BAA2B,CAAC;AAC1C,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./posts";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/discussions/api/posts/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
@@ -0,0 +1,225 @@
1
+ import { __rest } from "tslib";
2
+ import { discussionsApiRequest, discussionsApiRequestV2, } from "../discussions-api-request";
3
+ import { SearchPostsFormat, } from "../types";
4
+ /**
5
+ * search posts
6
+ *
7
+ * @deprecated use searchPostsV2 instead
8
+ * @export
9
+ * @param {ISearchPostsParams} options
10
+ * @return {*} {Promise<IPagedResponse<IPost>>}
11
+ */
12
+ export function searchPosts(options) {
13
+ const url = `/posts/search`;
14
+ return discussionsApiRequest(url, Object.assign(Object.assign({}, options), { data: Object.assign({}, options.data), httpMethod: "POST" }));
15
+ }
16
+ /**
17
+ * searches for posts and resolves a promise with CSV string representing the results
18
+ *
19
+ * @deprecated use exportPostsV2 instead
20
+ * @export
21
+ * @param {IExportPostsParams} options
22
+ * @return {*} {Promise<string>}
23
+ */
24
+ export function exportPosts(options) {
25
+ const url = `/posts/search`;
26
+ return discussionsApiRequest(url, Object.assign(Object.assign({}, options), { data: Object.assign(Object.assign({}, options.data), { f: SearchPostsFormat.CSV }), httpMethod: "POST" }));
27
+ }
28
+ /**
29
+ * create post
30
+ *
31
+ * @deprecated use createPostV2 instead
32
+ * @export
33
+ * @param {ICreatePostParams} options
34
+ * @return {*} {Promise<IPost>}
35
+ */
36
+ export function createPost(options) {
37
+ const url = `/posts`;
38
+ return discussionsApiRequest(url, Object.assign({ httpMethod: "POST" }, getCreateUpdateRequestParams(options)));
39
+ }
40
+ /**
41
+ * create reply to post
42
+ *
43
+ * @deprecated use createReplyV2 instead
44
+ * @export
45
+ * @param {string} parentId
46
+ * @param {ICreateReplyParams} options
47
+ * @return {*} {Promise<IPost>}
48
+ */
49
+ export function createReply(options) {
50
+ const url = `/posts/${options.postId}/reply`;
51
+ return discussionsApiRequest(url, Object.assign({ httpMethod: "POST" }, getCreateUpdateRequestParams(options)));
52
+ }
53
+ /**
54
+ * fetch post
55
+ *
56
+ * @deprecated use fetchPostV2 instead
57
+ * @export
58
+ * @param {IFetchPostParams} params
59
+ * @return {*} {Promise<IPost>}
60
+ */
61
+ export function fetchPost(params) {
62
+ const url = `/posts/${params.postId}`;
63
+ params.httpMethod = "GET";
64
+ return discussionsApiRequest(url, params);
65
+ }
66
+ /**
67
+ * remove post
68
+ *
69
+ * @deprecated use removePostV2 instead
70
+ * @export
71
+ * @param {IRemovePostParams} options
72
+ * @return {*} {Promise<IRemovePostResponse>}
73
+ */
74
+ export function removePost(options) {
75
+ const url = `/posts/${options.postId}`;
76
+ options.httpMethod = "DELETE";
77
+ return discussionsApiRequest(url, options);
78
+ }
79
+ /**
80
+ * update post
81
+ * NOTE: this method currently only update post.title and post.body
82
+ *
83
+ * @deprecated use updatePostV2 instead
84
+ * @export
85
+ * @param {IUpdatePostParams} options
86
+ * @return {*} {Promise<IPost>}
87
+ */
88
+ export function updatePost(options) {
89
+ const url = `/posts/${options.postId}`;
90
+ return discussionsApiRequest(url, Object.assign({ httpMethod: "PATCH" }, getCreateUpdateRequestParams(options)));
91
+ }
92
+ /**
93
+ * update post status
94
+ * NOTE: this method will only update a post's status
95
+ *
96
+ * @deprecated use updatePostStatusV2 instead
97
+ * @export
98
+ * @param {IUpdatePostStatusParams} options
99
+ * @return {*} {Promise<IPost>}
100
+ */
101
+ export function updatePostStatus(options) {
102
+ const url = `/posts/${options.postId}/status`;
103
+ options.httpMethod = "PATCH";
104
+ return discussionsApiRequest(url, options);
105
+ }
106
+ /**
107
+ * Builds the necessary request options for post/reply create/update requests
108
+ * @param mentionUrl
109
+ */
110
+ function getCreateUpdateRequestParams(params) {
111
+ const { mentionUrl } = params, requestOptions = __rest(params, ["mentionUrl"]);
112
+ if (mentionUrl) {
113
+ requestOptions.headers = Object.assign(Object.assign({}, requestOptions.headers), { "mention-url": mentionUrl });
114
+ }
115
+ return requestOptions;
116
+ }
117
+ /*******************************
118
+ * V2
119
+ *******************************/
120
+ /**
121
+ * search posts V2
122
+ *
123
+ * @export
124
+ * @param {ISearchPostsParams} options
125
+ * @return {*} {Promise<IPagedResponse<IPost>>}
126
+ */
127
+ export function searchPostsV2(options) {
128
+ const url = `/posts/search`;
129
+ return discussionsApiRequestV2(url, Object.assign(Object.assign({}, options), { data: Object.assign({}, options.data), httpMethod: "POST" }));
130
+ }
131
+ /**
132
+ * searches for posts and resolves a promise with CSV string representing the results V2
133
+ *
134
+ * @export
135
+ * @param {IExportPostsParams} options
136
+ * @return {*} {Promise<string>}
137
+ */
138
+ export function exportPostsV2(options) {
139
+ const url = `/posts/search`;
140
+ return discussionsApiRequestV2(url, Object.assign(Object.assign({}, options), { data: Object.assign(Object.assign({}, options.data), { f: SearchPostsFormat.CSV }), httpMethod: "POST" }));
141
+ }
142
+ /**
143
+ * create post
144
+ *
145
+ * @export
146
+ * @param {ICreatePostParamsV2} options
147
+ * @return {*} {Promise<IPost>}
148
+ */
149
+ export function createPostV2(options) {
150
+ const url = `/posts`;
151
+ return discussionsApiRequestV2(url, Object.assign({ httpMethod: "POST" }, getCreateUpdateRequestParamsV2(options)));
152
+ }
153
+ /**
154
+ * create reply to post
155
+ *
156
+ * @export
157
+ * @param {string} parentId
158
+ * @param {ICreateReplyParams} options
159
+ * @return {*} {Promise<IPost>}
160
+ */
161
+ export function createReplyV2(options) {
162
+ const url = `/posts/${options.postId}/reply`;
163
+ return discussionsApiRequestV2(url, Object.assign({ httpMethod: "POST" }, getCreateUpdateRequestParamsV2(options)));
164
+ }
165
+ /**
166
+ * fetch post
167
+ *
168
+ * @export
169
+ * @param {IFetchPostParams} params
170
+ * @return {*} {Promise<IPost>}
171
+ */
172
+ export function fetchPostV2(params) {
173
+ const url = `/posts/${params.postId}`;
174
+ params.httpMethod = "GET";
175
+ return discussionsApiRequestV2(url, params);
176
+ }
177
+ /**
178
+ * remove post
179
+ *
180
+ * @export
181
+ * @param {IRemovePostParams} options
182
+ * @return {*} {Promise<IRemovePostResponse>}
183
+ */
184
+ export function removePostV2(options) {
185
+ const url = `/posts/${options.postId}`;
186
+ options.httpMethod = "DELETE";
187
+ return discussionsApiRequestV2(url, options);
188
+ }
189
+ /**
190
+ * update post
191
+ * NOTE: this method currently only update post.title and post.body
192
+ *
193
+ * @export
194
+ * @param {IUpdatePostParams} options
195
+ * @return {*} {Promise<IPost>}
196
+ */
197
+ export function updatePostV2(options) {
198
+ const url = `/posts/${options.postId}`;
199
+ return discussionsApiRequestV2(url, Object.assign({ httpMethod: "PATCH" }, getCreateUpdateRequestParamsV2(options)));
200
+ }
201
+ /**
202
+ * update post status
203
+ * NOTE: this method will only update a post's status
204
+ *
205
+ * @export
206
+ * @param {IUpdatePostStatusParams} options
207
+ * @return {*} {Promise<IPost>}
208
+ */
209
+ export function updatePostStatusV2(options) {
210
+ const url = `/posts/${options.postId}/status`;
211
+ options.httpMethod = "PATCH";
212
+ return discussionsApiRequestV2(url, options);
213
+ }
214
+ /**
215
+ * Builds the necessary request options for post/reply create/update requests
216
+ * @param mentionUrl
217
+ */
218
+ function getCreateUpdateRequestParamsV2(params) {
219
+ const { mentionUrl } = params, requestOptions = __rest(params, ["mentionUrl"]);
220
+ if (mentionUrl) {
221
+ requestOptions.headers = Object.assign(Object.assign({}, requestOptions.headers), { "mention-url": mentionUrl });
222
+ }
223
+ return requestOptions;
224
+ }
225
+ //# sourceMappingURL=posts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"posts.js","sourceRoot":"","sources":["../../../../../src/discussions/api/posts/posts.ts"],"names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MAAM,GAAG,GAAG,UAAU,OAAO,CAAC,MAAM,EAAE,CAAC;IACvC,OAAO,uBAAuB,CAAC,GAAG,kBAChC,UAAU,EAAE,OAAO,IAChB,8BAA8B,CAAC,OAAO,CAAC,EAC1C,CAAC;AACL,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAAgC;IAEhC,MAAM,GAAG,GAAG,UAAU,OAAO,CAAC,MAAM,SAAS,CAAC;IAC9C,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC;IAC7B,OAAO,uBAAuB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAC/C,CAAC;AAED;;;GAGG;AACH,SAAS,8BAA8B,CAErC,MAAS;IACT,MAAM,EAAE,UAAU,KAAwB,MAAM,EAAzB,cAAc,UAAK,MAAM,EAA1C,cAAiC,CAAS,CAAC;IACjD,IAAI,UAAU,EAAE;QACd,cAAc,CAAC,OAAO,mCACjB,cAAc,CAAC,OAAO,KACzB,aAAa,EAAE,UAAU,GAC1B,CAAC;KACH;IACD,OAAO,cAAmB,CAAC;AAC7B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./reactions";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/discussions/api/reactions/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
@@ -0,0 +1,53 @@
1
+ import { discussionsApiRequest, discussionsApiRequestV2, } from "../discussions-api-request";
2
+ /**
3
+ * create reaction to post
4
+ *
5
+ * @deprecated use createReactionV2 instead
6
+ * @export
7
+ * @param {ICreateReactionOptions} options
8
+ * @return {*} {Promise<IReaction>}
9
+ */
10
+ export function createReaction(options) {
11
+ options.httpMethod = "POST";
12
+ return discussionsApiRequest(`/reactions`, options);
13
+ }
14
+ /**
15
+ * remove reaction
16
+ *
17
+ * @deprecated use removeReactionV2 instead
18
+ * @export
19
+ * @param {IRemoveReactionOptions} options
20
+ * @return {*} {Promise<IRemoveReactionResponse>}
21
+ */
22
+ export function removeReaction(options) {
23
+ const { reactionId } = options;
24
+ options.httpMethod = "DELETE";
25
+ return discussionsApiRequest(`/reactions/${reactionId}`, options);
26
+ }
27
+ /*******************************
28
+ * V2
29
+ *******************************/
30
+ /**
31
+ * create reaction to post
32
+ *
33
+ * @export
34
+ * @param {ICreateReactionOptions} options
35
+ * @return {*} {Promise<IReaction>}
36
+ */
37
+ export function createReactionV2(options) {
38
+ options.httpMethod = "POST";
39
+ return discussionsApiRequestV2(`/reactions`, options);
40
+ }
41
+ /**
42
+ * remove reaction
43
+ *
44
+ * @export
45
+ * @param {IRemoveReactionOptions} options
46
+ * @return {*} {Promise<IRemoveReactionResponse>}
47
+ */
48
+ export function removeReactionV2(options) {
49
+ const { reactionId } = options;
50
+ options.httpMethod = "DELETE";
51
+ return discussionsApiRequestV2(`/reactions/${reactionId}`, options);
52
+ }
53
+ //# sourceMappingURL=reactions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reactions.js","sourceRoot":"","sources":["../../../../../src/discussions/api/reactions/reactions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AAQpC;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAC5B,OAA+B;IAE/B,OAAO,CAAC,UAAU,GAAG,MAAM,CAAC;IAC5B,OAAO,qBAAqB,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;AACtD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAC5B,OAA+B;IAE/B,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IAC/B,OAAO,CAAC,UAAU,GAAG,QAAQ,CAAC;IAC9B,OAAO,qBAAqB,CAAC,cAAc,UAAU,EAAE,EAAE,OAAO,CAAC,CAAC;AACpE,CAAC;AAED;;iCAEiC;AAEjC;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAC9B,OAA+B;IAE/B,OAAO,CAAC,UAAU,GAAG,MAAM,CAAC;IAC5B,OAAO,uBAAuB,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;AACxD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAC9B,OAA+B;IAE/B,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IAC/B,OAAO,CAAC,UAAU,GAAG,QAAQ,CAAC;IAC9B,OAAO,uBAAuB,CAAC,cAAc,UAAU,EAAE,EAAE,OAAO,CAAC,CAAC;AACtE,CAAC"}