@wix/auto_sdk_comments_comments 1.0.0

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