@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,1529 @@
1
+ import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
2
+ import { queryBuilder } from '@wix/sdk-runtime/query-builder';
3
+ import { renameKeysFromSDKRequestToRESTRequest, renameKeysFromRESTResponseToSDKResponse, } from '@wix/sdk-runtime/rename-all-nested-keys';
4
+ import * as ambassadorWixCommentsV2Comment from './comments-v2-comment-comments.http.js';
5
+ // @ts-ignore
6
+ import { transformSDKAudioToRESTAudio } from '@wix/sdk-runtime/transformations/audio';
7
+ import { transformRESTAudioToSDKAudio } from '@wix/sdk-runtime/transformations/audio';
8
+ import { transformSDKImageToRESTImage } from '@wix/sdk-runtime/transformations/image';
9
+ import { transformRESTImageToSDKImage } from '@wix/sdk-runtime/transformations/image';
10
+ import { transformSDKVideoV2ToRESTVideoV2 } from '@wix/sdk-runtime/transformations/video-v2';
11
+ import { transformRESTVideoV2ToSDKVideoV2 } from '@wix/sdk-runtime/transformations/video-v2';
12
+ import { transformSDKDocumentToRESTDocument } from '@wix/sdk-runtime/transformations/document';
13
+ import { transformRESTDocumentToSDKDocument } from '@wix/sdk-runtime/transformations/document';
14
+ import { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';
15
+ export var NodeType;
16
+ (function (NodeType) {
17
+ NodeType["PARAGRAPH"] = "PARAGRAPH";
18
+ NodeType["TEXT"] = "TEXT";
19
+ NodeType["HEADING"] = "HEADING";
20
+ NodeType["BULLETED_LIST"] = "BULLETED_LIST";
21
+ NodeType["ORDERED_LIST"] = "ORDERED_LIST";
22
+ NodeType["LIST_ITEM"] = "LIST_ITEM";
23
+ NodeType["BLOCKQUOTE"] = "BLOCKQUOTE";
24
+ NodeType["CODE_BLOCK"] = "CODE_BLOCK";
25
+ NodeType["VIDEO"] = "VIDEO";
26
+ NodeType["DIVIDER"] = "DIVIDER";
27
+ NodeType["FILE"] = "FILE";
28
+ NodeType["GALLERY"] = "GALLERY";
29
+ NodeType["GIF"] = "GIF";
30
+ NodeType["HTML"] = "HTML";
31
+ NodeType["IMAGE"] = "IMAGE";
32
+ NodeType["LINK_PREVIEW"] = "LINK_PREVIEW";
33
+ /** @deprecated */
34
+ NodeType["MAP"] = "MAP";
35
+ NodeType["POLL"] = "POLL";
36
+ NodeType["APP_EMBED"] = "APP_EMBED";
37
+ NodeType["BUTTON"] = "BUTTON";
38
+ NodeType["COLLAPSIBLE_LIST"] = "COLLAPSIBLE_LIST";
39
+ NodeType["TABLE"] = "TABLE";
40
+ NodeType["EMBED"] = "EMBED";
41
+ NodeType["COLLAPSIBLE_ITEM"] = "COLLAPSIBLE_ITEM";
42
+ NodeType["COLLAPSIBLE_ITEM_TITLE"] = "COLLAPSIBLE_ITEM_TITLE";
43
+ NodeType["COLLAPSIBLE_ITEM_BODY"] = "COLLAPSIBLE_ITEM_BODY";
44
+ NodeType["TABLE_CELL"] = "TABLE_CELL";
45
+ NodeType["TABLE_ROW"] = "TABLE_ROW";
46
+ NodeType["EXTERNAL"] = "EXTERNAL";
47
+ NodeType["AUDIO"] = "AUDIO";
48
+ NodeType["CAPTION"] = "CAPTION";
49
+ NodeType["LAYOUT"] = "LAYOUT";
50
+ NodeType["LAYOUT_CELL"] = "LAYOUT_CELL";
51
+ })(NodeType || (NodeType = {}));
52
+ export var WidthType;
53
+ (function (WidthType) {
54
+ /** Width matches the content width */
55
+ WidthType["CONTENT"] = "CONTENT";
56
+ /** Small Width */
57
+ WidthType["SMALL"] = "SMALL";
58
+ /** Width will match the original asset width */
59
+ WidthType["ORIGINAL"] = "ORIGINAL";
60
+ /** coast-to-coast display */
61
+ WidthType["FULL_WIDTH"] = "FULL_WIDTH";
62
+ })(WidthType || (WidthType = {}));
63
+ export var PluginContainerDataAlignment;
64
+ (function (PluginContainerDataAlignment) {
65
+ /** Center Alignment */
66
+ PluginContainerDataAlignment["CENTER"] = "CENTER";
67
+ /** Left Alignment */
68
+ PluginContainerDataAlignment["LEFT"] = "LEFT";
69
+ /** Right Alignment */
70
+ PluginContainerDataAlignment["RIGHT"] = "RIGHT";
71
+ })(PluginContainerDataAlignment || (PluginContainerDataAlignment = {}));
72
+ export var Type;
73
+ (function (Type) {
74
+ /** Regular link button */
75
+ Type["LINK"] = "LINK";
76
+ /** Triggers custom action that is defined in plugin configuration by the consumer */
77
+ Type["ACTION"] = "ACTION";
78
+ })(Type || (Type = {}));
79
+ export var Target;
80
+ (function (Target) {
81
+ /** Opens the linked document in the same frame as it was clicked (this is default) */
82
+ Target["SELF"] = "SELF";
83
+ /** Opens the linked document in a new window or tab */
84
+ Target["BLANK"] = "BLANK";
85
+ /** Opens the linked document in the parent frame */
86
+ Target["PARENT"] = "PARENT";
87
+ /** Opens the linked document in the full body of the window */
88
+ Target["TOP"] = "TOP";
89
+ })(Target || (Target = {}));
90
+ export var TextAlignment;
91
+ (function (TextAlignment) {
92
+ /** browser default, eqivalent to `initial` */
93
+ TextAlignment["AUTO"] = "AUTO";
94
+ /** Left align */
95
+ TextAlignment["LEFT"] = "LEFT";
96
+ /** Right align */
97
+ TextAlignment["RIGHT"] = "RIGHT";
98
+ /** Center align */
99
+ TextAlignment["CENTER"] = "CENTER";
100
+ /** Text is spaced to line up its left and right edges to the left and right edges of the line box, except for the last line */
101
+ TextAlignment["JUSTIFY"] = "JUSTIFY";
102
+ })(TextAlignment || (TextAlignment = {}));
103
+ export var LineStyle;
104
+ (function (LineStyle) {
105
+ /** Single Line */
106
+ LineStyle["SINGLE"] = "SINGLE";
107
+ /** Double Line */
108
+ LineStyle["DOUBLE"] = "DOUBLE";
109
+ /** Dashed Line */
110
+ LineStyle["DASHED"] = "DASHED";
111
+ /** Dotted Line */
112
+ LineStyle["DOTTED"] = "DOTTED";
113
+ })(LineStyle || (LineStyle = {}));
114
+ export var Width;
115
+ (function (Width) {
116
+ /** Large line */
117
+ Width["LARGE"] = "LARGE";
118
+ /** Medium line */
119
+ Width["MEDIUM"] = "MEDIUM";
120
+ /** Small line */
121
+ Width["SMALL"] = "SMALL";
122
+ })(Width || (Width = {}));
123
+ export var Alignment;
124
+ (function (Alignment) {
125
+ /** Center alignment */
126
+ Alignment["CENTER"] = "CENTER";
127
+ /** Left alignment */
128
+ Alignment["LEFT"] = "LEFT";
129
+ /** Right alignment */
130
+ Alignment["RIGHT"] = "RIGHT";
131
+ })(Alignment || (Alignment = {}));
132
+ export var ViewMode;
133
+ (function (ViewMode) {
134
+ /** No PDF view */
135
+ ViewMode["NONE"] = "NONE";
136
+ /** Full PDF view */
137
+ ViewMode["FULL"] = "FULL";
138
+ /** Mini PDF view */
139
+ ViewMode["MINI"] = "MINI";
140
+ })(ViewMode || (ViewMode = {}));
141
+ export var LayoutType;
142
+ (function (LayoutType) {
143
+ /** Collage type */
144
+ LayoutType["COLLAGE"] = "COLLAGE";
145
+ /** Masonry type */
146
+ LayoutType["MASONRY"] = "MASONRY";
147
+ /** Grid type */
148
+ LayoutType["GRID"] = "GRID";
149
+ /** Thumbnail type */
150
+ LayoutType["THUMBNAIL"] = "THUMBNAIL";
151
+ /** Slider type */
152
+ LayoutType["SLIDER"] = "SLIDER";
153
+ /** Slideshow type */
154
+ LayoutType["SLIDESHOW"] = "SLIDESHOW";
155
+ /** Panorama type */
156
+ LayoutType["PANORAMA"] = "PANORAMA";
157
+ /** Column type */
158
+ LayoutType["COLUMN"] = "COLUMN";
159
+ /** Magic type */
160
+ LayoutType["MAGIC"] = "MAGIC";
161
+ /** Fullsize images type */
162
+ LayoutType["FULLSIZE"] = "FULLSIZE";
163
+ })(LayoutType || (LayoutType = {}));
164
+ export var Orientation;
165
+ (function (Orientation) {
166
+ /** Rows Orientation */
167
+ Orientation["ROWS"] = "ROWS";
168
+ /** Columns Orientation */
169
+ Orientation["COLUMNS"] = "COLUMNS";
170
+ })(Orientation || (Orientation = {}));
171
+ export var Crop;
172
+ (function (Crop) {
173
+ /** Crop to fill */
174
+ Crop["FILL"] = "FILL";
175
+ /** Crop to fit */
176
+ Crop["FIT"] = "FIT";
177
+ })(Crop || (Crop = {}));
178
+ export var ThumbnailsAlignment;
179
+ (function (ThumbnailsAlignment) {
180
+ /** Top alignment */
181
+ ThumbnailsAlignment["TOP"] = "TOP";
182
+ /** Right alignment */
183
+ ThumbnailsAlignment["RIGHT"] = "RIGHT";
184
+ /** Bottom alignment */
185
+ ThumbnailsAlignment["BOTTOM"] = "BOTTOM";
186
+ /** Left alignment */
187
+ ThumbnailsAlignment["LEFT"] = "LEFT";
188
+ /** No thumbnail */
189
+ ThumbnailsAlignment["NONE"] = "NONE";
190
+ })(ThumbnailsAlignment || (ThumbnailsAlignment = {}));
191
+ export var GIFType;
192
+ (function (GIFType) {
193
+ GIFType["NORMAL"] = "NORMAL";
194
+ GIFType["STICKER"] = "STICKER";
195
+ })(GIFType || (GIFType = {}));
196
+ export var Source;
197
+ (function (Source) {
198
+ Source["HTML"] = "HTML";
199
+ Source["ADSENSE"] = "ADSENSE";
200
+ })(Source || (Source = {}));
201
+ export var Position;
202
+ (function (Position) {
203
+ /** Thumbnail positioned at the start (left in LTR layouts, right in RTL layouts) */
204
+ Position["START"] = "START";
205
+ /** Thumbnail positioned at the end (right in LTR layouts, left in RTL layouts) */
206
+ Position["END"] = "END";
207
+ /** Thumbnail positioned at the top */
208
+ Position["TOP"] = "TOP";
209
+ /** Thumbnail hidden and not displayed */
210
+ Position["HIDDEN"] = "HIDDEN";
211
+ })(Position || (Position = {}));
212
+ export var MapType;
213
+ (function (MapType) {
214
+ /** Roadmap map type */
215
+ MapType["ROADMAP"] = "ROADMAP";
216
+ /** Satellite map type */
217
+ MapType["SATELITE"] = "SATELITE";
218
+ /** Hybrid map type */
219
+ MapType["HYBRID"] = "HYBRID";
220
+ /** Terrain map type */
221
+ MapType["TERRAIN"] = "TERRAIN";
222
+ })(MapType || (MapType = {}));
223
+ export var ViewRole;
224
+ (function (ViewRole) {
225
+ /** Only Poll creator can view the results */
226
+ ViewRole["CREATOR"] = "CREATOR";
227
+ /** Anyone who voted can see the results */
228
+ ViewRole["VOTERS"] = "VOTERS";
229
+ /** Anyone can see the results, even if one didn't vote */
230
+ ViewRole["EVERYONE"] = "EVERYONE";
231
+ })(ViewRole || (ViewRole = {}));
232
+ export var VoteRole;
233
+ (function (VoteRole) {
234
+ /** Logged in member */
235
+ VoteRole["SITE_MEMBERS"] = "SITE_MEMBERS";
236
+ /** Anyone */
237
+ VoteRole["ALL"] = "ALL";
238
+ })(VoteRole || (VoteRole = {}));
239
+ export var PollLayoutType;
240
+ (function (PollLayoutType) {
241
+ /** List */
242
+ PollLayoutType["LIST"] = "LIST";
243
+ /** Grid */
244
+ PollLayoutType["GRID"] = "GRID";
245
+ })(PollLayoutType || (PollLayoutType = {}));
246
+ export var PollLayoutDirection;
247
+ (function (PollLayoutDirection) {
248
+ /** Left-to-right */
249
+ PollLayoutDirection["LTR"] = "LTR";
250
+ /** Right-to-left */
251
+ PollLayoutDirection["RTL"] = "RTL";
252
+ })(PollLayoutDirection || (PollLayoutDirection = {}));
253
+ export var BackgroundType;
254
+ (function (BackgroundType) {
255
+ /** Color background type */
256
+ BackgroundType["COLOR"] = "COLOR";
257
+ /** Image background type */
258
+ BackgroundType["IMAGE"] = "IMAGE";
259
+ /** Gradiant background type */
260
+ BackgroundType["GRADIENT"] = "GRADIENT";
261
+ })(BackgroundType || (BackgroundType = {}));
262
+ export var DecorationType;
263
+ (function (DecorationType) {
264
+ DecorationType["BOLD"] = "BOLD";
265
+ DecorationType["ITALIC"] = "ITALIC";
266
+ DecorationType["UNDERLINE"] = "UNDERLINE";
267
+ DecorationType["SPOILER"] = "SPOILER";
268
+ DecorationType["ANCHOR"] = "ANCHOR";
269
+ DecorationType["MENTION"] = "MENTION";
270
+ DecorationType["LINK"] = "LINK";
271
+ DecorationType["COLOR"] = "COLOR";
272
+ DecorationType["FONT_SIZE"] = "FONT_SIZE";
273
+ DecorationType["EXTERNAL"] = "EXTERNAL";
274
+ DecorationType["STRIKETHROUGH"] = "STRIKETHROUGH";
275
+ })(DecorationType || (DecorationType = {}));
276
+ export var FontType;
277
+ (function (FontType) {
278
+ FontType["PX"] = "PX";
279
+ FontType["EM"] = "EM";
280
+ })(FontType || (FontType = {}));
281
+ export var AppType;
282
+ (function (AppType) {
283
+ AppType["PRODUCT"] = "PRODUCT";
284
+ AppType["EVENT"] = "EVENT";
285
+ AppType["BOOKING"] = "BOOKING";
286
+ })(AppType || (AppType = {}));
287
+ export var InitialExpandedItems;
288
+ (function (InitialExpandedItems) {
289
+ /** First item will be expended initally */
290
+ InitialExpandedItems["FIRST"] = "FIRST";
291
+ /** All items will expended initally */
292
+ InitialExpandedItems["ALL"] = "ALL";
293
+ /** All items collapsed initally */
294
+ InitialExpandedItems["NONE"] = "NONE";
295
+ })(InitialExpandedItems || (InitialExpandedItems = {}));
296
+ export var Direction;
297
+ (function (Direction) {
298
+ /** Left-to-right */
299
+ Direction["LTR"] = "LTR";
300
+ /** Right-to-left */
301
+ Direction["RTL"] = "RTL";
302
+ })(Direction || (Direction = {}));
303
+ export var VerticalAlignment;
304
+ (function (VerticalAlignment) {
305
+ /** Top alignment */
306
+ VerticalAlignment["TOP"] = "TOP";
307
+ /** Middle alignment */
308
+ VerticalAlignment["MIDDLE"] = "MIDDLE";
309
+ /** Bottom alignment */
310
+ VerticalAlignment["BOTTOM"] = "BOTTOM";
311
+ })(VerticalAlignment || (VerticalAlignment = {}));
312
+ /**
313
+ * `NullValue` is a singleton enumeration to represent the null value for the
314
+ * `Value` type union.
315
+ *
316
+ * The JSON representation for `NullValue` is JSON `null`.
317
+ */
318
+ export var NullValue;
319
+ (function (NullValue) {
320
+ /** Null value. */
321
+ NullValue["NULL_VALUE"] = "NULL_VALUE";
322
+ })(NullValue || (NullValue = {}));
323
+ export var Status;
324
+ (function (Status) {
325
+ /** Unknown status. */
326
+ Status["UNKNOWN"] = "UNKNOWN";
327
+ /** This comment is published and publicly visible. */
328
+ Status["PUBLISHED"] = "PUBLISHED";
329
+ /** This comment is deleted. */
330
+ Status["DELETED"] = "DELETED";
331
+ /** This comment is pending moderation. Moderation is not currently supported. */
332
+ Status["PENDING"] = "PENDING";
333
+ /** This comment has been hidden by a site moderator. */
334
+ Status["HIDDEN"] = "HIDDEN";
335
+ })(Status || (Status = {}));
336
+ export var VersioningMode;
337
+ (function (VersioningMode) {
338
+ /** use default versioning mode agreed with search team */
339
+ VersioningMode["DEFAULT"] = "DEFAULT";
340
+ /** execute only if version is greater than existing */
341
+ VersioningMode["GREATER_THAN"] = "GREATER_THAN";
342
+ /** execute only if version is greater or equal to existing */
343
+ VersioningMode["GREATER_OR_EQUAL"] = "GREATER_OR_EQUAL";
344
+ })(VersioningMode || (VersioningMode = {}));
345
+ export var Action;
346
+ (function (Action) {
347
+ /** Unknown content. */
348
+ Action["UNKNOWN"] = "UNKNOWN";
349
+ /** Approve draft content. */
350
+ Action["APPROVE"] = "APPROVE";
351
+ /** Reject draft content. */
352
+ Action["REJECT"] = "REJECT";
353
+ })(Action || (Action = {}));
354
+ export var SortOrder;
355
+ (function (SortOrder) {
356
+ SortOrder["ASC"] = "ASC";
357
+ SortOrder["DESC"] = "DESC";
358
+ })(SortOrder || (SortOrder = {}));
359
+ export var Order;
360
+ (function (Order) {
361
+ /** Unknown order. */
362
+ Order["UNKNOWN_ORDER"] = "UNKNOWN_ORDER";
363
+ /** Oldest comments appear at the top of the list. */
364
+ Order["OLDEST_FIRST"] = "OLDEST_FIRST";
365
+ /** Newest comments appear at the top of the list. */
366
+ Order["NEWEST_FIRST"] = "NEWEST_FIRST";
367
+ /** Comments with the highest reaction count appear at the top of the list. */
368
+ Order["REACTION_COUNT"] = "REACTION_COUNT";
369
+ /** Comments with the highest vote count appear at the top of the list. */
370
+ Order["NET_VOTE_COUNT"] = "NET_VOTE_COUNT";
371
+ /** Comments with the highest rating appear at the top of the list. */
372
+ Order["RATING"] = "RATING";
373
+ /** Comments with the lowest vote count appear at the top of the list. */
374
+ Order["NET_VOTE_COUNT_ASC"] = "NET_VOTE_COUNT_ASC";
375
+ /** Comments with the lowest rating appear at the top of the list. */
376
+ Order["RATING_ASC"] = "RATING_ASC";
377
+ })(Order || (Order = {}));
378
+ export var ReplySortOrder;
379
+ (function (ReplySortOrder) {
380
+ /** Unknown order. */
381
+ ReplySortOrder["UNKNOWN_ORDER"] = "UNKNOWN_ORDER";
382
+ /** Oldest comments appear at the top of the list. */
383
+ ReplySortOrder["OLDEST_FIRST"] = "OLDEST_FIRST";
384
+ /** Newest comments appear at the top of the list. */
385
+ ReplySortOrder["NEWEST_FIRST"] = "NEWEST_FIRST";
386
+ /** Comments with the highest reaction count appear at the top of the list. */
387
+ ReplySortOrder["REACTION_COUNT"] = "REACTION_COUNT";
388
+ })(ReplySortOrder || (ReplySortOrder = {}));
389
+ export var WebhookIdentityType;
390
+ (function (WebhookIdentityType) {
391
+ WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
392
+ WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
393
+ WebhookIdentityType["MEMBER"] = "MEMBER";
394
+ WebhookIdentityType["WIX_USER"] = "WIX_USER";
395
+ WebhookIdentityType["APP"] = "APP";
396
+ })(WebhookIdentityType || (WebhookIdentityType = {}));
397
+ /**
398
+ * Creates a new comment and publishes it.
399
+ *
400
+ * The `appId`, `contextId`, and `resourceId` are all required and associate the created comment with the specific
401
+ * resource it responds to. See **Integrations** in the Comments introduction for a list of integrated scopes for these fields.
402
+ *
403
+ * If the created comment is a direct response to another comment, the `commentId` of the parent comment should be passed
404
+ * as `parentComment.id` in this comment's request. See **Terminology** in the Comments introduction for additional information on parent comments and replies.
405
+ * @param comment - Comment to create.
406
+ * @public
407
+ * @requiredField comment
408
+ * @requiredField comment.appId
409
+ * @requiredField comment.content
410
+ * @requiredField comment.contextId
411
+ * @requiredField comment.resourceId
412
+ * @permissionId WIX_COMMENTS.COMMENT_CREATE
413
+ * @permissionId WIX_COMMENTS.COMMENT_OVERRIDE_AUTHOR
414
+ * @permissionId WIX_COMMENTS.COMMENT_OVERRIDE_COMMENT_DATE
415
+ * @permissionScope Manage Comments
416
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
417
+ * @permissionScope Manage Comments
418
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
419
+ * @permissionScope Manage Comments
420
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
421
+ * @applicableIdentity APP
422
+ * @returns Created comment.
423
+ * @fqn wix.comments.ng.v1.CommentsNg.CreateComment
424
+ */
425
+ export async function createComment(comment) {
426
+ // @ts-ignore
427
+ const { httpClient, sideEffects } = arguments[1];
428
+ const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({ comment: comment }, [
429
+ 'comment.content.richContent',
430
+ 'comment.draftContent.richContent',
431
+ ]), [
432
+ {
433
+ transformFn: transformSDKImageToRESTImage,
434
+ paths: [
435
+ { path: 'comment.content.attachments.image' },
436
+ { path: 'comment.draftContent.attachments.image' },
437
+ ],
438
+ },
439
+ {
440
+ transformFn: transformSDKVideoV2ToRESTVideoV2,
441
+ paths: [
442
+ { path: 'comment.content.attachments.video' },
443
+ { path: 'comment.draftContent.attachments.video' },
444
+ ],
445
+ },
446
+ {
447
+ transformFn: transformSDKAudioToRESTAudio,
448
+ paths: [
449
+ { path: 'comment.content.attachments.audio' },
450
+ { path: 'comment.draftContent.attachments.audio' },
451
+ ],
452
+ },
453
+ {
454
+ transformFn: transformSDKDocumentToRESTDocument,
455
+ paths: [
456
+ { path: 'comment.content.attachments.document' },
457
+ { path: 'comment.draftContent.attachments.document' },
458
+ ],
459
+ },
460
+ ]);
461
+ const reqOpts = ambassadorWixCommentsV2Comment.createComment(payload);
462
+ sideEffects?.onSiteCall?.();
463
+ try {
464
+ const result = await httpClient.request(reqOpts);
465
+ sideEffects?.onSuccess?.(result);
466
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
467
+ {
468
+ transformFn: transformRESTImageToSDKImage,
469
+ paths: [
470
+ { path: 'comment.content.attachments.image' },
471
+ { path: 'comment.draftContent.attachments.image' },
472
+ ],
473
+ },
474
+ {
475
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
476
+ paths: [
477
+ { path: 'comment.content.attachments.video' },
478
+ { path: 'comment.draftContent.attachments.video' },
479
+ ],
480
+ },
481
+ {
482
+ transformFn: transformRESTAudioToSDKAudio,
483
+ paths: [
484
+ { path: 'comment.content.attachments.audio' },
485
+ { path: 'comment.draftContent.attachments.audio' },
486
+ ],
487
+ },
488
+ {
489
+ transformFn: transformRESTDocumentToSDKDocument,
490
+ paths: [
491
+ { path: 'comment.content.attachments.document' },
492
+ { path: 'comment.draftContent.attachments.document' },
493
+ ],
494
+ },
495
+ ]), ['comment.content.richContent', 'comment.draftContent.richContent'])?.comment;
496
+ }
497
+ catch (err) {
498
+ const transformedError = sdkTransformError(err, {
499
+ spreadPathsToArguments: {},
500
+ explicitPathsToArguments: { comment: '$[0]' },
501
+ singleArgumentUnchanged: false,
502
+ }, ['comment']);
503
+ sideEffects?.onError?.(err);
504
+ throw transformedError;
505
+ }
506
+ }
507
+ /**
508
+ * Retrieves a comment.
509
+ * @param commentId - ID of the comment to retrieve.
510
+ * @public
511
+ * @requiredField commentId
512
+ * @permissionId WIX_COMMENTS.COMMENT_READ
513
+ * @permissionScope Read Comments
514
+ * @permissionScopeId SCOPE.DC_COMMENTS.READ.COMMENTS
515
+ * @permissionScope Manage Comments
516
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
517
+ * @applicableIdentity APP
518
+ * @returns Retrieved comment.
519
+ * @fqn wix.comments.ng.v1.CommentsNg.GetComment
520
+ */
521
+ export async function getComment(commentId) {
522
+ // @ts-ignore
523
+ const { httpClient, sideEffects } = arguments[1];
524
+ const payload = renameKeysFromSDKRequestToRESTRequest({ commentId: commentId }, []);
525
+ const reqOpts = ambassadorWixCommentsV2Comment.getComment(payload);
526
+ sideEffects?.onSiteCall?.();
527
+ try {
528
+ const result = await httpClient.request(reqOpts);
529
+ sideEffects?.onSuccess?.(result);
530
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
531
+ {
532
+ transformFn: transformRESTImageToSDKImage,
533
+ paths: [
534
+ { path: 'comment.content.attachments.image' },
535
+ { path: 'comment.draftContent.attachments.image' },
536
+ ],
537
+ },
538
+ {
539
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
540
+ paths: [
541
+ { path: 'comment.content.attachments.video' },
542
+ { path: 'comment.draftContent.attachments.video' },
543
+ ],
544
+ },
545
+ {
546
+ transformFn: transformRESTAudioToSDKAudio,
547
+ paths: [
548
+ { path: 'comment.content.attachments.audio' },
549
+ { path: 'comment.draftContent.attachments.audio' },
550
+ ],
551
+ },
552
+ {
553
+ transformFn: transformRESTDocumentToSDKDocument,
554
+ paths: [
555
+ { path: 'comment.content.attachments.document' },
556
+ { path: 'comment.draftContent.attachments.document' },
557
+ ],
558
+ },
559
+ ]), ['comment.content.richContent', 'comment.draftContent.richContent'])?.comment;
560
+ }
561
+ catch (err) {
562
+ const transformedError = sdkTransformError(err, {
563
+ spreadPathsToArguments: {},
564
+ explicitPathsToArguments: { commentId: '$[0]' },
565
+ singleArgumentUnchanged: false,
566
+ }, ['commentId']);
567
+ sideEffects?.onError?.(err);
568
+ throw transformedError;
569
+ }
570
+ }
571
+ /**
572
+ * Updates a comment.
573
+ *
574
+ * Each time the comment is updated, `revision` increments by 1. The current `revision` must be
575
+ * passed when updating the comment. This ensures you're working with the latest comment and
576
+ * prevents unintended overwrites.
577
+ * @param _id - Comment ID.
578
+ * @public
579
+ * @requiredField _id
580
+ * @requiredField comment
581
+ * @requiredField comment.revision
582
+ * @permissionId WIX_COMMENTS.COMMENT_UPDATE
583
+ * @permissionScope Manage Comments
584
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
585
+ * @applicableIdentity APP
586
+ * @returns Updated comment.
587
+ * @fqn wix.comments.ng.v1.CommentsNg.UpdateComment
588
+ */
589
+ export async function updateComment(_id, comment) {
590
+ // @ts-ignore
591
+ const { httpClient, sideEffects } = arguments[2];
592
+ const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({ comment: { ...comment, id: _id } }, ['comment.content.richContent', 'comment.draftContent.richContent']), [
593
+ {
594
+ transformFn: transformSDKImageToRESTImage,
595
+ paths: [
596
+ { path: 'comment.content.attachments.image' },
597
+ { path: 'comment.draftContent.attachments.image' },
598
+ ],
599
+ },
600
+ {
601
+ transformFn: transformSDKVideoV2ToRESTVideoV2,
602
+ paths: [
603
+ { path: 'comment.content.attachments.video' },
604
+ { path: 'comment.draftContent.attachments.video' },
605
+ ],
606
+ },
607
+ {
608
+ transformFn: transformSDKAudioToRESTAudio,
609
+ paths: [
610
+ { path: 'comment.content.attachments.audio' },
611
+ { path: 'comment.draftContent.attachments.audio' },
612
+ ],
613
+ },
614
+ {
615
+ transformFn: transformSDKDocumentToRESTDocument,
616
+ paths: [
617
+ { path: 'comment.content.attachments.document' },
618
+ { path: 'comment.draftContent.attachments.document' },
619
+ ],
620
+ },
621
+ ]);
622
+ const reqOpts = ambassadorWixCommentsV2Comment.updateComment(payload);
623
+ sideEffects?.onSiteCall?.();
624
+ try {
625
+ const result = await httpClient.request(reqOpts);
626
+ sideEffects?.onSuccess?.(result);
627
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
628
+ {
629
+ transformFn: transformRESTImageToSDKImage,
630
+ paths: [
631
+ { path: 'comment.content.attachments.image' },
632
+ { path: 'comment.draftContent.attachments.image' },
633
+ ],
634
+ },
635
+ {
636
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
637
+ paths: [
638
+ { path: 'comment.content.attachments.video' },
639
+ { path: 'comment.draftContent.attachments.video' },
640
+ ],
641
+ },
642
+ {
643
+ transformFn: transformRESTAudioToSDKAudio,
644
+ paths: [
645
+ { path: 'comment.content.attachments.audio' },
646
+ { path: 'comment.draftContent.attachments.audio' },
647
+ ],
648
+ },
649
+ {
650
+ transformFn: transformRESTDocumentToSDKDocument,
651
+ paths: [
652
+ { path: 'comment.content.attachments.document' },
653
+ { path: 'comment.draftContent.attachments.document' },
654
+ ],
655
+ },
656
+ ]), ['comment.content.richContent', 'comment.draftContent.richContent'])?.comment;
657
+ }
658
+ catch (err) {
659
+ const transformedError = sdkTransformError(err, {
660
+ spreadPathsToArguments: { comment: '$[1]' },
661
+ explicitPathsToArguments: { 'comment.id': '$[0]' },
662
+ singleArgumentUnchanged: false,
663
+ }, ['_id', 'comment']);
664
+ sideEffects?.onError?.(err);
665
+ throw transformedError;
666
+ }
667
+ }
668
+ /**
669
+ * Deletes a comment.
670
+ *
671
+ * This method deletes the `content` of the comment and sets its `status` to `DELETED`.
672
+ * @param commentId - ID of the comment to delete.
673
+ * @public
674
+ * @requiredField commentId
675
+ * @permissionId WIX_COMMENTS.COMMENT_DELETE
676
+ * @permissionScope Manage Comments
677
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
678
+ * @applicableIdentity APP
679
+ * @fqn wix.comments.ng.v1.CommentsNg.DeleteComment
680
+ */
681
+ export async function deleteComment(commentId) {
682
+ // @ts-ignore
683
+ const { httpClient, sideEffects } = arguments[1];
684
+ const payload = renameKeysFromSDKRequestToRESTRequest({ commentId: commentId }, []);
685
+ const reqOpts = ambassadorWixCommentsV2Comment.deleteComment(payload);
686
+ sideEffects?.onSiteCall?.();
687
+ try {
688
+ const result = await httpClient.request(reqOpts);
689
+ sideEffects?.onSuccess?.(result);
690
+ }
691
+ catch (err) {
692
+ const transformedError = sdkTransformError(err, {
693
+ spreadPathsToArguments: {},
694
+ explicitPathsToArguments: { commentId: '$[0]' },
695
+ singleArgumentUnchanged: false,
696
+ }, ['commentId']);
697
+ sideEffects?.onError?.(err);
698
+ throw transformedError;
699
+ }
700
+ }
701
+ /**
702
+ * Moderates the draft content of a comment.
703
+ *
704
+ * - `APPROVE`: Moves `draftContent` to `content` and updates the comment `status` to `PUBLISHED`.
705
+ * - `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`.
706
+ * @param commentId - ID of the comment to moderate.
707
+ * @param revision - Revision number, which increments by `1` each time the comment is updated.
708
+ *
709
+ * To prevent conflicting changes, the current `revision` must be passed when updating the comment.
710
+ * @public
711
+ * @documentationMaturity preview
712
+ * @requiredField commentId
713
+ * @requiredField revision
714
+ * @permissionId WIX_COMMENTS.COMMENT_MODERATE_DRAFT_CONTENT
715
+ * @permissionScope Manage Comments
716
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
717
+ * @applicableIdentity APP
718
+ * @fqn wix.comments.ng.v1.CommentsNg.ModerateDraftContent
719
+ */
720
+ export async function moderateDraftContent(commentId, revision, options) {
721
+ // @ts-ignore
722
+ const { httpClient, sideEffects } = arguments[3];
723
+ const payload = renameKeysFromSDKRequestToRESTRequest({
724
+ commentId: commentId,
725
+ revision: revision,
726
+ draftContentAction: options?.draftContentAction,
727
+ }, []);
728
+ const reqOpts = ambassadorWixCommentsV2Comment.moderateDraftContent(payload);
729
+ sideEffects?.onSiteCall?.();
730
+ try {
731
+ const result = await httpClient.request(reqOpts);
732
+ sideEffects?.onSuccess?.(result);
733
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
734
+ {
735
+ transformFn: transformRESTImageToSDKImage,
736
+ paths: [
737
+ { path: 'comment.content.attachments.image' },
738
+ { path: 'comment.draftContent.attachments.image' },
739
+ ],
740
+ },
741
+ {
742
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
743
+ paths: [
744
+ { path: 'comment.content.attachments.video' },
745
+ { path: 'comment.draftContent.attachments.video' },
746
+ ],
747
+ },
748
+ {
749
+ transformFn: transformRESTAudioToSDKAudio,
750
+ paths: [
751
+ { path: 'comment.content.attachments.audio' },
752
+ { path: 'comment.draftContent.attachments.audio' },
753
+ ],
754
+ },
755
+ {
756
+ transformFn: transformRESTDocumentToSDKDocument,
757
+ paths: [
758
+ { path: 'comment.content.attachments.document' },
759
+ { path: 'comment.draftContent.attachments.document' },
760
+ ],
761
+ },
762
+ ]), ['comment.content.richContent', 'comment.draftContent.richContent']);
763
+ }
764
+ catch (err) {
765
+ const transformedError = sdkTransformError(err, {
766
+ spreadPathsToArguments: {},
767
+ explicitPathsToArguments: {
768
+ commentId: '$[0]',
769
+ revision: '$[1]',
770
+ draftContentAction: '$[2].draftContentAction',
771
+ },
772
+ singleArgumentUnchanged: false,
773
+ }, ['commentId', 'revision', 'options']);
774
+ sideEffects?.onError?.(err);
775
+ throw transformedError;
776
+ }
777
+ }
778
+ /**
779
+ * Creates a query to retrieve a list of comments.
780
+ *
781
+ * The `queryComments()` function builds a query to retrieve a list of comments and returns a [`CommentsQueryBuilder`](#commentsquerybuilder) object.
782
+ *
783
+ * The returned object contains the query definition, which is typically used to run the query using the [`find()`](#commentsquerybuilder/find) function.
784
+ *
785
+ * 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.
786
+ *
787
+ * `queryComments()` runs with the following `CommentsQueryBuilder` default that you can override:
788
+ * + `ascending("_id")`
789
+ *
790
+ * 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"`.
791
+ *
792
+ * 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).
793
+ * @public
794
+ * @requiredField appId
795
+ * @param appId - App ID to query comments for.
796
+ * @permissionScope Read Comments
797
+ * @permissionScopeId SCOPE.DC_COMMENTS.READ.COMMENTS
798
+ * @permissionScope Manage Comments
799
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
800
+ * @permissionId WIX_COMMENTS.COMMENT_QUERY
801
+ * @applicableIdentity APP
802
+ * @fqn wix.comments.ng.v1.CommentsNg.QueryComments
803
+ */
804
+ export function queryComments(appId) {
805
+ // @ts-ignore
806
+ const { httpClient, sideEffects } = arguments[1];
807
+ return queryBuilder({
808
+ func: async (payload) => {
809
+ const reqOpts = ambassadorWixCommentsV2Comment.queryComments(payload);
810
+ sideEffects?.onSiteCall?.();
811
+ try {
812
+ const result = await httpClient.request(reqOpts);
813
+ sideEffects?.onSuccess?.(result);
814
+ return result;
815
+ }
816
+ catch (err) {
817
+ sideEffects?.onError?.(err);
818
+ throw err;
819
+ }
820
+ },
821
+ requestTransformer: (query) => {
822
+ const args = [query, appId, {}];
823
+ return renameKeysFromSDKRequestToRESTRequest({ appId: args?.[1], ...args?.[2], query: args?.[0] }, []);
824
+ },
825
+ responseTransformer: ({ data }) => {
826
+ const transformedData = renameKeysFromRESTResponseToSDKResponse(transformPaths(data, [
827
+ {
828
+ transformFn: transformRESTImageToSDKImage,
829
+ paths: [
830
+ { path: 'comments.content.attachments.image' },
831
+ { path: 'comments.draftContent.attachments.image' },
832
+ ],
833
+ },
834
+ {
835
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
836
+ paths: [
837
+ { path: 'comments.content.attachments.video' },
838
+ { path: 'comments.draftContent.attachments.video' },
839
+ ],
840
+ },
841
+ {
842
+ transformFn: transformRESTAudioToSDKAudio,
843
+ paths: [
844
+ { path: 'comments.content.attachments.audio' },
845
+ { path: 'comments.draftContent.attachments.audio' },
846
+ ],
847
+ },
848
+ {
849
+ transformFn: transformRESTDocumentToSDKDocument,
850
+ paths: [
851
+ { path: 'comments.content.attachments.document' },
852
+ { path: 'comments.draftContent.attachments.document' },
853
+ ],
854
+ },
855
+ ]), ['comments.content.richContent', 'comments.draftContent.richContent']);
856
+ return {
857
+ items: transformedData?.comments,
858
+ pagingMetadata: transformedData?.pagingMetadata,
859
+ };
860
+ },
861
+ errorTransformer: (err) => {
862
+ const transformedError = sdkTransformError(err, {
863
+ spreadPathsToArguments: {},
864
+ explicitPathsToArguments: { appId: '$[1]', query: '$[0]' },
865
+ singleArgumentUnchanged: false,
866
+ });
867
+ throw transformedError;
868
+ },
869
+ pagingMethod: 'CURSOR',
870
+ transformationPaths: {},
871
+ });
872
+ }
873
+ /**
874
+ * Sets `marked` to `TRUE` to mark a comment.
875
+ *
876
+ * Call Query Comments to filter for marked comments to then apply customization to.
877
+ * See Sample Flows for an example.
878
+ * @param commentId - ID of the comment to mark.
879
+ * @public
880
+ * @requiredField commentId
881
+ * @permissionId WIX_COMMENTS.COMMENT_MARK
882
+ * @permissionScope Manage Comments
883
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
884
+ * @applicableIdentity APP
885
+ * @fqn wix.comments.ng.v1.CommentsNg.MarkComment
886
+ */
887
+ export async function markComment(commentId) {
888
+ // @ts-ignore
889
+ const { httpClient, sideEffects } = arguments[1];
890
+ const payload = renameKeysFromSDKRequestToRESTRequest({ commentId: commentId }, []);
891
+ const reqOpts = ambassadorWixCommentsV2Comment.markComment(payload);
892
+ sideEffects?.onSiteCall?.();
893
+ try {
894
+ const result = await httpClient.request(reqOpts);
895
+ sideEffects?.onSuccess?.(result);
896
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
897
+ {
898
+ transformFn: transformRESTImageToSDKImage,
899
+ paths: [
900
+ { path: 'comment.content.attachments.image' },
901
+ { path: 'comment.draftContent.attachments.image' },
902
+ ],
903
+ },
904
+ {
905
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
906
+ paths: [
907
+ { path: 'comment.content.attachments.video' },
908
+ { path: 'comment.draftContent.attachments.video' },
909
+ ],
910
+ },
911
+ {
912
+ transformFn: transformRESTAudioToSDKAudio,
913
+ paths: [
914
+ { path: 'comment.content.attachments.audio' },
915
+ { path: 'comment.draftContent.attachments.audio' },
916
+ ],
917
+ },
918
+ {
919
+ transformFn: transformRESTDocumentToSDKDocument,
920
+ paths: [
921
+ { path: 'comment.content.attachments.document' },
922
+ { path: 'comment.draftContent.attachments.document' },
923
+ ],
924
+ },
925
+ ]), ['comment.content.richContent', 'comment.draftContent.richContent']);
926
+ }
927
+ catch (err) {
928
+ const transformedError = sdkTransformError(err, {
929
+ spreadPathsToArguments: {},
930
+ explicitPathsToArguments: { commentId: '$[0]' },
931
+ singleArgumentUnchanged: false,
932
+ }, ['commentId']);
933
+ sideEffects?.onError?.(err);
934
+ throw transformedError;
935
+ }
936
+ }
937
+ /**
938
+ * Sets `marked` to `FALSE` to unmark a comment.
939
+ * @param commentId - ID of the comment to unmark.
940
+ * @public
941
+ * @requiredField commentId
942
+ * @permissionId WIX_COMMENTS.COMMENT_MARK
943
+ * @permissionScope Manage Comments
944
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
945
+ * @applicableIdentity APP
946
+ * @fqn wix.comments.ng.v1.CommentsNg.UnmarkComment
947
+ */
948
+ export async function unmarkComment(commentId) {
949
+ // @ts-ignore
950
+ const { httpClient, sideEffects } = arguments[1];
951
+ const payload = renameKeysFromSDKRequestToRESTRequest({ commentId: commentId }, []);
952
+ const reqOpts = ambassadorWixCommentsV2Comment.unmarkComment(payload);
953
+ sideEffects?.onSiteCall?.();
954
+ try {
955
+ const result = await httpClient.request(reqOpts);
956
+ sideEffects?.onSuccess?.(result);
957
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
958
+ {
959
+ transformFn: transformRESTImageToSDKImage,
960
+ paths: [
961
+ { path: 'comment.content.attachments.image' },
962
+ { path: 'comment.draftContent.attachments.image' },
963
+ ],
964
+ },
965
+ {
966
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
967
+ paths: [
968
+ { path: 'comment.content.attachments.video' },
969
+ { path: 'comment.draftContent.attachments.video' },
970
+ ],
971
+ },
972
+ {
973
+ transformFn: transformRESTAudioToSDKAudio,
974
+ paths: [
975
+ { path: 'comment.content.attachments.audio' },
976
+ { path: 'comment.draftContent.attachments.audio' },
977
+ ],
978
+ },
979
+ {
980
+ transformFn: transformRESTDocumentToSDKDocument,
981
+ paths: [
982
+ { path: 'comment.content.attachments.document' },
983
+ { path: 'comment.draftContent.attachments.document' },
984
+ ],
985
+ },
986
+ ]), ['comment.content.richContent', 'comment.draftContent.richContent']);
987
+ }
988
+ catch (err) {
989
+ const transformedError = sdkTransformError(err, {
990
+ spreadPathsToArguments: {},
991
+ explicitPathsToArguments: { commentId: '$[0]' },
992
+ singleArgumentUnchanged: false,
993
+ }, ['commentId']);
994
+ sideEffects?.onError?.(err);
995
+ throw transformedError;
996
+ }
997
+ }
998
+ /**
999
+ * Hides a comment in a widget. The comment status becomes `HIDDEN`.
1000
+ * @param commentId - ID of the comment to hide.
1001
+ * @public
1002
+ * @documentationMaturity preview
1003
+ * @requiredField commentId
1004
+ * @permissionId WIX_COMMENTS.COMMENT_HIDE
1005
+ * @permissionScope Manage Comments
1006
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
1007
+ * @applicableIdentity APP
1008
+ * @fqn wix.comments.ng.v1.CommentsNg.HideComment
1009
+ */
1010
+ export async function hideComment(commentId) {
1011
+ // @ts-ignore
1012
+ const { httpClient, sideEffects } = arguments[1];
1013
+ const payload = renameKeysFromSDKRequestToRESTRequest({ commentId: commentId }, []);
1014
+ const reqOpts = ambassadorWixCommentsV2Comment.hideComment(payload);
1015
+ sideEffects?.onSiteCall?.();
1016
+ try {
1017
+ const result = await httpClient.request(reqOpts);
1018
+ sideEffects?.onSuccess?.(result);
1019
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1020
+ {
1021
+ transformFn: transformRESTImageToSDKImage,
1022
+ paths: [
1023
+ { path: 'comment.content.attachments.image' },
1024
+ { path: 'comment.draftContent.attachments.image' },
1025
+ ],
1026
+ },
1027
+ {
1028
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
1029
+ paths: [
1030
+ { path: 'comment.content.attachments.video' },
1031
+ { path: 'comment.draftContent.attachments.video' },
1032
+ ],
1033
+ },
1034
+ {
1035
+ transformFn: transformRESTAudioToSDKAudio,
1036
+ paths: [
1037
+ { path: 'comment.content.attachments.audio' },
1038
+ { path: 'comment.draftContent.attachments.audio' },
1039
+ ],
1040
+ },
1041
+ {
1042
+ transformFn: transformRESTDocumentToSDKDocument,
1043
+ paths: [
1044
+ { path: 'comment.content.attachments.document' },
1045
+ { path: 'comment.draftContent.attachments.document' },
1046
+ ],
1047
+ },
1048
+ ]), ['comment.content.richContent', 'comment.draftContent.richContent']);
1049
+ }
1050
+ catch (err) {
1051
+ const transformedError = sdkTransformError(err, {
1052
+ spreadPathsToArguments: {},
1053
+ explicitPathsToArguments: { commentId: '$[0]' },
1054
+ singleArgumentUnchanged: false,
1055
+ }, ['commentId']);
1056
+ sideEffects?.onError?.(err);
1057
+ throw transformedError;
1058
+ }
1059
+ }
1060
+ /**
1061
+ * Publishes a comment with the `HIDDEN` status. The comment status becomes `PUBLISHED`.
1062
+ *
1063
+ * To publish a new comment, call Create Comment.
1064
+ * @param commentId - ID of the comment to publish.
1065
+ * @public
1066
+ * @documentationMaturity preview
1067
+ * @requiredField commentId
1068
+ * @permissionId WIX_COMMENTS.COMMENT_PUBLISH
1069
+ * @permissionScope Manage Comments
1070
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
1071
+ * @applicableIdentity APP
1072
+ * @fqn wix.comments.ng.v1.CommentsNg.PublishComment
1073
+ */
1074
+ export async function publishComment(commentId) {
1075
+ // @ts-ignore
1076
+ const { httpClient, sideEffects } = arguments[1];
1077
+ const payload = renameKeysFromSDKRequestToRESTRequest({ commentId: commentId }, []);
1078
+ const reqOpts = ambassadorWixCommentsV2Comment.publishComment(payload);
1079
+ sideEffects?.onSiteCall?.();
1080
+ try {
1081
+ const result = await httpClient.request(reqOpts);
1082
+ sideEffects?.onSuccess?.(result);
1083
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1084
+ {
1085
+ transformFn: transformRESTImageToSDKImage,
1086
+ paths: [
1087
+ { path: 'comment.content.attachments.image' },
1088
+ { path: 'comment.draftContent.attachments.image' },
1089
+ ],
1090
+ },
1091
+ {
1092
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
1093
+ paths: [
1094
+ { path: 'comment.content.attachments.video' },
1095
+ { path: 'comment.draftContent.attachments.video' },
1096
+ ],
1097
+ },
1098
+ {
1099
+ transformFn: transformRESTAudioToSDKAudio,
1100
+ paths: [
1101
+ { path: 'comment.content.attachments.audio' },
1102
+ { path: 'comment.draftContent.attachments.audio' },
1103
+ ],
1104
+ },
1105
+ {
1106
+ transformFn: transformRESTDocumentToSDKDocument,
1107
+ paths: [
1108
+ { path: 'comment.content.attachments.document' },
1109
+ { path: 'comment.draftContent.attachments.document' },
1110
+ ],
1111
+ },
1112
+ ]), ['comment.content.richContent', 'comment.draftContent.richContent']);
1113
+ }
1114
+ catch (err) {
1115
+ const transformedError = sdkTransformError(err, {
1116
+ spreadPathsToArguments: {},
1117
+ explicitPathsToArguments: { commentId: '$[0]' },
1118
+ singleArgumentUnchanged: false,
1119
+ }, ['commentId']);
1120
+ sideEffects?.onError?.(err);
1121
+ throw transformedError;
1122
+ }
1123
+ }
1124
+ /**
1125
+ * Counts comments, given the specified filtering. Comments with the `HIDDEN` status are not included in the response.
1126
+ * @param appId - App ID to count the comments of.
1127
+ * @public
1128
+ * @requiredField appId
1129
+ * @permissionId WIX_COMMENTS.COMMENT_COUNT
1130
+ * @permissionScope Manage Comments
1131
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
1132
+ * @applicableIdentity APP
1133
+ * @fqn wix.comments.ng.v1.CommentsNg.CountComments
1134
+ */
1135
+ export async function countComments(appId, options) {
1136
+ // @ts-ignore
1137
+ const { httpClient, sideEffects } = arguments[2];
1138
+ const payload = renameKeysFromSDKRequestToRESTRequest({ appId: appId, filter: options?.filter }, []);
1139
+ const reqOpts = ambassadorWixCommentsV2Comment.countComments(payload);
1140
+ sideEffects?.onSiteCall?.();
1141
+ try {
1142
+ const result = await httpClient.request(reqOpts);
1143
+ sideEffects?.onSuccess?.(result);
1144
+ return renameKeysFromRESTResponseToSDKResponse(result.data, []);
1145
+ }
1146
+ catch (err) {
1147
+ const transformedError = sdkTransformError(err, {
1148
+ spreadPathsToArguments: {},
1149
+ explicitPathsToArguments: { appId: '$[0]', filter: '$[1].filter' },
1150
+ singleArgumentUnchanged: false,
1151
+ }, ['appId', 'options']);
1152
+ sideEffects?.onError?.(err);
1153
+ throw transformedError;
1154
+ }
1155
+ }
1156
+ /**
1157
+ * Lists published comments and replies from a specified resource, such as a blog post.
1158
+ * @param appId - ID of the app from which the comments are listed.
1159
+ * @public
1160
+ * @documentationMaturity preview
1161
+ * @requiredField appId
1162
+ * @requiredField options.contextId
1163
+ * @requiredField options.resourceId
1164
+ * @permissionId WIX_COMMENTS.COMMENT_LIST
1165
+ * @permissionScope Read Comments
1166
+ * @permissionScopeId SCOPE.DC_COMMENTS.READ.COMMENTS
1167
+ * @permissionScope Manage Comments
1168
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
1169
+ * @applicableIdentity APP
1170
+ * @fqn wix.comments.ng.v1.CommentsNg.ListCommentsByResource
1171
+ */
1172
+ export async function listCommentsByResource(appId, options) {
1173
+ // @ts-ignore
1174
+ const { httpClient, sideEffects } = arguments[2];
1175
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1176
+ appId: appId,
1177
+ contextId: options?.contextId,
1178
+ contextType: options?.contextType,
1179
+ resourceId: options?.resourceId,
1180
+ commentSort: options?.commentSort,
1181
+ replySort: options?.replySort,
1182
+ cursorPaging: options?.cursorPaging,
1183
+ }, []);
1184
+ const reqOpts = ambassadorWixCommentsV2Comment.listCommentsByResource(payload);
1185
+ sideEffects?.onSiteCall?.();
1186
+ try {
1187
+ const result = await httpClient.request(reqOpts);
1188
+ sideEffects?.onSuccess?.(result);
1189
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1190
+ {
1191
+ transformFn: transformRESTImageToSDKImage,
1192
+ paths: [
1193
+ { path: 'comments.content.attachments.image' },
1194
+ { path: 'comments.draftContent.attachments.image' },
1195
+ { path: 'commentReplies.*.replies.content.attachments.image' },
1196
+ { path: 'commentReplies.*.replies.draftContent.attachments.image' },
1197
+ ],
1198
+ },
1199
+ {
1200
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
1201
+ paths: [
1202
+ { path: 'comments.content.attachments.video' },
1203
+ { path: 'comments.draftContent.attachments.video' },
1204
+ { path: 'commentReplies.*.replies.content.attachments.video' },
1205
+ { path: 'commentReplies.*.replies.draftContent.attachments.video' },
1206
+ ],
1207
+ },
1208
+ {
1209
+ transformFn: transformRESTAudioToSDKAudio,
1210
+ paths: [
1211
+ { path: 'comments.content.attachments.audio' },
1212
+ { path: 'comments.draftContent.attachments.audio' },
1213
+ { path: 'commentReplies.*.replies.content.attachments.audio' },
1214
+ { path: 'commentReplies.*.replies.draftContent.attachments.audio' },
1215
+ ],
1216
+ },
1217
+ {
1218
+ transformFn: transformRESTDocumentToSDKDocument,
1219
+ paths: [
1220
+ { path: 'comments.content.attachments.document' },
1221
+ { path: 'comments.draftContent.attachments.document' },
1222
+ { path: 'commentReplies.*.replies.content.attachments.document' },
1223
+ {
1224
+ path: 'commentReplies.*.replies.draftContent.attachments.document',
1225
+ },
1226
+ ],
1227
+ },
1228
+ ]), ['comments.content.richContent', 'comments.draftContent.richContent']);
1229
+ }
1230
+ catch (err) {
1231
+ const transformedError = sdkTransformError(err, {
1232
+ spreadPathsToArguments: {},
1233
+ explicitPathsToArguments: {
1234
+ appId: '$[0]',
1235
+ contextId: '$[1].contextId',
1236
+ contextType: '$[1].contextType',
1237
+ resourceId: '$[1].resourceId',
1238
+ commentSort: '$[1].commentSort',
1239
+ replySort: '$[1].replySort',
1240
+ cursorPaging: '$[1].cursorPaging',
1241
+ },
1242
+ singleArgumentUnchanged: false,
1243
+ }, ['appId', 'options']);
1244
+ sideEffects?.onError?.(err);
1245
+ throw transformedError;
1246
+ }
1247
+ }
1248
+ /**
1249
+ * Returns a thread of a comment or a reply.
1250
+ *
1251
+ * 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.
1252
+ *
1253
+ * 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.
1254
+ * @param commentId - Comment ID.
1255
+ * @public
1256
+ * @documentationMaturity preview
1257
+ * @requiredField commentId
1258
+ * @permissionId WIX_COMMENTS.COMMENT_THREAD
1259
+ * @permissionScope Read Comments
1260
+ * @permissionScopeId SCOPE.DC_COMMENTS.READ.COMMENTS
1261
+ * @permissionScope Manage Comments
1262
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
1263
+ * @applicableIdentity APP
1264
+ * @fqn wix.comments.ng.v1.CommentsNg.GetCommentThread
1265
+ */
1266
+ export async function getCommentThread(commentId, options) {
1267
+ // @ts-ignore
1268
+ const { httpClient, sideEffects } = arguments[2];
1269
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1270
+ commentId: commentId,
1271
+ appId: options?.appId,
1272
+ commentSort: options?.commentSort,
1273
+ replySort: options?.replySort,
1274
+ }, []);
1275
+ const reqOpts = ambassadorWixCommentsV2Comment.getCommentThread(payload);
1276
+ sideEffects?.onSiteCall?.();
1277
+ try {
1278
+ const result = await httpClient.request(reqOpts);
1279
+ sideEffects?.onSuccess?.(result);
1280
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1281
+ {
1282
+ transformFn: transformRESTImageToSDKImage,
1283
+ paths: [
1284
+ { path: 'comments.content.attachments.image' },
1285
+ { path: 'comments.draftContent.attachments.image' },
1286
+ { path: 'commentReplies.*.replies.content.attachments.image' },
1287
+ { path: 'commentReplies.*.replies.draftContent.attachments.image' },
1288
+ ],
1289
+ },
1290
+ {
1291
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
1292
+ paths: [
1293
+ { path: 'comments.content.attachments.video' },
1294
+ { path: 'comments.draftContent.attachments.video' },
1295
+ { path: 'commentReplies.*.replies.content.attachments.video' },
1296
+ { path: 'commentReplies.*.replies.draftContent.attachments.video' },
1297
+ ],
1298
+ },
1299
+ {
1300
+ transformFn: transformRESTAudioToSDKAudio,
1301
+ paths: [
1302
+ { path: 'comments.content.attachments.audio' },
1303
+ { path: 'comments.draftContent.attachments.audio' },
1304
+ { path: 'commentReplies.*.replies.content.attachments.audio' },
1305
+ { path: 'commentReplies.*.replies.draftContent.attachments.audio' },
1306
+ ],
1307
+ },
1308
+ {
1309
+ transformFn: transformRESTDocumentToSDKDocument,
1310
+ paths: [
1311
+ { path: 'comments.content.attachments.document' },
1312
+ { path: 'comments.draftContent.attachments.document' },
1313
+ { path: 'commentReplies.*.replies.content.attachments.document' },
1314
+ {
1315
+ path: 'commentReplies.*.replies.draftContent.attachments.document',
1316
+ },
1317
+ ],
1318
+ },
1319
+ ]), ['comments.content.richContent', 'comments.draftContent.richContent']);
1320
+ }
1321
+ catch (err) {
1322
+ const transformedError = sdkTransformError(err, {
1323
+ spreadPathsToArguments: {},
1324
+ explicitPathsToArguments: {
1325
+ commentId: '$[0]',
1326
+ appId: '$[1].appId',
1327
+ commentSort: '$[1].commentSort',
1328
+ replySort: '$[1].replySort',
1329
+ },
1330
+ singleArgumentUnchanged: false,
1331
+ }, ['commentId', 'options']);
1332
+ sideEffects?.onError?.(err);
1333
+ throw transformedError;
1334
+ }
1335
+ }
1336
+ /**
1337
+ * Publishes multiple comments with the `HIDDEN` status. The comment status becomes `PUBLISHED`.
1338
+ * @param appId - ID of the app where to publish the comment.
1339
+ * @public
1340
+ * @documentationMaturity preview
1341
+ * @requiredField appId
1342
+ * @requiredField options
1343
+ * @requiredField options.filter
1344
+ * @permissionId WIX_COMMENTS.BULK_COMMENT_PUBLISH
1345
+ * @permissionScope Manage Comments
1346
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
1347
+ * @applicableIdentity APP
1348
+ * @fqn wix.comments.ng.v1.CommentsNg.BulkPublishComment
1349
+ */
1350
+ export async function bulkPublishComment(appId, options) {
1351
+ // @ts-ignore
1352
+ const { httpClient, sideEffects } = arguments[2];
1353
+ const payload = renameKeysFromSDKRequestToRESTRequest({ appId: appId, filter: options?.filter }, []);
1354
+ const reqOpts = ambassadorWixCommentsV2Comment.bulkPublishComment(payload);
1355
+ sideEffects?.onSiteCall?.();
1356
+ try {
1357
+ const result = await httpClient.request(reqOpts);
1358
+ sideEffects?.onSuccess?.(result);
1359
+ return renameKeysFromRESTResponseToSDKResponse(result.data, []);
1360
+ }
1361
+ catch (err) {
1362
+ const transformedError = sdkTransformError(err, {
1363
+ spreadPathsToArguments: {},
1364
+ explicitPathsToArguments: { appId: '$[0]', filter: '$[1].filter' },
1365
+ singleArgumentUnchanged: false,
1366
+ }, ['appId', 'options']);
1367
+ sideEffects?.onError?.(err);
1368
+ throw transformedError;
1369
+ }
1370
+ }
1371
+ /**
1372
+ * Hides multiple comments. The comment status becomes `HIDDEN`.
1373
+ * @param appId - ID of the app where to hide the comments.
1374
+ * @public
1375
+ * @documentationMaturity preview
1376
+ * @requiredField appId
1377
+ * @requiredField options
1378
+ * @requiredField options.filter
1379
+ * @permissionId WIX_COMMENTS.BULK_COMMENT_HIDE
1380
+ * @permissionScope Manage Comments
1381
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
1382
+ * @applicableIdentity APP
1383
+ * @fqn wix.comments.ng.v1.CommentsNg.BulkHideComment
1384
+ */
1385
+ export async function bulkHideComment(appId, options) {
1386
+ // @ts-ignore
1387
+ const { httpClient, sideEffects } = arguments[2];
1388
+ const payload = renameKeysFromSDKRequestToRESTRequest({ appId: appId, filter: options?.filter }, []);
1389
+ const reqOpts = ambassadorWixCommentsV2Comment.bulkHideComment(payload);
1390
+ sideEffects?.onSiteCall?.();
1391
+ try {
1392
+ const result = await httpClient.request(reqOpts);
1393
+ sideEffects?.onSuccess?.(result);
1394
+ return renameKeysFromRESTResponseToSDKResponse(result.data, []);
1395
+ }
1396
+ catch (err) {
1397
+ const transformedError = sdkTransformError(err, {
1398
+ spreadPathsToArguments: {},
1399
+ explicitPathsToArguments: { appId: '$[0]', filter: '$[1].filter' },
1400
+ singleArgumentUnchanged: false,
1401
+ }, ['appId', 'options']);
1402
+ sideEffects?.onError?.(err);
1403
+ throw transformedError;
1404
+ }
1405
+ }
1406
+ /**
1407
+ * Deletes multiple comments.
1408
+ * @param appId - ID of the app where to delete the comments.
1409
+ * @public
1410
+ * @documentationMaturity preview
1411
+ * @requiredField appId
1412
+ * @requiredField options
1413
+ * @requiredField options.filter
1414
+ * @permissionId WIX_COMMENTS.BULK_COMMENT_DELETE
1415
+ * @permissionScope Manage Comments
1416
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
1417
+ * @applicableIdentity APP
1418
+ * @fqn wix.comments.ng.v1.CommentsNg.BulkDeleteComment
1419
+ */
1420
+ export async function bulkDeleteComment(appId, options) {
1421
+ // @ts-ignore
1422
+ const { httpClient, sideEffects } = arguments[2];
1423
+ const payload = renameKeysFromSDKRequestToRESTRequest({ appId: appId, filter: options?.filter }, []);
1424
+ const reqOpts = ambassadorWixCommentsV2Comment.bulkDeleteComment(payload);
1425
+ sideEffects?.onSiteCall?.();
1426
+ try {
1427
+ const result = await httpClient.request(reqOpts);
1428
+ sideEffects?.onSuccess?.(result);
1429
+ return renameKeysFromRESTResponseToSDKResponse(result.data, []);
1430
+ }
1431
+ catch (err) {
1432
+ const transformedError = sdkTransformError(err, {
1433
+ spreadPathsToArguments: {},
1434
+ explicitPathsToArguments: { appId: '$[0]', filter: '$[1].filter' },
1435
+ singleArgumentUnchanged: false,
1436
+ }, ['appId', 'options']);
1437
+ sideEffects?.onError?.(err);
1438
+ throw transformedError;
1439
+ }
1440
+ }
1441
+ /**
1442
+ * Moderates the draft content of multiple comments.
1443
+ * @param appId - ID of the app where to moderate the comments.
1444
+ * @public
1445
+ * @documentationMaturity preview
1446
+ * @requiredField appId
1447
+ * @requiredField options
1448
+ * @requiredField options.draftContentAction
1449
+ * @requiredField options.filter
1450
+ * @permissionId WIX_COMMENTS.BULK_COMMENT_MODERATE_DRAFT_CONTENT
1451
+ * @permissionScope Manage Comments
1452
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
1453
+ * @applicableIdentity APP
1454
+ * @fqn wix.comments.ng.v1.CommentsNg.BulkModerateDraftContent
1455
+ */
1456
+ export async function bulkModerateDraftContent(appId, options) {
1457
+ // @ts-ignore
1458
+ const { httpClient, sideEffects } = arguments[2];
1459
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1460
+ appId: appId,
1461
+ filter: options?.filter,
1462
+ draftContentAction: options?.draftContentAction,
1463
+ }, []);
1464
+ const reqOpts = ambassadorWixCommentsV2Comment.bulkModerateDraftContent(payload);
1465
+ sideEffects?.onSiteCall?.();
1466
+ try {
1467
+ const result = await httpClient.request(reqOpts);
1468
+ sideEffects?.onSuccess?.(result);
1469
+ return renameKeysFromRESTResponseToSDKResponse(result.data, []);
1470
+ }
1471
+ catch (err) {
1472
+ const transformedError = sdkTransformError(err, {
1473
+ spreadPathsToArguments: {},
1474
+ explicitPathsToArguments: {
1475
+ appId: '$[0]',
1476
+ filter: '$[1].filter',
1477
+ draftContentAction: '$[1].draftContentAction',
1478
+ },
1479
+ singleArgumentUnchanged: false,
1480
+ }, ['appId', 'options']);
1481
+ sideEffects?.onError?.(err);
1482
+ throw transformedError;
1483
+ }
1484
+ }
1485
+ /**
1486
+ * Moves multiple comments to another resource.
1487
+ * @param appId - ID of the app from which to move the comments.
1488
+ * @public
1489
+ * @documentationMaturity preview
1490
+ * @requiredField appId
1491
+ * @requiredField options.destination.contextId
1492
+ * @requiredField options.destination.resourceId
1493
+ * @requiredField options.filter
1494
+ * @permissionId WIX_COMMENTS.BULK_COMMENT_MOVE
1495
+ * @permissionScope Manage Comments
1496
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
1497
+ * @applicableIdentity APP
1498
+ * @fqn wix.comments.ng.v1.CommentsNg.BulkMoveCommentByFilter
1499
+ */
1500
+ export async function bulkMoveCommentByFilter(appId, options) {
1501
+ // @ts-ignore
1502
+ const { httpClient, sideEffects } = arguments[2];
1503
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1504
+ appId: appId,
1505
+ filter: options?.filter,
1506
+ destination: options?.destination,
1507
+ }, []);
1508
+ const reqOpts = ambassadorWixCommentsV2Comment.bulkMoveCommentByFilter(payload);
1509
+ sideEffects?.onSiteCall?.();
1510
+ try {
1511
+ const result = await httpClient.request(reqOpts);
1512
+ sideEffects?.onSuccess?.(result);
1513
+ return renameKeysFromRESTResponseToSDKResponse(result.data, []);
1514
+ }
1515
+ catch (err) {
1516
+ const transformedError = sdkTransformError(err, {
1517
+ spreadPathsToArguments: {},
1518
+ explicitPathsToArguments: {
1519
+ appId: '$[0]',
1520
+ filter: '$[1].filter',
1521
+ destination: '$[1].destination',
1522
+ },
1523
+ singleArgumentUnchanged: false,
1524
+ }, ['appId', 'options']);
1525
+ sideEffects?.onError?.(err);
1526
+ throw transformedError;
1527
+ }
1528
+ }
1529
+ //# sourceMappingURL=comments-v2-comment-comments.universal.js.map