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