@wix/auto_sdk_comments_comments 1.0.10 → 1.0.12

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 (129) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/comments-v2-comment-comments.context.d.ts +68 -0
  11. package/build/cjs/src/comments-v2-comment-comments.context.js +109 -0
  12. package/build/cjs/src/comments-v2-comment-comments.context.js.map +1 -0
  13. package/build/cjs/src/comments-v2-comment-comments.http.d.ts +90 -0
  14. package/build/cjs/src/comments-v2-comment-comments.http.js +2533 -0
  15. package/build/cjs/src/comments-v2-comment-comments.http.js.map +1 -0
  16. package/build/cjs/src/comments-v2-comment-comments.meta.d.ts +48 -0
  17. package/build/cjs/src/comments-v2-comment-comments.meta.js +370 -0
  18. package/build/cjs/src/comments-v2-comment-comments.meta.js.map +1 -0
  19. package/build/cjs/src/comments-v2-comment-comments.public.d.ts +202 -0
  20. package/build/cjs/src/comments-v2-comment-comments.public.js +1341 -0
  21. package/build/cjs/src/comments-v2-comment-comments.public.js.map +1 -0
  22. package/build/{internal/meta.d.mts → cjs/src/comments-v2-comment-comments.types.d.ts} +558 -240
  23. package/build/cjs/src/comments-v2-comment-comments.types.js +386 -0
  24. package/build/cjs/src/comments-v2-comment-comments.types.js.map +1 -0
  25. package/build/{comments-v2-comment-comments.universal-Bt560XJw.d.mts → cjs/src/comments-v2-comment-comments.universal.d.ts} +693 -254
  26. package/build/cjs/src/comments-v2-comment-comments.universal.js +1574 -0
  27. package/build/cjs/src/comments-v2-comment-comments.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/src/comments-v2-comment-comments.context.d.ts +68 -0
  38. package/build/es/src/comments-v2-comment-comments.context.js +68 -0
  39. package/build/es/src/comments-v2-comment-comments.context.js.map +1 -0
  40. package/build/es/src/comments-v2-comment-comments.http.d.ts +90 -0
  41. package/build/es/src/comments-v2-comment-comments.http.js +2512 -0
  42. package/build/es/src/comments-v2-comment-comments.http.js.map +1 -0
  43. package/build/es/src/comments-v2-comment-comments.meta.d.ts +48 -0
  44. package/build/es/src/comments-v2-comment-comments.meta.js +326 -0
  45. package/build/es/src/comments-v2-comment-comments.meta.js.map +1 -0
  46. package/build/es/src/comments-v2-comment-comments.public.d.ts +202 -0
  47. package/build/es/src/comments-v2-comment-comments.public.js +1282 -0
  48. package/build/es/src/comments-v2-comment-comments.public.js.map +1 -0
  49. package/build/{internal/meta.d.ts → es/src/comments-v2-comment-comments.types.d.ts} +558 -240
  50. package/build/es/src/comments-v2-comment-comments.types.js +383 -0
  51. package/build/es/src/comments-v2-comment-comments.types.js.map +1 -0
  52. package/build/{comments-v2-comment-comments.universal-Bt560XJw.d.ts → es/src/comments-v2-comment-comments.universal.d.ts} +693 -254
  53. package/build/es/src/comments-v2-comment-comments.universal.js +1529 -0
  54. package/build/es/src/comments-v2-comment-comments.universal.js.map +1 -0
  55. package/build/internal/cjs/index.d.ts +1 -0
  56. package/build/internal/cjs/index.js +18 -0
  57. package/build/internal/cjs/index.js.map +1 -0
  58. package/build/internal/cjs/index.typings.d.ts +1 -0
  59. package/build/internal/cjs/index.typings.js +18 -0
  60. package/build/internal/cjs/index.typings.js.map +1 -0
  61. package/build/internal/cjs/meta.d.ts +1 -0
  62. package/build/internal/cjs/meta.js +18 -0
  63. package/build/internal/cjs/meta.js.map +1 -0
  64. package/build/internal/cjs/src/comments-v2-comment-comments.context.d.ts +68 -0
  65. package/build/internal/cjs/src/comments-v2-comment-comments.context.js +109 -0
  66. package/build/internal/cjs/src/comments-v2-comment-comments.context.js.map +1 -0
  67. package/build/internal/cjs/src/comments-v2-comment-comments.http.d.ts +90 -0
  68. package/build/internal/cjs/src/comments-v2-comment-comments.http.js +2533 -0
  69. package/build/internal/cjs/src/comments-v2-comment-comments.http.js.map +1 -0
  70. package/build/internal/cjs/src/comments-v2-comment-comments.meta.d.ts +48 -0
  71. package/build/internal/cjs/src/comments-v2-comment-comments.meta.js +370 -0
  72. package/build/internal/cjs/src/comments-v2-comment-comments.meta.js.map +1 -0
  73. package/build/internal/cjs/src/comments-v2-comment-comments.public.d.ts +202 -0
  74. package/build/internal/cjs/src/comments-v2-comment-comments.public.js +1341 -0
  75. package/build/internal/cjs/src/comments-v2-comment-comments.public.js.map +1 -0
  76. package/build/{meta.d.mts → internal/cjs/src/comments-v2-comment-comments.types.d.ts} +558 -240
  77. package/build/internal/cjs/src/comments-v2-comment-comments.types.js +386 -0
  78. package/build/internal/cjs/src/comments-v2-comment-comments.types.js.map +1 -0
  79. package/build/internal/{comments-v2-comment-comments.universal-Bt560XJw.d.ts → cjs/src/comments-v2-comment-comments.universal.d.ts} +693 -254
  80. package/build/internal/cjs/src/comments-v2-comment-comments.universal.js +1574 -0
  81. package/build/internal/cjs/src/comments-v2-comment-comments.universal.js.map +1 -0
  82. package/build/internal/es/index.d.ts +1 -0
  83. package/build/internal/es/index.js +2 -0
  84. package/build/internal/es/index.js.map +1 -0
  85. package/build/internal/es/index.typings.d.ts +1 -0
  86. package/build/internal/es/index.typings.js +2 -0
  87. package/build/internal/es/index.typings.js.map +1 -0
  88. package/build/internal/es/meta.d.ts +1 -0
  89. package/build/internal/es/meta.js +2 -0
  90. package/build/internal/es/meta.js.map +1 -0
  91. package/build/internal/es/src/comments-v2-comment-comments.context.d.ts +68 -0
  92. package/build/internal/es/src/comments-v2-comment-comments.context.js +68 -0
  93. package/build/internal/es/src/comments-v2-comment-comments.context.js.map +1 -0
  94. package/build/internal/es/src/comments-v2-comment-comments.http.d.ts +90 -0
  95. package/build/internal/es/src/comments-v2-comment-comments.http.js +2512 -0
  96. package/build/internal/es/src/comments-v2-comment-comments.http.js.map +1 -0
  97. package/build/internal/es/src/comments-v2-comment-comments.meta.d.ts +48 -0
  98. package/build/internal/es/src/comments-v2-comment-comments.meta.js +326 -0
  99. package/build/internal/es/src/comments-v2-comment-comments.meta.js.map +1 -0
  100. package/build/internal/es/src/comments-v2-comment-comments.public.d.ts +202 -0
  101. package/build/internal/es/src/comments-v2-comment-comments.public.js +1282 -0
  102. package/build/internal/es/src/comments-v2-comment-comments.public.js.map +1 -0
  103. package/build/{meta.d.ts → internal/es/src/comments-v2-comment-comments.types.d.ts} +558 -240
  104. package/build/internal/es/src/comments-v2-comment-comments.types.js +383 -0
  105. package/build/internal/es/src/comments-v2-comment-comments.types.js.map +1 -0
  106. package/build/internal/{comments-v2-comment-comments.universal-Bt560XJw.d.mts → es/src/comments-v2-comment-comments.universal.d.ts} +693 -254
  107. package/build/internal/es/src/comments-v2-comment-comments.universal.js +1529 -0
  108. package/build/internal/es/src/comments-v2-comment-comments.universal.js.map +1 -0
  109. package/package.json +13 -14
  110. package/build/index.d.mts +0 -249
  111. package/build/index.d.ts +0 -249
  112. package/build/index.js +0 -5232
  113. package/build/index.js.map +0 -1
  114. package/build/index.mjs +0 -5145
  115. package/build/index.mjs.map +0 -1
  116. package/build/internal/index.d.mts +0 -249
  117. package/build/internal/index.d.ts +0 -249
  118. package/build/internal/index.js +0 -5232
  119. package/build/internal/index.js.map +0 -1
  120. package/build/internal/index.mjs +0 -5145
  121. package/build/internal/index.mjs.map +0 -1
  122. package/build/internal/meta.js +0 -2832
  123. package/build/internal/meta.js.map +0 -1
  124. package/build/internal/meta.mjs +0 -2788
  125. package/build/internal/meta.mjs.map +0 -1
  126. package/build/meta.js +0 -2832
  127. package/build/meta.js.map +0 -1
  128. package/build/meta.mjs +0 -2788
  129. package/build/meta.mjs.map +0 -1
