@wix/auto_sdk_comments_comments 1.0.10 → 1.0.12

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