@@ -0,0 +1,2512 @@
1
+ import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';
2
+ import { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';
3
+ import { transformRESTFloatToSDKFloat } from '@wix/sdk-runtime/transformations/float';
4
+ import { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';
5
+ import { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';
6
+ import { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';
7
+ import { resolveUrl } from '@wix/sdk-runtime/rest-modules';
8
+ function resolveWixCommentsNgV1CommentsNgUrl(opts) {
9
+ const domainToMappings = {
10
+ 'www.wixapis.com': [
11
+ {
12
+ srcPath: '/comments/v1/comments',
13
+ destPath: '/v1/comments',
14
+ },
15
+ {
16
+ srcPath: '/comments/v1/bulk/comments',
17
+ destPath: '/v1/bulk/comments',
18
+ },
19
+ ],
20
+ _: [
21
+ {
22
+ srcPath: '/_api/comments-ng/v1',
23
+ destPath: '/v1',
24
+ },
25
+ ],
26
+ 'manage._base_domain_': [
27
+ {
28
+ srcPath: '/_api/comments-ng/v1',
29
+ destPath: '/v1',
30
+ },
31
+ ],
32
+ 'www._base_domain_': [
33
+ {
34
+ srcPath: '/_api/comments-ng/v1',
35
+ destPath: '/v1',
36
+ },
37
+ ],
38
+ '*.dev.wix-code.com': [
39
+ {
40
+ srcPath: '/_api/comments-ng',
41
+ destPath: '',
42
+ },
43
+ ],
44
+ };
45
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
46
+ }
47
+ const PACKAGE_NAME = '@wix/auto_sdk_comments_comments';
48
+ /**
49
+ * Creates a new comment and publishes it.
50
+ *
51
+ * The `appId`, `contextId`, and `resourceId` are all required and associate the created comment with the specific
52
+ * resource it responds to. See **Integrations** in the Comments introduction for a list of integrated scopes for these fields.
53
+ *
54
+ * If the created comment is a direct response to another comment, the `commentId` of the parent comment should be passed
55
+ * as `parentComment.id` in this comment's request. See **Terminology** in the Comments introduction for additional information on parent comments and replies.
56
+ */
57
+ export function createComment(payload) {
58
+ function __createComment({ host }) {
59
+ const serializedData = transformPaths(payload, [
60
+ {
61
+ transformFn: transformSDKTimestampToRESTTimestamp,
62
+ paths: [
63
+ { path: 'comment.createdDate' },
64
+ { path: 'comment.updatedDate' },
65
+ { path: 'comment.commentDate' },
66
+ { path: 'comment.content.commentDate' },
67
+ { path: 'comment.content.richContent.metadata.createdTimestamp' },
68
+ { path: 'comment.content.richContent.metadata.updatedTimestamp' },
69
+ { path: 'comment.content.attachments.image.urlExpirationDate' },
70
+ { path: 'comment.content.attachments.video.urlExpirationDate' },
71
+ {
72
+ path: 'comment.content.attachments.video.posters.urlExpirationDate',
73
+ },
74
+ { path: 'comment.content.attachments.audio.urlExpirationDate' },
75
+ { path: 'comment.content.attachments.document.urlExpirationDate' },
76
+ { path: 'comment.draftContent.commentDate' },
77
+ {
78
+ path: 'comment.draftContent.richContent.metadata.createdTimestamp',
79
+ },
80
+ {
81
+ path: 'comment.draftContent.richContent.metadata.updatedTimestamp',
82
+ },
83
+ { path: 'comment.draftContent.attachments.image.urlExpirationDate' },
84
+ { path: 'comment.draftContent.attachments.video.urlExpirationDate' },
85
+ {
86
+ path: 'comment.draftContent.attachments.video.posters.urlExpirationDate',
87
+ },
88
+ { path: 'comment.draftContent.attachments.audio.urlExpirationDate' },
89
+ {
90
+ path: 'comment.draftContent.attachments.document.urlExpirationDate',
91
+ },
92
+ ],
93
+ },
94
+ {
95
+ transformFn: transformSDKFloatToRESTFloat,
96
+ paths: [
97
+ {
98
+ path: 'comment.content.richContent.nodes.galleryData.items.image.media.duration',
99
+ },
100
+ {
101
+ path: 'comment.content.richContent.nodes.galleryData.items.video.media.duration',
102
+ },
103
+ {
104
+ path: 'comment.content.richContent.nodes.galleryData.items.video.thumbnail.duration',
105
+ },
106
+ {
107
+ path: 'comment.content.richContent.nodes.galleryData.options.item.ratio',
108
+ },
109
+ {
110
+ path: 'comment.content.richContent.nodes.imageData.image.duration',
111
+ },
112
+ { path: 'comment.content.richContent.nodes.mapData.mapSettings.lat' },
113
+ { path: 'comment.content.richContent.nodes.mapData.mapSettings.lng' },
114
+ {
115
+ path: 'comment.content.richContent.nodes.pollData.poll.image.duration',
116
+ },
117
+ {
118
+ path: 'comment.content.richContent.nodes.pollData.poll.options.image.duration',
119
+ },
120
+ {
121
+ path: 'comment.content.richContent.nodes.pollData.design.poll.background.image.duration',
122
+ },
123
+ {
124
+ path: 'comment.content.richContent.nodes.appEmbedData.image.duration',
125
+ },
126
+ {
127
+ path: 'comment.content.richContent.nodes.videoData.video.duration',
128
+ },
129
+ {
130
+ path: 'comment.content.richContent.nodes.videoData.thumbnail.duration',
131
+ },
132
+ {
133
+ path: 'comment.content.richContent.nodes.audioData.audio.duration',
134
+ },
135
+ {
136
+ path: 'comment.content.richContent.nodes.audioData.coverImage.duration',
137
+ },
138
+ {
139
+ path: 'comment.draftContent.richContent.nodes.galleryData.items.image.media.duration',
140
+ },
141
+ {
142
+ path: 'comment.draftContent.richContent.nodes.galleryData.items.video.media.duration',
143
+ },
144
+ {
145
+ path: 'comment.draftContent.richContent.nodes.galleryData.items.video.thumbnail.duration',
146
+ },
147
+ {
148
+ path: 'comment.draftContent.richContent.nodes.galleryData.options.item.ratio',
149
+ },
150
+ {
151
+ path: 'comment.draftContent.richContent.nodes.imageData.image.duration',
152
+ },
153
+ {
154
+ path: 'comment.draftContent.richContent.nodes.mapData.mapSettings.lat',
155
+ },
156
+ {
157
+ path: 'comment.draftContent.richContent.nodes.mapData.mapSettings.lng',
158
+ },
159
+ {
160
+ path: 'comment.draftContent.richContent.nodes.pollData.poll.image.duration',
161
+ },
162
+ {
163
+ path: 'comment.draftContent.richContent.nodes.pollData.poll.options.image.duration',
164
+ },
165
+ {
166
+ path: 'comment.draftContent.richContent.nodes.pollData.design.poll.background.image.duration',
167
+ },
168
+ {
169
+ path: 'comment.draftContent.richContent.nodes.appEmbedData.image.duration',
170
+ },
171
+ {
172
+ path: 'comment.draftContent.richContent.nodes.videoData.video.duration',
173
+ },
174
+ {
175
+ path: 'comment.draftContent.richContent.nodes.videoData.thumbnail.duration',
176
+ },
177
+ {
178
+ path: 'comment.draftContent.richContent.nodes.audioData.audio.duration',
179
+ },
180
+ {
181
+ path: 'comment.draftContent.richContent.nodes.audioData.coverImage.duration',
182
+ },
183
+ ],
184
+ },
185
+ ]);
186
+ const metadata = {
187
+ entityFqdn: 'wix.comments.v2.comment',
188
+ method: 'POST',
189
+ methodFqn: 'wix.comments.ng.v1.CommentsNg.CreateComment',
190
+ packageName: PACKAGE_NAME,
191
+ url: resolveWixCommentsNgV1CommentsNgUrl({
192
+ protoPath: '/v1/comments',
193
+ data: serializedData,
194
+ host,
195
+ }),
196
+ data: serializedData,
197
+ transformResponse: (payload) => transformPaths(payload, [
198
+ {
199
+ transformFn: transformRESTTimestampToSDKTimestamp,
200
+ paths: [
201
+ { path: 'comment.createdDate' },
202
+ { path: 'comment.updatedDate' },
203
+ { path: 'comment.commentDate' },
204
+ { path: 'comment.content.commentDate' },
205
+ { path: 'comment.content.richContent.metadata.createdTimestamp' },
206
+ { path: 'comment.content.richContent.metadata.updatedTimestamp' },
207
+ { path: 'comment.content.attachments.image.urlExpirationDate' },
208
+ { path: 'comment.content.attachments.video.urlExpirationDate' },
209
+ {
210
+ path: 'comment.content.attachments.video.posters.urlExpirationDate',
211
+ },
212
+ { path: 'comment.content.attachments.audio.urlExpirationDate' },
213
+ {
214
+ path: 'comment.content.attachments.document.urlExpirationDate',
215
+ },
216
+ { path: 'comment.draftContent.commentDate' },
217
+ {
218
+ path: 'comment.draftContent.richContent.metadata.createdTimestamp',
219
+ },
220
+ {
221
+ path: 'comment.draftContent.richContent.metadata.updatedTimestamp',
222
+ },
223
+ {
224
+ path: 'comment.draftContent.attachments.image.urlExpirationDate',
225
+ },
226
+ {
227
+ path: 'comment.draftContent.attachments.video.urlExpirationDate',
228
+ },
229
+ {
230
+ path: 'comment.draftContent.attachments.video.posters.urlExpirationDate',
231
+ },
232
+ {
233
+ path: 'comment.draftContent.attachments.audio.urlExpirationDate',
234
+ },
235
+ {
236
+ path: 'comment.draftContent.attachments.document.urlExpirationDate',
237
+ },
238
+ ],
239
+ },
240
+ {
241
+ transformFn: transformRESTFloatToSDKFloat,
242
+ paths: [
243
+ {
244
+ path: 'comment.content.richContent.nodes.galleryData.items.image.media.duration',
245
+ },
246
+ {
247
+ path: 'comment.content.richContent.nodes.galleryData.items.video.media.duration',
248
+ },
249
+ {
250
+ path: 'comment.content.richContent.nodes.galleryData.items.video.thumbnail.duration',
251
+ },
252
+ {
253
+ path: 'comment.content.richContent.nodes.galleryData.options.item.ratio',
254
+ },
255
+ {
256
+ path: 'comment.content.richContent.nodes.imageData.image.duration',
257
+ },
258
+ {
259
+ path: 'comment.content.richContent.nodes.mapData.mapSettings.lat',
260
+ },
261
+ {
262
+ path: 'comment.content.richContent.nodes.mapData.mapSettings.lng',
263
+ },
264
+ {
265
+ path: 'comment.content.richContent.nodes.pollData.poll.image.duration',
266
+ },
267
+ {
268
+ path: 'comment.content.richContent.nodes.pollData.poll.options.image.duration',
269
+ },
270
+ {
271
+ path: 'comment.content.richContent.nodes.pollData.design.poll.background.image.duration',
272
+ },
273
+ {
274
+ path: 'comment.content.richContent.nodes.appEmbedData.image.duration',
275
+ },
276
+ {
277
+ path: 'comment.content.richContent.nodes.videoData.video.duration',
278
+ },
279
+ {
280
+ path: 'comment.content.richContent.nodes.videoData.thumbnail.duration',
281
+ },
282
+ {
283
+ path: 'comment.content.richContent.nodes.audioData.audio.duration',
284
+ },
285
+ {
286
+ path: 'comment.content.richContent.nodes.audioData.coverImage.duration',
287
+ },
288
+ {
289
+ path: 'comment.draftContent.richContent.nodes.galleryData.items.image.media.duration',
290
+ },
291
+ {
292
+ path: 'comment.draftContent.richContent.nodes.galleryData.items.video.media.duration',
293
+ },
294
+ {
295
+ path: 'comment.draftContent.richContent.nodes.galleryData.items.video.thumbnail.duration',
296
+ },
297
+ {
298
+ path: 'comment.draftContent.richContent.nodes.galleryData.options.item.ratio',
299
+ },
300
+ {
301
+ path: 'comment.draftContent.richContent.nodes.imageData.image.duration',
302
+ },
303
+ {
304
+ path: 'comment.draftContent.richContent.nodes.mapData.mapSettings.lat',
305
+ },
306
+ {
307
+ path: 'comment.draftContent.richContent.nodes.mapData.mapSettings.lng',
308
+ },
309
+ {
310
+ path: 'comment.draftContent.richContent.nodes.pollData.poll.image.duration',
311
+ },
312
+ {
313
+ path: 'comment.draftContent.richContent.nodes.pollData.poll.options.image.duration',
314
+ },
315
+ {
316
+ path: 'comment.draftContent.richContent.nodes.pollData.design.poll.background.image.duration',
317
+ },
318
+ {
319
+ path: 'comment.draftContent.richContent.nodes.appEmbedData.image.duration',
320
+ },
321
+ {
322
+ path: 'comment.draftContent.richContent.nodes.videoData.video.duration',
323
+ },
324
+ {
325
+ path: 'comment.draftContent.richContent.nodes.videoData.thumbnail.duration',
326
+ },
327
+ {
328
+ path: 'comment.draftContent.richContent.nodes.audioData.audio.duration',
329
+ },
330
+ {
331
+ path: 'comment.draftContent.richContent.nodes.audioData.coverImage.duration',
332
+ },
333
+ ],
334
+ },
335
+ ]),
336
+ };
337
+ return metadata;
338
+ }
339
+ return __createComment;
340
+ }
341
+ /** Retrieves a comment. */
342
+ export function getComment(payload) {
343
+ function __getComment({ host }) {
344
+ const metadata = {
345
+ entityFqdn: 'wix.comments.v2.comment',
346
+ method: 'GET',
347
+ methodFqn: 'wix.comments.ng.v1.CommentsNg.GetComment',
348
+ packageName: PACKAGE_NAME,
349
+ url: resolveWixCommentsNgV1CommentsNgUrl({
350
+ protoPath: '/v1/comments/{commentId}',
351
+ data: payload,
352
+ host,
353
+ }),
354
+ params: toURLSearchParams(payload),
355
+ transformResponse: (payload) => transformPaths(payload, [
356
+ {
357
+ transformFn: transformRESTTimestampToSDKTimestamp,
358
+ paths: [
359
+ { path: 'comment.createdDate' },
360
+ { path: 'comment.updatedDate' },
361
+ { path: 'comment.commentDate' },
362
+ { path: 'comment.content.commentDate' },
363
+ { path: 'comment.content.richContent.metadata.createdTimestamp' },
364
+ { path: 'comment.content.richContent.metadata.updatedTimestamp' },
365
+ { path: 'comment.content.attachments.image.urlExpirationDate' },
366
+ { path: 'comment.content.attachments.video.urlExpirationDate' },
367
+ {
368
+ path: 'comment.content.attachments.video.posters.urlExpirationDate',
369
+ },
370
+ { path: 'comment.content.attachments.audio.urlExpirationDate' },
371
+ {
372
+ path: 'comment.content.attachments.document.urlExpirationDate',
373
+ },
374
+ { path: 'comment.draftContent.commentDate' },
375
+ {
376
+ path: 'comment.draftContent.richContent.metadata.createdTimestamp',
377
+ },
378
+ {
379
+ path: 'comment.draftContent.richContent.metadata.updatedTimestamp',
380
+ },
381
+ {
382
+ path: 'comment.draftContent.attachments.image.urlExpirationDate',
383
+ },
384
+ {
385
+ path: 'comment.draftContent.attachments.video.urlExpirationDate',
386
+ },
387
+ {
388
+ path: 'comment.draftContent.attachments.video.posters.urlExpirationDate',
389
+ },
390
+ {
391
+ path: 'comment.draftContent.attachments.audio.urlExpirationDate',
392
+ },
393
+ {
394
+ path: 'comment.draftContent.attachments.document.urlExpirationDate',
395
+ },
396
+ ],
397
+ },
398
+ {
399
+ transformFn: transformRESTFloatToSDKFloat,
400
+ paths: [
401
+ {
402
+ path: 'comment.content.richContent.nodes.galleryData.items.image.media.duration',
403
+ },
404
+ {
405
+ path: 'comment.content.richContent.nodes.galleryData.items.video.media.duration',
406
+ },
407
+ {
408
+ path: 'comment.content.richContent.nodes.galleryData.items.video.thumbnail.duration',
409
+ },
410
+ {
411
+ path: 'comment.content.richContent.nodes.galleryData.options.item.ratio',
412
+ },
413
+ {
414
+ path: 'comment.content.richContent.nodes.imageData.image.duration',
415
+ },
416
+ {
417
+ path: 'comment.content.richContent.nodes.mapData.mapSettings.lat',
418
+ },
419
+ {
420
+ path: 'comment.content.richContent.nodes.mapData.mapSettings.lng',
421
+ },
422
+ {
423
+ path: 'comment.content.richContent.nodes.pollData.poll.image.duration',
424
+ },
425
+ {
426
+ path: 'comment.content.richContent.nodes.pollData.poll.options.image.duration',
427
+ },
428
+ {
429
+ path: 'comment.content.richContent.nodes.pollData.design.poll.background.image.duration',
430
+ },
431
+ {
432
+ path: 'comment.content.richContent.nodes.appEmbedData.image.duration',
433
+ },
434
+ {
435
+ path: 'comment.content.richContent.nodes.videoData.video.duration',
436
+ },
437
+ {
438
+ path: 'comment.content.richContent.nodes.videoData.thumbnail.duration',
439
+ },
440
+ {
441
+ path: 'comment.content.richContent.nodes.audioData.audio.duration',
442
+ },
443
+ {
444
+ path: 'comment.content.richContent.nodes.audioData.coverImage.duration',
445
+ },
446
+ {
447
+ path: 'comment.draftContent.richContent.nodes.galleryData.items.image.media.duration',
448
+ },
449
+ {
450
+ path: 'comment.draftContent.richContent.nodes.galleryData.items.video.media.duration',
451
+ },
452
+ {
453
+ path: 'comment.draftContent.richContent.nodes.galleryData.items.video.thumbnail.duration',
454
+ },
455
+ {
456
+ path: 'comment.draftContent.richContent.nodes.galleryData.options.item.ratio',
457
+ },
458
+ {
459
+ path: 'comment.draftContent.richContent.nodes.imageData.image.duration',
460
+ },
461
+ {
462
+ path: 'comment.draftContent.richContent.nodes.mapData.mapSettings.lat',
463
+ },
464
+ {
465
+ path: 'comment.draftContent.richContent.nodes.mapData.mapSettings.lng',
466
+ },
467
+ {
468
+ path: 'comment.draftContent.richContent.nodes.pollData.poll.image.duration',
469
+ },
470
+ {
471
+ path: 'comment.draftContent.richContent.nodes.pollData.poll.options.image.duration',
472
+ },
473
+ {
474
+ path: 'comment.draftContent.richContent.nodes.pollData.design.poll.background.image.duration',
475
+ },
476
+ {
477
+ path: 'comment.draftContent.richContent.nodes.appEmbedData.image.duration',
478
+ },
479
+ {
480
+ path: 'comment.draftContent.richContent.nodes.videoData.video.duration',
481
+ },
482
+ {
483
+ path: 'comment.draftContent.richContent.nodes.videoData.thumbnail.duration',
484
+ },
485
+ {
486
+ path: 'comment.draftContent.richContent.nodes.audioData.audio.duration',
487
+ },
488
+ {
489
+ path: 'comment.draftContent.richContent.nodes.audioData.coverImage.duration',
490
+ },
491
+ ],
492
+ },
493
+ ]),
494
+ };
495
+ return metadata;
496
+ }
497
+ return __getComment;
498
+ }
499
+ /**
500
+ * Updates a comment.
501
+ *
502
+ * Each time the comment is updated, `revision` increments by 1. The current `revision` must be
503
+ * passed when updating the comment. This ensures you're working with the latest comment and
504
+ * prevents unintended overwrites.
505
+ */
506
+ export function updateComment(payload) {
507
+ function __updateComment({ host }) {
508
+ const serializedData = transformPaths(payload, [
509
+ {
510
+ transformFn: transformSDKTimestampToRESTTimestamp,
511
+ paths: [
512
+ { path: 'comment.createdDate' },
513
+ { path: 'comment.updatedDate' },
514
+ { path: 'comment.commentDate' },
515
+ { path: 'comment.content.commentDate' },
516
+ { path: 'comment.content.richContent.metadata.createdTimestamp' },
517
+ { path: 'comment.content.richContent.metadata.updatedTimestamp' },
518
+ { path: 'comment.content.attachments.image.urlExpirationDate' },
519
+ { path: 'comment.content.attachments.video.urlExpirationDate' },
520
+ {
521
+ path: 'comment.content.attachments.video.posters.urlExpirationDate',
522
+ },
523
+ { path: 'comment.content.attachments.audio.urlExpirationDate' },
524
+ { path: 'comment.content.attachments.document.urlExpirationDate' },
525
+ { path: 'comment.draftContent.commentDate' },
526
+ {
527
+ path: 'comment.draftContent.richContent.metadata.createdTimestamp',
528
+ },
529
+ {
530
+ path: 'comment.draftContent.richContent.metadata.updatedTimestamp',
531
+ },
532
+ { path: 'comment.draftContent.attachments.image.urlExpirationDate' },
533
+ { path: 'comment.draftContent.attachments.video.urlExpirationDate' },
534
+ {
535
+ path: 'comment.draftContent.attachments.video.posters.urlExpirationDate',
536
+ },
537
+ { path: 'comment.draftContent.attachments.audio.urlExpirationDate' },
538
+ {
539
+ path: 'comment.draftContent.attachments.document.urlExpirationDate',
540
+ },
541
+ ],
542
+ },
543
+ {
544
+ transformFn: transformSDKFloatToRESTFloat,
545
+ paths: [
546
+ {
547
+ path: 'comment.content.richContent.nodes.galleryData.items.image.media.duration',
548
+ },
549
+ {
550
+ path: 'comment.content.richContent.nodes.galleryData.items.video.media.duration',
551
+ },
552
+ {
553
+ path: 'comment.content.richContent.nodes.galleryData.items.video.thumbnail.duration',
554
+ },
555
+ {
556
+ path: 'comment.content.richContent.nodes.galleryData.options.item.ratio',
557
+ },
558
+ {
559
+ path: 'comment.content.richContent.nodes.imageData.image.duration',
560
+ },
561
+ { path: 'comment.content.richContent.nodes.mapData.mapSettings.lat' },
562
+ { path: 'comment.content.richContent.nodes.mapData.mapSettings.lng' },
563
+ {
564
+ path: 'comment.content.richContent.nodes.pollData.poll.image.duration',
565
+ },
566
+ {
567
+ path: 'comment.content.richContent.nodes.pollData.poll.options.image.duration',
568
+ },
569
+ {
570
+ path: 'comment.content.richContent.nodes.pollData.design.poll.background.image.duration',
571
+ },
572
+ {
573
+ path: 'comment.content.richContent.nodes.appEmbedData.image.duration',
574
+ },
575
+ {
576
+ path: 'comment.content.richContent.nodes.videoData.video.duration',
577
+ },
578
+ {
579
+ path: 'comment.content.richContent.nodes.videoData.thumbnail.duration',
580
+ },
581
+ {
582
+ path: 'comment.content.richContent.nodes.audioData.audio.duration',
583
+ },
584
+ {
585
+ path: 'comment.content.richContent.nodes.audioData.coverImage.duration',
586
+ },
587
+ {
588
+ path: 'comment.draftContent.richContent.nodes.galleryData.items.image.media.duration',
589
+ },
590
+ {
591
+ path: 'comment.draftContent.richContent.nodes.galleryData.items.video.media.duration',
592
+ },
593
+ {
594
+ path: 'comment.draftContent.richContent.nodes.galleryData.items.video.thumbnail.duration',
595
+ },
596
+ {
597
+ path: 'comment.draftContent.richContent.nodes.galleryData.options.item.ratio',
598
+ },
599
+ {
600
+ path: 'comment.draftContent.richContent.nodes.imageData.image.duration',
601
+ },
602
+ {
603
+ path: 'comment.draftContent.richContent.nodes.mapData.mapSettings.lat',
604
+ },
605
+ {
606
+ path: 'comment.draftContent.richContent.nodes.mapData.mapSettings.lng',
607
+ },
608
+ {
609
+ path: 'comment.draftContent.richContent.nodes.pollData.poll.image.duration',
610
+ },
611
+ {
612
+ path: 'comment.draftContent.richContent.nodes.pollData.poll.options.image.duration',
613
+ },
614
+ {
615
+ path: 'comment.draftContent.richContent.nodes.pollData.design.poll.background.image.duration',
616
+ },
617
+ {
618
+ path: 'comment.draftContent.richContent.nodes.appEmbedData.image.duration',
619
+ },
620
+ {
621
+ path: 'comment.draftContent.richContent.nodes.videoData.video.duration',
622
+ },
623
+ {
624
+ path: 'comment.draftContent.richContent.nodes.videoData.thumbnail.duration',
625
+ },
626
+ {
627
+ path: 'comment.draftContent.richContent.nodes.audioData.audio.duration',
628
+ },
629
+ {
630
+ path: 'comment.draftContent.richContent.nodes.audioData.coverImage.duration',
631
+ },
632
+ ],
633
+ },
634
+ ]);
635
+ const metadata = {
636
+ entityFqdn: 'wix.comments.v2.comment',
637
+ method: 'PATCH',
638
+ methodFqn: 'wix.comments.ng.v1.CommentsNg.UpdateComment',
639
+ packageName: PACKAGE_NAME,
640
+ url: resolveWixCommentsNgV1CommentsNgUrl({
641
+ protoPath: '/v1/comments/{comment.id}',
642
+ data: serializedData,
643
+ host,
644
+ }),
645
+ data: serializedData,
646
+ transformResponse: (payload) => transformPaths(payload, [
647
+ {
648
+ transformFn: transformRESTTimestampToSDKTimestamp,
649
+ paths: [
650
+ { path: 'comment.createdDate' },
651
+ { path: 'comment.updatedDate' },
652
+ { path: 'comment.commentDate' },
653
+ { path: 'comment.content.commentDate' },
654
+ { path: 'comment.content.richContent.metadata.createdTimestamp' },
655
+ { path: 'comment.content.richContent.metadata.updatedTimestamp' },
656
+ { path: 'comment.content.attachments.image.urlExpirationDate' },
657
+ { path: 'comment.content.attachments.video.urlExpirationDate' },
658
+ {
659
+ path: 'comment.content.attachments.video.posters.urlExpirationDate',
660
+ },
661
+ { path: 'comment.content.attachments.audio.urlExpirationDate' },
662
+ {
663
+ path: 'comment.content.attachments.document.urlExpirationDate',
664
+ },
665
+ { path: 'comment.draftContent.commentDate' },
666
+ {
667
+ path: 'comment.draftContent.richContent.metadata.createdTimestamp',
668
+ },
669
+ {
670
+ path: 'comment.draftContent.richContent.metadata.updatedTimestamp',
671
+ },
672
+ {
673
+ path: 'comment.draftContent.attachments.image.urlExpirationDate',
674
+ },
675
+ {
676
+ path: 'comment.draftContent.attachments.video.urlExpirationDate',
677
+ },
678
+ {
679
+ path: 'comment.draftContent.attachments.video.posters.urlExpirationDate',
680
+ },
681
+ {
682
+ path: 'comment.draftContent.attachments.audio.urlExpirationDate',
683
+ },
684
+ {
685
+ path: 'comment.draftContent.attachments.document.urlExpirationDate',
686
+ },
687
+ ],
688
+ },
689
+ {
690
+ transformFn: transformRESTFloatToSDKFloat,
691
+ paths: [
692
+ {
693
+ path: 'comment.content.richContent.nodes.galleryData.items.image.media.duration',
694
+ },
695
+ {
696
+ path: 'comment.content.richContent.nodes.galleryData.items.video.media.duration',
697
+ },
698
+ {
699
+ path: 'comment.content.richContent.nodes.galleryData.items.video.thumbnail.duration',
700
+ },
701
+ {
702
+ path: 'comment.content.richContent.nodes.galleryData.options.item.ratio',
703
+ },
704
+ {
705
+ path: 'comment.content.richContent.nodes.imageData.image.duration',
706
+ },
707
+ {
708
+ path: 'comment.content.richContent.nodes.mapData.mapSettings.lat',
709
+ },
710
+ {
711
+ path: 'comment.content.richContent.nodes.mapData.mapSettings.lng',
712
+ },
713
+ {
714
+ path: 'comment.content.richContent.nodes.pollData.poll.image.duration',
715
+ },
716
+ {
717
+ path: 'comment.content.richContent.nodes.pollData.poll.options.image.duration',
718
+ },
719
+ {
720
+ path: 'comment.content.richContent.nodes.pollData.design.poll.background.image.duration',
721
+ },
722
+ {
723
+ path: 'comment.content.richContent.nodes.appEmbedData.image.duration',
724
+ },
725
+ {
726
+ path: 'comment.content.richContent.nodes.videoData.video.duration',
727
+ },
728
+ {
729
+ path: 'comment.content.richContent.nodes.videoData.thumbnail.duration',
730
+ },
731
+ {
732
+ path: 'comment.content.richContent.nodes.audioData.audio.duration',
733
+ },
734
+ {
735
+ path: 'comment.content.richContent.nodes.audioData.coverImage.duration',
736
+ },
737
+ {
738
+ path: 'comment.draftContent.richContent.nodes.galleryData.items.image.media.duration',
739
+ },
740
+ {
741
+ path: 'comment.draftContent.richContent.nodes.galleryData.items.video.media.duration',
742
+ },
743
+ {
744
+ path: 'comment.draftContent.richContent.nodes.galleryData.items.video.thumbnail.duration',
745
+ },
746
+ {
747
+ path: 'comment.draftContent.richContent.nodes.galleryData.options.item.ratio',
748
+ },
749
+ {
750
+ path: 'comment.draftContent.richContent.nodes.imageData.image.duration',
751
+ },
752
+ {
753
+ path: 'comment.draftContent.richContent.nodes.mapData.mapSettings.lat',
754
+ },
755
+ {
756
+ path: 'comment.draftContent.richContent.nodes.mapData.mapSettings.lng',
757
+ },
758
+ {
759
+ path: 'comment.draftContent.richContent.nodes.pollData.poll.image.duration',
760
+ },
761
+ {
762
+ path: 'comment.draftContent.richContent.nodes.pollData.poll.options.image.duration',
763
+ },
764
+ {
765
+ path: 'comment.draftContent.richContent.nodes.pollData.design.poll.background.image.duration',
766
+ },
767
+ {
768
+ path: 'comment.draftContent.richContent.nodes.appEmbedData.image.duration',
769
+ },
770
+ {
771
+ path: 'comment.draftContent.richContent.nodes.videoData.video.duration',
772
+ },
773
+ {
774
+ path: 'comment.draftContent.richContent.nodes.videoData.thumbnail.duration',
775
+ },
776
+ {
777
+ path: 'comment.draftContent.richContent.nodes.audioData.audio.duration',
778
+ },
779
+ {
780
+ path: 'comment.draftContent.richContent.nodes.audioData.coverImage.duration',
781
+ },
782
+ ],
783
+ },
784
+ ]),
785
+ };
786
+ return metadata;
787
+ }
788
+ return __updateComment;
789
+ }
790
+ /**
791
+ * Deletes a comment.
792
+ *
793
+ * This method deletes the `content` of the comment and sets its `status` to `DELETED`.
794
+ */
795
+ export function deleteComment(payload) {
796
+ function __deleteComment({ host }) {
797
+ const metadata = {
798
+ entityFqdn: 'wix.comments.v2.comment',
799
+ method: 'DELETE',
800
+ methodFqn: 'wix.comments.ng.v1.CommentsNg.DeleteComment',
801
+ packageName: PACKAGE_NAME,
802
+ url: resolveWixCommentsNgV1CommentsNgUrl({
803
+ protoPath: '/v1/comments/{commentId}',
804
+ data: payload,
805
+ host,
806
+ }),
807
+ params: toURLSearchParams(payload),
808
+ };
809
+ return metadata;
810
+ }
811
+ return __deleteComment;
812
+ }
813
+ /**
814
+ * Moderates the draft content of a comment.
815
+ *
816
+ * - `APPROVE`: Moves `draftContent` to `content` and updates the comment `status` to `PUBLISHED`.
817
+ * - `REJECT`: Clears `draftContent` if comment `status` is `PUBLISHED` or, if comment `status` is `PENDING` it will keep `draftContent` the same and change `status` to `HIDDEN`.
818
+ */
819
+ export function moderateDraftContent(payload) {
820
+ function __moderateDraftContent({ host }) {
821
+ const metadata = {
822
+ entityFqdn: 'wix.comments.v2.comment',
823
+ method: 'POST',
824
+ methodFqn: 'wix.comments.ng.v1.CommentsNg.ModerateDraftContent',
825
+ packageName: PACKAGE_NAME,
826
+ url: resolveWixCommentsNgV1CommentsNgUrl({
827
+ protoPath: '/v1/comments/{commentId}/moderate',
828
+ data: payload,
829
+ host,
830
+ }),
831
+ data: payload,
832
+ transformResponse: (payload) => transformPaths(payload, [
833
+ {
834
+ transformFn: transformRESTTimestampToSDKTimestamp,
835
+ paths: [
836
+ { path: 'comment.createdDate' },
837
+ { path: 'comment.updatedDate' },
838
+ { path: 'comment.commentDate' },
839
+ { path: 'comment.content.commentDate' },
840
+ { path: 'comment.content.richContent.metadata.createdTimestamp' },
841
+ { path: 'comment.content.richContent.metadata.updatedTimestamp' },
842
+ { path: 'comment.content.attachments.image.urlExpirationDate' },
843
+ { path: 'comment.content.attachments.video.urlExpirationDate' },
844
+ {
845
+ path: 'comment.content.attachments.video.posters.urlExpirationDate',
846
+ },
847
+ { path: 'comment.content.attachments.audio.urlExpirationDate' },
848
+ {
849
+ path: 'comment.content.attachments.document.urlExpirationDate',
850
+ },
851
+ { path: 'comment.draftContent.commentDate' },
852
+ {
853
+ path: 'comment.draftContent.richContent.metadata.createdTimestamp',
854
+ },
855
+ {
856
+ path: 'comment.draftContent.richContent.metadata.updatedTimestamp',
857
+ },
858
+ {
859
+ path: 'comment.draftContent.attachments.image.urlExpirationDate',
860
+ },
861
+ {
862
+ path: 'comment.draftContent.attachments.video.urlExpirationDate',
863
+ },
864
+ {
865
+ path: 'comment.draftContent.attachments.video.posters.urlExpirationDate',
866
+ },
867
+ {
868
+ path: 'comment.draftContent.attachments.audio.urlExpirationDate',
869
+ },
870
+ {
871
+ path: 'comment.draftContent.attachments.document.urlExpirationDate',
872
+ },
873
+ ],
874
+ },
875
+ {
876
+ transformFn: transformRESTFloatToSDKFloat,
877
+ paths: [
878
+ {
879
+ path: 'comment.content.richContent.nodes.galleryData.items.image.media.duration',
880
+ },
881
+ {
882
+ path: 'comment.content.richContent.nodes.galleryData.items.video.media.duration',
883
+ },
884
+ {
885
+ path: 'comment.content.richContent.nodes.galleryData.items.video.thumbnail.duration',
886
+ },
887
+ {
888
+ path: 'comment.content.richContent.nodes.galleryData.options.item.ratio',
889
+ },
890
+ {
891
+ path: 'comment.content.richContent.nodes.imageData.image.duration',
892
+ },
893
+ {
894
+ path: 'comment.content.richContent.nodes.mapData.mapSettings.lat',
895
+ },
896
+ {
897
+ path: 'comment.content.richContent.nodes.mapData.mapSettings.lng',
898
+ },
899
+ {
900
+ path: 'comment.content.richContent.nodes.pollData.poll.image.duration',
901
+ },
902
+ {
903
+ path: 'comment.content.richContent.nodes.pollData.poll.options.image.duration',
904
+ },
905
+ {
906
+ path: 'comment.content.richContent.nodes.pollData.design.poll.background.image.duration',
907
+ },
908
+ {
909
+ path: 'comment.content.richContent.nodes.appEmbedData.image.duration',
910
+ },
911
+ {
912
+ path: 'comment.content.richContent.nodes.videoData.video.duration',
913
+ },
914
+ {
915
+ path: 'comment.content.richContent.nodes.videoData.thumbnail.duration',
916
+ },
917
+ {
918
+ path: 'comment.content.richContent.nodes.audioData.audio.duration',
919
+ },
920
+ {
921
+ path: 'comment.content.richContent.nodes.audioData.coverImage.duration',
922
+ },
923
+ {
924
+ path: 'comment.draftContent.richContent.nodes.galleryData.items.image.media.duration',
925
+ },
926
+ {
927
+ path: 'comment.draftContent.richContent.nodes.galleryData.items.video.media.duration',
928
+ },
929
+ {
930
+ path: 'comment.draftContent.richContent.nodes.galleryData.items.video.thumbnail.duration',
931
+ },
932
+ {
933
+ path: 'comment.draftContent.richContent.nodes.galleryData.options.item.ratio',
934
+ },
935
+ {
936
+ path: 'comment.draftContent.richContent.nodes.imageData.image.duration',
937
+ },
938
+ {
939
+ path: 'comment.draftContent.richContent.nodes.mapData.mapSettings.lat',
940
+ },
941
+ {
942
+ path: 'comment.draftContent.richContent.nodes.mapData.mapSettings.lng',
943
+ },
944
+ {
945
+ path: 'comment.draftContent.richContent.nodes.pollData.poll.image.duration',
946
+ },
947
+ {
948
+ path: 'comment.draftContent.richContent.nodes.pollData.poll.options.image.duration',
949
+ },
950
+ {
951
+ path: 'comment.draftContent.richContent.nodes.pollData.design.poll.background.image.duration',
952
+ },
953
+ {
954
+ path: 'comment.draftContent.richContent.nodes.appEmbedData.image.duration',
955
+ },
956
+ {
957
+ path: 'comment.draftContent.richContent.nodes.videoData.video.duration',
958
+ },
959
+ {
960
+ path: 'comment.draftContent.richContent.nodes.videoData.thumbnail.duration',
961
+ },
962
+ {
963
+ path: 'comment.draftContent.richContent.nodes.audioData.audio.duration',
964
+ },
965
+ {
966
+ path: 'comment.draftContent.richContent.nodes.audioData.coverImage.duration',
967
+ },
968
+ ],
969
+ },
970
+ ]),
971
+ };
972
+ return metadata;
973
+ }
974
+ return __moderateDraftContent;
975
+ }
976
+ /**
977
+ * Creates a query to retrieve a list of comments.
978
+ *
979
+ * The `queryComments()` function builds a query to retrieve a list of comments and returns a [`CommentsQueryBuilder`](#commentsquerybuilder) object.
980
+ *
981
+ * The returned object contains the query definition, which is typically used to run the query using the [`find()`](#commentsquerybuilder/find) function.
982
+ *
983
+ * You can refine the query by chaining `CommentsQueryBuilder` functions onto the query. `CommentsQueryBuilder` functions enable you to sort, filter, and control the results that `queryComments()` returns.
984
+ *
985
+ * `queryComments()` runs with the following `CommentsQueryBuilder` default that you can override:
986
+ * + `ascending("_id")`
987
+ *
988
+ * The functions that are chained to `queryComments()` are applied in the order they are called. For example, if you apply `ascending("voteSummary.netVoteCount")` and then `ascending("replyCount")`, the results are sorted first by the `"voteSummary.netVoteCount"`, and then, if there are multiple results with the same `"voteSummary.netVoteCount"`, the items are sorted by `"replyCount"`.
989
+ *
990
+ * The following `CommentsQueryBuilder` functions are supported for the `queryComments()` function. For a full description of the comment object, see the object returned for the [`items`](#commentsqueryresult/items) property in [`CommentsQueryResult`](#commentsqueryresult).
991
+ */
992
+ export function queryComments(payload) {
993
+ function __queryComments({ host }) {
994
+ const metadata = {
995
+ entityFqdn: 'wix.comments.v2.comment',
996
+ method: 'POST',
997
+ methodFqn: 'wix.comments.ng.v1.CommentsNg.QueryComments',
998
+ packageName: PACKAGE_NAME,
999
+ url: resolveWixCommentsNgV1CommentsNgUrl({
1000
+ protoPath: '/v1/comments/query-cursor',
1001
+ data: payload,
1002
+ host,
1003
+ }),
1004
+ data: payload,
1005
+ transformResponse: (payload) => transformPaths(payload, [
1006
+ {
1007
+ transformFn: transformRESTTimestampToSDKTimestamp,
1008
+ paths: [
1009
+ { path: 'comments.createdDate' },
1010
+ { path: 'comments.updatedDate' },
1011
+ { path: 'comments.commentDate' },
1012
+ { path: 'comments.content.commentDate' },
1013
+ {
1014
+ path: 'comments.content.richContent.metadata.createdTimestamp',
1015
+ },
1016
+ {
1017
+ path: 'comments.content.richContent.metadata.updatedTimestamp',
1018
+ },
1019
+ { path: 'comments.content.attachments.image.urlExpirationDate' },
1020
+ { path: 'comments.content.attachments.video.urlExpirationDate' },
1021
+ {
1022
+ path: 'comments.content.attachments.video.posters.urlExpirationDate',
1023
+ },
1024
+ { path: 'comments.content.attachments.audio.urlExpirationDate' },
1025
+ {
1026
+ path: 'comments.content.attachments.document.urlExpirationDate',
1027
+ },
1028
+ { path: 'comments.draftContent.commentDate' },
1029
+ {
1030
+ path: 'comments.draftContent.richContent.metadata.createdTimestamp',
1031
+ },
1032
+ {
1033
+ path: 'comments.draftContent.richContent.metadata.updatedTimestamp',
1034
+ },
1035
+ {
1036
+ path: 'comments.draftContent.attachments.image.urlExpirationDate',
1037
+ },
1038
+ {
1039
+ path: 'comments.draftContent.attachments.video.urlExpirationDate',
1040
+ },
1041
+ {
1042
+ path: 'comments.draftContent.attachments.video.posters.urlExpirationDate',
1043
+ },
1044
+ {
1045
+ path: 'comments.draftContent.attachments.audio.urlExpirationDate',
1046
+ },
1047
+ {
1048
+ path: 'comments.draftContent.attachments.document.urlExpirationDate',
1049
+ },
1050
+ ],
1051
+ },
1052
+ {
1053
+ transformFn: transformRESTFloatToSDKFloat,
1054
+ paths: [
1055
+ {
1056
+ path: 'comments.content.richContent.nodes.galleryData.items.image.media.duration',
1057
+ },
1058
+ {
1059
+ path: 'comments.content.richContent.nodes.galleryData.items.video.media.duration',
1060
+ },
1061
+ {
1062
+ path: 'comments.content.richContent.nodes.galleryData.items.video.thumbnail.duration',
1063
+ },
1064
+ {
1065
+ path: 'comments.content.richContent.nodes.galleryData.options.item.ratio',
1066
+ },
1067
+ {
1068
+ path: 'comments.content.richContent.nodes.imageData.image.duration',
1069
+ },
1070
+ {
1071
+ path: 'comments.content.richContent.nodes.mapData.mapSettings.lat',
1072
+ },
1073
+ {
1074
+ path: 'comments.content.richContent.nodes.mapData.mapSettings.lng',
1075
+ },
1076
+ {
1077
+ path: 'comments.content.richContent.nodes.pollData.poll.image.duration',
1078
+ },
1079
+ {
1080
+ path: 'comments.content.richContent.nodes.pollData.poll.options.image.duration',
1081
+ },
1082
+ {
1083
+ path: 'comments.content.richContent.nodes.pollData.design.poll.background.image.duration',
1084
+ },
1085
+ {
1086
+ path: 'comments.content.richContent.nodes.appEmbedData.image.duration',
1087
+ },
1088
+ {
1089
+ path: 'comments.content.richContent.nodes.videoData.video.duration',
1090
+ },
1091
+ {
1092
+ path: 'comments.content.richContent.nodes.videoData.thumbnail.duration',
1093
+ },
1094
+ {
1095
+ path: 'comments.content.richContent.nodes.audioData.audio.duration',
1096
+ },
1097
+ {
1098
+ path: 'comments.content.richContent.nodes.audioData.coverImage.duration',
1099
+ },
1100
+ {
1101
+ path: 'comments.draftContent.richContent.nodes.galleryData.items.image.media.duration',
1102
+ },
1103
+ {
1104
+ path: 'comments.draftContent.richContent.nodes.galleryData.items.video.media.duration',
1105
+ },
1106
+ {
1107
+ path: 'comments.draftContent.richContent.nodes.galleryData.items.video.thumbnail.duration',
1108
+ },
1109
+ {
1110
+ path: 'comments.draftContent.richContent.nodes.galleryData.options.item.ratio',
1111
+ },
1112
+ {
1113
+ path: 'comments.draftContent.richContent.nodes.imageData.image.duration',
1114
+ },
1115
+ {
1116
+ path: 'comments.draftContent.richContent.nodes.mapData.mapSettings.lat',
1117
+ },
1118
+ {
1119
+ path: 'comments.draftContent.richContent.nodes.mapData.mapSettings.lng',
1120
+ },
1121
+ {
1122
+ path: 'comments.draftContent.richContent.nodes.pollData.poll.image.duration',
1123
+ },
1124
+ {
1125
+ path: 'comments.draftContent.richContent.nodes.pollData.poll.options.image.duration',
1126
+ },
1127
+ {
1128
+ path: 'comments.draftContent.richContent.nodes.pollData.design.poll.background.image.duration',
1129
+ },
1130
+ {
1131
+ path: 'comments.draftContent.richContent.nodes.appEmbedData.image.duration',
1132
+ },
1133
+ {
1134
+ path: 'comments.draftContent.richContent.nodes.videoData.video.duration',
1135
+ },
1136
+ {
1137
+ path: 'comments.draftContent.richContent.nodes.videoData.thumbnail.duration',
1138
+ },
1139
+ {
1140
+ path: 'comments.draftContent.richContent.nodes.audioData.audio.duration',
1141
+ },
1142
+ {
1143
+ path: 'comments.draftContent.richContent.nodes.audioData.coverImage.duration',
1144
+ },
1145
+ ],
1146
+ },
1147
+ ]),
1148
+ };
1149
+ return metadata;
1150
+ }
1151
+ return __queryComments;
1152
+ }
1153
+ /**
1154
+ * Sets `marked` to `TRUE` to mark a comment.
1155
+ *
1156
+ * Call Query Comments to filter for marked comments to then apply customization to.
1157
+ * See Sample Flows for an example.
1158
+ */
1159
+ export function markComment(payload) {
1160
+ function __markComment({ host }) {
1161
+ const metadata = {
1162
+ entityFqdn: 'wix.comments.v2.comment',
1163
+ method: 'PUT',
1164
+ methodFqn: 'wix.comments.ng.v1.CommentsNg.MarkComment',
1165
+ packageName: PACKAGE_NAME,
1166
+ url: resolveWixCommentsNgV1CommentsNgUrl({
1167
+ protoPath: '/v1/comments/{commentId}/mark',
1168
+ data: payload,
1169
+ host,
1170
+ }),
1171
+ data: payload,
1172
+ transformResponse: (payload) => transformPaths(payload, [
1173
+ {
1174
+ transformFn: transformRESTTimestampToSDKTimestamp,
1175
+ paths: [
1176
+ { path: 'comment.createdDate' },
1177
+ { path: 'comment.updatedDate' },
1178
+ { path: 'comment.commentDate' },
1179
+ { path: 'comment.content.commentDate' },
1180
+ { path: 'comment.content.richContent.metadata.createdTimestamp' },
1181
+ { path: 'comment.content.richContent.metadata.updatedTimestamp' },
1182
+ { path: 'comment.content.attachments.image.urlExpirationDate' },
1183
+ { path: 'comment.content.attachments.video.urlExpirationDate' },
1184
+ {
1185
+ path: 'comment.content.attachments.video.posters.urlExpirationDate',
1186
+ },
1187
+ { path: 'comment.content.attachments.audio.urlExpirationDate' },
1188
+ {
1189
+ path: 'comment.content.attachments.document.urlExpirationDate',
1190
+ },
1191
+ { path: 'comment.draftContent.commentDate' },
1192
+ {
1193
+ path: 'comment.draftContent.richContent.metadata.createdTimestamp',
1194
+ },
1195
+ {
1196
+ path: 'comment.draftContent.richContent.metadata.updatedTimestamp',
1197
+ },
1198
+ {
1199
+ path: 'comment.draftContent.attachments.image.urlExpirationDate',
1200
+ },
1201
+ {
1202
+ path: 'comment.draftContent.attachments.video.urlExpirationDate',
1203
+ },
1204
+ {
1205
+ path: 'comment.draftContent.attachments.video.posters.urlExpirationDate',
1206
+ },
1207
+ {
1208
+ path: 'comment.draftContent.attachments.audio.urlExpirationDate',
1209
+ },
1210
+ {
1211
+ path: 'comment.draftContent.attachments.document.urlExpirationDate',
1212
+ },
1213
+ ],
1214
+ },
1215
+ {
1216
+ transformFn: transformRESTFloatToSDKFloat,
1217
+ paths: [
1218
+ {
1219
+ path: 'comment.content.richContent.nodes.galleryData.items.image.media.duration',
1220
+ },
1221
+ {
1222
+ path: 'comment.content.richContent.nodes.galleryData.items.video.media.duration',
1223
+ },
1224
+ {
1225
+ path: 'comment.content.richContent.nodes.galleryData.items.video.thumbnail.duration',
1226
+ },
1227
+ {
1228
+ path: 'comment.content.richContent.nodes.galleryData.options.item.ratio',
1229
+ },
1230
+ {
1231
+ path: 'comment.content.richContent.nodes.imageData.image.duration',
1232
+ },
1233
+ {
1234
+ path: 'comment.content.richContent.nodes.mapData.mapSettings.lat',
1235
+ },
1236
+ {
1237
+ path: 'comment.content.richContent.nodes.mapData.mapSettings.lng',
1238
+ },
1239
+ {
1240
+ path: 'comment.content.richContent.nodes.pollData.poll.image.duration',
1241
+ },
1242
+ {
1243
+ path: 'comment.content.richContent.nodes.pollData.poll.options.image.duration',
1244
+ },
1245
+ {
1246
+ path: 'comment.content.richContent.nodes.pollData.design.poll.background.image.duration',
1247
+ },
1248
+ {
1249
+ path: 'comment.content.richContent.nodes.appEmbedData.image.duration',
1250
+ },
1251
+ {
1252
+ path: 'comment.content.richContent.nodes.videoData.video.duration',
1253
+ },
1254
+ {
1255
+ path: 'comment.content.richContent.nodes.videoData.thumbnail.duration',
1256
+ },
1257
+ {
1258
+ path: 'comment.content.richContent.nodes.audioData.audio.duration',
1259
+ },
1260
+ {
1261
+ path: 'comment.content.richContent.nodes.audioData.coverImage.duration',
1262
+ },
1263
+ {
1264
+ path: 'comment.draftContent.richContent.nodes.galleryData.items.image.media.duration',
1265
+ },
1266
+ {
1267
+ path: 'comment.draftContent.richContent.nodes.galleryData.items.video.media.duration',
1268
+ },
1269
+ {
1270
+ path: 'comment.draftContent.richContent.nodes.galleryData.items.video.thumbnail.duration',
1271
+ },
1272
+ {
1273
+ path: 'comment.draftContent.richContent.nodes.galleryData.options.item.ratio',
1274
+ },
1275
+ {
1276
+ path: 'comment.draftContent.richContent.nodes.imageData.image.duration',
1277
+ },
1278
+ {
1279
+ path: 'comment.draftContent.richContent.nodes.mapData.mapSettings.lat',
1280
+ },
1281
+ {
1282
+ path: 'comment.draftContent.richContent.nodes.mapData.mapSettings.lng',
1283
+ },
1284
+ {
1285
+ path: 'comment.draftContent.richContent.nodes.pollData.poll.image.duration',
1286
+ },
1287
+ {
1288
+ path: 'comment.draftContent.richContent.nodes.pollData.poll.options.image.duration',
1289
+ },
1290
+ {
1291
+ path: 'comment.draftContent.richContent.nodes.pollData.design.poll.background.image.duration',
1292
+ },
1293
+ {
1294
+ path: 'comment.draftContent.richContent.nodes.appEmbedData.image.duration',
1295
+ },
1296
+ {
1297
+ path: 'comment.draftContent.richContent.nodes.videoData.video.duration',
1298
+ },
1299
+ {
1300
+ path: 'comment.draftContent.richContent.nodes.videoData.thumbnail.duration',
1301
+ },
1302
+ {
1303
+ path: 'comment.draftContent.richContent.nodes.audioData.audio.duration',
1304
+ },
1305
+ {
1306
+ path: 'comment.draftContent.richContent.nodes.audioData.coverImage.duration',
1307
+ },
1308
+ ],
1309
+ },
1310
+ ]),
1311
+ };
1312
+ return metadata;
1313
+ }
1314
+ return __markComment;
1315
+ }
1316
+ /** Sets `marked` to `FALSE` to unmark a comment. */
1317
+ export function unmarkComment(payload) {
1318
+ function __unmarkComment({ host }) {
1319
+ const metadata = {
1320
+ entityFqdn: 'wix.comments.v2.comment',
1321
+ method: 'PUT',
1322
+ methodFqn: 'wix.comments.ng.v1.CommentsNg.UnmarkComment',
1323
+ packageName: PACKAGE_NAME,
1324
+ url: resolveWixCommentsNgV1CommentsNgUrl({
1325
+ protoPath: '/v1/comments/{commentId}/unmark',
1326
+ data: payload,
1327
+ host,
1328
+ }),
1329
+ data: payload,
1330
+ transformResponse: (payload) => transformPaths(payload, [
1331
+ {
1332
+ transformFn: transformRESTTimestampToSDKTimestamp,
1333
+ paths: [
1334
+ { path: 'comment.createdDate' },
1335
+ { path: 'comment.updatedDate' },
1336
+ { path: 'comment.commentDate' },
1337
+ { path: 'comment.content.commentDate' },
1338
+ { path: 'comment.content.richContent.metadata.createdTimestamp' },
1339
+ { path: 'comment.content.richContent.metadata.updatedTimestamp' },
1340
+ { path: 'comment.content.attachments.image.urlExpirationDate' },
1341
+ { path: 'comment.content.attachments.video.urlExpirationDate' },
1342
+ {
1343
+ path: 'comment.content.attachments.video.posters.urlExpirationDate',
1344
+ },
1345
+ { path: 'comment.content.attachments.audio.urlExpirationDate' },
1346
+ {
1347
+ path: 'comment.content.attachments.document.urlExpirationDate',
1348
+ },
1349
+ { path: 'comment.draftContent.commentDate' },
1350
+ {
1351
+ path: 'comment.draftContent.richContent.metadata.createdTimestamp',
1352
+ },
1353
+ {
1354
+ path: 'comment.draftContent.richContent.metadata.updatedTimestamp',
1355
+ },
1356
+ {
1357
+ path: 'comment.draftContent.attachments.image.urlExpirationDate',
1358
+ },
1359
+ {
1360
+ path: 'comment.draftContent.attachments.video.urlExpirationDate',
1361
+ },
1362
+ {
1363
+ path: 'comment.draftContent.attachments.video.posters.urlExpirationDate',
1364
+ },
1365
+ {
1366
+ path: 'comment.draftContent.attachments.audio.urlExpirationDate',
1367
+ },
1368
+ {
1369
+ path: 'comment.draftContent.attachments.document.urlExpirationDate',
1370
+ },
1371
+ ],
1372
+ },
1373
+ {
1374
+ transformFn: transformRESTFloatToSDKFloat,
1375
+ paths: [
1376
+ {
1377
+ path: 'comment.content.richContent.nodes.galleryData.items.image.media.duration',
1378
+ },
1379
+ {
1380
+ path: 'comment.content.richContent.nodes.galleryData.items.video.media.duration',
1381
+ },
1382
+ {
1383
+ path: 'comment.content.richContent.nodes.galleryData.items.video.thumbnail.duration',
1384
+ },
1385
+ {
1386
+ path: 'comment.content.richContent.nodes.galleryData.options.item.ratio',
1387
+ },
1388
+ {
1389
+ path: 'comment.content.richContent.nodes.imageData.image.duration',
1390
+ },
1391
+ {
1392
+ path: 'comment.content.richContent.nodes.mapData.mapSettings.lat',
1393
+ },
1394
+ {
1395
+ path: 'comment.content.richContent.nodes.mapData.mapSettings.lng',
1396
+ },
1397
+ {
1398
+ path: 'comment.content.richContent.nodes.pollData.poll.image.duration',
1399
+ },
1400
+ {
1401
+ path: 'comment.content.richContent.nodes.pollData.poll.options.image.duration',
1402
+ },
1403
+ {
1404
+ path: 'comment.content.richContent.nodes.pollData.design.poll.background.image.duration',
1405
+ },
1406
+ {
1407
+ path: 'comment.content.richContent.nodes.appEmbedData.image.duration',
1408
+ },
1409
+ {
1410
+ path: 'comment.content.richContent.nodes.videoData.video.duration',
1411
+ },
1412
+ {
1413
+ path: 'comment.content.richContent.nodes.videoData.thumbnail.duration',
1414
+ },
1415
+ {
1416
+ path: 'comment.content.richContent.nodes.audioData.audio.duration',
1417
+ },
1418
+ {
1419
+ path: 'comment.content.richContent.nodes.audioData.coverImage.duration',
1420
+ },
1421
+ {
1422
+ path: 'comment.draftContent.richContent.nodes.galleryData.items.image.media.duration',
1423
+ },
1424
+ {
1425
+ path: 'comment.draftContent.richContent.nodes.galleryData.items.video.media.duration',
1426
+ },
1427
+ {
1428
+ path: 'comment.draftContent.richContent.nodes.galleryData.items.video.thumbnail.duration',
1429
+ },
1430
+ {
1431
+ path: 'comment.draftContent.richContent.nodes.galleryData.options.item.ratio',
1432
+ },
1433
+ {
1434
+ path: 'comment.draftContent.richContent.nodes.imageData.image.duration',
1435
+ },
1436
+ {
1437
+ path: 'comment.draftContent.richContent.nodes.mapData.mapSettings.lat',
1438
+ },
1439
+ {
1440
+ path: 'comment.draftContent.richContent.nodes.mapData.mapSettings.lng',
1441
+ },
1442
+ {
1443
+ path: 'comment.draftContent.richContent.nodes.pollData.poll.image.duration',
1444
+ },
1445
+ {
1446
+ path: 'comment.draftContent.richContent.nodes.pollData.poll.options.image.duration',
1447
+ },
1448
+ {
1449
+ path: 'comment.draftContent.richContent.nodes.pollData.design.poll.background.image.duration',
1450
+ },
1451
+ {
1452
+ path: 'comment.draftContent.richContent.nodes.appEmbedData.image.duration',
1453
+ },
1454
+ {
1455
+ path: 'comment.draftContent.richContent.nodes.videoData.video.duration',
1456
+ },
1457
+ {
1458
+ path: 'comment.draftContent.richContent.nodes.videoData.thumbnail.duration',
1459
+ },
1460
+ {
1461
+ path: 'comment.draftContent.richContent.nodes.audioData.audio.duration',
1462
+ },
1463
+ {
1464
+ path: 'comment.draftContent.richContent.nodes.audioData.coverImage.duration',
1465
+ },
1466
+ ],
1467
+ },
1468
+ ]),
1469
+ };
1470
+ return metadata;
1471
+ }
1472
+ return __unmarkComment;
1473
+ }
1474
+ /** Hides a comment in a widget. The comment status becomes `HIDDEN`. */
1475
+ export function hideComment(payload) {
1476
+ function __hideComment({ host }) {
1477
+ const metadata = {
1478
+ entityFqdn: 'wix.comments.v2.comment',
1479
+ method: 'PUT',
1480
+ methodFqn: 'wix.comments.ng.v1.CommentsNg.HideComment',
1481
+ packageName: PACKAGE_NAME,
1482
+ url: resolveWixCommentsNgV1CommentsNgUrl({
1483
+ protoPath: '/v1/comments/{commentId}/hide',
1484
+ data: payload,
1485
+ host,
1486
+ }),
1487
+ data: payload,
1488
+ transformResponse: (payload) => transformPaths(payload, [
1489
+ {
1490
+ transformFn: transformRESTTimestampToSDKTimestamp,
1491
+ paths: [
1492
+ { path: 'comment.createdDate' },
1493
+ { path: 'comment.updatedDate' },
1494
+ { path: 'comment.commentDate' },
1495
+ { path: 'comment.content.commentDate' },
1496
+ { path: 'comment.content.richContent.metadata.createdTimestamp' },
1497
+ { path: 'comment.content.richContent.metadata.updatedTimestamp' },
1498
+ { path: 'comment.content.attachments.image.urlExpirationDate' },
1499
+ { path: 'comment.content.attachments.video.urlExpirationDate' },
1500
+ {
1501
+ path: 'comment.content.attachments.video.posters.urlExpirationDate',
1502
+ },
1503
+ { path: 'comment.content.attachments.audio.urlExpirationDate' },
1504
+ {
1505
+ path: 'comment.content.attachments.document.urlExpirationDate',
1506
+ },
1507
+ { path: 'comment.draftContent.commentDate' },
1508
+ {
1509
+ path: 'comment.draftContent.richContent.metadata.createdTimestamp',
1510
+ },
1511
+ {
1512
+ path: 'comment.draftContent.richContent.metadata.updatedTimestamp',
1513
+ },
1514
+ {
1515
+ path: 'comment.draftContent.attachments.image.urlExpirationDate',
1516
+ },
1517
+ {
1518
+ path: 'comment.draftContent.attachments.video.urlExpirationDate',
1519
+ },
1520
+ {
1521
+ path: 'comment.draftContent.attachments.video.posters.urlExpirationDate',
1522
+ },
1523
+ {
1524
+ path: 'comment.draftContent.attachments.audio.urlExpirationDate',
1525
+ },
1526
+ {
1527
+ path: 'comment.draftContent.attachments.document.urlExpirationDate',
1528
+ },
1529
+ ],
1530
+ },
1531
+ {
1532
+ transformFn: transformRESTFloatToSDKFloat,
1533
+ paths: [
1534
+ {
1535
+ path: 'comment.content.richContent.nodes.galleryData.items.image.media.duration',
1536
+ },
1537
+ {
1538
+ path: 'comment.content.richContent.nodes.galleryData.items.video.media.duration',
1539
+ },
1540
+ {
1541
+ path: 'comment.content.richContent.nodes.galleryData.items.video.thumbnail.duration',
1542
+ },
1543
+ {
1544
+ path: 'comment.content.richContent.nodes.galleryData.options.item.ratio',
1545
+ },
1546
+ {
1547
+ path: 'comment.content.richContent.nodes.imageData.image.duration',
1548
+ },
1549
+ {
1550
+ path: 'comment.content.richContent.nodes.mapData.mapSettings.lat',
1551
+ },
1552
+ {
1553
+ path: 'comment.content.richContent.nodes.mapData.mapSettings.lng',
1554
+ },
1555
+ {
1556
+ path: 'comment.content.richContent.nodes.pollData.poll.image.duration',
1557
+ },
1558
+ {
1559
+ path: 'comment.content.richContent.nodes.pollData.poll.options.image.duration',
1560
+ },
1561
+ {
1562
+ path: 'comment.content.richContent.nodes.pollData.design.poll.background.image.duration',
1563
+ },
1564
+ {
1565
+ path: 'comment.content.richContent.nodes.appEmbedData.image.duration',
1566
+ },
1567
+ {
1568
+ path: 'comment.content.richContent.nodes.videoData.video.duration',
1569
+ },
1570
+ {
1571
+ path: 'comment.content.richContent.nodes.videoData.thumbnail.duration',
1572
+ },
1573
+ {
1574
+ path: 'comment.content.richContent.nodes.audioData.audio.duration',
1575
+ },
1576
+ {
1577
+ path: 'comment.content.richContent.nodes.audioData.coverImage.duration',
1578
+ },
1579
+ {
1580
+ path: 'comment.draftContent.richContent.nodes.galleryData.items.image.media.duration',
1581
+ },
1582
+ {
1583
+ path: 'comment.draftContent.richContent.nodes.galleryData.items.video.media.duration',
1584
+ },
1585
+ {
1586
+ path: 'comment.draftContent.richContent.nodes.galleryData.items.video.thumbnail.duration',
1587
+ },
1588
+ {
1589
+ path: 'comment.draftContent.richContent.nodes.galleryData.options.item.ratio',
1590
+ },
1591
+ {
1592
+ path: 'comment.draftContent.richContent.nodes.imageData.image.duration',
1593
+ },
1594
+ {
1595
+ path: 'comment.draftContent.richContent.nodes.mapData.mapSettings.lat',
1596
+ },
1597
+ {
1598
+ path: 'comment.draftContent.richContent.nodes.mapData.mapSettings.lng',
1599
+ },
1600
+ {
1601
+ path: 'comment.draftContent.richContent.nodes.pollData.poll.image.duration',
1602
+ },
1603
+ {
1604
+ path: 'comment.draftContent.richContent.nodes.pollData.poll.options.image.duration',
1605
+ },
1606
+ {
1607
+ path: 'comment.draftContent.richContent.nodes.pollData.design.poll.background.image.duration',
1608
+ },
1609
+ {
1610
+ path: 'comment.draftContent.richContent.nodes.appEmbedData.image.duration',
1611
+ },
1612
+ {
1613
+ path: 'comment.draftContent.richContent.nodes.videoData.video.duration',
1614
+ },
1615
+ {
1616
+ path: 'comment.draftContent.richContent.nodes.videoData.thumbnail.duration',
1617
+ },
1618
+ {
1619
+ path: 'comment.draftContent.richContent.nodes.audioData.audio.duration',
1620
+ },
1621
+ {
1622
+ path: 'comment.draftContent.richContent.nodes.audioData.coverImage.duration',
1623
+ },
1624
+ ],
1625
+ },
1626
+ ]),
1627
+ };
1628
+ return metadata;
1629
+ }
1630
+ return __hideComment;
1631
+ }
1632
+ /**
1633
+ * Publishes a comment with the `HIDDEN` status. The comment status becomes `PUBLISHED`.
1634
+ *
1635
+ * To publish a new comment, call Create Comment.
1636
+ */
1637
+ export function publishComment(payload) {
1638
+ function __publishComment({ host }) {
1639
+ const metadata = {
1640
+ entityFqdn: 'wix.comments.v2.comment',
1641
+ method: 'PUT',
1642
+ methodFqn: 'wix.comments.ng.v1.CommentsNg.PublishComment',
1643
+ packageName: PACKAGE_NAME,
1644
+ url: resolveWixCommentsNgV1CommentsNgUrl({
1645
+ protoPath: '/v1/comments/{commentId}/publish',
1646
+ data: payload,
1647
+ host,
1648
+ }),
1649
+ data: payload,
1650
+ transformResponse: (payload) => transformPaths(payload, [
1651
+ {
1652
+ transformFn: transformRESTTimestampToSDKTimestamp,
1653
+ paths: [
1654
+ { path: 'comment.createdDate' },
1655
+ { path: 'comment.updatedDate' },
1656
+ { path: 'comment.commentDate' },
1657
+ { path: 'comment.content.commentDate' },
1658
+ { path: 'comment.content.richContent.metadata.createdTimestamp' },
1659
+ { path: 'comment.content.richContent.metadata.updatedTimestamp' },
1660
+ { path: 'comment.content.attachments.image.urlExpirationDate' },
1661
+ { path: 'comment.content.attachments.video.urlExpirationDate' },
1662
+ {
1663
+ path: 'comment.content.attachments.video.posters.urlExpirationDate',
1664
+ },
1665
+ { path: 'comment.content.attachments.audio.urlExpirationDate' },
1666
+ {
1667
+ path: 'comment.content.attachments.document.urlExpirationDate',
1668
+ },
1669
+ { path: 'comment.draftContent.commentDate' },
1670
+ {
1671
+ path: 'comment.draftContent.richContent.metadata.createdTimestamp',
1672
+ },
1673
+ {
1674
+ path: 'comment.draftContent.richContent.metadata.updatedTimestamp',
1675
+ },
1676
+ {
1677
+ path: 'comment.draftContent.attachments.image.urlExpirationDate',
1678
+ },
1679
+ {
1680
+ path: 'comment.draftContent.attachments.video.urlExpirationDate',
1681
+ },
1682
+ {
1683
+ path: 'comment.draftContent.attachments.video.posters.urlExpirationDate',
1684
+ },
1685
+ {
1686
+ path: 'comment.draftContent.attachments.audio.urlExpirationDate',
1687
+ },
1688
+ {
1689
+ path: 'comment.draftContent.attachments.document.urlExpirationDate',
1690
+ },
1691
+ ],
1692
+ },
1693
+ {
1694
+ transformFn: transformRESTFloatToSDKFloat,
1695
+ paths: [
1696
+ {
1697
+ path: 'comment.content.richContent.nodes.galleryData.items.image.media.duration',
1698
+ },
1699
+ {
1700
+ path: 'comment.content.richContent.nodes.galleryData.items.video.media.duration',
1701
+ },
1702
+ {
1703
+ path: 'comment.content.richContent.nodes.galleryData.items.video.thumbnail.duration',
1704
+ },
1705
+ {
1706
+ path: 'comment.content.richContent.nodes.galleryData.options.item.ratio',
1707
+ },
1708
+ {
1709
+ path: 'comment.content.richContent.nodes.imageData.image.duration',
1710
+ },
1711
+ {
1712
+ path: 'comment.content.richContent.nodes.mapData.mapSettings.lat',
1713
+ },
1714
+ {
1715
+ path: 'comment.content.richContent.nodes.mapData.mapSettings.lng',
1716
+ },
1717
+ {
1718
+ path: 'comment.content.richContent.nodes.pollData.poll.image.duration',
1719
+ },
1720
+ {
1721
+ path: 'comment.content.richContent.nodes.pollData.poll.options.image.duration',
1722
+ },
1723
+ {
1724
+ path: 'comment.content.richContent.nodes.pollData.design.poll.background.image.duration',
1725
+ },
1726
+ {
1727
+ path: 'comment.content.richContent.nodes.appEmbedData.image.duration',
1728
+ },
1729
+ {
1730
+ path: 'comment.content.richContent.nodes.videoData.video.duration',
1731
+ },
1732
+ {
1733
+ path: 'comment.content.richContent.nodes.videoData.thumbnail.duration',
1734
+ },
1735
+ {
1736
+ path: 'comment.content.richContent.nodes.audioData.audio.duration',
1737
+ },
1738
+ {
1739
+ path: 'comment.content.richContent.nodes.audioData.coverImage.duration',
1740
+ },
1741
+ {
1742
+ path: 'comment.draftContent.richContent.nodes.galleryData.items.image.media.duration',
1743
+ },
1744
+ {
1745
+ path: 'comment.draftContent.richContent.nodes.galleryData.items.video.media.duration',
1746
+ },
1747
+ {
1748
+ path: 'comment.draftContent.richContent.nodes.galleryData.items.video.thumbnail.duration',
1749
+ },
1750
+ {
1751
+ path: 'comment.draftContent.richContent.nodes.galleryData.options.item.ratio',
1752
+ },
1753
+ {
1754
+ path: 'comment.draftContent.richContent.nodes.imageData.image.duration',
1755
+ },
1756
+ {
1757
+ path: 'comment.draftContent.richContent.nodes.mapData.mapSettings.lat',
1758
+ },
1759
+ {
1760
+ path: 'comment.draftContent.richContent.nodes.mapData.mapSettings.lng',
1761
+ },
1762
+ {
1763
+ path: 'comment.draftContent.richContent.nodes.pollData.poll.image.duration',
1764
+ },
1765
+ {
1766
+ path: 'comment.draftContent.richContent.nodes.pollData.poll.options.image.duration',
1767
+ },
1768
+ {
1769
+ path: 'comment.draftContent.richContent.nodes.pollData.design.poll.background.image.duration',
1770
+ },
1771
+ {
1772
+ path: 'comment.draftContent.richContent.nodes.appEmbedData.image.duration',
1773
+ },
1774
+ {
1775
+ path: 'comment.draftContent.richContent.nodes.videoData.video.duration',
1776
+ },
1777
+ {
1778
+ path: 'comment.draftContent.richContent.nodes.videoData.thumbnail.duration',
1779
+ },
1780
+ {
1781
+ path: 'comment.draftContent.richContent.nodes.audioData.audio.duration',
1782
+ },
1783
+ {
1784
+ path: 'comment.draftContent.richContent.nodes.audioData.coverImage.duration',
1785
+ },
1786
+ ],
1787
+ },
1788
+ ]),
1789
+ };
1790
+ return metadata;
1791
+ }
1792
+ return __publishComment;
1793
+ }
1794
+ /** Counts comments, given the specified filtering. Comments with the `HIDDEN` status are not included in the response. */
1795
+ export function countComments(payload) {
1796
+ function __countComments({ host }) {
1797
+ const metadata = {
1798
+ entityFqdn: 'wix.comments.v2.comment',
1799
+ method: 'POST',
1800
+ methodFqn: 'wix.comments.ng.v1.CommentsNg.CountComments',
1801
+ packageName: PACKAGE_NAME,
1802
+ url: resolveWixCommentsNgV1CommentsNgUrl({
1803
+ protoPath: '/v1/comments/count',
1804
+ data: payload,
1805
+ host,
1806
+ }),
1807
+ data: payload,
1808
+ };
1809
+ return metadata;
1810
+ }
1811
+ return __countComments;
1812
+ }
1813
+ /** Lists published comments and replies from a specified resource, such as a blog post. */
1814
+ export function listCommentsByResource(payload) {
1815
+ function __listCommentsByResource({ host }) {
1816
+ const metadata = {
1817
+ entityFqdn: 'wix.comments.v2.comment',
1818
+ method: 'GET',
1819
+ methodFqn: 'wix.comments.ng.v1.CommentsNg.ListCommentsByResource',
1820
+ packageName: PACKAGE_NAME,
1821
+ url: resolveWixCommentsNgV1CommentsNgUrl({
1822
+ protoPath: '/v1/comments/list-by-resource',
1823
+ data: payload,
1824
+ host,
1825
+ }),
1826
+ params: toURLSearchParams(payload),
1827
+ transformResponse: (payload) => transformPaths(payload, [
1828
+ {
1829
+ transformFn: transformRESTTimestampToSDKTimestamp,
1830
+ paths: [
1831
+ { path: 'comments.createdDate' },
1832
+ { path: 'comments.updatedDate' },
1833
+ { path: 'comments.commentDate' },
1834
+ { path: 'comments.content.commentDate' },
1835
+ {
1836
+ path: 'comments.content.richContent.metadata.createdTimestamp',
1837
+ },
1838
+ {
1839
+ path: 'comments.content.richContent.metadata.updatedTimestamp',
1840
+ },
1841
+ { path: 'comments.content.attachments.image.urlExpirationDate' },
1842
+ { path: 'comments.content.attachments.video.urlExpirationDate' },
1843
+ {
1844
+ path: 'comments.content.attachments.video.posters.urlExpirationDate',
1845
+ },
1846
+ { path: 'comments.content.attachments.audio.urlExpirationDate' },
1847
+ {
1848
+ path: 'comments.content.attachments.document.urlExpirationDate',
1849
+ },
1850
+ { path: 'comments.draftContent.commentDate' },
1851
+ {
1852
+ path: 'comments.draftContent.richContent.metadata.createdTimestamp',
1853
+ },
1854
+ {
1855
+ path: 'comments.draftContent.richContent.metadata.updatedTimestamp',
1856
+ },
1857
+ {
1858
+ path: 'comments.draftContent.attachments.image.urlExpirationDate',
1859
+ },
1860
+ {
1861
+ path: 'comments.draftContent.attachments.video.urlExpirationDate',
1862
+ },
1863
+ {
1864
+ path: 'comments.draftContent.attachments.video.posters.urlExpirationDate',
1865
+ },
1866
+ {
1867
+ path: 'comments.draftContent.attachments.audio.urlExpirationDate',
1868
+ },
1869
+ {
1870
+ path: 'comments.draftContent.attachments.document.urlExpirationDate',
1871
+ },
1872
+ { path: 'commentReplies.*.replies.createdDate' },
1873
+ { path: 'commentReplies.*.replies.updatedDate' },
1874
+ { path: 'commentReplies.*.replies.commentDate' },
1875
+ { path: 'commentReplies.*.replies.content.commentDate' },
1876
+ {
1877
+ path: 'commentReplies.*.replies.content.richContent.metadata.createdTimestamp',
1878
+ },
1879
+ {
1880
+ path: 'commentReplies.*.replies.content.richContent.metadata.updatedTimestamp',
1881
+ },
1882
+ {
1883
+ path: 'commentReplies.*.replies.content.attachments.image.urlExpirationDate',
1884
+ },
1885
+ {
1886
+ path: 'commentReplies.*.replies.content.attachments.video.urlExpirationDate',
1887
+ },
1888
+ {
1889
+ path: 'commentReplies.*.replies.content.attachments.video.posters.urlExpirationDate',
1890
+ },
1891
+ {
1892
+ path: 'commentReplies.*.replies.content.attachments.audio.urlExpirationDate',
1893
+ },
1894
+ {
1895
+ path: 'commentReplies.*.replies.content.attachments.document.urlExpirationDate',
1896
+ },
1897
+ { path: 'commentReplies.*.replies.draftContent.commentDate' },
1898
+ {
1899
+ path: 'commentReplies.*.replies.draftContent.richContent.metadata.createdTimestamp',
1900
+ },
1901
+ {
1902
+ path: 'commentReplies.*.replies.draftContent.richContent.metadata.updatedTimestamp',
1903
+ },
1904
+ {
1905
+ path: 'commentReplies.*.replies.draftContent.attachments.image.urlExpirationDate',
1906
+ },
1907
+ {
1908
+ path: 'commentReplies.*.replies.draftContent.attachments.video.urlExpirationDate',
1909
+ },
1910
+ {
1911
+ path: 'commentReplies.*.replies.draftContent.attachments.video.posters.urlExpirationDate',
1912
+ },
1913
+ {
1914
+ path: 'commentReplies.*.replies.draftContent.attachments.audio.urlExpirationDate',
1915
+ },
1916
+ {
1917
+ path: 'commentReplies.*.replies.draftContent.attachments.document.urlExpirationDate',
1918
+ },
1919
+ ],
1920
+ },
1921
+ {
1922
+ transformFn: transformRESTFloatToSDKFloat,
1923
+ paths: [
1924
+ {
1925
+ path: 'comments.content.richContent.nodes.galleryData.items.image.media.duration',
1926
+ },
1927
+ {
1928
+ path: 'comments.content.richContent.nodes.galleryData.items.video.media.duration',
1929
+ },
1930
+ {
1931
+ path: 'comments.content.richContent.nodes.galleryData.items.video.thumbnail.duration',
1932
+ },
1933
+ {
1934
+ path: 'comments.content.richContent.nodes.galleryData.options.item.ratio',
1935
+ },
1936
+ {
1937
+ path: 'comments.content.richContent.nodes.imageData.image.duration',
1938
+ },
1939
+ {
1940
+ path: 'comments.content.richContent.nodes.mapData.mapSettings.lat',
1941
+ },
1942
+ {
1943
+ path: 'comments.content.richContent.nodes.mapData.mapSettings.lng',
1944
+ },
1945
+ {
1946
+ path: 'comments.content.richContent.nodes.pollData.poll.image.duration',
1947
+ },
1948
+ {
1949
+ path: 'comments.content.richContent.nodes.pollData.poll.options.image.duration',
1950
+ },
1951
+ {
1952
+ path: 'comments.content.richContent.nodes.pollData.design.poll.background.image.duration',
1953
+ },
1954
+ {
1955
+ path: 'comments.content.richContent.nodes.appEmbedData.image.duration',
1956
+ },
1957
+ {
1958
+ path: 'comments.content.richContent.nodes.videoData.video.duration',
1959
+ },
1960
+ {
1961
+ path: 'comments.content.richContent.nodes.videoData.thumbnail.duration',
1962
+ },
1963
+ {
1964
+ path: 'comments.content.richContent.nodes.audioData.audio.duration',
1965
+ },
1966
+ {
1967
+ path: 'comments.content.richContent.nodes.audioData.coverImage.duration',
1968
+ },
1969
+ {
1970
+ path: 'comments.draftContent.richContent.nodes.galleryData.items.image.media.duration',
1971
+ },
1972
+ {
1973
+ path: 'comments.draftContent.richContent.nodes.galleryData.items.video.media.duration',
1974
+ },
1975
+ {
1976
+ path: 'comments.draftContent.richContent.nodes.galleryData.items.video.thumbnail.duration',
1977
+ },
1978
+ {
1979
+ path: 'comments.draftContent.richContent.nodes.galleryData.options.item.ratio',
1980
+ },
1981
+ {
1982
+ path: 'comments.draftContent.richContent.nodes.imageData.image.duration',
1983
+ },
1984
+ {
1985
+ path: 'comments.draftContent.richContent.nodes.mapData.mapSettings.lat',
1986
+ },
1987
+ {
1988
+ path: 'comments.draftContent.richContent.nodes.mapData.mapSettings.lng',
1989
+ },
1990
+ {
1991
+ path: 'comments.draftContent.richContent.nodes.pollData.poll.image.duration',
1992
+ },
1993
+ {
1994
+ path: 'comments.draftContent.richContent.nodes.pollData.poll.options.image.duration',
1995
+ },
1996
+ {
1997
+ path: 'comments.draftContent.richContent.nodes.pollData.design.poll.background.image.duration',
1998
+ },
1999
+ {
2000
+ path: 'comments.draftContent.richContent.nodes.appEmbedData.image.duration',
2001
+ },
2002
+ {
2003
+ path: 'comments.draftContent.richContent.nodes.videoData.video.duration',
2004
+ },
2005
+ {
2006
+ path: 'comments.draftContent.richContent.nodes.videoData.thumbnail.duration',
2007
+ },
2008
+ {
2009
+ path: 'comments.draftContent.richContent.nodes.audioData.audio.duration',
2010
+ },
2011
+ {
2012
+ path: 'comments.draftContent.richContent.nodes.audioData.coverImage.duration',
2013
+ },
2014
+ {
2015
+ path: 'commentReplies.*.replies.content.richContent.nodes.galleryData.items.image.media.duration',
2016
+ },
2017
+ {
2018
+ path: 'commentReplies.*.replies.content.richContent.nodes.galleryData.items.video.media.duration',
2019
+ },
2020
+ {
2021
+ path: 'commentReplies.*.replies.content.richContent.nodes.galleryData.items.video.thumbnail.duration',
2022
+ },
2023
+ {
2024
+ path: 'commentReplies.*.replies.content.richContent.nodes.galleryData.options.item.ratio',
2025
+ },
2026
+ {
2027
+ path: 'commentReplies.*.replies.content.richContent.nodes.imageData.image.duration',
2028
+ },
2029
+ {
2030
+ path: 'commentReplies.*.replies.content.richContent.nodes.mapData.mapSettings.lat',
2031
+ },
2032
+ {
2033
+ path: 'commentReplies.*.replies.content.richContent.nodes.mapData.mapSettings.lng',
2034
+ },
2035
+ {
2036
+ path: 'commentReplies.*.replies.content.richContent.nodes.pollData.poll.image.duration',
2037
+ },
2038
+ {
2039
+ path: 'commentReplies.*.replies.content.richContent.nodes.pollData.poll.options.image.duration',
2040
+ },
2041
+ {
2042
+ path: 'commentReplies.*.replies.content.richContent.nodes.pollData.design.poll.background.image.duration',
2043
+ },
2044
+ {
2045
+ path: 'commentReplies.*.replies.content.richContent.nodes.appEmbedData.image.duration',
2046
+ },
2047
+ {
2048
+ path: 'commentReplies.*.replies.content.richContent.nodes.videoData.video.duration',
2049
+ },
2050
+ {
2051
+ path: 'commentReplies.*.replies.content.richContent.nodes.videoData.thumbnail.duration',
2052
+ },
2053
+ {
2054
+ path: 'commentReplies.*.replies.content.richContent.nodes.audioData.audio.duration',
2055
+ },
2056
+ {
2057
+ path: 'commentReplies.*.replies.content.richContent.nodes.audioData.coverImage.duration',
2058
+ },
2059
+ {
2060
+ path: 'commentReplies.*.replies.draftContent.richContent.nodes.galleryData.items.image.media.duration',
2061
+ },
2062
+ {
2063
+ path: 'commentReplies.*.replies.draftContent.richContent.nodes.galleryData.items.video.media.duration',
2064
+ },
2065
+ {
2066
+ path: 'commentReplies.*.replies.draftContent.richContent.nodes.galleryData.items.video.thumbnail.duration',
2067
+ },
2068
+ {
2069
+ path: 'commentReplies.*.replies.draftContent.richContent.nodes.galleryData.options.item.ratio',
2070
+ },
2071
+ {
2072
+ path: 'commentReplies.*.replies.draftContent.richContent.nodes.imageData.image.duration',
2073
+ },
2074
+ {
2075
+ path: 'commentReplies.*.replies.draftContent.richContent.nodes.mapData.mapSettings.lat',
2076
+ },
2077
+ {
2078
+ path: 'commentReplies.*.replies.draftContent.richContent.nodes.mapData.mapSettings.lng',
2079
+ },
2080
+ {
2081
+ path: 'commentReplies.*.replies.draftContent.richContent.nodes.pollData.poll.image.duration',
2082
+ },
2083
+ {
2084
+ path: 'commentReplies.*.replies.draftContent.richContent.nodes.pollData.poll.options.image.duration',
2085
+ },
2086
+ {
2087
+ path: 'commentReplies.*.replies.draftContent.richContent.nodes.pollData.design.poll.background.image.duration',
2088
+ },
2089
+ {
2090
+ path: 'commentReplies.*.replies.draftContent.richContent.nodes.appEmbedData.image.duration',
2091
+ },
2092
+ {
2093
+ path: 'commentReplies.*.replies.draftContent.richContent.nodes.videoData.video.duration',
2094
+ },
2095
+ {
2096
+ path: 'commentReplies.*.replies.draftContent.richContent.nodes.videoData.thumbnail.duration',
2097
+ },
2098
+ {
2099
+ path: 'commentReplies.*.replies.draftContent.richContent.nodes.audioData.audio.duration',
2100
+ },
2101
+ {
2102
+ path: 'commentReplies.*.replies.draftContent.richContent.nodes.audioData.coverImage.duration',
2103
+ },
2104
+ ],
2105
+ },
2106
+ ]),
2107
+ };
2108
+ return metadata;
2109
+ }
2110
+ return __listCommentsByResource;
2111
+ }
2112
+ /**
2113
+ * Returns a thread of a comment or a reply.
2114
+ *
2115
+ * If you request a comment thread, the method returns a single comment with cursors. With cursors (`pagingMetadata.cursors.next` or `pagingMetadata.cursors.prev`) you can load replies by calling the List Comments by Resource method.
2116
+ *
2117
+ * If you request a reply thread, the method returns a reply with its parent comment. With cursors (`pagingMetadata.cursors.next` or `pagingMetadata.cursors.prev`) you can load replies by calling the List Comments by Resource method.
2118
+ */
2119
+ export function getCommentThread(payload) {
2120
+ function __getCommentThread({ host }) {
2121
+ const metadata = {
2122
+ entityFqdn: 'wix.comments.v2.comment',
2123
+ method: 'GET',
2124
+ methodFqn: 'wix.comments.ng.v1.CommentsNg.GetCommentThread',
2125
+ packageName: PACKAGE_NAME,
2126
+ url: resolveWixCommentsNgV1CommentsNgUrl({
2127
+ protoPath: '/v1/comments/{commentId}/thread',
2128
+ data: payload,
2129
+ host,
2130
+ }),
2131
+ params: toURLSearchParams(payload),
2132
+ transformResponse: (payload) => transformPaths(payload, [
2133
+ {
2134
+ transformFn: transformRESTTimestampToSDKTimestamp,
2135
+ paths: [
2136
+ { path: 'comments.createdDate' },
2137
+ { path: 'comments.updatedDate' },
2138
+ { path: 'comments.commentDate' },
2139
+ { path: 'comments.content.commentDate' },
2140
+ {
2141
+ path: 'comments.content.richContent.metadata.createdTimestamp',
2142
+ },
2143
+ {
2144
+ path: 'comments.content.richContent.metadata.updatedTimestamp',
2145
+ },
2146
+ { path: 'comments.content.attachments.image.urlExpirationDate' },
2147
+ { path: 'comments.content.attachments.video.urlExpirationDate' },
2148
+ {
2149
+ path: 'comments.content.attachments.video.posters.urlExpirationDate',
2150
+ },
2151
+ { path: 'comments.content.attachments.audio.urlExpirationDate' },
2152
+ {
2153
+ path: 'comments.content.attachments.document.urlExpirationDate',
2154
+ },
2155
+ { path: 'comments.draftContent.commentDate' },
2156
+ {
2157
+ path: 'comments.draftContent.richContent.metadata.createdTimestamp',
2158
+ },
2159
+ {
2160
+ path: 'comments.draftContent.richContent.metadata.updatedTimestamp',
2161
+ },
2162
+ {
2163
+ path: 'comments.draftContent.attachments.image.urlExpirationDate',
2164
+ },
2165
+ {
2166
+ path: 'comments.draftContent.attachments.video.urlExpirationDate',
2167
+ },
2168
+ {
2169
+ path: 'comments.draftContent.attachments.video.posters.urlExpirationDate',
2170
+ },
2171
+ {
2172
+ path: 'comments.draftContent.attachments.audio.urlExpirationDate',
2173
+ },
2174
+ {
2175
+ path: 'comments.draftContent.attachments.document.urlExpirationDate',
2176
+ },
2177
+ { path: 'commentReplies.*.replies.createdDate' },
2178
+ { path: 'commentReplies.*.replies.updatedDate' },
2179
+ { path: 'commentReplies.*.replies.commentDate' },
2180
+ { path: 'commentReplies.*.replies.content.commentDate' },
2181
+ {
2182
+ path: 'commentReplies.*.replies.content.richContent.metadata.createdTimestamp',
2183
+ },
2184
+ {
2185
+ path: 'commentReplies.*.replies.content.richContent.metadata.updatedTimestamp',
2186
+ },
2187
+ {
2188
+ path: 'commentReplies.*.replies.content.attachments.image.urlExpirationDate',
2189
+ },
2190
+ {
2191
+ path: 'commentReplies.*.replies.content.attachments.video.urlExpirationDate',
2192
+ },
2193
+ {
2194
+ path: 'commentReplies.*.replies.content.attachments.video.posters.urlExpirationDate',
2195
+ },
2196
+ {
2197
+ path: 'commentReplies.*.replies.content.attachments.audio.urlExpirationDate',
2198
+ },
2199
+ {
2200
+ path: 'commentReplies.*.replies.content.attachments.document.urlExpirationDate',
2201
+ },
2202
+ { path: 'commentReplies.*.replies.draftContent.commentDate' },
2203
+ {
2204
+ path: 'commentReplies.*.replies.draftContent.richContent.metadata.createdTimestamp',
2205
+ },
2206
+ {
2207
+ path: 'commentReplies.*.replies.draftContent.richContent.metadata.updatedTimestamp',
2208
+ },
2209
+ {
2210
+ path: 'commentReplies.*.replies.draftContent.attachments.image.urlExpirationDate',
2211
+ },
2212
+ {
2213
+ path: 'commentReplies.*.replies.draftContent.attachments.video.urlExpirationDate',
2214
+ },
2215
+ {
2216
+ path: 'commentReplies.*.replies.draftContent.attachments.video.posters.urlExpirationDate',
2217
+ },
2218
+ {
2219
+ path: 'commentReplies.*.replies.draftContent.attachments.audio.urlExpirationDate',
2220
+ },
2221
+ {
2222
+ path: 'commentReplies.*.replies.draftContent.attachments.document.urlExpirationDate',
2223
+ },
2224
+ ],
2225
+ },
2226
+ {
2227
+ transformFn: transformRESTFloatToSDKFloat,
2228
+ paths: [
2229
+ {
2230
+ path: 'comments.content.richContent.nodes.galleryData.items.image.media.duration',
2231
+ },
2232
+ {
2233
+ path: 'comments.content.richContent.nodes.galleryData.items.video.media.duration',
2234
+ },
2235
+ {
2236
+ path: 'comments.content.richContent.nodes.galleryData.items.video.thumbnail.duration',
2237
+ },
2238
+ {
2239
+ path: 'comments.content.richContent.nodes.galleryData.options.item.ratio',
2240
+ },
2241
+ {
2242
+ path: 'comments.content.richContent.nodes.imageData.image.duration',
2243
+ },
2244
+ {
2245
+ path: 'comments.content.richContent.nodes.mapData.mapSettings.lat',
2246
+ },
2247
+ {
2248
+ path: 'comments.content.richContent.nodes.mapData.mapSettings.lng',
2249
+ },
2250
+ {
2251
+ path: 'comments.content.richContent.nodes.pollData.poll.image.duration',
2252
+ },
2253
+ {
2254
+ path: 'comments.content.richContent.nodes.pollData.poll.options.image.duration',
2255
+ },
2256
+ {
2257
+ path: 'comments.content.richContent.nodes.pollData.design.poll.background.image.duration',
2258
+ },
2259
+ {
2260
+ path: 'comments.content.richContent.nodes.appEmbedData.image.duration',
2261
+ },
2262
+ {
2263
+ path: 'comments.content.richContent.nodes.videoData.video.duration',
2264
+ },
2265
+ {
2266
+ path: 'comments.content.richContent.nodes.videoData.thumbnail.duration',
2267
+ },
2268
+ {
2269
+ path: 'comments.content.richContent.nodes.audioData.audio.duration',
2270
+ },
2271
+ {
2272
+ path: 'comments.content.richContent.nodes.audioData.coverImage.duration',
2273
+ },
2274
+ {
2275
+ path: 'comments.draftContent.richContent.nodes.galleryData.items.image.media.duration',
2276
+ },
2277
+ {
2278
+ path: 'comments.draftContent.richContent.nodes.galleryData.items.video.media.duration',
2279
+ },
2280
+ {
2281
+ path: 'comments.draftContent.richContent.nodes.galleryData.items.video.thumbnail.duration',
2282
+ },
2283
+ {
2284
+ path: 'comments.draftContent.richContent.nodes.galleryData.options.item.ratio',
2285
+ },
2286
+ {
2287
+ path: 'comments.draftContent.richContent.nodes.imageData.image.duration',
2288
+ },
2289
+ {
2290
+ path: 'comments.draftContent.richContent.nodes.mapData.mapSettings.lat',
2291
+ },
2292
+ {
2293
+ path: 'comments.draftContent.richContent.nodes.mapData.mapSettings.lng',
2294
+ },
2295
+ {
2296
+ path: 'comments.draftContent.richContent.nodes.pollData.poll.image.duration',
2297
+ },
2298
+ {
2299
+ path: 'comments.draftContent.richContent.nodes.pollData.poll.options.image.duration',
2300
+ },
2301
+ {
2302
+ path: 'comments.draftContent.richContent.nodes.pollData.design.poll.background.image.duration',
2303
+ },
2304
+ {
2305
+ path: 'comments.draftContent.richContent.nodes.appEmbedData.image.duration',
2306
+ },
2307
+ {
2308
+ path: 'comments.draftContent.richContent.nodes.videoData.video.duration',
2309
+ },
2310
+ {
2311
+ path: 'comments.draftContent.richContent.nodes.videoData.thumbnail.duration',
2312
+ },
2313
+ {
2314
+ path: 'comments.draftContent.richContent.nodes.audioData.audio.duration',
2315
+ },
2316
+ {
2317
+ path: 'comments.draftContent.richContent.nodes.audioData.coverImage.duration',
2318
+ },
2319
+ {
2320
+ path: 'commentReplies.*.replies.content.richContent.nodes.galleryData.items.image.media.duration',
2321
+ },
2322
+ {
2323
+ path: 'commentReplies.*.replies.content.richContent.nodes.galleryData.items.video.media.duration',
2324
+ },
2325
+ {
2326
+ path: 'commentReplies.*.replies.content.richContent.nodes.galleryData.items.video.thumbnail.duration',
2327
+ },
2328
+ {
2329
+ path: 'commentReplies.*.replies.content.richContent.nodes.galleryData.options.item.ratio',
2330
+ },
2331
+ {
2332
+ path: 'commentReplies.*.replies.content.richContent.nodes.imageData.image.duration',
2333
+ },
2334
+ {
2335
+ path: 'commentReplies.*.replies.content.richContent.nodes.mapData.mapSettings.lat',
2336
+ },
2337
+ {
2338
+ path: 'commentReplies.*.replies.content.richContent.nodes.mapData.mapSettings.lng',
2339
+ },
2340
+ {
2341
+ path: 'commentReplies.*.replies.content.richContent.nodes.pollData.poll.image.duration',
2342
+ },
2343
+ {
2344
+ path: 'commentReplies.*.replies.content.richContent.nodes.pollData.poll.options.image.duration',
2345
+ },
2346
+ {
2347
+ path: 'commentReplies.*.replies.content.richContent.nodes.pollData.design.poll.background.image.duration',
2348
+ },
2349
+ {
2350
+ path: 'commentReplies.*.replies.content.richContent.nodes.appEmbedData.image.duration',
2351
+ },
2352
+ {
2353
+ path: 'commentReplies.*.replies.content.richContent.nodes.videoData.video.duration',
2354
+ },
2355
+ {
2356
+ path: 'commentReplies.*.replies.content.richContent.nodes.videoData.thumbnail.duration',
2357
+ },
2358
+ {
2359
+ path: 'commentReplies.*.replies.content.richContent.nodes.audioData.audio.duration',
2360
+ },
2361
+ {
2362
+ path: 'commentReplies.*.replies.content.richContent.nodes.audioData.coverImage.duration',
2363
+ },
2364
+ {
2365
+ path: 'commentReplies.*.replies.draftContent.richContent.nodes.galleryData.items.image.media.duration',
2366
+ },
2367
+ {
2368
+ path: 'commentReplies.*.replies.draftContent.richContent.nodes.galleryData.items.video.media.duration',
2369
+ },
2370
+ {
2371
+ path: 'commentReplies.*.replies.draftContent.richContent.nodes.galleryData.items.video.thumbnail.duration',
2372
+ },
2373
+ {
2374
+ path: 'commentReplies.*.replies.draftContent.richContent.nodes.galleryData.options.item.ratio',
2375
+ },
2376
+ {
2377
+ path: 'commentReplies.*.replies.draftContent.richContent.nodes.imageData.image.duration',
2378
+ },
2379
+ {
2380
+ path: 'commentReplies.*.replies.draftContent.richContent.nodes.mapData.mapSettings.lat',
2381
+ },
2382
+ {
2383
+ path: 'commentReplies.*.replies.draftContent.richContent.nodes.mapData.mapSettings.lng',
2384
+ },
2385
+ {
2386
+ path: 'commentReplies.*.replies.draftContent.richContent.nodes.pollData.poll.image.duration',
2387
+ },
2388
+ {
2389
+ path: 'commentReplies.*.replies.draftContent.richContent.nodes.pollData.poll.options.image.duration',
2390
+ },
2391
+ {
2392
+ path: 'commentReplies.*.replies.draftContent.richContent.nodes.pollData.design.poll.background.image.duration',
2393
+ },
2394
+ {
2395
+ path: 'commentReplies.*.replies.draftContent.richContent.nodes.appEmbedData.image.duration',
2396
+ },
2397
+ {
2398
+ path: 'commentReplies.*.replies.draftContent.richContent.nodes.videoData.video.duration',
2399
+ },
2400
+ {
2401
+ path: 'commentReplies.*.replies.draftContent.richContent.nodes.videoData.thumbnail.duration',
2402
+ },
2403
+ {
2404
+ path: 'commentReplies.*.replies.draftContent.richContent.nodes.audioData.audio.duration',
2405
+ },
2406
+ {
2407
+ path: 'commentReplies.*.replies.draftContent.richContent.nodes.audioData.coverImage.duration',
2408
+ },
2409
+ ],
2410
+ },
2411
+ ]),
2412
+ };
2413
+ return metadata;
2414
+ }
2415
+ return __getCommentThread;
2416
+ }
2417
+ /** Publishes multiple comments with the `HIDDEN` status. The comment status becomes `PUBLISHED`. */
2418
+ export function bulkPublishComment(payload) {
2419
+ function __bulkPublishComment({ host }) {
2420
+ const metadata = {
2421
+ entityFqdn: 'wix.comments.v2.comment',
2422
+ method: 'POST',
2423
+ methodFqn: 'wix.comments.ng.v1.CommentsNg.BulkPublishComment',
2424
+ packageName: PACKAGE_NAME,
2425
+ url: resolveWixCommentsNgV1CommentsNgUrl({
2426
+ protoPath: '/v1/bulk/comments/publish-by-filter',
2427
+ data: payload,
2428
+ host,
2429
+ }),
2430
+ data: payload,
2431
+ };
2432
+ return metadata;
2433
+ }
2434
+ return __bulkPublishComment;
2435
+ }
2436
+ /** Hides multiple comments. The comment status becomes `HIDDEN`. */
2437
+ export function bulkHideComment(payload) {
2438
+ function __bulkHideComment({ host }) {
2439
+ const metadata = {
2440
+ entityFqdn: 'wix.comments.v2.comment',
2441
+ method: 'PUT',
2442
+ methodFqn: 'wix.comments.ng.v1.CommentsNg.BulkHideComment',
2443
+ packageName: PACKAGE_NAME,
2444
+ url: resolveWixCommentsNgV1CommentsNgUrl({
2445
+ protoPath: '/v1/bulk/comments/hide-by-filter',
2446
+ data: payload,
2447
+ host,
2448
+ }),
2449
+ data: payload,
2450
+ };
2451
+ return metadata;
2452
+ }
2453
+ return __bulkHideComment;
2454
+ }
2455
+ /** Deletes multiple comments. */
2456
+ export function bulkDeleteComment(payload) {
2457
+ function __bulkDeleteComment({ host }) {
2458
+ const metadata = {
2459
+ entityFqdn: 'wix.comments.v2.comment',
2460
+ method: 'PUT',
2461
+ methodFqn: 'wix.comments.ng.v1.CommentsNg.BulkDeleteComment',
2462
+ packageName: PACKAGE_NAME,
2463
+ url: resolveWixCommentsNgV1CommentsNgUrl({
2464
+ protoPath: '/v1/bulk/comments/delete-by-filter',
2465
+ data: payload,
2466
+ host,
2467
+ }),
2468
+ data: payload,
2469
+ };
2470
+ return metadata;
2471
+ }
2472
+ return __bulkDeleteComment;
2473
+ }
2474
+ /** Moderates the draft content of multiple comments. */
2475
+ export function bulkModerateDraftContent(payload) {
2476
+ function __bulkModerateDraftContent({ host }) {
2477
+ const metadata = {
2478
+ entityFqdn: 'wix.comments.v2.comment',
2479
+ method: 'POST',
2480
+ methodFqn: 'wix.comments.ng.v1.CommentsNg.BulkModerateDraftContent',
2481
+ packageName: PACKAGE_NAME,
2482
+ url: resolveWixCommentsNgV1CommentsNgUrl({
2483
+ protoPath: '/v1/bulk/comments/moderate-by-filter',
2484
+ data: payload,
2485
+ host,
2486
+ }),
2487
+ data: payload,
2488
+ };
2489
+ return metadata;
2490
+ }
2491
+ return __bulkModerateDraftContent;
2492
+ }
2493
+ /** Moves multiple comments to another resource. */
2494
+ export function bulkMoveCommentByFilter(payload) {
2495
+ function __bulkMoveCommentByFilter({ host }) {
2496
+ const metadata = {
2497
+ entityFqdn: 'wix.comments.v2.comment',
2498
+ method: 'PUT',
2499
+ methodFqn: 'wix.comments.ng.v1.CommentsNg.BulkMoveCommentByFilter',
2500
+ packageName: PACKAGE_NAME,
2501
+ url: resolveWixCommentsNgV1CommentsNgUrl({
2502
+ protoPath: '/v1/bulk/comments/move-by-filter',
2503
+ data: payload,
2504
+ host,
2505
+ }),
2506
+ data: payload,
2507
+ };
2508
+ return metadata;
2509
+ }
2510
+ return __bulkMoveCommentByFilter;
2511
+ }
2512
+ //# sourceMappingURL=comments-v2-comment-comments.http.js.map